diff options
author | gad <gad@FreeBSD.org> | 2004-03-27 22:14:42 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2004-03-27 22:14:42 +0000 |
commit | 22c6f74458bca082b10d211aa9f02187b09fc38c (patch) | |
tree | d93b6acdb8dfb738f064f8ce35abb4b6d8fd8a42 /bin | |
parent | db8a4ef7a95739a4ae7e66152121d3bf9cfd6b56 (diff) | |
download | FreeBSD-src-22c6f74458bca082b10d211aa9f02187b09fc38c.zip FreeBSD-src-22c6f74458bca082b10d211aa9f02187b09fc38c.tar.gz |
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.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ps/ps.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 0ca01c6..2488ef6 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -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 */ } |