projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c26f3b1
)
test: return a non-zero return code when 'nobody' user doesn't exist
author
Frantisek Sumsal
<frantisek@sumsal.cz>
Mon, 6 May 2019 08:48:12 +0000
(10:48 +0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 6 May 2019 13:13:07 +0000
(15:13 +0200)
Lookup of a non-existing user using getpwnam() is not considered
an error, thus the `errno` is not set appropriately, causing
unexpected fails on systems, where 'nobody' user doesn't exist by
default
src/test/test-capability.c
patch
|
blob
|
history
diff --git
a/src/test/test-capability.c
b/src/test/test-capability.c
index
6b2de66
..
f9fae84
100644
(file)
--- a/
src/test/test-capability.c
+++ b/
src/test/test-capability.c
@@
-99,7
+99,7
@@
static int setup_tests(bool *run_ambient) {
nobody = getpwnam(NOBODY_USER_NAME);
if (!nobody)
- return log_error_errno(
errno
, "Could not find nobody user: %m");
+ return log_error_errno(
SYNTHETIC_ERRNO(ENOENT)
, "Could not find nobody user: %m");
test_uid = nobody->pw_uid;
test_gid = nobody->pw_gid;