platform/upstream/polkit.git
17 years agorip out the notion of Resources
David Zeuthen [Tue, 19 Jun 2007 19:41:55 +0000 (15:41 -0400)]
rip out the notion of Resources

It makes things a _lot more_ complicated having to deal with resources
and there's a much nicer way to deal with it: Punt it to the apps:

It's much more natural for the application to have a notion about
about what resources are "trusted" (and e.g. requires lesser
privileges) and what resources aren't.

Consider dial-up networking; here the privileged application that
performs the dial-up operation consults a list (maintained by the
system administrator) of allowed numbers to dial. If the unprivileged
networking UI applet that requests a number to be dialed is on the
list it uses the PolicyKit action 'nm-dialup-trusted-location', if it
isn't then it uses the PolicyKit action 'nm-dialup-untrusted-location'.

17 years agoswitch to XML for policy definition files and introduce descriptions
David Zeuthen [Mon, 23 Apr 2007 01:13:17 +0000 (21:13 -0400)]
switch to XML for policy definition files and introduce descriptions

Descriptions will be subject to i18n/l10n efforts at some point.

Also add a new tool polkit-list-actions.

17 years agoalso remember to do s/libpolkit/polkit/ on the pkg-config files
David Zeuthen [Tue, 17 Apr 2007 06:13:02 +0000 (02:13 -0400)]
also remember to do s/libpolkit/polkit/ on the pkg-config files

17 years agorename libpolkit to polkit
David Zeuthen [Tue, 17 Apr 2007 05:41:09 +0000 (01:41 -0400)]
rename libpolkit to polkit

It's more consistent and, uhm, easier to type.

17 years agoadd some validation to public facing functions
David Zeuthen [Mon, 16 Apr 2007 03:37:29 +0000 (23:37 -0400)]
add some validation to public facing functions

17 years agoremove misguided action parameters
David Zeuthen [Sun, 15 Apr 2007 23:41:00 +0000 (19:41 -0400)]
remove misguided action parameters

This feature was introduced with

 commit 02a4c5101ca4751963f76a0e016d3308389dc2a5
 http://gitweb.freedesktop.org/?p=PolicyKit.git;a=commit;h=02a4c5101ca4751963f76a0e016d3308389dc2a5

It makes things a lot harder for privilege granting if a feature like
action parameters are present. Thinking about it, they're not really
necessary; the parameters should just be encoded in the resource name;
e.g. with the example given in the commit

> This is useful for letting mechanisms convey information which may be
> useful in making a decision whether an action is OK. For example,
> NetworkManager could use this to provide the phone-number parameter
> with a hypothetical "nm-dialup" action. Then a site or vendor can
> provide insert
>
>  mandatory polkit-run-program.so \
>     program="/usr/lib/check-dialup-number.sh" privilege="nm-dialup"
>
> into /etc/PolicyKit/PolicyKit.conf and have said program check
>
>  $POLKIT_ACTION_PARAM_PHONE_NUMBER
>
> in that program.

is broken; the right thing here is for a hypothetical NetworkManager
to pass the dial up connection details as the resource

 resource.type = "NetworkManager"
 resource.id = "/org/freedesktop/NM/DialUpConnection/number=555-HOT-CHICKS"

in a well-defined format etc. etc.

17 years agoadd the PAM configuration file
David Zeuthen [Sun, 15 Apr 2007 22:55:27 +0000 (18:55 -0400)]
add the PAM configuration file

17 years agoadd pkg-config files for the two new libraries
David Zeuthen [Sun, 15 Apr 2007 22:54:35 +0000 (18:54 -0400)]
add pkg-config files for the two new libraries

17 years agoadd the correct version files for docs
David Zeuthen [Sun, 15 Apr 2007 22:53:42 +0000 (18:53 -0400)]
add the correct version files for docs

17 years agoadd grant functionality + lots of other changes
David Zeuthen [Sun, 15 Apr 2007 22:51:19 +0000 (18:51 -0400)]
add grant functionality + lots of other changes

 - Split libpolkit into three libraries
   - libpolkit : to be used only by mechanisms and modules
   - libpolkit-dbus : utility library for libpolkit to get caller, session
                      etc. info from the bus and ConsoleKit
   - libpolkit-grant : client side library for obtaining privileges; uses
                       a setgid helper internally

 - grant functionality
   - a helper library, libpolkit-grant, to gain privileges
     - includes a setgid $POLKIT_GROUP helper to write granted privileges
   - a PK module, to read and interpret granted privileges
   - a cmdline app, polkit-grant, using said library

 - Other changes
   - so it turns out that sizeof(bool) != sizeof(gboolean), sizeof(dbus_bool_t)
     This blows so define our own polkit_bool_t type
   - add some validation routines

