summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbpasswd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index d2652ad95a..93e2f81585 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -430,6 +430,15 @@ static int process_root(int local_flags)
}
if((local_flags & LOCAL_SET_PASSWORD) && (new_passwd == NULL)) {
+ struct passwd *passwd;
+
+ passwd = getpwnam_alloc(NULL, user_name);
+ if (!passwd) {
+ DEBUG(0, ("Cannot locate Unix account for "
+ "'%s'!\n", user_name));
+ exit(1);;
+ }
+
new_passwd = prompt_for_new_password(stdin_passwd_get);
if(!new_passwd) {