]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-condition: don't assume that all non-root users are normal users (#6409)
authorFelipe Sateler <fsateler@users.noreply.github.com>
Thu, 20 Jul 2017 00:48:23 +0000 (20:48 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 20 Jul 2017 00:48:23 +0000 (20:48 -0400)
Automated builders may run under a dedicated system user, and this test would fail that

Fixes #6366

src/test/test-condition.c

index 121345cfd1c72a4a666f812fd3c954ff814af8b8..b15f1b98c07d8b956688c465ed93631fc11652d7 100644 (file)
@@ -390,7 +390,7 @@ static void test_condition_test_user(void) {
         assert_se(condition);
         r = condition_test(condition);
         log_info("ConditionUser=@system → %i", r);
-        if (geteuid() == 0)
+        if (getuid() < SYSTEM_UID_MAX || geteuid() < SYSTEM_UID_MAX)
                 assert_se(r > 0);
         else
                 assert_se(r == 0);