platform/upstream/polkit.git
9 years agoInstall service for default.target instead of graphical.target 00/32500/1 accepted/tizen_3.0_ivi accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen tizen_3.0 tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.2015.q2_common tizen_3.0.m1_mobile tizen_3.0.m1_tv tizen_3.0.m2 tizen_3.0_ivi accepted/tizen/3.0/ivi/20161011.062239 accepted/tizen/common/20150105.171233 accepted/tizen/ivi/20150108.010449 accepted/tizen/ivi/20160218.025803 accepted/tizen/mobile/20150108.233313 accepted/tizen/tv/20150108.003050 accepted/tizen/wearable/20150106.002904 submit/tizen/20150105.140239 submit/tizen_3.0.m2/20170104.093754 submit/tizen_3.0_ivi/20161010.000006 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000007 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release tizen_3.0_ivi_release
Jussi Laako [Tue, 4 Nov 2014 15:05:24 +0000 (17:05 +0200)]
Install service for default.target instead of graphical.target

Change-Id: Id2c9b0e5319b0e07c0130054d402bc3e50f1b2ef
Signed-off-by: Jussi Laako <jussi.laako@linux.intel.com>
10 years agostart using smack processes 27/16927/1 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_generic accepted/tizen_ivi_panda accepted/tizen_ivi_release tizen_3.0.2014.q3_common tizen_3.0.m14.2_ivi tizen_3.0.m14.3_ivi tizen_ivi_release accepted/tizen/generic/20140227.074256 accepted/tizen/generic/20140312.110707 accepted/tizen/ivi/20140228.011128 accepted/tizen/ivi/panda/20140312.120353 accepted/tizen/ivi/release/20140312.124331 accepted/tizen/mobile/20140227.072025 submit/tizen/20140227.051925 submit/tizen/20140312.070906 submit/tizen_ivi_release/20140312.071334 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.2_ivi_release tizen_3.0.m14.3_ivi_release
Michael Leibowitz [Thu, 27 Feb 2014 05:12:24 +0000 (21:12 -0800)]
start using smack processes

Change-Id: I8daa785f95b3ba7215a7d3c6f27cfdb35f4c8156

10 years agoAdd PolkitSmackProcess: a subclass of PolkitUnixProcess 26/16926/1
Michael Leibowitz [Thu, 27 Feb 2014 04:52:28 +0000 (20:52 -0800)]
Add PolkitSmackProcess: a subclass of PolkitUnixProcess

This adds smack label based subjects and re-arranges the way unix
process is done to make it possible to inherit.  The docs are still a
little broken.

Change-Id: I118683bce8829a6dc00c84305a5372a88aefb49a

10 years agopackaging: don't add the polkitd user/group 67/15667/2 submit/tizen/20140130.033517
Patrick McCarty [Fri, 24 Jan 2014 20:11:49 +0000 (12:11 -0800)]
packaging: don't add the polkitd user/group

In Tizen, the 'setup' package contains the list of users and groups
needed by other system packages, so the polkit package should not create
the polkitd user and group here in the %pre scriptlet.

Change-Id: I9079a1b1d2de304094fa54e243280984de7d802c
Signed-off-by: Patrick McCarty <patrick.mccarty@linux.intel.com>
10 years agoadd .changes 97/12597/1 accepted/tizen/generic accepted/tizen/ivi accepted/tizen/mobile accepted/tizen/20131119.185419 accepted/tizen/20131204.185431 accepted/tizen/generic/20140130.083521 accepted/tizen/ivi/20140130.173712 accepted/tizen/mobile/20140224.083703 submit/tizen/20131119.180520 submit/tizen/20131119.180602 submit/tizen/20131119.183848
Michael Leibowitz [Tue, 19 Nov 2013 17:57:06 +0000 (09:57 -0800)]
add .changes

Change-Id: Id70861fc10cc17c2da14a5c82c6211a3a16aa0c8
Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
10 years agopackage polkit for tizen
Michael Leibowitz [Tue, 19 Nov 2013 17:54:02 +0000 (09:54 -0800)]
package polkit for tizen

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
10 years agoprefix/lib/polkit -> libdir/polkit
Michael Leibowitz [Tue, 19 Nov 2013 17:52:41 +0000 (09:52 -0800)]
prefix/lib/polkit -> libdir/polkit