The grant functionality, especially the setgid helper needs thorough
security review before we can release it.

17 years agoremove all usage of glib from the header files
David Zeuthen [Mon, 9 Apr 2007 22:38:20 +0000 (18:38 -0400)]
remove all usage of glib from the header files

This paves the way for getting rid of a glib dependency; when and if
that happens is to be determined; right now it just doesn't make a lot
of sense to reimplement GKeyFile, GSList, GHashTable, g_spawn_sync and
other useful routines. But it might make sense if we want to get the
message bus daemon to link with libpolkit so you e.g. can say

 <policy polkit="acme-frobnicate">
   <allow send_interface="com.acme.Frobnicator"
 </policy>

to allow a caller on the system message bus to access that interface
if, and only if, he can do the "acme-frobnicate" action according to
PolicyKit.

17 years agoassociate parameters (key/value pairs) with the Action class
David Zeuthen [Mon, 9 Apr 2007 19:20:04 +0000 (15:20 -0400)]
associate parameters (key/value pairs) with the Action class

This is useful for letting mechanisms convey information which may be
useful in making a decision whether an action is OK. For example,
NetworkManager could use this to provide the phone-number parameter
with a hypothetical "nm-dialup" action. Then a site or vendor can
provide insert

 mandatory polkit-run-program.so program="/usr/lib/check-dialup-number.sh" privilege="nm-dialup"

into /etc/PolicyKit/PolicyKit.conf and have said program check

 $POLKIT_ACTION_PARAM_PHONE_NUMBER

in that program.

17 years agoremember to set session's ConsoleKit object path
David Zeuthen [Mon, 9 Apr 2007 19:16:10 +0000 (15:16 -0400)]
remember to set session's ConsoleKit object path

17 years agopolicy files now have the .policy extension, not .priv
David Zeuthen [Sun, 8 Apr 2007 23:38:02 +0000 (19:38 -0400)]
policy files now have the .policy extension, not .priv

17 years agono need to reference polkit-module-default twice in a man page
David Zeuthen [Sun, 8 Apr 2007 23:18:23 +0000 (19:18 -0400)]
no need to reference polkit-module-default twice in a man page

17 years agominor fixes to the PolicyKit manual page
David Zeuthen [Sun, 8 Apr 2007 23:12:31 +0000 (19:12 -0400)]
minor fixes to the PolicyKit manual page

17 years agomass renaming of classes
David Zeuthen [Sun, 8 Apr 2007 23:06:59 +0000 (19:06 -0400)]
mass renaming of classes

 Privilege -> Action
 PrivilegeFile -> PolicyFile
 PrivilegeFileEntry -> PolicyFileEntry
 PrivilegeCache -> PolicyCache

Hopefully it makes a bit more sense now.

17 years agofix up Makefile.am
David Zeuthen [Sun, 8 Apr 2007 21:26:29 +0000 (17:26 -0400)]
fix up Makefile.am

17 years agogenerate and dist ChangeLog
David Zeuthen [Sun, 8 Apr 2007 21:25:31 +0000 (17:25 -0400)]
generate and dist ChangeLog

17 years agoadd built-in options and a new module pam-polkit-run-program.so
David Zeuthen [Sun, 8 Apr 2007 20:49:27 +0000 (16:49 -0400)]
add built-in options and a new module pam-polkit-run-program.so

17 years agostop disting ChangeLog and start disting modules/PolicyKit.conf
David Zeuthen [Sun, 8 Apr 2007 06:13:34 +0000 (02:13 -0400)]
stop disting ChangeLog and start disting modules/PolicyKit.conf

Am happy to report that 'make distcheck' now works!

17 years agoadd module loading to PolicyKit
David Zeuthen [Sun, 8 Apr 2007 06:07:42 +0000 (02:07 -0400)]
add module loading to PolicyKit

This paves the way for writing

 1. A module that tracks temporary (look in /var/run) and permanent (look
    in /var/lib) privilege grants
 2. A D-Bus service to authenticate a client to obtain to a privilege
    grant and then writing the grant in temporary or permanent storage

Also, this feature lets people very easily lock down the system; just
edit /etc/PolicyKit/PolicyKit.conf; add pam-module-deny-all / -allow-all
stanzas with various privilege=<regexp> and user=<username> options.

17 years agowatch the correct directory
David Zeuthen [Sat, 7 Apr 2007 02:09:00 +0000 (22:09 -0400)]
watch the correct directory

