summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2011-03-14Don't show diagnostic messages intended for the administrator to the end userDavid Zeuthen1-4/+0
See https://bugzilla.gnome.org/show_bug.cgi?id=644737#c6 for discussion. Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-11introspection: Add --c-include to the gir filesBenjamin Otte2-0/+2
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-03Build examples by default and fix compiler warningsDavid Zeuthen1-1/+1
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-03Fix a couple of warnings triggered by gcc 4.6David Zeuthen5-14/+1
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-03Deprecated PolkitBackendActionLookupDavid Zeuthen10-315/+147
Instead, pass the untranslated message as polkit.message and set the gettext domain on polkit.gettext_domain. For printf()-style messages, occurences of the form $(name_of_key) in the translated version of polkit.message are expanded with the value of the property name_of_key. See the pkexec(1) mechanism for an example of how to use this. Additionally, the property polkit.icon_name can be set to the icon. Note that not all authentication agents use this - in particular, gnome-shell does not. It is no longer possible to set the details to be shown in the authentication dialog. It was never a good idea to hide information there anyway. Instead, the mechanism should format a meaningful message. Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Allow overriding message shown in authentication dialogDavid Zeuthen2-0/+23
This is much easier than writing a PolkitBackendActionLookup class and installing an extension. On the downside it requires the caller to be uid 0. Example: http://people.freedesktop.org/~david/polkit-pass-messages.png Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Bug 29712 – Use monotonic for temporary authorizationsDavid Zeuthen2-6/+27
https://bugs.freedesktop.org/show_bug.cgi?id=29712 Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Be a bit more careful parsing the command-lineDavid Zeuthen2-19/+29
In particular, avoid crashing for Zombies Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23pkcheck: Make it possible to list and revoke temporary authorizationsDavid Zeuthen2-1/+270
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Make pkcheck(1) report if the authentication dialog was dismissedDavid Zeuthen1-0/+5
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Bug 27253 – Use GOBJECT_INTROSPECTION_CHECK from gobject-introspectionAdrian Bunk2-16/+16
https://bugs.freedesktop.org/show_bug.cgi?id=27253 Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Be more specific about what info we want when enumerating filesDavid Zeuthen4-4/+4
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Fix a memory leakDavid Zeuthen1-0/+2
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Bug 32334 – Always set polkit.retains_authorization_after_challengeDavid Zeuthen1-11/+7
Otherwise it's impossible to implement lock buttons. https://bugs.freedesktop.org/show_bug.cgi?id=32334 Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Bug 30438 – PolicyKit fails to build on AIXDavid Zeuthen2-3/+24
https://bugs.freedesktop.org/show_bug.cgi?id=30438 Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Bug 29871 – Fix build failures with binutils-goldMichael Biebl1-0/+1
Link polkit_agent_helper_1 against GLIB_LIBS. Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23Bug 27081 – pkexec fails to build on non glibc systemsDavid Zeuthen1-5/+4
https://bugs.freedesktop.org/show_bug.cgi?id=27081 Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-22Bug 30653 – No way to detect cancellation in pkexecDavid Zeuthen5-12/+94
https://bugs.freedesktop.org/show_bug.cgi?id=30653 Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-21Pass caller and subject pid to authentication agentDavid Zeuthen1-0/+57
The authentication agent can use information this to inform the user about the UI application that triggered the authentication request (if any). Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-21Always pass non-zero value to g_once_init_leave()David Zeuthen1-6/+7
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-21Fix up debug and timeouts in agent helperDavid Zeuthen3-26/+34
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-21Add some debug info that can be shown with the env var POLKIT_DEBUGDavid Zeuthen1-13/+49
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-21Improve error reporting for authentication sessionsDavid Zeuthen2-4/+54
In particular ensure that we show Incorrect permissions on /opt/gnome-shell/install/libexec/polkit-agent-helper-1 as a PAM error message if the permissions on the helper are incorrect (e.g. if the helper is not setuid root). Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-18Fix-up PolkitAgentSession to use GObject propertiesDavid Zeuthen1-4/+95
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-17Build gir/typelib for PolkitAgent-1.0David Zeuthen2-2/+36
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-17Add missing GObject Introspection annotationsDavid Zeuthen12-60/+53
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-10Fix another GCC uninitialized variable warningColin Walters1-1/+1
2010-09-10Fix (correct) GCC warning about possibly-uninitialized variableColin Walters1-2/+2
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-10Remove duplicate definitions of enumeration typesColin Walters3-12/+0
These are defined in polkitenumtypes.h, don't re-define them. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-26Bug 29816 – Install polkitagentenumtypes.hVincent Untz1-0/+1
https://bugs.freedesktop.org/show_bug.cgi?id=29816 Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-20Fix dist-checkDavid Zeuthen1-1/+1
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-20Various doc cleanupsDavid Zeuthen14-80/+163
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-20pkcheck: add --enable-internal-agent optionDavid Zeuthen2-2/+54
We don't want this on by default because things like system daemons (such as libvirtd) are using pkcheck(1) and in some unfortunate cases these may have a tty attached. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-20pkexec: add --disable-internal-agent optionDavid Zeuthen1-2/+9
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-18Fix ConsoleKit interaction bugDavid Zeuthen1-5/+47
First of all, there was a glaring bug where we forgot to load the GKeyFile for /var/run/ConsoleKit/database resulting in criticals like this: (lt-polkitd:17984): GLib-CRITICAL **: g_key_file_get_boolean: assertion `key_file != NULL' failed (lt-polkitd:17984): GLib-CRITICAL **: g_key_file_get_boolean: assertion `key_file != NULL' failed Furthermore, this resulted in the Authority returning "not authorized" for subjects that should have been authorized. For an example, see https://bugzilla.redhat.com/show_bug.cgi?id=624125 Fix this bug by calling ensure_database() to make sure the GKeyFile contains information from /var/run/ConsoleKit/database. Also, since there is a race (theoretical at least, but see https://bugzilla.gnome.org/show_bug.cgi?id=627285 ) with file monitoring, also ensure that we are using the latest and greatest version of /var/run/ConsoleKit/database. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-12Add textual authentication agent and use it in pkexec(1)David Zeuthen16-198/+1292
This makes pkexec(1) work when e.g. logging in via ssh(1) or the linux console but also when using `su -'. Example: [davidz@x61 ~]$ su - bateman Password: [bateman@x61 ~]$ pkexec bash ==== AUTHENTICATING FOR org.freedesktop.policykit.exec === Authentication is needed to run `/bin/bash' as the super user Authenticating as: root Password: ==== AUTHENTICATION COMPLETE === [root@x61 ~]# Summary of changes - Added a PolkitAgentTextListener class - Add new polkit_agent_listener_register() (and _unregister()) API - Deprecate polkit_agent_register_listener API - Allow registering authentication agents for PolkitUnixProcess subjects and prefer such agents to ones governing the session - Make PolkitAgentSession use the thread-default GMainContext - otherwise it won't work in spawned threads - (finally) use PolkitAgentTextListener in pkexec(1) if authorization via authentication is possible but no authentication agent was found Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-12Fix scanning of unix-process subjectsDavid Zeuthen1-10/+12
In particular accept both "unix-process:<pid>,<starttime>" and "unix-process:<pid>". For the latter, return an error if we cannot lookup the starttime (for example if the given pid references a non-existing process). Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-09Properly reference headersDavid Zeuthen3-3/+6
Based on a patch from Jonathan Conder <j@skurvy.no-ip.org>, see https://bugs.freedesktop.org/show_bug.cgi?id=25798 Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-09Don't dist org.freedesktop.ConsoleKit.xml; It's dead, JimDavid Zeuthen1-1/+0
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-09Update GI annotationsDavid Zeuthen15-99/+96
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-09PolkitBackend: Don't export unneeded convenience APIDavid Zeuthen10-27/+16
No need to export these classes PolkitBackendActionPool PolkitBackendSessionMonitor PolkitBackendConfigSource PolkitBackendLocalAuthorizationStore since exporting them means we need to support their API and ABI Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-09Use polkit_authority_get_sync() instead of deprecated polkit_authority_get()David Zeuthen5-7/+33
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-09Add g_return_if_fail() to all public API entry pointsDavid Zeuthen13-0/+101
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-09PolkitAuthority: Add g_return_if_fail() checksDavid Zeuthen1-6/+136
Also fix a locking bug. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-09PolkitAuthority: Implement failable initializationDavid Zeuthen3-42/+289
... and deprecate polkit_authority_get(). Also fix up locking in PolkitAuthority. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-07Add a GPermission implementationDavid Zeuthen5-0/+906
Based on code from Matthias Clasen <mclasen@redhat.com>. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03Make NameOwnerChanged a private impl detail of the interactive authorityDavid Zeuthen3-81/+69
There's no need to expose this as public API. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03Remove Lock Down functionalityDavid Zeuthen7-988/+3
This is better implemented as a separate set of extension to the local authority. The only current known user, PolkitLockButton, will be ported away from using these interfaces. Since polkit still hasn't reached 1.0 this removal of functionality is OK especially since the NEWS file has already wanred something like this may happen. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-02Implement polkit_temporary_authorization_new_for_gvariant()David Zeuthen3-5/+36
This is hit by the authentication agent in order to display a padlock when temporary authorizations exist. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30Make polkitd accept --replace and gracefully handle SIGINTDavid Zeuthen7-101/+327
E.g. actually clean up everything before exiting. This makes it much easier to chase memory leaks. Signed-off-by: David Zeuthen <davidz@redhat.com>