From bbaf33de9a1e021f7793de6d963c4e7bd7b151d6 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Mon, 28 Jan 2019 12:30:27 +0100 Subject: [PATCH] programs: allow processes with a high uid Since we used signed ints for uids, high ones will appear as negative values, so we shouldn't exclude this. Otherwise a user with a high id will get: ERROR:pkexec.c:718:main: assertion failed: (polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject)) >= 0) --- src/programs/pkexec.c | 2 +- src/programs/pkttyagent.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c index e5f4c2e..c1742df 100644 --- a/src/programs/pkexec.c +++ b/src/programs/pkexec.c @@ -769,7 +769,7 @@ main (int argc, char *argv[]) /* really double-check the invariants guaranteed by the PolkitUnixProcess class */ g_assert (subject != NULL); g_assert (polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (subject)) == pid_of_caller); - g_assert (polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject)) >= 0); + g_assert (polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject)) != -1); g_assert (polkit_unix_process_get_start_time (POLKIT_UNIX_PROCESS (subject)) > 0); error = NULL; diff --git a/src/programs/pkttyagent.c b/src/programs/pkttyagent.c index 8028f2d..a8004c3 100644 --- a/src/programs/pkttyagent.c +++ b/src/programs/pkttyagent.c @@ -188,7 +188,7 @@ main (int argc, char *argv[]) /* really double-check the invariants guaranteed by the PolkitUnixProcess class */ g_assert (subject != NULL); g_assert (polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (subject)) == pid_of_caller); - g_assert (polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject)) >= 0); + g_assert (polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject)) != -1); g_assert (polkit_unix_process_get_start_time (POLKIT_UNIX_PROCESS (subject)) > 0); } -- GitLab