17 years agoreally ignore privilege files starting with "." this time
David Zeuthen [Sat, 7 Apr 2007 01:52:37 +0000 (21:52 -0400)]
really ignore privilege files starting with "." this time

Also avoid dumping all privilege file entries to debug whenever we
populate our privilege cache.

17 years agorefine file monitoring interface and implement policy reload
David Zeuthen [Sat, 7 Apr 2007 01:01:35 +0000 (21:01 -0400)]
refine file monitoring interface and implement policy reload

17 years agomake polkit-privilege-file-validate accept multiple files
David Zeuthen [Sat, 7 Apr 2007 01:01:14 +0000 (21:01 -0400)]
make polkit-privilege-file-validate accept multiple files

17 years agomove to using _pk_debug and respect $POLKIT_DEBUG
David Zeuthen [Fri, 6 Apr 2007 20:23:47 +0000 (16:23 -0400)]
move to using _pk_debug and respect $POLKIT_DEBUG

17 years agoread privilege files and actually use the policy described in those
David Zeuthen [Fri, 6 Apr 2007 18:09:02 +0000 (14:09 -0400)]
read privilege files and actually use the policy described in those

17 years agoprovide an example privilege file
David Zeuthen [Wed, 4 Apr 2007 20:52:59 +0000 (16:52 -0400)]
provide an example privilege file

17 years agoinclude PolKitPrivilegeFile in API docs
David Zeuthen [Wed, 4 Apr 2007 20:38:34 +0000 (16:38 -0400)]
include PolKitPrivilegeFile in API docs

17 years agointroduce a PolKitResult enumeration and make privilege files use that
David Zeuthen [Wed, 4 Apr 2007 20:26:20 +0000 (16:26 -0400)]
introduce a PolKitResult enumeration and make privilege files use that

17 years agoadd support for privilege files and provide a validation tool
David Zeuthen [Wed, 4 Apr 2007 07:08:09 +0000 (03:08 -0400)]
add support for privilege files and provide a validation tool

17 years agoget rid of AS_AC_EXPAND and use autoconf docdir
David Zeuthen [Wed, 4 Apr 2007 04:39:16 +0000 (00:39 -0400)]
get rid of AS_AC_EXPAND and use autoconf docdir

Inspired by recent patches to both HAL and ConsoleKit from Michael
Biebl <mbiebl@gmail.com>.

17 years agono need to mention $(top_srcdir) twice
David Zeuthen [Thu, 29 Mar 2007 05:17:40 +0000 (01:17 -0400)]
no need to mention $(top_srcdir) twice

17 years agobuild fix so 'make distcheck' works
David Zeuthen [Thu, 29 Mar 2007 05:06:16 +0000 (01:06 -0400)]
build fix so 'make distcheck' works

17 years agoadd two tools polkit-check-caller and polkit-check-session
David Zeuthen [Thu, 29 Mar 2007 04:46:42 +0000 (00:46 -0400)]
add two tools polkit-check-caller and polkit-check-session

17 years agoimplement the classes carrying data
David Zeuthen [Thu, 29 Mar 2007 00:10:52 +0000 (20:10 -0400)]
implement the classes carrying data

17 years agodocument the API
David Zeuthen [Wed, 28 Mar 2007 22:08:50 +0000 (18:08 -0400)]
document the API

Now I only need to implement it...

17 years agosplit libpolkit into more source/header files
David Zeuthen [Wed, 28 Mar 2007 18:50:02 +0000 (14:50 -0400)]
split libpolkit into more source/header files

17 years agoproposed API
David Zeuthen [Wed, 28 Mar 2007 18:11:56 +0000 (14:11 -0400)]
proposed API

17 years agoupdate to the gtk-doc.make from the HAL project
David Zeuthen [Wed, 28 Mar 2007 18:11:00 +0000 (14:11 -0400)]
update to the gtk-doc.make from the HAL project

17 years agoreset project and remove all existing code
David Zeuthen [Wed, 28 Mar 2007 17:01:37 +0000 (13:01 -0400)]
reset project and remove all existing code

Some of the code, e.g. the daemon, will be brought back in other forms.

17 years agofix make distcheck
Danny Kukawka [Mon, 21 Aug 2006 18:41:21 +0000 (20:41 +0200)]
fix make distcheck

A quick (and dirty) fix to get 'make distcheck' complete running and
to fix polkitd-test

17 years agostop configure if pam/pam-devel is missing
Danny Kukawka [Mon, 21 Aug 2006 18:28:09 +0000 (20:28 +0200)]
stop configure if pam/pam-devel is missing

This little patch fixes configure to stop and print a error message if
pam/pam-devel is missing while run configure for PolicyKit

