platform/upstream/polkit.git
16 years agoimplement kit_hash_foreach_remove()
David Zeuthen [Sat, 1 Dec 2007 01:38:01 +0000 (20:38 -0500)]
implement kit_hash_foreach_remove()

16 years agoadd a new KitString class
David Zeuthen [Sat, 1 Dec 2007 00:24:38 +0000 (19:24 -0500)]
add a new KitString class

16 years agoadd some more test cases for p-a-db.c
David Zeuthen [Fri, 30 Nov 2007 21:43:17 +0000 (16:43 -0500)]
add some more test cases for p-a-db.c

16 years agofix OOM handling in p-a-db.c and only invalidate the cache when necessary
David Zeuthen [Fri, 30 Nov 2007 20:40:03 +0000 (15:40 -0500)]
fix OOM handling in p-a-db.c and only invalidate the cache when necessary

16 years agoadd some more test env variables so we can bypass ConsoleKit in the tests
David Zeuthen [Fri, 30 Nov 2007 19:59:20 +0000 (14:59 -0500)]
add some more test env variables so we can bypass ConsoleKit in the tests

16 years agoupdate .gitignore files
David Zeuthen [Thu, 29 Nov 2007 21:01:47 +0000 (16:01 -0500)]
update .gitignore files

16 years agoadd .gitignore files to get test tree structure in the repo
David Zeuthen [Thu, 29 Nov 2007 20:59:59 +0000 (15:59 -0500)]
add .gitignore files to get test tree structure in the repo

16 years agofix unit tests for polkit-authorization-db.c
David Zeuthen [Thu, 29 Nov 2007 20:47:15 +0000 (15:47 -0500)]
fix unit tests for polkit-authorization-db.c

16 years agoadd test-friendly abstractions for getpwnam and getpwuid
David Zeuthen [Thu, 29 Nov 2007 05:07:40 +0000 (00:07 -0500)]
add test-friendly abstractions for getpwnam and getpwuid

16 years agoonly fail the Nth alloc, not all allocs greater than N
David Zeuthen [Thu, 29 Nov 2007 05:06:54 +0000 (00:06 -0500)]
only fail the Nth alloc, not all allocs greater than N

16 years agoavoid logging to syslog even for invalid files
David Zeuthen [Thu, 29 Nov 2007 03:32:52 +0000 (22:32 -0500)]
avoid logging to syslog even for invalid files

16 years agorelicense everything to the MIT/X11 license
David Zeuthen [Wed, 28 Nov 2007 21:50:50 +0000 (16:50 -0500)]
relicense everything to the MIT/X11 license

16 years agoadd (partial) test cases for polkit-authorization-db.c
David Zeuthen [Sun, 25 Nov 2007 21:06:42 +0000 (16:06 -0500)]
add (partial) test cases for polkit-authorization-db.c

16 years agobuild with -rdynamic for maint mode and use this to print a stack trace
David Zeuthen [Sun, 25 Nov 2007 21:06:12 +0000 (16:06 -0500)]
build with -rdynamic for maint mode and use this to print a stack trace

16 years agofix a bug where the childs environment wasn't inherited
David Zeuthen [Sat, 24 Nov 2007 17:36:41 +0000 (12:36 -0500)]
fix a bug where the childs environment wasn't inherited

16 years agoadd test harness for polkit-utils
David Zeuthen [Sat, 24 Nov 2007 16:13:40 +0000 (11:13 -0500)]
add test harness for polkit-utils

16 years agowrite newline since kit_string_entry_create doesn't do that any more
David Zeuthen [Sat, 24 Nov 2007 16:08:51 +0000 (11:08 -0500)]
write newline since kit_string_entry_create doesn't do that any more

16 years agoavoid adding newline at the end of generated entry
David Zeuthen [Fri, 23 Nov 2007 00:15:36 +0000 (19:15 -0500)]
avoid adding newline at the end of generated entry

16 years agoupdate TODO
David Zeuthen [Thu, 22 Nov 2007 04:23:09 +0000 (23:23 -0500)]
update TODO

16 years agoalso encode \n\r\t characters
David Zeuthen [Thu, 22 Nov 2007 02:38:08 +0000 (21:38 -0500)]
also encode \n\r\t characters

