summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-08-22Revert "Minor code refactoring"Eric Koegel4-118/+163
This reverts commit bee63889f4a0b8f57807a61d8396346cec8cd5b1. There are some cases where ConsoleKit2 would crash after successfully suspending so revert this commit.
2015-08-09Ensure we add CONSOLE_KIT_LIBS to libckEric Koegel1-4/+6
Otherwise we will break the build on some platforms. Also update the translations.
2015-08-09Minor code refactoringEric Koegel4-163/+118
This removes and cleans up some duplicated code. Both the ck-manager and the ck-session had an implementation to get the calling uid/pid so it's now moved to a common location. The inhibit changed signal has been made more explicit in when the delay is removed. The polkit permissions was duplicated over two functions and has been moved to a single common one. So this patch is just minor house keeping.
2015-08-09Filter out the sddm userEric Koegel1-2/+3
This way CK2 doesn't get confused and think multiple users are logged in when it's just a service account.
2015-08-02Update gettext to avoid a warning messageEric Koegel1-21/+59
Also improve the translation messages in the process groups and mark that file translatable.
2015-07-28Add process grouping/trackingEric Koegel5-19/+379
On Linux, this adds an optional dependency on cgmanager to use cgroups to manage and track processes. This is more reliable and secure than the XDG_SESSION_COOKIE however it will fall back to that. https://github.com/ConsoleKit2/ConsoleKit2/issues/7
2015-07-26Prevent infinite loop when removing inhibitorsEric Koegel1-1/+1
2015-07-19Merge pull request #31 from Somasis/masterEric Koegel2-7/+7
Respect multilib/multiarch filesystem layouts
2015-07-19test-session: Fix wrong variable checkEric Koegel1-4/+3
Found by Coverity scan.
2015-07-19Fix get_caller_info in CkSessionEric Koegel2-2/+6
And make sure we unref the variants that get created.
2015-07-19Add an additional bounds checkEric Koegel1-1/+1
2015-07-14Respect multilib/multiarch filesystem layoutsKylie McClain2-7/+7
Adapted from https://bugs.freedesktop.org/show_bug.cgi?id=24608
2015-07-12Add an --enable-tests configure optionEric Koegel1-0/+8
And document the --enable-debug option better. The enable-tests option defaults to off so that normal release builds don't have to waste time compiling tests that won't be installed or used.
2015-07-06Watch and handle dbus NameOwnerChanged eventsEric Koegel1-72/+48
Properly watch for dbus NameOwnerChanged events so we can handle session bus removal events. This should be the same as before the GDBus port. https://github.com/ConsoleKit2/ConsoleKit2/issues/27
2015-06-21Add new DBUS method: ListInhibitorsEric Koegel9-13/+263
Returns the current list of inhibitors, an array of strings representing the what, who, why, mode, and two unsigned int32 representing the user ID and process ID. This is the same method that logind uses. Needed to have inhibit track the uid/pid of the caller to mirror what logind returns.
2015-06-15Cksession return empty string when login session id not setEric Koegel1-4/+8
This matches how it was handled prior to the GDBus port.
2015-06-14test-manager: clean up test sessionsEric Koegel1-2/+26
2015-06-14idle since hint return NULL when idle hint not setEric Koegel1-0/+5
If the idle hint isn't set then return NULL when requesting the idle since hint, otherwise tools like ck-list-sessions returns a time in 1970.
2015-06-14CkSession fix uid handlingEric Koegel1-4/+3
Use the ConsoleKitSession uid for everything. This got missed on the port to GDBus. Now the correct uid is written to the CKDB. Fixes: https://github.com/ConsoleKit2/ConsoleKit2/issues/26
2015-06-14test-session: Close temporary sessionEric Koegel1-1/+15
2015-06-14throw warning if pid <= 1Eric Koegel1-0/+5
2015-06-13Handle login_session_id == NULLEric Koegel1-1/+5
2015-06-09Fix build warningsEric Koegel1-25/+15
And operations when both polkit and rabc isn't used.
2015-06-08Fix logic of the inhibit changed eventEric Koegel1-2/+2
2015-06-08Fix Coverity CID 95915 Dereference after null checkEric Koegel1-1/+5
2015-06-08Port list-sessions.c to GDBusEric Koegel1-0/+1
The ck-connector only uses libdbus and not dbus-glib and it handles OOM. Going to GDBus wouldn't let us properly handle OOM because glib just aborts when g_malloc hits the OOM. So we'll leave that. This patch removes the dbus-glib dependency as everything has been ported. For: https://github.com/ConsoleKit2/ConsoleKit2/issues/8
2015-06-07Don't delete the inhibit files on startupEric Koegel1-39/+0
There's no gain since they are randomly generated temp files.
2015-06-07Fix inhibit FD passing with GDBusEric Koegel4-42/+73
2015-06-07Return NULL + error when no sessionsEric Koegel1-4/+4
2015-06-07Add "mode" to the inhibit callEric Koegel9-137/+538
Now we support the mode string of the inhibit dbus call. It can either be a "block" or "delay". If no delay lock is done, a system call action will delay 2 seconds to give applications time to save state. Holding a delay lock will increase the timeout to a max of 8 seconds.
2015-05-17Remove the pam-foreground-compat.ckEric Koegel1-33/+0
It was used to provide /var/run/console/<username> to mimic what PAM did for at_console. This script causes race condition issues on OpenBSD and won't be useful when the multi-seat features land.
2015-05-10Call the dbus signals for shutdown/sleepEric Koegel1-17/+21
This calls the correct public dbus signals for prepare to sleep and shutdown.
2015-05-10CkSession: Fix error handling in dbus_activateEric Koegel1-1/+11
Since we set an initial error message in the event g_signal_emit isn't handled for the session activate signal, we need to keep track of that error message. Additionally, that signal call may return a different error message such as the session is already activate on the seat so we need to keep track of both since we'll need to free the memory associated with them.
2015-05-10Return NULL when there's no sessions or seatsEric Koegel4-13/+22
When calling get_sessions/seats return NULL + an error stating that there's nothing to return. This makes the GDBus branch work like the pre-GDBus code.
2015-05-10Revert "Fix NULL checks"Eric Koegel2-4/+4
This reverts commit eefeb4cca69150de1f9f99c48c84eff67f56a4f7.
2015-05-10Revert "Don't set an initial value"Eric Koegel1-1/+5
This reverts commit 45cc0180fae3708ce17d16578041edb54e8c308d.
2015-04-14Don't set an initial valueEric Koegel1-5/+1
Otherwise we end up getting an error over a previous error message.
2015-04-14Change vt error code to CkSeatEric Koegel3-1/+5
And update docs list error causes.
2015-04-14Fix NULL checksEric Koegel2-4/+4
2015-04-14Return error codes when seat fails to activate sessionEric Koegel6-27/+47
This helps out consumers who want to know when the error message is something simple like Session already active.
2015-04-14unix_user should be cast to a uid_tEric Koegel1-1/+1
(int)unix_user should be (uid_t) because it may be (un)signed. POSIX is vague about the datatype http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_12
2015-04-13uid/pid = 0 not NULLEric Koegel2-14/+14
2015-04-13Fix Coverity CID 89287 Uninitialized scalar variableEric Koegel2-14/+14
uid and pid could be used uninitialized, CWE-457
2015-04-13Add missing break statmentEric Koegel1-0/+1
Coverity CID 89285, CWE-484
2015-04-13Fix some cppcheck warningsEric Koegel5-8/+7
2015-04-13CkSession: document what failure codes may be returned.Eric Koegel2-1/+2
2015-04-13CkSeat: document what failure codes may be returned.Eric Koegel1-1/+2
2015-04-13CkSeat: Ensure we return TRUE from dbus callsEric Koegel1-3/+2
Otherwise GDBus doesn't think we handled the call and gets angry.
2015-04-13CkManager: Ensure we return TRUE from dbus callsEric Koegel1-4/+4
Otherwise GDBus doesn't think we handled the call and gets angry.
2015-04-13CkManager: document what failure codes may be returned.Eric Koegel2-7/+32