diff options
author | Richard Hughes <richard@hughsie.com> | 2017-07-24 16:19:17 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-07-24 16:25:10 +0100 |
commit | 27bcd57dd02a99d28ade55b71a19ada3d7ba2014 (patch) | |
tree | ae565c0b595dfe7129b79285a1ba4a6ca6d88b3b /src | |
parent | c104d369fc0145fc125d96521f0aefb2b01f8af0 (diff) | |
download | colord-27bcd57dd02a99d28ade55b71a19ada3d7ba2014.tar.gz |
Make PolicyKit a hard requirement
If this is not used then any user can do anything.
Diffstat (limited to 'src')
-rw-r--r-- | src/cd-common.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/cd-common.c b/src/cd-common.c index 6933db8..1361f23 100644 --- a/src/cd-common.c +++ b/src/cd-common.c @@ -22,14 +22,11 @@ #include "config.h" #include <string.h> - -#ifdef USE_POLKIT #include <polkit/polkit.h> -#endif #include "cd-common.h" -#if defined(USE_POLKIT) && !defined(POLKIT_HAS_AUTOPTR_MACROS) +#if !defined(POLKIT_HAS_AUTOPTR_MACROS) G_DEFINE_AUTOPTR_CLEANUP_FUNC(PolkitAuthorizationResult, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(PolkitSubject, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(PolkitAuthority, g_object_unref) @@ -124,11 +121,9 @@ cd_main_sender_authenticated (GDBusConnection *connection, { guint uid; g_autoptr(GError) error_local = NULL; -#ifdef USE_POLKIT g_autoptr(PolkitAuthority) authority = NULL; g_autoptr(PolkitAuthorizationResult) result = NULL; g_autoptr(PolkitSubject) subject = NULL; -#endif /* uid 0 is allowed to do all actions */ uid = cd_main_get_sender_uid (connection, sender, &error_local); @@ -158,7 +153,6 @@ cd_main_sender_authenticated (GDBusConnection *connection, } #endif -#ifdef USE_POLKIT /* get authority */ authority = polkit_authority_get_sync (NULL, &error_local); if (authority == NULL) { @@ -197,10 +191,6 @@ cd_main_sender_authenticated (GDBusConnection *connection, action_id); return FALSE; } -#else - g_warning ("CdCommon: not checking %s for %s as no PolicyKit support", - action_id, sender); -#endif return TRUE; } |