16 years agorework the .auths file format to use key/value pairs and make it future-proof
David Zeuthen [Thu, 22 Nov 2007 01:33:35 +0000 (20:33 -0500)]
rework the .auths file format to use key/value pairs and make it future-proof

16 years agoset errno to ENOMEM when forcibly failing an allocation
David Zeuthen [Thu, 22 Nov 2007 01:11:04 +0000 (20:11 -0500)]
set errno to ENOMEM when forcibly failing an allocation

16 years agoadd support for percent encoding/decoding and colon separated kv-lists
David Zeuthen [Wed, 21 Nov 2007 22:08:22 +0000 (17:08 -0500)]
add support for percent encoding/decoding and colon separated kv-lists

16 years agomake dummy backend work
David Zeuthen [Wed, 21 Nov 2007 03:58:27 +0000 (22:58 -0500)]
make dummy backend work

16 years agofix 'make check-coverage'
David Zeuthen [Wed, 21 Nov 2007 03:46:50 +0000 (22:46 -0500)]
fix 'make check-coverage'

16 years agoremove Since gtk-doc tags from the internal libkit library
David Zeuthen [Wed, 21 Nov 2007 02:40:42 +0000 (21:40 -0500)]
remove Since gtk-doc tags from the internal libkit library

16 years agodefine abstract Authentication Agent interface and make polkit-auth(1) use it
David Zeuthen [Tue, 20 Nov 2007 21:38:44 +0000 (16:38 -0500)]
define abstract Authentication Agent interface and make polkit-auth(1) use it

Also provide a convenience function to access it: polkit_auth_obtain().

16 years agomake PolKitAuthorization a bit more future proof by adding get_type()
David Zeuthen [Tue, 20 Nov 2007 06:00:33 +0000 (01:00 -0500)]
make PolKitAuthorization a bit more future proof by adding get_type()

16 years agoprovide a way to force a reload of all caches etc.
David Zeuthen [Tue, 20 Nov 2007 05:25:34 +0000 (00:25 -0500)]
provide a way to force a reload of all caches etc.

16 years agoadd support for negative authorizations
David Zeuthen [Tue, 20 Nov 2007 04:25:30 +0000 (23:25 -0500)]
add support for negative authorizations

Negative authorizations is a way to block an entity; previously the
algorithm was something like (ignoring the config file for now)

  Result is_authorized() {
    res = has_implicit_auth();
    if (res == YES) {
      return YES;
    } else if (has_explicit_auth()) {
      return YES;
    }
    return res;
  }

Now it's

  Result is_authorized() {
    res = has_implicit_auth();
    expl = has_explicit_auth();
    is_blocked = has_negative_explicit_auth();

    if (is_blocked)
      return NO;

    if (res == YES) {
      return YES;
    } else if (has_explicit_auth()) {
      return YES;
    }
    return res;
  }

E.g. just a single negative auth will force NO to be returned. I
really, really need to write into the spec how this works; my mental
L1 cache can't contain it anymore. Once it's formally defined we need
to craft a test suite to verify that the code works according to
spec...

16 years agoexport the policydir in the .pc file
David Zeuthen [Mon, 19 Nov 2007 17:47:18 +0000 (12:47 -0500)]
export the policydir in the .pc file

This is useful when building a project using polkit in a different
prefix. Lennart asked for it.

16 years agorequire org.fd.pk.revoke to revoke auths for self if granted by someone else
David Zeuthen [Mon, 19 Nov 2007 05:27:56 +0000 (00:27 -0500)]
require org.fd.pk.revoke to revoke auths for self if granted by someone else

16 years agoprovide convenience functions for auth checking and port helpers to use them
David Zeuthen [Mon, 19 Nov 2007 00:16:23 +0000 (19:16 -0500)]
provide convenience functions for auth checking and port helpers to use them

Basically, checking auths with polkit is now a one-liner:

    if (polkit_check_auth (getpid (), "com.acme.some-action", NULL) == 0) {
        fprintf (stderr, "Not authorized; go away\n");
        exit (1);
    }

This can be used for making a lot of the legacy UNIX tools PolicyKit
aware. For example, vixie-cron could make crontab(1) (a setuid
program) check whether the calling user is authorized for the action

 org.isc.vixie-cron.edit-own-crontab

