From 22c6f74458bca082b10d211aa9f02187b09fc38c Mon Sep 17 00:00:00 2001 From: gad Date: Sat, 27 Mar 2004 22:14:42 +0000 Subject: 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. --- bin/ps/ps.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'bin') 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 */ } -- cgit v1.1