Bug 2525 - passdb/pdb_nds.c: "unsigned char *" incompatible with "char *"
passdb/pdb_nds.c: "unsigned char *" incompatible with "char *"
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.12
SGI IRIX
: P4 normal
: none
Assigned To: James Peach (outdated mail address)
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-22 14:30 UTC by Jason Mader
Modified: 2006-06-27 09:52 UTC (History)
0 users

See Also:


Attachments
change parameter types on generate_random_buffer() (489 bytes, patch)
2005-08-12 16:45 UTC, Jason Mader
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mader 2005-03-22 14:30:12 UTC
cc-1164 cc: WARNING File = passdb/pdb_nds.c, Line = 798
  Argument of type "unsigned char *" is incompatible with parameter of type
          "char *".

                        if (pdb_nds_get_password(ldap_state->smbldap_state, dn,
&pwd_len, clear_text_pw) == L\
DAP_SUCCESS) {
                                                                               
          ^

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

                        rc = ldap_simple_bind_s(ld, dn, clear_text_pw);
                                                        ^
Comment 1 Jason Mader 2005-03-22 20:14:33 UTC
Changing clear_text_pw to "char *" on line 760 is consistent with other pdb_
code, but has the side effect

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

                        generate_random_buffer(clear_text_pw, 24);
                                               ^
Comment 2 Jason Mader 2005-03-23 11:09:01 UTC
My thought is that generate_random_buffer() should have arguments just like
read(), as in the case there's a /dev/urandom it's just reading directly from
urandom anyway.  And in most invocations in Samba code the length argument is
sizeof() also.

void generate_random_buffer(void *out, size_t len)
Comment 3 Gerald (Jerry) Carter 2005-03-24 06:26:23 UTC
lowering priority
Comment 4 James Peach (outdated mail address) 2005-07-30 22:46:14 UTC
Reassign IRIX bugs to me.
Comment 5 Jason Mader 2005-08-12 16:45:51 UTC
Created attachment 1372 [details]
change parameter types on generate_random_buffer()
Comment 6 Jason Mader 2005-08-13 06:01:59 UTC
This was just fixed in Revision 9303 with the (unsigned char *) typecast on the argument to calls of 
generate_random_buffer().  However, I really still think there should be no typecast, and instead change 
the parameters on the generate_random_buffer function to "void *" and "size_t":

void generate_random_buffer(void *out, size_t len);

This isn't anything more than a glorified call to read() anyway, so it's parameters should be the same as 
read.

It's consistent with other functions in lib/genrand.c.
Comment 7 Jason Mader 2006-06-27 09:52:27 UTC
This file no longer exists in 3.0.23rc3