This is a nice way to provide least privilege and still put the system
administrator in control via polkit-auth(1), polkit-action(1) and the
GTK+ "Manage Authorizations" utility:

 http://people.redhat.com/davidz/polkitg-auth-1.png
 http://people.redhat.com/davidz/polkitg-auth-2.png
 http://people.redhat.com/davidz/polkitg-auth-3.png

16 years agoadd support for vendor, vendor_url and icon_name tags in .policy files
David Zeuthen [Sun, 18 Nov 2007 02:17:50 +0000 (21:17 -0500)]
add support for vendor, vendor_url and icon_name tags in .policy files

16 years agorestrict new API to the default backend only
David Zeuthen [Sat, 17 Nov 2007 21:47:51 +0000 (16:47 -0500)]
restrict new API to the default backend only

16 years agoadd API for overriding defaults and make polkit-action(1) use this API.
David Zeuthen [Sat, 17 Nov 2007 21:43:25 +0000 (16:43 -0500)]
add API for overriding defaults and make polkit-action(1) use this API.

16 years agofix a grave bug where the wrong authorizations were returned
David Zeuthen [Sat, 17 Nov 2007 16:50:29 +0000 (11:50 -0500)]
fix a grave bug where the wrong authorizations were returned

We were modifying the 'uid' parameter in _authdb_get_auths_for_uid();
I bet that if we had unit tests this bug would have been caught
earlier...

17 years agofix parallel build
David Zeuthen [Mon, 12 Nov 2007 18:43:10 +0000 (13:43 -0500)]
fix parallel build

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

17 years agocreate /var/lib/misc on 'make install'
David Zeuthen [Mon, 12 Nov 2007 18:14:22 +0000 (13:14 -0500)]
create /var/lib/misc on 'make install'

http://bugs.freedesktop.org/show_bug.cgi?id=13113

17 years agobuild system fixes and refuse to install if built with --enable-tests
David Zeuthen [Mon, 12 Nov 2007 18:10:46 +0000 (13:10 -0500)]
build system fixes and refuse to install if built with --enable-tests

17 years agoadd unit test framework to the rest of the library sources
David Zeuthen [Mon, 12 Nov 2007 01:08:02 +0000 (20:08 -0500)]
add unit test framework to the rest of the library sources

17 years agofix build for dummy backend
David Zeuthen [Mon, 12 Nov 2007 00:03:46 +0000 (19:03 -0500)]
fix build for dummy backend

17 years agoalso check for file descriptor leaks
David Zeuthen [Sun, 11 Nov 2007 23:38:14 +0000 (18:38 -0500)]
also check for file descriptor leaks

17 years agotweak how we do coverage reporting
David Zeuthen [Sun, 11 Nov 2007 22:58:00 +0000 (17:58 -0500)]
tweak how we do coverage reporting

17 years agoremove glib dependency from libpolkit.so
David Zeuthen [Sun, 11 Nov 2007 22:09:26 +0000 (17:09 -0500)]
remove glib dependency from libpolkit.so

17 years agodon't overflow when splitting a string
David Zeuthen [Sun, 11 Nov 2007 22:08:38 +0000 (17:08 -0500)]
don't overflow when splitting a string

17 years agoactually include the files with the spawn functions
David Zeuthen [Sun, 11 Nov 2007 21:32:22 +0000 (16:32 -0500)]
actually include the files with the spawn functions

17 years agoadd spawn function to libkit
David Zeuthen [Sun, 11 Nov 2007 21:31:55 +0000 (16:31 -0500)]
add spawn function to libkit

17 years agoadd (empty, for now) tests for remaining files
David Zeuthen [Sun, 11 Nov 2007 16:32:01 +0000 (11:32 -0500)]
add (empty, for now) tests for remaining files

17 years agouse kit_strsplit in polkit-sysdeps
David Zeuthen [Sun, 11 Nov 2007 05:05:41 +0000 (00:05 -0500)]
use kit_strsplit in polkit-sysdeps

17 years agoadd strsplit function
David Zeuthen [Sun, 11 Nov 2007 05:02:41 +0000 (00:02 -0500)]
add strsplit function

