summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2009-04-16 17:14:29 +0200
committerJim McDonough <jmcd@samba.org>2009-04-16 17:14:29 +0200
commit75ccf934ac09e5af68cfd5afdd75a1b32ca24287 (patch)
tree550186f2f36b55741d1c44e8a2f4c07cf1c2b834 /source3
parent56aae35a234f19eda9702ce321b92fa382a1ada6 (diff)
downloadsamba-75ccf934ac09e5af68cfd5afdd75a1b32ca24287.tar.gz
samba-75ccf934ac09e5af68cfd5afdd75a1b32ca24287.tar.bz2
samba-75ccf934ac09e5af68cfd5afdd75a1b32ca24287.zip
Don't look up local user for remote changes, even when root.
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/smbpasswd.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 4cd0d55f56..8cca93f5de 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -430,14 +430,18 @@ static int process_root(int local_flags)
}
if((local_flags & LOCAL_SET_PASSWORD) && (new_passwd == NULL)) {
- struct passwd *passwd = getpwnam_alloc(NULL, user_name);
+ struct passwd *passwd;
- if (!passwd) {
- fprintf(stderr, "Cannot locate Unix account for "
- "'%s'!\n", user_name);
- exit(1);
+ if (remote_machine == NULL) {
+ passwd = getpwnam_alloc(NULL, user_name);
+
+ if (!passwd) {
+ fprintf(stderr, "Cannot locate Unix account for "
+ "'%s'!\n", user_name);
+ exit(1);
+ }
+ TALLOC_FREE(passwd);
}
- TALLOC_FREE(passwd);
new_passwd = prompt_for_new_password(stdin_passwd_get);