diff options
Diffstat (limited to 'source3/utils/smbpasswd.c')
-rw-r--r-- | source3/utils/smbpasswd.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index d20760bee1..94bfe464e4 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -221,13 +221,12 @@ static BOOL password_change(const char *remote_machine, char *user_name, if (remote_machine != NULL) { if (local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER|LOCAL_DISABLE_USER|LOCAL_ENABLE_USER| - LOCAL_TRUST_ACCOUNT|LOCAL_SET_NO_PASSWORD)) - { + LOCAL_TRUST_ACCOUNT|LOCAL_SET_NO_PASSWORD)) { /* these things can't be done remotely yet */ return False; } - ret = remote_password_change(remote_machine, user_name, old_passwd, - new_passwd, err_str, sizeof(err_str)); + ret = remote_password_change(remote_machine, user_name, + old_passwd, new_passwd, err_str, sizeof(err_str)); if(*err_str) fprintf(stderr, err_str); return ret; @@ -409,11 +408,9 @@ static int process_root(int argc, char *argv[]) * smbpasswd file) then we need to prompt for a new password. */ - if(local_flags & LOCAL_ENABLE_USER) - { + if(local_flags & LOCAL_ENABLE_USER) { SAM_ACCOUNT *sampass = pdb_getsampwnam(user_name); - if((sampass != NULL) && (pdb_get_lanman_passwd(sampass) != NULL)) - { + if((sampass != NULL) && (pdb_get_lanman_passwd(sampass) != NULL)) { new_passwd = xstrdup("XXXX"); /* Don't care. */ } } @@ -427,15 +424,13 @@ static int process_root(int argc, char *argv[]) } } - if (!password_change(remote_machine, user_name, old_passwd, new_passwd, local_flags)) - { + if (!password_change(remote_machine, user_name, old_passwd, new_passwd, local_flags)) { fprintf(stderr,"Failed to modify password entry for user %s\n", user_name); result = 1; goto done; } - if(!(local_flags & (LOCAL_ADD_USER|LOCAL_DISABLE_USER|LOCAL_ENABLE_USER|LOCAL_DELETE_USER|LOCAL_SET_NO_PASSWORD))) - { + if(!(local_flags & (LOCAL_ADD_USER|LOCAL_DISABLE_USER|LOCAL_ENABLE_USER|LOCAL_DELETE_USER|LOCAL_SET_NO_PASSWORD))) { SAM_ACCOUNT *sampass = pdb_getsampwnam(user_name); printf("Password changed for user %s.", user_name ); if( (sampass != NULL) && (pdb_get_acct_ctrl(sampass)&ACB_DISABLED) ) |