From: Felipe Sateler Date: Thu, 20 Jul 2017 00:48:23 +0000 (-0400) Subject: test-condition: don't assume that all non-root users are normal users (#6409) X-Git-Tag: v235~313 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=708d423915c4ea48d408b5a3395c11055247b9bc;p=thirdparty%2Fsystemd.git test-condition: don't assume that all non-root users are normal users (#6409) Automated builders may run under a dedicated system user, and this test would fail that Fixes #6366 --- diff --git a/src/test/test-condition.c b/src/test/test-condition.c index 121345cfd1c..b15f1b98c07 100644 --- a/src/test/test-condition.c +++ b/src/test/test-condition.c @@ -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);