X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-core.c;h=e505fcb0ed987ad0c8f43beb5a2b4b37afc6c940;hp=3079d45b94e4ea8d5c873e80abe8af02965c8105;hb=8622c1b84e198fb2d0626e622dfeaaa446e38f3a;hpb=1af38c8b5d50171f9998bde959859583c0c625d4 diff --git a/src/login/logind-core.c b/src/login/logind-core.c index 3079d45b9..e505fcb0e 100644 --- a/src/login/logind-core.c +++ b/src/login/logind-core.c @@ -115,8 +115,8 @@ int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User ** } int manager_add_user_by_name(Manager *m, const char *name, User **_user) { - uid_t uid = 1000; - gid_t gid = 1000; + uid_t uid; + gid_t gid; int r; assert(m); @@ -345,7 +345,6 @@ int manager_get_user_by_pid(Manager *m, pid_t pid, User **user) { *user = s->user; #endif // 0 - return 1; } @@ -392,16 +391,16 @@ bool manager_shall_kill(Manager *m, const char *user) { assert(m); assert(user); - if (!m->kill_user_processes) + if (!m->kill_exclude_users && streq(user, "root")) return false; if (strv_contains(m->kill_exclude_users, user)) return false; - if (strv_isempty(m->kill_only_users)) - return true; + if (!strv_isempty(m->kill_only_users)) + return strv_contains(m->kill_only_users, user); - return strv_contains(m->kill_only_users, user); + return m->kill_user_processes; } #if 0 /// UNNEEDED by elogind @@ -526,7 +525,7 @@ static int manager_count_external_displays(Manager *m) { continue; /* Ignore internal displays: the type is encoded in - * the sysfs name, as the second dash seperated item + * the sysfs name, as the second dash separated item * (the first is the card name, the last the connector * number). We implement a whitelist of external * displays here, rather than a whitelist, to ensure