diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-08-09 13:29:02 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-08-09 13:29:02 +0000 |
commit | 1330324e7bb702b08e884e44da1cddab47cb9ee1 (patch) | |
tree | 1bacb58c55772b9b2703dd285f6abd14e050657c /source3 | |
parent | 8df69f8601aa88efcadf149d8dd323036d5fce42 (diff) | |
download | samba-1330324e7bb702b08e884e44da1cddab47cb9ee1.tar.gz samba-1330324e7bb702b08e884e44da1cddab47cb9ee1.tar.bz2 samba-1330324e7bb702b08e884e44da1cddab47cb9ee1.zip |
bug in num. arguments detection that stopped the -add option working
lkcl
(This used to be commit e025ffa0aacb577619cc35f0b9e5c5a862f4429f)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/smbpasswd.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index f43262ef83..7a4a1e2cdb 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -203,8 +203,7 @@ _my_get_smbpwnam(FILE * fp, char *name, BOOL * valid_old_pwd, */ static void usage(char *name) { - fprintf(stderr, "Usage (as root) is : %s [-add] [username] [password]\n", name); - fprintf(stderr, "Usage (as user) is : %s [old password new password]\n", name); + fprintf(stderr, "Usage is : %s [-add] [username] [password]\n", name); exit(1); } @@ -270,7 +269,7 @@ static void usage(char *name) if ((argv[1][0] == '-') && (argv[1][1] == 'a')) add_user = True; - if(add_user && (argc != 4 || argc != 3)) + if(add_user && (argc < 2 || argc > 4)) usage(argv[0]); /* root can specify password on command-line */ @@ -485,10 +484,7 @@ Error was %d. Password file may be corrupt ! Please examine by hand !\n", we don't need to check the old password. */ if (real_uid != 0) { if (valid_old_pwd == False) { - fprintf(stderr, "%s: User %s is disabled, plase contact your administrator to enable it.\n", argv[0], pwd->pw_name); - fclose(fp); - pw_file_unlock(lockfd); - exit(1); + fprintf(stderr, "%s: User %s has no old SMB password.\n", argv[0], pwd->pw_name); } /* Check the old Lanman password - NULL means 'NO PASSWORD' */ if (smb_pwent->smb_passwd != NULL) { |