17 years agoalso include libkit in top-level coverage report
David Zeuthen [Sat, 10 Nov 2007 23:23:38 +0000 (18:23 -0500)]
also include libkit in top-level coverage report

17 years agosplit utility bits into a private statically linked library
David Zeuthen [Sat, 10 Nov 2007 23:17:38 +0000 (18:17 -0500)]
split utility bits into a private statically linked library

getting closer...

$ grep glib *.c
polkit-authorization.c:#include <glib.h>
polkit-authorization-db.c:#include <glib.h>
polkit-authorization-db-dummy.c:#include <glib.h>
polkit-config.c:#include <glib.h>
polkit-context.c:#include <glib.h>
polkit-sysdeps.c:#include <glib.h>

17 years agoadd unit tests for PolKitAuthorization
David Zeuthen [Fri, 9 Nov 2007 19:15:44 +0000 (14:15 -0500)]
add unit tests for PolKitAuthorization

17 years agoadd unit tests for PolKitAuthorizationConstraint
David Zeuthen [Fri, 9 Nov 2007 17:23:01 +0000 (12:23 -0500)]
add unit tests for PolKitAuthorizationConstraint

17 years agoforgot to add src/Makefile.am
David Zeuthen [Thu, 8 Nov 2007 20:29:02 +0000 (15:29 -0500)]
forgot to add src/Makefile.am

17 years agoadd unit tests of PolKitPolicyCache
David Zeuthen [Thu, 8 Nov 2007 20:26:43 +0000 (15:26 -0500)]
add unit tests of PolKitPolicyCache

17 years agouse unique action names
David Zeuthen [Thu, 8 Nov 2007 19:20:58 +0000 (14:20 -0500)]
use unique action names

17 years agoadd test case for PolKitError to get to 100%
David Zeuthen [Thu, 8 Nov 2007 17:58:10 +0000 (12:58 -0500)]
add test case for PolKitError to get to 100%

17 years agoadd some gtk-doc to private bits to get doc coverage to 100%
David Zeuthen [Thu, 8 Nov 2007 17:43:23 +0000 (12:43 -0500)]
add some gtk-doc to private bits to get doc coverage to 100%

17 years agofix build with all library soruce in src/
David Zeuthen [Thu, 8 Nov 2007 17:37:38 +0000 (12:37 -0500)]
fix build with all library soruce in src/

17 years agomove all library source to a src/ directory
David Zeuthen [Thu, 8 Nov 2007 17:26:31 +0000 (12:26 -0500)]
move all library source to a src/ directory

This is primarily so gtk-doc can target only libraries. Needs lots of
fixing; will be done in upcoming commits.

17 years agoreimplement string hashing and comparison
David Zeuthen [Thu, 8 Nov 2007 17:24:17 +0000 (12:24 -0500)]
reimplement string hashing and comparison

17 years agoadd doubly-linked lists
David Zeuthen [Thu, 8 Nov 2007 00:09:40 +0000 (19:09 -0500)]
add doubly-linked lists

17 years agohook up expat to use our memory handling API
David Zeuthen [Tue, 6 Nov 2007 21:55:08 +0000 (16:55 -0500)]
hook up expat to use our memory handling API

Disable by default because, unfortunately, expat seems to leak on
certain OOM paths. Sigh.

17 years agoalso dist test .policy files
David Zeuthen [Tue, 6 Nov 2007 21:01:07 +0000 (16:01 -0500)]
also dist test .policy files

17 years agoincrease test coverage for PolKitPolicyFile
David Zeuthen [Tue, 6 Nov 2007 20:55:49 +0000 (15:55 -0500)]
increase test coverage for PolKitPolicyFile

17 years agofix some unaligned access bugs
David Zeuthen [Tue, 6 Nov 2007 20:55:02 +0000 (15:55 -0500)]
fix some unaligned access bugs

17 years agoadd unit tests for PolKitPolicyFile and add some features to PolKitHash
David Zeuthen [Tue, 6 Nov 2007 17:03:42 +0000 (12:03 -0500)]
add unit tests for PolKitPolicyFile and add some features to PolKitHash

17 years agoimprove coverage of PolKitPolicyFileEntry by switching to PolKitHashTable
David Zeuthen [Mon, 5 Nov 2007 20:28:33 +0000 (15:28 -0500)]
improve coverage of PolKitPolicyFileEntry by switching to PolKitHashTable

