From 5cb042433cc14469bff6f4f0ba915c273f613a79 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Sep 2002 18:24:15 +0000 Subject: [PATCH] I hate shadowed globals too :-). Jeremy. --- source/utils/smbpasswd.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c index 035b4aadc5d..60b94ae4da1 100644 --- a/source/utils/smbpasswd.c +++ b/source/utils/smbpasswd.c @@ -702,23 +702,23 @@ static int set_domain_sid_from_dc( char *domain, char *remote ) *************************************************************/ static char *stdin_new_passwd(void) { - static fstring new_passwd; + static fstring new_pwd; size_t len; - ZERO_ARRAY(new_passwd); + ZERO_ARRAY(new_pwd); /* * if no error is reported from fgets() and string at least contains * the newline that ends the password, then replace the newline with * a null terminator. */ - if ( fgets(new_passwd, sizeof(new_passwd), stdin) != NULL) { - if ((len = strlen(new_passwd)) > 0) { - if(new_passwd[len-1] == '\n') - new_passwd[len - 1] = 0; + if ( fgets(new_pwd, sizeof(new_pwd), stdin) != NULL) { + if ((len = strlen(new_pwd)) > 0) { + if(new_pwd[len-1] == '\n') + new_pwd[len - 1] = 0; } } - return(new_passwd); + return(new_pwd); } @@ -744,20 +744,20 @@ static char *get_pass( char *prompt, BOOL stdin_get) static char *prompt_for_new_password(BOOL stdin_get) { char *p; - fstring new_passwd; + fstring new_pwd; - ZERO_ARRAY(new_passwd); + ZERO_ARRAY(new_pwd); p = get_pass("New SMB password:", stdin_get); - fstrcpy(new_passwd, p); + fstrcpy(new_pwd, p); safe_free(p); p = get_pass("Retype new SMB password:", stdin_get); - if (strcmp(p, new_passwd)) { + if (strcmp(p, new_pwd)) { fprintf(stderr, "Mismatch - password unchanged.\n"); - ZERO_ARRAY(new_passwd); + ZERO_ARRAY(new_pwd); safe_free(p); return NULL; } @@ -770,27 +770,27 @@ static char *prompt_for_new_password(BOOL stdin_get) Change a password either locally or remotely. *************************************************************/ -static BOOL password_change(const char *remote_machine, char *user_name, - char *old_passwd, char *new_passwd, int local_flags) +static BOOL password_change(const char *rem_machine, char *usr_name, + char *old_pwd, char *new_pwd, int loc_flags) { BOOL ret; pstring err_str; pstring msg_str; - if (remote_machine != NULL) { - if (local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER|LOCAL_DISABLE_USER|LOCAL_ENABLE_USER| + if (rem_machine != NULL) { + if (loc_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER|LOCAL_DISABLE_USER|LOCAL_ENABLE_USER| 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(rem_machine, usr_name, + old_pwd, new_pwd, err_str, sizeof(err_str)); if(*err_str) fprintf(stderr, err_str); return ret; } - ret = local_password_change(user_name, local_flags, new_passwd, + ret = local_password_change(usr_name, loc_flags, new_pwd, err_str, sizeof(err_str), msg_str, sizeof(msg_str)); if(*msg_str) -- 2.11.4.GIT