summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2019-05-06 10:48:12 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-06 15:13:07 +0200
commit6ab668337e28ed8e594b0a9ce0b31f2afe3506d8 (patch)
treed5d9a51aaf46f21fc66d3855ff84305b66a0384f
parentMerge pull request #12429 from ssahani/link-local-fallback (diff)
downloadsystemd-6ab668337e28ed8e594b0a9ce0b31f2afe3506d8.tar.xz
systemd-6ab668337e28ed8e594b0a9ce0b31f2afe3506d8.zip
test: return a non-zero return code when 'nobody' user doesn't exist
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
-rw-r--r--src/test/test-capability.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test-capability.c b/src/test/test-capability.c
index 6b2de66bb7..f9fae84dde 100644
--- 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;