Fixes systems where /lib64 is used

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
11 years agoUpdate NEWS for release 0.112
Miloslav Trmač [Wed, 18 Sep 2013 16:40:48 +0000 (18:40 +0200)]
Update NEWS for release

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
11 years agopkcheck: Support --process=pid,start-time,uid syntax too
Colin Walters [Mon, 19 Aug 2013 16:16:11 +0000 (12:16 -0400)]
pkcheck: Support --process=pid,start-time,uid syntax too

The uid is a new addition; this allows callers such as libvirt to
close a race condition in reading the uid of the process talking to
them.  They can read it via getsockopt(SO_PEERCRED) or equivalent,
rather than having pkcheck look at /proc later after the fact.

Programs which invoke pkcheck but need to know beforehand (i.e.  at
compile time) whether or not it supports passing the uid can
use:

pkcheck_supports_uid=$($PKG_CONFIG --variable pkcheck_supports_uid polkit-gobject-1)
test x$pkcheck_supports_uid = xyes

11 years agopolkitunixprocess: Deprecate racy APIs
Colin Walters [Tue, 20 Aug 2013 19:15:31 +0000 (15:15 -0400)]
polkitunixprocess: Deprecate racy APIs

It's only safe for processes to be created with their owning uid,
(without kernel support, which we don't have).  Anything else is
subject to clients exec()ing setuid binaries after the fact.

11 years agoUpdate the czech once more with newest pot file.
Tomas Chvatal [Tue, 4 Jun 2013 09:34:31 +0000 (11:34 +0200)]
Update the czech once more with newest pot file.

https://bugs.freedesktop.org/show_bug.cgi?id=65313

Signed-off-by: Tomas Chvatal <tomas.chvatal@gmail.com>
11 years agoAdd czech translation po file to distribution.
Tomas Chvatal [Sun, 2 Jun 2013 09:41:36 +0000 (11:41 +0200)]
Add czech translation po file to distribution.

https://bugs.freedesktop.org/show_bug.cgi?id=65313

Signed-off-by: Tomas Chvatal <tomas.chvatal@gmail.com>
11 years agoUse GOnce for interface type registration
Tomas Bzatek [Wed, 29 May 2013 13:45:31 +0000 (15:45 +0200)]
Use GOnce for interface type registration

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

11 years agoPost-release version bump to 0.112
Miloslav Trmač [Wed, 15 May 2013 21:20:08 +0000 (23:20 +0200)]
Post-release version bump to 0.112

11 years agoUpdate NEWS for release 0.111
Miloslav Trmač [Wed, 15 May 2013 14:22:24 +0000 (16:22 +0200)]
Update NEWS for release

11 years agoFix inclusion of COPYING into documentation with srcdir != builddir
Miloslav Trmač [Wed, 15 May 2013 20:10:09 +0000 (22:10 +0200)]
Fix inclusion of COPYING into documentation with srcdir != builddir

https://bugs.freedesktop.org/show_bug.cgi?id=64197

11 years agoExit pkaction with status 0 on success
Miloslav Trmač [Fri, 19 Apr 2013 23:22:58 +0000 (01:22 +0200)]
Exit pkaction with status 0 on success

https://bugs.freedesktop.org/show_bug.cgi?id=29936

11 years agoRefuse unrecognized command-line operands
Miloslav Trmač [Fri, 19 Apr 2013 23:21:11 +0000 (01:21 +0200)]
Refuse unrecognized command-line operands

(Inconsistent options are still accepted.)

https://bugs.freedesktop.org/show_bug.cgi?id=29936

11 years agoAdd bug reporting address and home page to --help output
Miloslav Trmač [Fri, 19 Apr 2013 23:13:36 +0000 (01:13 +0200)]
Add bug reporting address and home page to --help output

... as required by GNU coding standards.

https://bugs.freedesktop.org/show_bug.cgi?id=29936

11 years agoFix package version / bug report address mixing
Miloslav Trmač [Fri, 19 Apr 2013 22:59:19 +0000 (00:59 +0200)]
Fix package version / bug report address mixing

PACKAGE_VERSION curently contains the mailing list address as well; this
leaks into output of --version and other places.

While at it, update AM_INIT_AUTOMAKE to the new form and use correct m4
quoting at least for these lines.

https://bugs.freedesktop.org/show_bug.cgi?id=29936

11 years agoDon't spawn man for --help
Miloslav Trmač [Fri, 19 Apr 2013 22:20:21 +0000 (00:20 +0200)]
Don't spawn man for --help

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

11 years agoRemove an unused va_start
Miloslav Trmač [Tue, 7 May 2013 20:32:12 +0000 (22:32 +0200)]
Remove an unused va_start

https://bugs.freedesktop.org/show_bug.cgi?id=64336

11 years agoFix a memory leak
Miloslav Trmač [Tue, 7 May 2013 20:30:25 +0000 (22:30 +0200)]
Fix a memory leak

https://bugs.freedesktop.org/show_bug.cgi?id=64336

11 years agoDrop unused variable
Miloslav Trmač [Tue, 7 May 2013 20:26:41 +0000 (22:26 +0200)]
Drop unused variable

https://bugs.freedesktop.org/show_bug.cgi?id=64336

11 years agoRefuse non-string parameters to Polkit.spawn()
Miloslav Trmač [Thu, 18 Apr 2013 18:32:05 +0000 (20:32 +0200)]
Refuse non-string parameters to Polkit.spawn()

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

11 years agoFix handling of null returned from _runRules
Miloslav Trmač [Thu, 18 Apr 2013 18:31:48 +0000 (20:31 +0200)]
Fix handling of null returned from _runRules

https://bugs.freedesktop.org/show_bug.cgi?id=63575

11 years agoFix a TypeError when no admin rules are registered
Miloslav Trmač [Tue, 9 Apr 2013 18:50:38 +0000 (20:50 +0200)]
Fix a TypeError when no admin rules are registered

https://bugs.freedesktop.org/show_bug.cgi?id=63575

11 years agoMore warnings about using auth_self*
Miloslav Trmač [Thu, 18 Apr 2013 19:14:08 +0000 (21:14 +0200)]
More warnings about using auth_self*

Suggested by Colin Walters.

https://bugs.freedesktop.org/show_bug.cgi?id=57284

11 years agoUse auth_admin* instead of auth_self* in examples
Miloslav Trmač [Thu, 14 Feb 2013 13:48:20 +0000 (14:48 +0100)]
Use auth_admin* instead of auth_self* in examples

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.

11 years agoman: Fix pkaction man page wrt to --action-id option
Michael Biebl [Wed, 14 Sep 2011 07:45:03 +0000 (09:45 +0200)]
man: Fix pkaction man page wrt to --action-id option

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=641527

11 years agojsauthority: Work with mozjs-17.0 too
Colin Walters [Fri, 12 Apr 2013 16:29:07 +0000 (12:29 -0400)]
jsauthority: Work with mozjs-17.0 too

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

11 years agoRevert "Dynamically load libmozjs185.so and cope with it not being available"
Colin Walters [Fri, 12 Apr 2013 16:03:51 +0000 (12:03 -0400)]
Revert "Dynamically load libmozjs185.so and cope with it not being available"

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

11 years agojsauthority: Use JSVAL_NULL rather than {0} struct initialization
Colin Walters [Fri, 12 Apr 2013 18:22:49 +0000 (14:22 -0400)]
jsauthority: Use JSVAL_NULL rather than {0} struct initialization

This is future compatible with mozjs-17.0.

https://bugs.freedesktop.org/show_bug.cgi?id=59830

11 years agojsauthority: We can really only handle a string
Colin Walters [Tue, 16 Apr 2013 18:03:17 +0000 (14:03 -0400)]
jsauthority: We can really only handle a string

JSVAL_TO_STRING would barf on a null value, so don't
claim to handle it.

11 years agoAdd a FIXME to polkitprivate.h
Miloslav Trmač [Thu, 18 Apr 2013 17:54:59 +0000 (19:54 +0200)]
Add a FIXME to polkitprivate.h

See discussion in https://bugs.freedesktop.org/show_bug.cgi?id=63573 .

11 years agoAdd annotations for element types of returned lists
Miloslav Trmač [Mon, 15 Apr 2013 21:08:21 +0000 (23:08 +0200)]
Add annotations for element types of returned lists

... to silence warnings when g-ir-scanner warnings are enabled.

https://bugs.freedesktop.org/show_bug.cgi?id=63573

11 years agoFix an obvious docstring typo.
Miloslav Trmač [Wed, 10 Apr 2013 01:06:59 +0000 (03:06 +0200)]
Fix an obvious docstring typo.

https://bugs.freedesktop.org/show_bug.cgi?id=63573

11 years agoFold enum documentation into relevant classes
Miloslav Trmač [Wed, 10 Apr 2013 01:01:16 +0000 (03:01 +0200)]
Fold enum documentation into relevant classes

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

11 years agoDocument deprecated functions.
Miloslav Trmač [Wed, 10 Apr 2013 00:51:34 +0000 (02:51 +0200)]
Document deprecated functions.

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

11 years agoInclude documentation of polkit_action_description_get_annotation_keys
Miloslav Trmač [Wed, 10 Apr 2013 00:50:39 +0000 (02:50 +0200)]
Include documentation of polkit_action_description_get_annotation_keys

This seems a fairly obvious public counterpart of
polkit_action_description_get_annotation, and it is used in pkaction.c
in what is pretty much an example of public API use.

https://bugs.freedesktop.org/show_bug.cgi?id=63573

11 years agoMove polkit_temporary_authorization_new to private header file.
Miloslav Trmač [Wed, 10 Apr 2013 00:47:50 +0000 (02:47 +0200)]
Move polkit_temporary_authorization_new to private header file.

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

11 years agoFix most "undocumented symbol" warnings
Miloslav Trmač [Wed, 10 Apr 2013 00:46:38 +0000 (02:46 +0200)]
Fix most "undocumented symbol" warnings

- Mark private header files as private.
- Fix obvious typos in the section file.

https://bugs.freedesktop.org/show_bug.cgi?id=63573

11 years agoLeave out backend from gtk-doc generation
Miloslav Trmač [Tue, 9 Apr 2013 23:57:20 +0000 (01:57 +0200)]
Leave out backend from gtk-doc generation

... which silences warnings about these classes missing from
polkit-1-sections.txt

https://bugs.freedesktop.org/show_bug.cgi?id=63573

11 years agoAdd annotation glossary
Miloslav Trmač [Tue, 9 Apr 2013 23:30:11 +0000 (01:30 +0200)]
Add annotation glossary

as described at the end of
https://live.gnome.org/GObjectIntrospection/Annotations.  Fixes a huge
number of warnings.

https://bugs.freedesktop.org/show_bug.cgi?id=63573

11 years agoFix various memory leaks.
Miloslav Trmač [Sat, 13 Apr 2013 01:19:17 +0000 (03:19 +0200)]
Fix various memory leaks.

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

11 years agoconfigure: Specify GLib min/max version
Colin Walters [Thu, 11 Apr 2013 18:36:33 +0000 (14:36 -0400)]
configure: Specify GLib min/max version

Mainly to avoid deprecation warnings about g_type_init().

https://bugs.freedesktop.org/show_bug.cgi?id=63440

11 years agoFix DOC_SOURCE_DIR for builddir != srcdir
Miloslav Trmač [Tue, 9 Apr 2013 23:28:03 +0000 (01:28 +0200)]
Fix DOC_SOURCE_DIR for builddir != srcdir

This snippet comes from gtk-doc 1.18 examples/Makefile.am; we might want
to update all of the file but that's not strictly necessary.

https://bugs.freedesktop.org/show_bug.cgi?id=63479

11 years agoFix build with srcdir!=builddir
Miloslav Trmač [Tue, 9 Apr 2013 23:24:50 +0000 (01:24 +0200)]
Fix build with srcdir!=builddir

gtk-doc.make is attempting to add --path automatically but there is a
bug in the script in gtk-doc 1.18

https://bugs.freedesktop.org/show_bug.cgi?id=63479

11 years agoClean (git status) after autogen.sh
Miloslav Trmač [Tue, 9 Apr 2013 22:38:29 +0000 (00:38 +0200)]
Clean (git status) after autogen.sh

Ignore most automatically created files.  Add empty ChangeLog (to avoid
surprises if anyone wanted to add content later).

https://bugs.freedesktop.org/show_bug.cgi?id=63479

11 years agoAdd missing #include <sys/wait.h>
Samuli Suominen [Wed, 13 Mar 2013 19:44:04 +0000 (21:44 +0200)]
Add missing #include <sys/wait.h>

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

11 years agoupdate types for js188
darkxst [Thu, 24 Jan 2013 00:37:00 +0000 (00:37 +0000)]
update types for js188

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

11 years agomocklibc: Only require autoconf 2.63
Colin Walters [Thu, 11 Apr 2013 17:39:34 +0000 (13:39 -0400)]
mocklibc: Only require autoconf 2.63

It still works, and this lets polkit build on RHEL6.

11 years agopkexec: Set process environment from pam_getenvlist()
Steve Langasek [Fri, 8 Mar 2013 11:00:00 +0000 (12:00 +0100)]
pkexec: Set process environment from pam_getenvlist()

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

11 years agopolkitagent, pkexec: Respect SUID_CFLAGS and SUID_LDFLAGS
Vincent Untz [Fri, 24 Feb 2012 12:13:17 +0000 (13:13 +0100)]
polkitagent, pkexec: Respect SUID_CFLAGS and SUID_LDFLAGS

This is a good way for distributors to use -fPIE/-pie.

https://bugs.freedesktop.org/attachment.cgi?id=57584

11 years agobuild: try harder to avoid systemd/consolekit misconfiguration
Giovanni Campagna [Tue, 19 Feb 2013 16:31:45 +0000 (17:31 +0100)]
build: try harder to avoid systemd/consolekit misconfiguration

Check if the system is booting systemd, and fail if the automatic
configuration picks the wrong value. Emit a warning if the user explicitly
chose one way or the other, to account for cross-building.

https://bugs.freedesktop.org/show_bug.cgi?id=61127

11 years agoFix the build with automake 1.13
Nuno Araujo [Tue, 15 Jan 2013 16:47:22 +0000 (17:47 +0100)]
Fix the build with automake 1.13

In Automake 1.13, the long-deprecated macro AM_CONFIG_HEADER (deprecated
since 2002) has been removed in favour of AC_CONFIG_HEADERS.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoPost-release version bump to 0.111
David Zeuthen [Wed, 9 Jan 2013 20:06:40 +0000 (15:06 -0500)]
Post-release version bump to 0.111

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoUpdate NEWS for release 0.110
David Zeuthen [Wed, 9 Jan 2013 20:03:21 +0000 (15:03 -0500)]
Update NEWS for release

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoRemove AM_PROG_CC_STDC
David Zeuthen [Wed, 9 Jan 2013 20:00:49 +0000 (15:00 -0500)]
Remove AM_PROG_CC_STDC

Part of https://bugs.freedesktop.org/show_bug.cgi?id=59091

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoUse mutex and condition variables properly
David Zeuthen [Wed, 9 Jan 2013 19:22:20 +0000 (14:22 -0500)]
Use mutex and condition variables properly

This was pointed out in bug 57325.

https://bugs.freedesktop.org/show_bug.cgi?id=57325

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoFix build on GNU Hurd
Emilio Pozuelo Monfort [Sat, 26 Mar 2011 07:28:14 +0000 (07:28 +0000)]
Fix build on GNU Hurd

https://bugs.freedesktop.org/show_bug.cgi?id=35685

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agobuild: Remove generated introspection files on "make clean"
Michael Biebl [Sat, 29 Dec 2012 21:11:18 +0000 (22:11 +0100)]
build: Remove generated introspection files on "make clean"

https://bugs.freedesktop.org/show_bug.cgi?id=58869

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoSet XAUTHORITY environment variable if is unset
David Zeuthen [Wed, 19 Dec 2012 19:28:29 +0000 (14:28 -0500)]
Set XAUTHORITY environment variable if is unset

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>
11 years agoPost-release version bump to 0.110
David Zeuthen [Wed, 19 Dec 2012 15:08:25 +0000 (10:08 -0500)]
Post-release version bump to 0.110

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoUpdate NEWS for release 0.109
David Zeuthen [Wed, 19 Dec 2012 15:05:36 +0000 (10:05 -0500)]
Update NEWS for release

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoDon't require libmozjs185 devel packages for polkit rules to work
David Zeuthen [Thu, 15 Nov 2012 15:09:06 +0000 (10:09 -0500)]
Don't require libmozjs185 devel packages for polkit rules to work

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>
11 years agoInclude gmodule-2.0 to avoid linker errors
David Zeuthen [Wed, 14 Nov 2012 19:29:16 +0000 (14:29 -0500)]
Include gmodule-2.0 to avoid linker errors

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoPost-release version bump to 0.109
David Zeuthen [Wed, 14 Nov 2012 19:16:15 +0000 (14:16 -0500)]
Post-release version bump to 0.109

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoUpdate NEWS for release 0.108
David Zeuthen [Wed, 14 Nov 2012 18:26:23 +0000 (13:26 -0500)]
Update NEWS for release

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agodocs: mention the audience for authorization rules
David Zeuthen [Wed, 14 Nov 2012 18:23:19 +0000 (13:23 -0500)]
docs: mention the audience for authorization rules

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoDynamically load libmozjs185.so and cope with it not being available
David Zeuthen [Wed, 14 Nov 2012 17:12:16 +0000 (12:12 -0500)]
Dynamically load libmozjs185.so and cope with it not being available

A number of downstream distributors have - one way or the other -
requested this feature.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agobuild: Fix .gir generation for parallel make
Ryan Lortie [Tue, 13 Nov 2012 16:50:14 +0000 (11:50 -0500)]
build: Fix .gir generation for parallel make

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>
12 years agoPolkitAgent: Avoid crashing if initializing the server object fails
Adam Jackson [Tue, 9 Oct 2012 18:08:24 +0000 (14:08 -0400)]
PolkitAgent: Avoid crashing if initializing the server object fails

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>
12 years agoFall back to authenticating as uid 0 if the list of admin identities is empty
David Zeuthen [Tue, 18 Sep 2012 18:47:06 +0000 (14:47 -0400)]
Fall back to authenticating as uid 0 if the list of admin identities is empty

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>
12 years agoPost-release version bump to 0.108
David Zeuthen [Wed, 11 Jul 2012 17:34:11 +0000 (13:34 -0400)]
Post-release version bump to 0.108

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoUpdate NEWS for release 0.107
David Zeuthen [Wed, 11 Jul 2012 17:30:18 +0000 (13:30 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agopkexec: add support for argv1 annotation and mention shebang-wrappers
David Zeuthen [Wed, 11 Jul 2012 16:58:06 +0000 (12:58 -0400)]
pkexec: add support for argv1 annotation and mention shebang-wrappers

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoIntroduce a polkit.Result enumeration for authorization rules
David Zeuthen [Fri, 6 Jul 2012 14:19:45 +0000 (10:19 -0400)]
Introduce a polkit.Result enumeration for authorization rules

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>
12 years agoNuke --enable-verbose flag
David Zeuthen [Fri, 6 Jul 2012 13:55:37 +0000 (09:55 -0400)]
Nuke --enable-verbose flag

It doesn't do anything. This was pointed out in

 https://bugs.freedesktop.org/show_bug.cgi?id=51470

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoNuke leftover polkit-backend-1.pc file
David Zeuthen [Fri, 6 Jul 2012 13:53:42 +0000 (09:53 -0400)]
Nuke leftover polkit-backend-1.pc file

This was reported in https://bugs.freedesktop.org/show_bug.cgi?id=51466

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoTry harder to look up the right localization
Matthias Clasen [Thu, 28 Jun 2012 00:28:00 +0000 (20:28 -0400)]
Try harder to look up the right localization

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>
12 years agoUpdate guidance on situations where there is no polkit authority
David Zeuthen [Fri, 8 Jun 2012 17:38:53 +0000 (13:38 -0400)]
Update guidance on situations where there is no polkit authority

Now that GDBusProxy does something reasonable for a masked systemd
service, see

 https://bugzilla.gnome.org/show_bug.cgi?id=677718

construction of the PolkitAuthority object does not fail anymore. That
doesn't mean the authority is available, though, so mention that users
should check the result of the CheckAuthorization() call as well. Or
in the case of PolkitAuthority, that the error is not a POLKIT_ERROR.

This is actually a nice feature, it means that if you unmask
polkit.service then mechanisms using PolkitAuthority will start using
it without a restart.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoPost-release version bump to 0.107
David Zeuthen [Thu, 7 Jun 2012 18:02:32 +0000 (14:02 -0400)]
Post-release version bump to 0.107

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoUpdate NEWS for release 0.106
David Zeuthen [Thu, 7 Jun 2012 17:57:48 +0000 (13:57 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agodocs: add a "make sure your app works when there's no polkitd(8)" note
David Zeuthen [Thu, 7 Jun 2012 15:43:20 +0000 (11:43 -0400)]
docs: add a "make sure your app works when there's no polkitd(8)" note

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoMention the implications of returning *_keep in an authorization rule
David Zeuthen [Thu, 7 Jun 2012 14:35:07 +0000 (10:35 -0400)]
Mention the implications of returning *_keep in an authorization rule

Pointed out by Dan Williams <dcbw@redhat.com> on IRC.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoMake it work when using ConsoleKit instead of libsystemd-login
David Zeuthen [Wed, 6 Jun 2012 18:32:26 +0000 (14:32 -0400)]
Make it work when using ConsoleKit instead of libsystemd-login

... 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>
12 years agoagenthelper-pam: Fix newline-trimming code
Colin Walters [Wed, 6 Jun 2012 13:05:14 +0000 (09:05 -0400)]
agenthelper-pam: Fix newline-trimming code

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>
12 years agoautogen.sh: Fix check for libtool (we only need libtoolize)
Colin Walters [Sun, 29 Jan 2012 21:22:51 +0000 (16:22 -0500)]
autogen.sh: Fix check for libtool (we only need libtoolize)

A pre-built libtool copy may not be installed on all systems; all
we need is libtoolize.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agobuild: Check for mozjs185, not libjs
Colin Walters [Wed, 6 Jun 2012 11:21:42 +0000 (07:21 -0400)]
build: Check for mozjs185, not libjs

libjs is a Fedora-specific invention; mozjs185.pc lives in the
upstream tarball.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoState that authorization rules must not rely on SpiderMonkey features
David Zeuthen [Mon, 4 Jun 2012 17:40:45 +0000 (13:40 -0400)]
State that authorization rules must not rely on SpiderMonkey features

... e.g. we reserve the right to switch out the JS engine.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoSmall updates to the "Writing polkit applications" chapter
David Zeuthen [Mon, 4 Jun 2012 17:24:39 +0000 (13:24 -0400)]
Small updates to the "Writing polkit applications" chapter

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoUpdate pkexec(1) man page with example
David Zeuthen [Mon, 4 Jun 2012 16:34:22 +0000 (12:34 -0400)]
Update pkexec(1) man page with example

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoUpdate links to udisks docs
David Zeuthen [Mon, 4 Jun 2012 16:32:09 +0000 (12:32 -0400)]
Update links to udisks docs

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoRewrite the "Writing polkit applications" chapter
David Zeuthen [Fri, 25 May 2012 21:12:17 +0000 (17:12 -0400)]
Rewrite the "Writing polkit applications" chapter

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoLog when the name org.fd.PolicyKit1 has been acquired
David Zeuthen [Fri, 25 May 2012 17:37:49 +0000 (13:37 -0400)]
Log when the name org.fd.PolicyKit1 has been acquired

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRun polkitd as an unprivileged user
David Zeuthen [Fri, 25 May 2012 16:40:42 +0000 (12:40 -0400)]
Run polkitd as an unprivileged user

There's really no reason to run all this code as uid 0.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove unused DBUS_GLIB_* and GIO_* variables
David Zeuthen [Fri, 25 May 2012 15:20:05 +0000 (11:20 -0400)]
Remove unused DBUS_GLIB_* and GIO_* variables

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoEnsure polkitd is rebuilt if libpolkit-backend-1.la changes
David Zeuthen [Fri, 25 May 2012 15:12:26 +0000 (11:12 -0400)]
Ensure polkitd is rebuilt if libpolkit-backend-1.la changes

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMove polkitd into src/polkitbackend
David Zeuthen [Fri, 25 May 2012 15:09:02 +0000 (11:09 -0400)]
Move polkitd into src/polkitbackend

Signed-off-by: David Zeuthen <davidz@redhat.com>