1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

If a non-existent user is given as part of `-U userlist', treat it as

a fatal error instead of a minor warning.  It is possible that a few
users are used to the previous behavior, but I'm claiming it was a bug.
This commit is contained in:
Garance A Drosehn 2004-03-27 22:14:42 +00:00
parent 29d58b106b
commit e3c4e1dd77
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127509

View File

@ -741,16 +741,6 @@ addelem_uid(struct listinfo *inf, const char *elem)
return (0); /* Do not add this value */
}
/*
* XXX - In the following, should the warnings be fatal errors?
* Historically they have been warnings, but I expect errors
* would be more appropriate. A warning message might be
* missed in a long `ps' listing, and the user would not
* realize that they had mistyped a userid. Also, Solaris
* and Linux treat these as errors. On the other hand, I
* can imagine that some users *might* be used to the
* present behavior.
*/
pwd = getpwnam(elem);
if (pwd == NULL) {
errno = 0;
@ -767,7 +757,12 @@ addelem_uid(struct listinfo *inf, const char *elem)
}
}
if (pwd == NULL) {
/* XXX: optfatal = 1; -- (see the above XXX) */
/*
* These used to be treated as minor warnings (and the
* option was simply ignored), but now they are fatal
* errors (and the command will be aborted).
*/
optfatal = 1;
return (0); /* Do not add this value */
}