17 years agoimplement polkit_hash_foreach
David Zeuthen [Mon, 5 Nov 2007 19:59:31 +0000 (14:59 -0500)]
implement polkit_hash_foreach

17 years agoexport memory mangement and hash table functions
David Zeuthen [Mon, 5 Nov 2007 18:41:03 +0000 (13:41 -0500)]
export memory mangement and hash table functions

17 years agoimplement our own hash table with 100% test coverage
David Zeuthen [Mon, 5 Nov 2007 18:34:45 +0000 (13:34 -0500)]
implement our own hash table with 100% test coverage

17 years agoadd unit tests for PolKitPolicyFileEntry
David Zeuthen [Sun, 4 Nov 2007 16:05:58 +0000 (11:05 -0500)]
add unit tests for PolKitPolicyFileEntry

We're only at 78@ coverage; need to reimplement GHashTable...

17 years agoadd unit tests for PolKitPolicyDefault
David Zeuthen [Sun, 4 Nov 2007 00:39:23 +0000 (20:39 -0400)]
add unit tests for PolKitPolicyDefault

17 years agoadd unit tests for PolKitCaller
David Zeuthen [Sat, 3 Nov 2007 23:06:22 +0000 (19:06 -0400)]
add unit tests for PolKitCaller

17 years agoadd unit tests for PolKitSession
David Zeuthen [Sat, 3 Nov 2007 22:13:44 +0000 (18:13 -0400)]
add unit tests for PolKitSession

17 years agoadd unit tests for PolKitSeat
David Zeuthen [Sat, 3 Nov 2007 21:50:35 +0000 (17:50 -0400)]
add unit tests for PolKitSeat

17 years agoadd unit tests for PolKitResult
David Zeuthen [Sat, 3 Nov 2007 21:34:33 +0000 (17:34 -0400)]
add unit tests for PolKitResult

17 years agoimplement OOM testing
David Zeuthen [Sat, 3 Nov 2007 21:21:53 +0000 (17:21 -0400)]
implement OOM testing

The glib dep removal. It has begun.

17 years agoadd tests for PolKitError
David Zeuthen [Sat, 3 Nov 2007 19:53:41 +0000 (15:53 -0400)]
add tests for PolKitError

17 years agoremove dead code
David Zeuthen [Sat, 3 Nov 2007 19:24:36 +0000 (15:24 -0400)]
remove dead code

17 years agoextend test coverage for PolKitAction
David Zeuthen [Sat, 3 Nov 2007 19:21:10 +0000 (15:21 -0400)]
extend test coverage for PolKitAction

It's now at 100%. Yay me.

17 years agoadd unit test framework with gcov coverage support (make check-coverage)
David Zeuthen [Sat, 3 Nov 2007 18:40:13 +0000 (14:40 -0400)]
add unit test framework with gcov coverage support (make check-coverage)

This is what it looks like

==============================================================================
Test coverage for module polkit:
==============================================================================
polkit-sysdeps.c                                        :   0% (0 of 38)
polkit-error.c                                          :   0% (0 of 44)
polkit-result.c                                         :   0% (0 of 16)
polkit-context.c                                        :   0% (0 of 213)
polkit-action.c                                         :  34% (20 of 58)
polkit-seat.c                                           :   0% (0 of 34)
polkit-session.c                                        :   0% (0 of 97)
polkit-caller.c                                         :   0% (0 of 81)
polkit-policy-file-entry.c                              :   0% (0 of 72)
polkit-policy-file.c                                    :   0% (0 of 220)
polkit-policy-cache.c                                   :   0% (0 of 98)
polkit-policy-default.c                                 :   0% (0 of 67)
polkit-debug.c                                          :   0% (0 of 15)
polkit-utils.c                                          :   0% (0 of 42)
polkit-config.c                                         :   0% (0 of 263)
polkit-authorization.c                                  :   0% (0 of 162)
polkit-authorization-constraint.c                       :   0% (0 of 107)
polkit-authorization-db.c                               :   0% (0 of 222)

Source lines          : 6919
Actual statements     : 1849
Executed statements   : 20
Test coverage         : 1%

