summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2010-07-30Nuke eggdbus usageDavid Zeuthen15-839/+311
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-29Port PolkitAgent to gdbusDavid Zeuthen3-192/+407
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-29Port PolkitBackendInteractiveAuthority to gdbusDavid Zeuthen3-93/+114
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-28Port CK class to gdbusDavid Zeuthen5-659/+228
Also simplify the code it by using the on-disk database. Makes everything a lot simpler. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-28Port core bits to gdbusDavid Zeuthen12-1201/+1570
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-15Bug 29051 – Configuration reload on every queryPetr Mrázek2-0/+3
Set has_data to true after the data is loaded to prevent excessive reloading of config files. Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-02Add shadow supportAndrew Psaltis6-82/+371
Added support for the shadow authentication framework instead of PAM. Enable it by passing --with-authfw=shadow to configure. This is done by splitting the polkitagenthelper source into separate parts, one that does auth with PAM, and another that does auth with shadow, sharing functions where appropriate. Also, all PAM-dependendent code in all other files has been #ifdef'd. The only affected file is src/programs/pkexec.c Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-03-10Bug 26982 – pkexec information disclosure vulnerabilityDan Rosenberg1-3/+2
pkexec is vulnerable to a minor information disclosure vulnerability that allows an attacker to verify whether or not arbitrary files exist, violating directory permissions. I reproduced the issue on my Karmic installation as follows: $ mkdir secret $ sudo chown root:root secret $ sudo chmod 400 secret $ sudo touch secret/hidden $ pkexec /home/drosenbe/secret/hidden (password prompt) $ pkexec /home/drosenbe/secret/doesnotexist Error getting information about /home/drosenbe/secret/doesnotexist: No such file or directory I've attached my patch for the issue. I replaced the stat() call entirely with access() using F_OK, so rather than check that the target exists, pkexec now checks if the user has permission to verify the existence of the program. There might be another way of doing this, such as chdir()'ing to the parent directory of the target and calling lstat(), but this seemed like more code than necessary to prevent such a minor problem. I see no reason to allow pkexec to execute targets that are not accessible to the executing user because of directory permissions. This is such a limited use case anyway that this doesn't really affect functionality. http://bugs.freedesktop.org/show_bug.cgi?id=26982 Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-01-15Don't log authorization checksDavid Zeuthen1-3/+4
It's a little too verbose to do this. See http://lists.freedesktop.org/archives/polkit-devel/2009-December/000283.html for the rationale.
2009-12-15Complain on stderr, not stdoutDavid Zeuthen1-3/+3
2009-12-15Save original cwd in pkexec(1) since it will change during the life-timeDavid Zeuthen1-5/+17
Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-15Make pkexec(1) use the syslogging facilitiesDavid Zeuthen1-29/+90
Dec 15 13:48:05 localhost pkexec[29065]: davidz: Executing command [USER=root] [TTY=/dev/pts/8] [CWD=/root] [COMMAND=/usr/bin/pk-example-frobnicate] Dec 15 13:49:30 localhost pkexec[29080]: davidz: The value for the SHELL variable was not found the /etc/shells file [USER=root] [TTY=/dev/pts/5] [CWD=/home/davidz] [COMMAND=/bin/bash] Dec 15 13:49:45 localhost pkexec[29082]: davidz: The value for environment variable LC_ALL contains suscipious content [USER=root] [TTY=/dev/pts/5] [CWD=/home/davidz] [COMMAND=/bin/bash] Dec 15 13:50:03 localhost pkexec[29086]: davidz: Error executing command as another user: Not authorized [USER=root] [TTY=/dev/pts/5] [CWD=/home/davidz] [COMMAND=/bin/bash] Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-15Make pkexec(1) validate environment variablesDavid Zeuthen1-2/+111
Suggested here http://lists.freedesktop.org/archives/polkit-devel/2009-December/000279.html Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-15Fix error message when no authentication agent is availableDavid Zeuthen1-1/+1
Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-15Properly handle return value from getpwnam_r()David Zeuthen1-3/+12
Pointed out by Kay Sievers - thanks! Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-15Remove trailing whitespace from log messagesDavid Zeuthen1-3/+3
Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-11Bug 25594 – System loggingDavid Zeuthen3-18/+314
For now we log the following events 1. Daemon startup -> /var/log/messages -------------------------------------- Dec 11 15:12:56 localhost polkitd[3035]: started daemon version 0.95 using authority implementation `local' version `0.95' 2. Authentication agent -> /var/log/secure ------------------------------------------ Dec 11 15:14:00 localhost polkitd(authority=local): Registered Authentication Agent for session /org/freedesktop/ConsoleKit/Session1 (system bus name :1.903 [./polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) Dec 11 15:16:18 localhost polkitd(authority=local): Unregistered Authentication Agent for session /org/freedesktop/ConsoleKit/Session1 (system bus name :1.903, object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus) 3. Authorization checks ----------------------- Dec 11 15:17:57 localhost polkitd(authority=local): ALLOWING action org.freedesktop.policykit.example.pkexec.run-frobnicate for unix-process:2517:25785526 [bash] owned by unix-user:davidz (check requested by system-bus-name::1.905 [pkexec /usr/bin/pk-example-frobnicate]) Dec 11 15:18:10 localhost polkitd(authority=local): ALLOWING action org.freedesktop.udisks.filesystem-mount-system-internal for system-bus-name::1.902 [palimpsest] owned by unix-user:davidz (check requested by system-bus-name::1.380 [/usr/libexec/udisks-daemon]) 4. Authorizations through authentication (both success and failures) -> /var/log/secure ---------------------------------------------------------- Dec 11 15:19:01 localhost polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 successfully authenticated as unix-user:davidz to gain TEMPORARY authorization for action org.freedesktop.policykit.example.pkexec.run-frobnicate for unix-process:2517:25785526 [bash] (owned by unix-user:davidz) Dec 11 15:19:01 localhost polkitd(authority=local): ALLOWING action org.freedesktop.policykit.example.pkexec.run-frobnicate for unix-process:2517:25785526 [bash] owned by unix-user:davidz (check requested by system-bus-name::1.906 [pkexec /usr/bin/pk-example-frobnicate]) Dec 11 15:19:10 localhost polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 successfully authenticated as unix-user:davidz to gain ONE-SHOT authorization for action org.freedesktop.policykit.exec for unix-process:2517:25785526 [bash] (owned by unix-user:davidz) Dec 11 15:19:10 localhost polkitd(authority=local): ALLOWING action org.freedesktop.policykit.exec for unix-process:2517:25785526 [bash] owned by unix-user:davidz (check requested by system-bus-name::1.908 [pkexec bash]) Dec 11 15:19:10 localhost pkexec: pam_unix(polkit-1:session): session opened for user root by davidz(uid=500) Dec 11 15:19:22 localhost polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 FAILED to authenticate to gain authorization for action org.freedesktop.policykit.exec for unix-process:2517:25785526 [bash] (owned by unix-user:davidz) Dec 11 15:19:22 localhost polkitd(authority=local): DENYING action org.freedesktop.policykit.exec for unix-process:2517:25785526 [bash] owned by unix-user:davidz (check requested by system-bus-name::1.910 [pkexec bash]) Dec 11 15:20:06 localhost polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 successfully authenticated as unix-user:bateman to gain ONE-SHOT authorization for action org.freedesktop.policykit.exec for unix-process:2517:25785526 [bash] (owned by unix-user:davidz) Dec 11 15:20:06 localhost polkitd(authority=local): ALLOWING action org.freedesktop.policykit.exec for unix-process:2517:25785526 [bash] owned by unix-user:davidz (check requested by system-bus-name::1.913 [pkexec bash]) Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-11Fix up last commentDavid Zeuthen1-1/+1
Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-11Run the open_session part of the PAM stack in pkexec(1)David Zeuthen2-1/+89
This was pointed out in http://lists.freedesktop.org/archives/polkit-devel/2009-December/000276.html We already run the authentication and acct_mgmt parts in the authentication agent. Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-11Fix logic error in pk-example-frobnicateDavid Zeuthen1-2/+2
Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-10Bug 25367 — Also read local authority configuration data from /etcDavid Zeuthen3-25/+224
Turns out some people would rather edit local files in /etc rather than shipping them in a package (as e.g. Fedora does with the polkit-desktop-policy RPM). This also drops the hard-coded list of directory names such as 10-vendor.d, 20-org.d - we now monitor the /var/lib/polkit-1/localauthority and /etc/polkit-1/localauthority directories for changes - whenever we see a subdirectory in any of these directories, we create an AuthorizationStore object that looks for .pkla files. Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-13Add Python exampleDavid Zeuthen1-0/+41
2009-11-13Properly validate all arguments passed via D-BusDavid Zeuthen3-21/+92
2009-11-11Port lockdown from pklalockdown(1) to D-Bus methodsDavid Zeuthen7-269/+522
Also rename the action from org.freedesktop.policykit.localauthority.lockdown to org.freedesktop.policykit.lockdown since any authority implementation can now implement this. This changes only ABI/API used by e.g. polkit-gnome. This is fine since we're not at 1.0 yet.
2009-11-11Add methods AddLockdownForAction() and RemoveLockdownForAction()David Zeuthen4-2/+553
Now to implement this in the interactive authority...
2009-10-21Bug 24176 – Current git master fails to build, GLIB_LDADD -> GLIB_LIBSMichael Biebl2-5/+5
Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-10-21Bug 24235 – polkit-agent-helper may call pam_end with a stale pam handleAndreas Sandberg1-0/+1
polkit-agent-helper calls pam_end on pam_h without setting pam_h to NULL. This causes the error handler to call pam_end on the stale handler if the send_dbus_message procedure fails, which in turn generates a SIGSEGV. Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-10-16Bug 24566 – Properly _ref authority in singleton constructorAlexander Sack1-1/+3
http://bugs.freedesktop.org/show_bug.cgi?id=24566 Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-10-15Bug 24495 – Fails to build on platforms without PATH_MAX (like hurd)Samuel Thibault1-0/+13
PATH_MAX, which hurd-i386 doesn't define since it doesn't have such arbitrary limitation. The attached patch fixes it by just using glibc's get_current_dir_name() extension when available. Signed-off-by: Michael Biebl <mbiebl@gmail.com> Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-09-29Clarify when AllowUserInteraction should and shouldn't be usedDavid Zeuthen1-0/+10
See https://bugzilla.redhat.com/show_bug.cgi?id=526053 for more details.
2009-09-16Add properties with information about the currently used authorityDavid Zeuthen12-5/+397
Also bump requirement on EggDBus to 0.6 (to be released later) for a bug-fix with flag properties.
2009-09-14Fix process start time when using polkit_unix_process_new_full()Bastien Nocera1-2/+5
When using polkit_unix_process_new_full() the start-time wasn't being set from the process' PID if it wasn't passed to the function. Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-09-14Clarify comment on where to find process start-time on LinuxDavid Zeuthen1-2/+2
Also handle 64-bit jiffies (rather than 63-bit) for maximum correctness.
2009-09-13Pass --libtool to g-ir-scannerDavid Zeuthen1-0/+1
Without this, builds with --enable-introspection fails in the Fedora buildsystem.
2009-09-13Add missing comma so we're save both LANG and LANGUAGE, not only LANGLANGUAGEDavid Zeuthen1-1/+1
2009-09-13Don't include Polkit-1.0.gir in the dist tarballMichael Biebl1-1/+1
Polkit-1.0.gir is a generated file and only built with --enable-instrospection. So remove it from EXTRA_DIST, otherwise "make dist" fails with --disable-introspection. Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-09-13Make examples optionalMichael Biebl1-1/+5
Add --enable-examples configure switch which allows to disable the compilation and installation of the examples. Default is off.
2009-09-13Make private symbols accessible to libpolkitagent and libpolkitbackendMichael Biebl3-1/+18
libpolkit{agent,backend} use private symbols from libpolkit-gobject. As we no longer export them, the build fails. Move those symbols into a separate noinst lib libpolkit-private, which those three libs can link against. Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-09-13Use _polkit_agent_marshal prefixMichael Biebl2-3/+3
Use _polkit_agent_marshal prefix with glib-genmarshal to hide the (autogenerated) symbols. Update the code accordingly. Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-09-13Trim the list of exported symbolsMichael Biebl3-0/+6
Add -export-symbols-regex '(^polkit_.*) to LDFLAGS for libpolkit* Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-09-12Implement lockdown for the Local Authority implementationDavid Zeuthen9-13/+367
2009-09-11Bug 23867 – UnixProcess vs. SystemBusName aliasingDavid Zeuthen3-7/+104
For now, convert SystemBusName to UnixProcess when storing/checking temporary authorizations. See http://git.gnome.org/cgit/PolicyKit-gnome/commit/?id=ad5fe38a1f7a7a670c3d8e9384b9cd0d037c9222 for a test-case for this.
2009-09-11Sort by action id in pkaction(1) outputDavid Zeuthen1-0/+11
2009-08-19Use correct program name when complaining about not being setuid rootDavid Zeuthen1-1/+1
2009-08-12Generate GI gir and typelibs for libpolkit-gobject-1David Zeuthen19-143/+282
This includes changing from POSIX types (uid_t, gid_t, pid_t) to gint. Won't affect much since the size is the same. And we want this anyway since it is needed to build the library on non-POSIX platforms.
2009-08-12Remove temporary authorization when the subject it applies to vanishesDavid Zeuthen2-3/+184
This makes it easier to write the desktop component showing a notification icon - said component now only needs to watch ::changed and reenumerate temporary authorizations. If this is done, then the notification icon is updated in near-realtime. Also emit ::changed on ConsoleKit changes. This helps remind Mechanisms that they should redo an authorization check (if this is how the Mechanism decides to cache authorizations).
2009-08-12Don't set the GError if the process doesn't existDavid Zeuthen1-6/+1
2009-08-12Pass the right struct offset for the ::changed class signal handlerDavid Zeuthen1-1/+1
2009-08-12Bug 23093 – FreeBSD portability fixesJoe Marcus Clarke9-31/+149
There are a few issues with building polkit-0.93 on FreeBSD: * No clearenv() function on FreeBSD * While FreeBSD has a /proc, it is deprecated, and kinfo_proc should be used instead. * FreeBSD's printf() functions do not support the %m notation. This is only supported for syslog(). * You can't call GINT_TO_POINTER() on a 64-bit value, as this will break on 64-bit OSes. The attached patch fixes these problems. First, a check for clearenv() is added to configure. Second, I moved the check for process uid to polkit/polkitunixprocess.c. This may not be ideal, but it seems to fit, and reduces code duplication. Third, I replaces all %m with %s ... g_strerror (errno). Finally, I replaced GINT_TO_POINTER() with GSIZE_TO_POINTER. Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-08-10Be more careful when determining process start timeDavid Zeuthen1-2/+5