summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2013-05-29Use GOnce for interface type registrationTomas Bzatek3-12/+18
Static local variable may not be enough since it doesn't provide locking. Related to these udisksd warnings: GLib-GObject-WARNING **: cannot register existing type `PolkitSubject' Thanks to Hans de Goede for spotting this! https://bugs.freedesktop.org/show_bug.cgi?id=65130
2013-05-13Exit pkaction with status 0 on successMiloslav Trmač1-0/+2
https://bugs.freedesktop.org/show_bug.cgi?id=29936
2013-05-13Refuse unrecognized command-line operandsMiloslav Trmač3-0/+18
(Inconsistent options are still accepted.) https://bugs.freedesktop.org/show_bug.cgi?id=29936
2013-05-13Add bug reporting address and home page to --help outputMiloslav Trmač4-2/+21
... as required by GNU coding standards. https://bugs.freedesktop.org/show_bug.cgi?id=29936
2013-05-13Don't spawn man for --helpMiloslav Trmač3-186/+138
Convert pkaction and pkttyagent to use GOptionContext. Don't convert pkcheck and only add --help output text because its non-standard --details(which requires two arguments) can't be implemented using GOptionContext. Don't touch pkexec, in a (futile?) attempt to minimize the amount of complex code running before authentication. This leaves the option processing lax as it was (e.g. accepting contradicting options, ignoring non-option arguments), and should only affect the handling of --help and behavior when invalid arguments are detected. https://bugs.freedesktop.org/show_bug.cgi?id=29936
2013-05-07Remove an unused va_startMiloslav Trmač1-1/+0
https://bugs.freedesktop.org/show_bug.cgi?id=64336
2013-05-07Fix a memory leakMiloslav Trmač1-0/+1
https://bugs.freedesktop.org/show_bug.cgi?id=64336
2013-05-07Drop unused variableMiloslav Trmač1-5/+0
https://bugs.freedesktop.org/show_bug.cgi?id=64336
2013-05-06Refuse non-string parameters to Polkit.spawn()Miloslav Trmač1-0/+6
Using integers or floating-point numbers could have resulted in a crash. Use JSVAL_IS_STRING() instead of implicit conversion through JS_ValueToString(); hopefully this will nudge the rule writer toward thinking more about the string conversion and the format of the resulting string. https://bugs.freedesktop.org/show_bug.cgi?id=63575
2013-05-06Fix handling of null returned from _runRulesMiloslav Trmač1-6/+6
https://bugs.freedesktop.org/show_bug.cgi?id=63575
2013-05-06Fix a TypeError when no admin rules are registeredMiloslav Trmač1-1/+1
https://bugs.freedesktop.org/show_bug.cgi?id=63575
2013-05-06Use auth_admin* instead of auth_self* in examplesMiloslav Trmač1-1/+1
From time to time, application developers just copy example configuration without examining it in details. Because polkit is typically used to control access to system-level operations, the policy (and therefore the examples) should limit access to system administrators only.
2013-04-23jsauthority: Work with mozjs-17.0 tooColin Walters1-6/+45
Based on work by Tim Lunn <tim@feathertop.org>, reworked on top of a regular dynamically-linked js. https://bugs.freedesktop.org/show_bug.cgi?id=59830
2013-04-23Revert "Dynamically load libmozjs185.so and cope with it not being available"Colin Walters2-304/+147
The new plan is to hard-require JS. See discussion in https://bugs.freedesktop.org/show_bug.cgi?id=59830 This reverts commit 34cb6353b9affd6c04ea480df5fc39d0ca72319d. Conflicts: src/polkitbackend/polkitbackendjsauthority.c
2013-04-23jsauthority: Use JSVAL_NULL rather than {0} struct initializationColin Walters1-6/+6
This is future compatible with mozjs-17.0. https://bugs.freedesktop.org/show_bug.cgi?id=59830
2013-04-23jsauthority: We can really only handle a stringColin Walters1-1/+1
JSVAL_TO_STRING would barf on a null value, so don't claim to handle it.
2013-04-18Add a FIXME to polkitprivate.hMiloslav Trmač1-0/+10
See discussion in https://bugs.freedesktop.org/show_bug.cgi?id=63573 .
2013-04-15Add annotations for element types of returned listsMiloslav Trmač2-16/+16
... to silence warnings when g-ir-scanner warnings are enabled. https://bugs.freedesktop.org/show_bug.cgi?id=63573
2013-04-15Fix an obvious docstring typo.Miloslav Trmač1-1/+1
https://bugs.freedesktop.org/show_bug.cgi?id=63573
2013-04-15Fold enum documentation into relevant classesMiloslav Trmač1-8/+0
Fold PolkitImplicitAuthorization and PolkitCheckAuthorizationFlags into the relevant classes in the section list; polkit-1-docs.xml is already not including the enum documents. https://bugs.freedesktop.org/show_bug.cgi?id=63573
2013-04-15Document deprecated functions.Miloslav Trmač2-0/+16
All of these are a part of public API with some external users. Do the minimum to avoid a warning; ideally we should also add a *_DISABLE_DEPRECATED macro etc. https://bugs.freedesktop.org/show_bug.cgi?id=63573
2013-04-15Move polkit_temporary_authorization_new to private header file.Miloslav Trmač2-5/+5
The related new_for_gvariant() is private already, this seems also intended to be private. searchco.de doesn't show any external users. https://bugs.freedesktop.org/show_bug.cgi?id=63573
2013-04-15Fix various memory leaks.Miloslav Trmač2-2/+3
The XML_ParserCreate_MM one was found by Florian Weimer in https://bugzilla.redhat.com/show_bug.cgi?id=888728 . This should cover everything found by valgrind on the JS authority test, augmented with a call to polkit_backend_authority_enumerate_actions() to verify the XML_ParserCreate_MM case. https://bugs.freedesktop.org/show_bug.cgi?id=63492
2013-04-12configure: Specify GLib min/max versionColin Walters1-0/+1
Mainly to avoid deprecation warnings about g_type_init(). https://bugs.freedesktop.org/show_bug.cgi?id=63440
2013-04-11Add missing #include <sys/wait.h>Samuli Suominen1-0/+1
This is required for WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG. This must have been implicit and nobody noticed, but isn't with SH4 architecture (Linux, Gentoo, GNU gcc and glibc). http://bugs.freedesktop.org/show_bug.cgi?id=62220
2013-04-11update types for js188darkxst1-20/+20
For esr17, mozilla have removed many of the custom typedefs and replaced them with standard types. For example jsuint -> guint32, uintN -> unsigned and int32 -> gint32. These changes are backwards compatible with js185 https://bugs.freedesktop.org/show_bug.cgi?id=59781
2013-04-11pkexec: Set process environment from pam_getenvlist()Steve Langasek1-0/+10
Various pam modules provide environment variables that are intended to be set in the environment of the pam session. pkexec needs to process the output of pam_getenvlist() to get these. https://bugs.freedesktop.org/show_bug.cgi?id=62016
2013-04-11polkitagent, pkexec: Respect SUID_CFLAGS and SUID_LDFLAGSVincent Untz2-0/+12
This is a good way for distributors to use -fPIE/-pie. https://bugs.freedesktop.org/attachment.cgi?id=57584
2013-01-09Use mutex and condition variables properlyDavid Zeuthen1-4/+5
This was pointed out in bug 57325. https://bugs.freedesktop.org/show_bug.cgi?id=57325 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2013-01-09Fix build on GNU HurdEmilio Pozuelo Monfort1-2/+3
https://bugs.freedesktop.org/show_bug.cgi?id=35685 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2013-01-09build: Remove generated introspection files on "make clean"Michael Biebl1-0/+1
https://bugs.freedesktop.org/show_bug.cgi?id=58869 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-12-19Set XAUTHORITY environment variable if is unsetDavid Zeuthen1-0/+22
The way it works is that if XAUTHORITY is unset, then its default value is $HOME/.Xauthority. But since we're changing user identity this will not work since $HOME will now change. Therefore, if XAUTHORITY is unset, just set its default value before changing identity. This bug only affected login managers using X Window Authorization but not explicitly setting the XAUTHORITY variable. You can argue that XAUTHORITY is broken since it forces uid-changing apps like pkexec(1) to do more work - and get involved in intimate details of how X works and so on - but that doesn't change how things work. Based on a patch from Peter Wu <lekensteyn@gmail.com>. https://bugs.freedesktop.org/show_bug.cgi?id=51623 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-11-15Don't require libmozjs185 devel packages for polkit rules to workDavid Zeuthen1-1/+1
The SO-name rules for SpiderMonkey are a little bit weird and we were opening wrong file. This problem was reported in https://bugs.freedesktop.org/show_bug.cgi?id=57146 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-11-14Dynamically load libmozjs185.so and cope with it not being availableDavid Zeuthen2-147/+304
A number of downstream distributors have - one way or the other - requested this feature. Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-11-13build: Fix .gir generation for parallel makeRyan Lortie2-0/+4
As per the intructions in the introspection Makefile, we should have a line declaring a dependency between the .gir and .la files. https://bugs.freedesktop.org/show_bug.cgi?id=57077 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-10-09PolkitAgent: Avoid crashing if initializing the server object failsAdam Jackson1-2/+1
Note that otherwise we return a freed server object. Since later in polkit_agent_listener_register_with_options we check against NULL to determine failure, this makes for sad times later when we call server_free() on it again. https://bugs.freedesktop.org/show_bug.cgi?id=55776 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-09-18Fall back to authenticating as uid 0 if the list of admin identities is emptyDavid Zeuthen1-6/+6
For example, this can happen if the wheel group has no members. This was reported in Red Hat bug 834494, see https://bugzilla.redhat.com/show_bug.cgi?id=834494 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-07-11pkexec: add support for argv1 annotation and mention shebang-wrappersDavid Zeuthen1-1/+15
Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-07-06Introduce a polkit.Result enumeration for authorization rulesDavid Zeuthen1-0/+10
This way an authorization rule can do this return polkit.Result.YES; which is slightly nicer than return "yes"; https://bugs.freedesktop.org/show_bug.cgi?id=50983 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-07-06Try harder to look up the right localizationMatthias Clasen1-9/+7
The code for looking up localized strings for action descriptions was manually trying to break locale names into pieces, but didn't get it right for e.g. zh_CN.utf-8. Instead, use the GLib function g_get_locale_variants(), which handles this (and more). This fixes the translation problem reported in https://bugzilla.gnome.org/show_bug.cgi?id=665497 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-06-06Make it work when using ConsoleKit instead of libsystemd-loginDavid Zeuthen3-9/+56
... although it would be nicer to just rip out the CK bits and simply hard-require libsystemd-login instead - it should work just fine on non-systemd systems, same way systemd-udev works fine there. Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-06-06agenthelper-pam: Fix newline-trimming codeColin Walters1-3/+8
First, we were using == instead of =, as the author probably intended. But after changing that, we're now assigning to const memory. Fix that by writing to a temporary string buffer. Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-05-25Log when the name org.fd.PolicyKit1 has been acquiredDavid Zeuthen1-6/+6
Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-05-25Run polkitd as an unprivileged userDavid Zeuthen2-1/+76
There's really no reason to run all this code as uid 0. Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-05-25Remove unused DBUS_GLIB_* and GIO_* variablesDavid Zeuthen1-1/+0
Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-05-25Ensure polkitd is rebuilt if libpolkit-backend-1.la changesDavid Zeuthen1-1/+1
Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-05-25Move polkitd into src/polkitbackendDavid Zeuthen4-42/+27
Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-05-25Use g_unix_signal_add() from GLib 2.30David Zeuthen4-198/+3
... instead of the one I wrote myself. Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-05-24Clarify pkexec(1) variablesDavid Zeuthen2-9/+10
Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-05-24Combine action and details parametersDavid Zeuthen3-95/+39
This also removes the ability to change detail parameters which is actually a good thing. If we later need a way to change the authentication message, we can always add something like polkit.addAuthenticationMessageRule() so the user can register a function returning a string. Signed-off-by: David Zeuthen <davidz@redhat.com>