core: add @system special value to ConditionUser=

It allows checking if the user is a system user or a normal user
This commit is contained in:
Felipe Sateler
2017-05-26 09:42:47 -04:00
parent c465a29f24
commit 534bab66ab
3 changed files with 20 additions and 4 deletions
+3
View File
@@ -154,6 +154,9 @@ static int condition_test_user(Condition *c) {
if (r >= 0)
return id == getuid() || id == geteuid();
if (streq("@system", c->parameter))
return getuid() <= SYSTEM_UID_MAX || geteuid() <= SYSTEM_UID_MAX;
username = getusername_malloc();
if (!username)
return -ENOMEM;