17 years agoupdated TODO list
David Zeuthen [Thu, 1 Nov 2007 05:21:47 +0000 (01:21 -0400)]
updated TODO list

17 years agointroduce one-shot authorizations
David Zeuthen [Thu, 1 Nov 2007 03:23:33 +0000 (23:23 -0400)]
introduce one-shot authorizations

17 years agomake polkit_context_is_[caller|session]_authorized() take a PolKitError
David Zeuthen [Wed, 31 Oct 2007 18:41:00 +0000 (14:41 -0400)]
make polkit_context_is_[caller|session]_authorized() take a PolKitError

17 years agorename revoke_if_oneshot to is_mechanism and also expose this on D-Bus
David Zeuthen [Wed, 31 Oct 2007 17:19:24 +0000 (13:19 -0400)]
rename revoke_if_oneshot to is_mechanism and also expose this on D-Bus

17 years agoavoid defining the same functions in both libpolkit and libpolkit-grant
David Zeuthen [Wed, 31 Oct 2007 16:48:57 +0000 (12:48 -0400)]
avoid defining the same functions in both libpolkit and libpolkit-grant

Looks like I forgot to delete those when doing the big move in
commit d9d790870b0372162091b00e19e38a24472a306d

17 years agoremember to reset killtimer and fix an error message
David Zeuthen [Wed, 31 Oct 2007 01:27:06 +0000 (21:27 -0400)]
remember to reset killtimer and fix an error message

17 years agoprovide a polkit D-Bus service that is activated on demand
David Zeuthen [Wed, 31 Oct 2007 01:17:08 +0000 (21:17 -0400)]
provide a polkit D-Bus service that is activated on demand

Right now we provide two methods

 IsProcessAuthorized
 IsSystemBusNameAuthorized

This is useful for a couple of reasons

 - some mechanisms (e.g. Avahi) runs in a chroot and their only
   life-line to the world is a system bus connection. If it were to
   use libpolkit (and Lennart says he wants it to, yay!) it would need
   to bindmount crazy stuff into the chroot.

 - languages for which libpolkit bindings not yet exist can use
   this interface

Going forward, this service can expose a private interface meaning we
can get rid of (almost) all of our setgid helpers.

17 years agomove authdb write functions to libpolkit-grant
David Zeuthen [Tue, 30 Oct 2007 22:21:04 +0000 (18:21 -0400)]
move authdb write functions to libpolkit-grant

This is primarily to keep libpolkit as minimal as possible as all that
mechanisms will ever need is the ability to read from the authdb.

17 years agorearrange the docs so all API is in one section
David Zeuthen [Tue, 30 Oct 2007 21:46:41 +0000 (17:46 -0400)]
rearrange the docs so all API is in one section

Also specificy, per function and class, if it's not in libpolkit.

17 years agouse _destroy, not _unref for hash tables
David Zeuthen [Mon, 29 Oct 2007 19:30:36 +0000 (15:30 -0400)]
use _destroy, not _unref for hash tables

The latter is only in glib 2.10.

Pointed out by Danny Kukawka <danny.kukawka@web.de>.

17 years agofix uid retrival when getting auths from all users
David Zeuthen [Mon, 29 Oct 2007 05:36:58 +0000 (01:36 -0400)]
fix uid retrival when getting auths from all users

17 years agofix docs
David Zeuthen [Mon, 29 Oct 2007 04:23:45 +0000 (00:23 -0400)]
fix docs

17 years agofix build with dummy backend
David Zeuthen [Mon, 29 Oct 2007 03:46:54 +0000 (23:46 -0400)]
fix build with dummy backend

17 years agolet authdb backends synthesize policy file entries
David Zeuthen [Mon, 29 Oct 2007 03:43:03 +0000 (23:43 -0400)]
let authdb backends synthesize policy file entries

17 years agominor build system and doc fixes
David Zeuthen [Mon, 29 Oct 2007 03:32:11 +0000 (23:32 -0400)]
minor build system and doc fixes

17 years agomove Linux specific code into a single file
David Zeuthen [Mon, 29 Oct 2007 03:13:16 +0000 (23:13 -0400)]
move Linux specific code into a single file

Haven't moved the inotify stuff yet; not sure about what abstraction
we need...