Bug 2069 - utils/smbpasswd.c: ret is set but never used
utils/smbpasswd.c: ret is set but never used
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: User/Group Accounts
3.0.8
All All
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-19 09:35 UTC by Jason Mader
Modified: 2005-08-24 10:17 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mader 2004-11-19 09:35:17 UTC
while compiling 3.0.9:

Compiling utils/smbpasswd.c
cc-1552 cc: WARNING File = utils/smbpasswd.c, Line = 432
  The variable "ret" is set but never used.

                                BOOL ret;
                                     ^

Looking at the code and surrounding code,

                        if(local_flags & LOCAL_ENABLE_USER) {
                                SAM_ACCOUNT *sampass = NULL;
                                BOOL ret;

                                pdb_init_sam(&sampass);
                                ret = pdb_getsampwnam(sampass, user_name);
                                if((sampass != False) && (pdb_get_lanman_passwd(sampass) == NULL)) {
                                        local_flags |= LOCAL_SET_PASSWORD;
                                }
                                pdb_free_sam(&sampass);
                        }

it looks like me like the IF statement should instead be:

    if((ret != False) && (pdb_get_lanman_passwd(sampass) == NULL))
Comment 1 Volker Lendecke 2004-11-19 13:57:05 UTC
Obviously correct. Applied, thanks!

Volker
Comment 2 Gerald (Jerry) Carter 2005-08-24 10:17:00 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.