Bug 2093 - passdb/pdb_ldap.c: several signed/unsigned incompatible types
Summary: passdb/pdb_ldap.c: several signed/unsigned incompatible types
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: User/Group Accounts (show other bugs)
Version: 3.0.9
Hardware: SGI IRIX
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-27 12:17 UTC by Jason Mader (mail bounces back)
Modified: 2005-08-24 10:21 UTC (History)
0 users

See Also:


Attachments
fixes several incompatible types in pdb_ldap.c (1.19 KB, patch)
2005-01-30 12:02 UTC, Jason Mader (mail bounces back)
no flags Details
changes pwHistLen to "unsigned int" and hours to "const unsigned char *" (1.21 KB, patch)
2005-03-17 12:57 UTC, Jason Mader (mail bounces back)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mader (mail bounces back) 2004-11-27 12:17:57 UTC
cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 725
  Argument of type "int *" is incompatible with parameter of type
          "unsigned int *".

        account_policy_get(AP_PASSWORD_HISTORY, &pwHistLen);
                                                ^

cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 1071
  Argument of type "int *" is incompatible with parameter of type
          "unsigned int *".

                        account_policy_get(AP_PASSWORD_HISTORY, &pwHistLen);
                                                                ^

cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 1078
  Argument of type "int *" is incompatible with parameter of type
          "unsigned int *".

                                const uint8 *pwhist = pdb_get_pw_history(sampass, &currHistLen);
                                                                                  ^

cc-1140 cc: WARNING File = passdb/pdb_ldap.c, Line = 1106
  A value of type "const unsigned char *" cannot be used to initialize an entity
          of type "const char *".

                const char *hours = pdb_get_hours(sampass);
                                    ^

cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 1108
  Argument of type "const char *" is incompatible with parameter of type
          "const unsigned char *".

                        pdb_sethexhours(temp, hours);
                                              ^
Comment 1 Jason Mader (mail bounces back) 2004-11-27 12:18:24 UTC
env CC=cc CFLAGS="-O" ./configure --with-quotas --with-acl-support --without-ads
Comment 2 Jason Mader (mail bounces back) 2004-11-27 12:28:44 UTC
line 478, and line 1070: pwHistLena should be 'unsigned int'
line 1077: currHistLen should be 'unsigned int'
line 1106: hours should be 'const unsight char *'

also,

line 2743: attrs might be 'char *' not const (at least on Irix)

cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 2758
  Argument of type "const char **" is incompatible with parameter of type
          "char **".

                            LDAP_SCOPE_SUBTREE, filter, attrs, 0, &result);
Comment 3 Jason Mader (mail bounces back) 2005-01-17 12:26:01 UTC
Line 2743 has been been fixed in Samba 3.0.11pre1, but the other incompatible parameter types 
remain.
Comment 4 Jason Mader (mail bounces back) 2005-01-30 12:02:48 UTC
Created attachment 926 [details]
fixes several incompatible types in pdb_ldap.c

Current for Samba 3.0.11rc1
Comment 5 Jason Mader (mail bounces back) 2005-02-05 14:28:12 UTC
(additional for 3.0.11)

cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 730
  Argument of type "int *" is incompatible with parameter of type
          "unsigned int *".

        account_policy_get(AP_PASSWORD_HISTORY, &pwHistLen);
                                                ^

cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 1074
  Argument of type "int *" is incompatible with parameter of type
          "unsigned int *".

                        account_policy_get(AP_PASSWORD_HISTORY, &pwHistLen);
                                                                ^

cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 1081
  Argument of type "int *" is incompatible with parameter of type
          "unsigned int *".

                                const uint8 *pwhist =
pdb_get_pw_history(sampass, &currHistLen);
                                                                                  ^

cc-1140 cc: WARNING File = passdb/pdb_ldap.c, Line = 1109
  A value of type "const unsigned char *" cannot be used to initialize an entity
          of type "const char *".

                const char *hours = pdb_get_hours(sampass);
                                    ^

cc-1164 cc: WARNING File = passdb/pdb_ldap.c, Line = 1111
  Argument of type "const char *" is incompatible with parameter of type
          "const unsigned char *".

                        pdb_sethexhours(temp, hours);
                                              ^

Comment 6 Jason Mader (mail bounces back) 2005-03-17 12:57:29 UTC
Created attachment 1043 [details]
changes pwHistLen to "unsigned int" and hours to "const unsigned char *"

Revised for Samba 3.0.12rc1
Comment 7 Gerald (Jerry) Carter 2005-03-22 10:07:15 UTC
fixed.  thanks.
Comment 8 Gerald (Jerry) Carter 2005-08-24 10:21:58 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.