artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
722fcec
)
fix uid -> username lookup
author
procter
<procter@openbsd.org>
Sat, 22 Sep 2018 02:18:19 +0000
(
02:18
+0000)
committer
procter
<procter@openbsd.org>
Sat, 22 Sep 2018 02:18:19 +0000
(
02:18
+0000)
ok deraadt@
usr.bin/top/username.c
patch
|
blob
|
history
diff --git
a/usr.bin/top/username.c
b/usr.bin/top/username.c
index
c5c402c
..
326ce59
100644
(file)
--- 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;
}