Fix another missed case where usermod would not set the "modified" flag:

-h - to set no password. But only mark modified if the account is not
already locked (i.e. first char of crypt password field is '*').
PR:		bin/19999
This commit is contained in:
David Nugent 2000-07-20 00:09:29 +00:00
parent de5615c10a
commit e4ac984548

View File

@ -587,9 +587,12 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
}
if ((arg = getarg(args, 'h')) != NULL) {
if (strcmp(arg->val, "-") == 0)
pwd->pw_passwd = "*"; /* No access */
else {
if (strcmp(arg->val, "-") == 0) {
if (!pwd->pw_passwd || *pwd->pw_passwd != '*') {
pwd->pw_passwd = "*"; /* No access */
edited = 1;
}
} else {
int fd = atoi(arg->val);
int b;
int istty = isatty(fd);