Bug 2069 - utils/smbpasswd.c: ret is set but never used
Summary: utils/smbpasswd.c: ret is set but never used
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: User/Group Accounts (show other bugs)
Version: 3.0.8
Hardware: All All
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-19 09:35 UTC by Jason Mader (mail bounces back)
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 (mail bounces back) 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 (dead mail address) 2005-08-24 10:17:00 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.