18 years agoPatch from Danny Kukawka <danny.kukawka@web.de> with some cleanup.s
Danny Kukawka [Sat, 29 Jul 2006 14:42:14 +0000 (10:42 -0400)]
Patch from Danny Kukawka <danny.kukawka@web.de> with some cleanup.s

* pam-polkit-console/pam-polkit-console.c: (pam_sm_open_session),
(pam_sm_close_session): fixed usage of pam_get_item() to respect
strict-aliasing rules

        * polkitd/polkit-manager.c: (polkit_manager_get_caller_info):
added ifdef around currently unused calling_selinux_context

        * tools/polkit-grant-privilege.c: (grant_complete_cb): replaced
libpolkit_free_context() with correct libpolkit_grant_free_context()

18 years agoAdd ChangeLog and *.tar.gz to .gitignore.
David Zeuthen [Sat, 29 Jul 2006 14:39:05 +0000 (10:39 -0400)]
Add ChangeLog and *.tar.gz to .gitignore.

18 years agoRemove ChangeLog file and add rules to Makefile.am to generate one for
David Zeuthen [Fri, 28 Jul 2006 00:52:26 +0000 (20:52 -0400)]
Remove ChangeLog file and add rules to Makefile.am to generate one for
disted tarballs.

18 years ago.cvsignore -> .gitignore
Kay Sievers [Thu, 27 Jul 2006 20:44:44 +0000 (22:44 +0200)]
.cvsignore -> .gitignore

18 years agoFor now, comment out SELinux stuff as it breaks when SELinux is not
David Zeuthen [Wed, 7 Jun 2006 00:26:55 +0000 (00:26 +0000)]
For now, comment out SELinux stuff as it breaks when SELinux is not
    available.

18 years agoPatch from Frederic Peters <fpeters@entrouvert.com>. jhbuild monitors files
David Zeuthen [Tue, 6 Jun 2006 14:48:27 +0000 (14:48 +0000)]
Patch from Frederic Peters <fpeters@entrouvert.com>. jhbuild monitors files
    being installed and prevents them from being written out of its target
    directory. This means HAL now prevents jhautobuild[1] to complete since
    pam-polkit-console hardcodes /lib/security. Attached is a patch with a
    configure option (--with-pam-module-dir) so it is possible to set an
    other directory. [1] http://jhbuild.bxlug.be

18 years agoPatch from Frederic Peters <fpeters@entrouvert.com>.
David Zeuthen [Tue, 6 Jun 2006 11:55:50 +0000 (11:55 +0000)]
Patch from Frederic Peters <fpeters@entrouvert.com>.
    http://jhbuild.bxlug.be/builds/2006-06-06-0000/logs/PolicyKit/#build
    shows a error when building newest PolicyKit with Debian PAM libraries.
Attached patch adds new configure checks; pam-polkit-console.c may need
    alternate behaviour if pam_vsyslog is missing (using straight
    vsyslog?).
configure.in,

18 years agoLots of changes! Almost ready for 0.2 release.
David Zeuthen [Mon, 5 Jun 2006 23:39:00 +0000 (23:39 +0000)]
Lots of changes! Almost ready for 0.2 release.

18 years agoUpdate to new D-BUS API; print " (temporary)" for privilege if appropriate.
David Zeuthen [Sat, 22 Apr 2006 23:27:14 +0000 (23:27 +0000)]
Update to new D-BUS API; print " (temporary)" for privilege if appropriate.
Update to new D-BUS API
Update to new D-BUS API (main): --do--
New file
Add build rules for polkit-revoke-privilege
Fix up prototypes
Update to new D-BUS API
    (polkit_manager_get_allowed_resources_for_privilege): --do--
    (polkit_manager_revoke_temporary_privilege): New function
    (polkit_manager_remove_temporary_privilege): Fix up resource handling
    (polkit_manager_add_temporary_privilege): --do--
Update to new D-BUS API and export libpolkit_revoke_temporary_privilege()
Update to new D-BUS API
    (libpolkit_get_allowed_resources_for_privilege_for_uid): --do--
    (libpolkit_revoke_temporary_privilege): New function
Rename InitiatePrivilegeGrant() to InitiateTemporaryPrivilegeGrant(). Add
    new function RevokeTemporaryPrivilege(). Make IsUserPrivileged() output
    a boolean is_temporary. GetAllowedResourcesForPrivilege() now also
    outputs an integer num_non_temp.

18 years agoWrite some more stuff
David Zeuthen [Sat, 22 Apr 2006 02:24:00 +0000 (02:24 +0000)]
Write some more stuff

