Bug 2461 - smbd/chgpasswd.c "unsigned char *" cannot be assigned to "char *"
Summary: smbd/chgpasswd.c "unsigned char *" cannot be assigned to "char *"
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.11
Hardware: SGI IRIX
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-16 11:03 UTC by Jason Mader (mail bounces back)
Modified: 2005-08-24 10:18 UTC (History)
0 users

See Also:


Attachments
patches smbd/chgpasswd.c libsmb/smbencrypt.c rpc_server/srv_samr_nt.c (1.79 KB, patch)
2005-03-16 11:14 UTC, Jason Mader (mail bounces back)
no flags Details
patches smbd/chgpasswd.c libsmb/smbencrypt.c rpc_server/srv_samr_nt.c (2.13 KB, patch)
2005-03-16 11:30 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) 2005-03-16 11:03:11 UTC
Samba 3.0.12rc1

Compiling smbd/chgpasswd.c
cc-1515 cc: WARNING File = smbd/chgpasswd.c, Line = 808
  A value of type "unsigned char *" cannot be assigned to an entity of type
          "char *".

                password_encrypted = password_encrypted_with_nt_hash;
                                   ^

cc-1515 cc: WARNING File = smbd/chgpasswd.c, Line = 809
  A value of type "const unsigned char *" cannot be assigned to an entity of
          type "const char *".

                encryption_key = nt_pw;
                               ^

cc-1515 cc: WARNING File = smbd/chgpasswd.c, Line = 812
  A value of type "unsigned char *" cannot be assigned to an entity of type
          "char *".

                password_encrypted = password_encrypted_with_lm_hash;
                                   ^

cc-1515 cc: WARNING File = smbd/chgpasswd.c, Line = 813
  A value of type "const unsigned char *" cannot be assigned to an entity of
          type "const char *".

                encryption_key = lanman_pw;
                               ^

cc-1164 cc: WARNING File = smbd/chgpasswd.c, Line = 839
  Argument of type "char *" is incompatible with parameter of type
          "unsigned char *".

        SamOEMhash( password_encrypted, encryption_key, 516);
                    ^

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

        SamOEMhash( password_encrypted, encryption_key, 516);
                                        ^
Comment 1 Jason Mader (mail bounces back) 2005-03-16 11:05:25 UTC
          Line 750 smbd/chgpasswd.c
          change password_encrypted -> unsigned char *

          Line 751 smbd/chgpasswd.c
          change encryption_key -> const unsigned char *

          Line 516 libsmb/smbencrypt.c
          change first variable in_buffer to unsigned char

          : Automatically generated
          :   decode_pw_buffer in include/proto.h
          :   change first variable in_buffer to unsigned char

          Line 2903 rpc_server/srv_samr_nt.c
          (char*) can be removed on id23->pass

          Line 2954 rpc_server/srv_samr_nt.c set_user_info_pw()
          change "char *pass" to "unsigned char *pass"

          Line 3100 rpc_server/srv_samr_nt.c
          (char*) can be removed on info.id24->pass
Comment 2 Jason Mader (mail bounces back) 2005-03-16 11:14:03 UTC
Created attachment 1037 [details]
patches smbd/chgpasswd.c libsmb/smbencrypt.c rpc_server/srv_samr_nt.c

Modifications to change password_encrypted & encryption_key to "unsigned char
*" in smbd/chgpasswd.c and related files.
Comment 3 Jason Mader (mail bounces back) 2005-03-16 11:24:04 UTC
(These lines are also affected by the changed, I'll revise the patch)

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

        dump_data(100, new_nt_p16, NT_HASH_LEN);
                       ^

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

        dump_data(100, pwhistory, PW_HISTORY_ENTRY_LEN*pwHisLen);
                       ^
Comment 4 Jason Mader (mail bounces back) 2005-03-16 11:30:41 UTC
Created attachment 1038 [details]
patches smbd/chgpasswd.c libsmb/smbencrypt.c rpc_server/srv_samr_nt.c

Modifications to change password_encrypted & encryption_key to "unsigned char
*" in smbd/chgpasswd.c and related files.
Comment 5 Gerald (Jerry) Carter (dead mail address) 2005-03-22 10:23:49 UTC
got it.  Thanks.
Comment 6 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:18:42 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.