diff options
author | Richard Procter <procter@cvs.openbsd.org> | 2018-09-22 02:18:20 +0000 |
---|---|---|
committer | Richard Procter <procter@cvs.openbsd.org> | 2018-09-22 02:18:20 +0000 |
commit | f6b07c7cc1e8ead1ef1cd5fca7a7d15c051b0596 (patch) | |
tree | 75fbf3896eaf38006f15b0af41f5d636d87d9542 /usr.bin/top | |
parent | 942ba2f1719cdde0ccf9c8864b55251da47b747e (diff) |
fix uid -> username lookup
ok deraadt@
Diffstat (limited to 'usr.bin/top')
-rw-r--r-- | usr.bin/top/username.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/top/username.c b/usr.bin/top/username.c index c5c402c16f5..326ce593ee9 100644 --- a/usr.bin/top/username.c +++ b/usr.bin/top/username.c @@ -1,4 +1,4 @@ -/* $OpenBSD: username.c,v 1.19 2018/09/16 02:44:06 millert Exp $ */ +/* $OpenBSD: username.c,v 1.20 2018/09/22 02:18:19 procter Exp $ */ /* * Top users/processes display for Unix @@ -51,6 +51,8 @@ uid_t userid(const char *username) { uid_t uid; - - return uid_from_user(username, &uid); + if (uid_from_user(username, &uid) == -1) { + uid = (uid_t)-1; + } + return uid; } |