18 years agoAdd in the new spec directory so we add the folder to the tarball.
Richard Hughes [Tue, 4 Apr 2006 19:04:20 +0000 (19:04 +0000)]
Add in the new spec directory so we add the folder to the tarball.
Fix this up in one place so it validates and so that make distcheck can run
    again..

18 years agoAdd docbook detection
David Zeuthen [Wed, 29 Mar 2006 16:15:28 +0000 (16:15 +0000)]
Add docbook detection
New files
Free the questions to prevent memory leak

18 years agoinitial commit
David Zeuthen [Wed, 29 Mar 2006 02:18:56 +0000 (02:18 +0000)]
initial commit

18 years agoAdd these files.
Richard Hughes [Mon, 27 Mar 2006 08:37:28 +0000 (08:37 +0000)]
Add these files.

18 years agoremove code that shouldn't be committed
David Zeuthen [Fri, 17 Mar 2006 00:23:00 +0000 (00:23 +0000)]
remove code that shouldn't be committed

18 years agoRemember to kill the child here
David Zeuthen [Fri, 17 Mar 2006 00:21:31 +0000 (00:21 +0000)]
Remember to kill the child here

18 years agoforgot ChangeLog for polkitd/main.c
David Zeuthen [Thu, 16 Mar 2006 23:36:16 +0000 (23:36 +0000)]
forgot ChangeLog for polkitd/main.c

18 years agoUnref when the child dies (polkit_session_initiate_auth): Ref the object
David Zeuthen [Thu, 16 Mar 2006 23:28:47 +0000 (23:28 +0000)]
Unref when the child dies (polkit_session_initiate_auth): Ref the object
    after creating child (polkit_session_initiator_disconnected): Make sure
    to nuke the kids

18 years agoInclude sys/types.h; fixed fd.o bug #6280. Patch from Wouter Bolsterlee
David Zeuthen [Wed, 15 Mar 2006 16:11:33 +0000 (16:11 +0000)]
Include sys/types.h; fixed fd.o bug #6280. Patch from Wouter Bolsterlee
    <uws+freedesktop@xs4all.nl>.

18 years agoChange priorities from 90 10 to 98 02 to make this work
David Zeuthen [Wed, 15 Mar 2006 00:33:35 +0000 (00:33 +0000)]
Change priorities from 90 10 to 98 02 to make this work
Remove user="@POLKIT_USER@" bits as I'm not sure we need a dedicated user
Cosmetic things

18 years agoremove Makefile.in; it's not needed
David Zeuthen [Wed, 15 Mar 2006 00:29:38 +0000 (00:29 +0000)]
remove Makefile.in; it's not needed

18 years agoAdd SUSE distro bits.
Kay Sievers [Wed, 15 Mar 2006 00:19:57 +0000 (00:19 +0000)]
Add SUSE distro bits.

18 years agoforgot two files
David Zeuthen [Tue, 14 Mar 2006 06:20:47 +0000 (06:20 +0000)]
forgot two files

18 years agoAdd a bunch of code; basically a full rewrite moving all queries to the
David Zeuthen [Tue, 14 Mar 2006 06:14:33 +0000 (06:14 +0000)]
Add a bunch of code; basically a full rewrite moving all queries to the
    daemon.

18 years agoUse right Cflags
David Zeuthen [Thu, 9 Mar 2006 17:14:48 +0000 (17:14 +0000)]
Use right Cflags

18 years agos/hal-policy/polkit/
David Zeuthen [Wed, 8 Mar 2006 03:28:58 +0000 (03:28 +0000)]
s/hal-policy/polkit/

18 years agoUse simpler names: user, group and txtsrc :-/
David Zeuthen [Wed, 8 Mar 2006 02:56:14 +0000 (02:56 +0000)]
Use simpler names: user, group and txtsrc :-/

18 years agoAdd libpoluser, libpolgroup and libpoltxtsrc variables
David Zeuthen [Wed, 8 Mar 2006 02:53:45 +0000 (02:53 +0000)]
Add libpoluser, libpolgroup and libpoltxtsrc variables

18 years agos/-llibpolkit/-lpolkit/
David Zeuthen [Wed, 8 Mar 2006 02:45:24 +0000 (02:45 +0000)]
s/-llibpolkit/-lpolkit/

18 years agoInitial import start
David Zeuthen [Wed, 8 Mar 2006 01:52:03 +0000 (01:52 +0000)]
Initial import

18 years agoInitial revision
David Zeuthen [Wed, 8 Mar 2006 01:52:03 +0000 (01:52 +0000)]
Initial revision