]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-condition: fix group check condition
authorFelipe Sateler <fsateler@gmail.com>
Tue, 24 Dec 2019 01:04:44 +0000 (22:04 -0300)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 26 Dec 2019 03:07:54 +0000 (12:07 +0900)
We were checking the uid, whereas we should have checked the gid

src/test/test-condition.c

index fce9232dcfebc781139a658de60c050d5befeb11..28b5b780c35b75677ee038d6fc8dfd340418f6f0 100644 (file)
@@ -689,7 +689,7 @@ static void test_condition_test_group(void) {
         condition_free(condition);
         free(gid);
 
-        groupname = (char*)(geteuid() == 0 ? NOBODY_GROUP_NAME : "root");
+        groupname = (char*)(getegid() == 0 ? NOBODY_GROUP_NAME : "root");
         condition = condition_new(CONDITION_GROUP, groupname, false, false);
         assert_se(condition);
         r = condition_test(condition);