summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2014-10-19Inhibit Manager now emits event changed signalsEric Koegel5-16/+114
When the inhibit lock increments to 1 it will be TRUE and when it reaches 0 it will be FALSE. Additional locks above 1 will not emit a signal but the manager will keep track.
2014-10-18Fill in the inhibit manager someEric Koegel7-48/+290
And add additional tests for it as we go
2014-10-17Emit signals on inhibit changesEric Koegel6-2/+366
Also start working on the inhibit manager.
2014-10-15Use g_io_add_watch for the named pipeEric Koegel2-5/+10
2014-10-14Update documentationEric Koegel3-5/+5
2014-10-14Add the suspend/hibernate scriptsEric Koegel2-0/+164
Also add the test-inhibit.c file to the repo, oops.
2014-10-14Parse the what portion for inhibitEric Koegel2-16/+176
2014-10-14Add some tests for inhibit locksEric Koegel3-6/+113
2014-10-14More inhibit workEric Koegel3-26/+102
2014-10-13Start working on the inhibit filesEric Koegel3-1/+248
Might need an inhibit manager at some point in the future to track all these locks and prevent duplicates. We'll see how complex it needs to be.
2014-10-13OpenBSD: VT are only available on i386 and amd64ajacoutot1-6/+2
Patch pulled from: http://anoncvs.estpak.ee/cgi-bin/cgit/openbsd-ports/tree/sysutils/consolekit/patches/patch-src_ck-vt-monitor_c
2014-10-13Fix gcc warningEric Koegel1-12/+12
warning: use of assignment suppression and length modifier together in gnu_scanf format. Additionally added comments next to each of the sscanf variables because there's a lot of them to keep track of.
2014-10-13More Suspend DBUS API workEric Koegel9-5/+320
We need a Can/Auth split for suspend/hibernate because the user may be authorized but the system is unable to perform those actions. Additionally start working the inhibit calls. We also need to actually add the suspend/hibernate tools.
2014-10-12Mark more user strings for i18nEric Koegel1-1/+1
2014-10-12Add i18n supportEric Koegel2-0/+11
Sets up ConsoleKit2 for translations via GNU gettext. There might still be a couple strings that need to be marked for translation, but this sets up the project to use gettext. Fixes bug: https://bugs.freedesktop.org/show_bug.cgi?id=23482
2014-10-10Only close fds that were openedEric Koegel1-1/+5
Don't try to close a fd that failed to be opened. Also use g_close to match up with the g_open.
2014-10-10fix resource leakEric Koegel1-1/+1
When open returns 0 (which is valid), there's a resource leak. Changing the comparison to include 0 fixes this leak.
2014-10-09Start adding the Suspend/Hibernate DBUS APIEric Koegel4-0/+258
The initial work in progress to add in suspend/hibernate and the inhibit locks.
2014-10-08Prevent possible use-after-free conditionAnders Kaseorg1-1/+2
This patch fixes a potential use-after-free crash, because the JobData created by ck_session_leader_collect_parameters isn’t holding a reference to its leader. At a minimum this presentation makes the object lifetime clearer. Reported in: https://bugs.freedesktop.org/show_bug.cgi?id=26227#c15
2014-10-08Fix crash on logout/login via SunRayHalton Huo1-1/+3
Turns out this bug is introduced by commit b4f893eb294883909759fc9fd825eade1a9f308c, which is later than when themulti-seat branch was created. This happens when user logout, c-k-d tries to activate the reserved Login window session, and send out the two signals in change_active_session(). The old_session is the session that user just log out, which should be removed after logout. There is race condition here, if the old_session get unrefed to 0 before the g_signal_emit call, then a core dump happens. Reported in: https://bugs.freedesktop.org/show_bug.cgi?id=28598
2014-10-07Size of pointer 'P' used instead of size of its data.Eric Koegel2-7/+7
CppCheck marks this as a warning that P might be used in sizeof instead of P->tty_text so we'll use sizeof (P->tty_text) to make it explicit.
2014-10-07Call thread_data_free before g_thread_exitEric Koegel1-1/+1
2014-10-06OpenBSD: Fix buildajacoutot1-38/+79
Pulls in fixes from: http://anoncvs.estpak.ee/cgi-bin/cgit/openbsd-ports/tree/sysutils/consolekit/patches/patch-src_ck-sysdeps-openbsd_c
2014-10-06Linux: Use /sys/class/tty/tty0/active for VT change notificationsEric Koegel3-4/+179
This prevents Linux from spawning 63 threads. Now there's one monitor thread that watches for the active VT to change. Based on the VT_WAITEVENT patch by Kan-Ru Chen. Fixes: https://github.com/ConsoleKit2/ConsoleKit2/issues/1 https://bugs.freedesktop.org/show_bug.cgi?id=17720 https://bugs.launchpad.net/ubuntu/+source/consolekit/+bug/148454
2014-10-05Set source id to 0 after calling g_source_removeEric Koegel4-0/+5
Avoids some GLIB-Critical runtime messages by properly resetting the source id variables after removing the source. Patch provided by Manfred Hampl.
2014-10-05Undefine _FORTIFY_SOURCE before redefining itEric Koegel1-0/+1
Otherwise GCC nags us with warnings.
2014-10-05unused label 'again'Eric Koegel1-1/+4
When building outside of linux, again isn't referenced so toss it in an ifdef to suppress the warning.
2014-10-05Do not use deprecated glib function g_atexitEric Koegel1-1/+1
atexit is part of stdlib.h.
2014-10-05Add an --enable-debug=full optionEric Koegel2-5/+20
When --enable-debug=full is passed, debugging is always enabled. This patch also moves the debug check below the option parsing so it properly takes effect. Additionally, a couple more debug messages have been added and some quotation marks were removed from the configure.ac script.
2014-10-05Fix some unused variable warningsEric Koegel1-6/+5
2014-10-04Add OpenBSD supportRobert Nagy4-3/+460
Patches taken from: https://github.com/avsm/openbsd-ports/tree/master/sysutils/consolekit/patches
2014-10-04Update makefiles and remove unused codeEric Koegel2-13/+3
2014-10-04Improve FreeBSD supportEric Koegel3-27/+77
Include the patches listed in: http://svnweb.freebsd.org/ports/head/sysutils/consolekit/files/ Credit goes to the FreeBSD team for this work.
2014-10-03Improve DragonFlyBSD supportEric Koegel2-2/+77
Patches taken from https://github.com/DragonFlyBSD/DPorts/tree/master/sysutils/consolekit
2014-10-01Remove unused variableEric Koegel1-1/+0
2014-10-01Be able to shutdown or reboot even without polkit or RBAC supportsRomain Perier1-0/+2
Ck does NOTHING at the origin if its built without polkit or RBAC supports, except display a warning using g_warning() (which does not make sense). The trick is to to call do_stop()/do_restart() in the #else directive :)
2014-10-01Add support for devices with long namesAleix Conchillo Flaqué1-1/+1
See http://launchpad.net/bugs/1130923
2014-10-01Cleanup console tag files on application startup and shutdown.Eric Koegel1-1/+41
2014-09-30kfreebsd - ignore empty environmentsEric Koegel1-0/+2
The freebsd specific code does not handle empty string in environment correctly. Fix submitted by Petr Salinger.
2014-09-30Clean up some compiler warnings and deprecated functionsEric Koegel12-30/+52
Signed-off-by: Eric Koegel <eric.koegel@gmail.com>
2014-09-30Enables the FreeBSD VT ioctls on GNU/kFreeBSD (Bug 73258)Eric Koegel1-2/+2
Patch written by Robert Millan. Signed-off-by: Eric Koegel <eric.koegel@gmail.com>
2014-09-30Fallback to getpeereid() on FreeBSD and GNU/kFreeBSD (Bug 73257)Eric Koegel1-0/+9
Patch written by Robert Millan. Signed-off-by: Eric Koegel <eric.koegel@gmail.com>
2012-03-19Add support for GNU/HurdPino Toscano2-0/+409
Currently consolekit fails to build on GNU/Hurd mainly because there's no sysdeps backend for the GNU OS implemented. The attached patch proposes a sysdeps-gnu backend, which implements the process management using Hurd's libps, the *ttyent API for the part of the console implementation and the rest using similar (valid) approaches of other backends. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=552393 https://bugs.freedesktop.org/show_bug.cgi?id=24738
2011-05-03Retry opening console device on EIOColin Watson1-0/+17
As reported in https://launchpad.net/bugs/544139, ConsoleKit sometimes fails to track the active VT. This particular case was tracked down to a race condition that happens if you try to open /dev/console while the current TTY is currently being closed. This yields an -EIO error, in which case CK should just try again. For a more detailled summary of the problem from a kernel perspective, please see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/554172/comments/245 . https://bugs.freedesktop.org/show_bug.cgi?id=31790
2010-11-17Revert "linux: Use VT_WAITEVENT if available to avoid spawn too many threads"Lennart Poettering3-86/+8
This reverts commit 2782cc8d4950effbc4407455e72bd4750cef6e11. VT_WAITEVENT is racy unfortunately, since events that happen between the time we woke up from a VT_WAITEVENT and we go into the next VT_WAITEVENT are lost completely.
2010-11-17Revert "linux: Check for VT_WAITEVENT ioctl during runtime"Lennart Poettering1-49/+9
This reverts commit 24dc214f55e7c7c17d888d0ccf94cd3625767462. VT_WAITEVENT is racy unfortunately, since events that happen between the time we woke up from a VT_WAITEVENT and we go into the next VT_WAITEVENT are lost completely.
2010-09-20dbus: bump dependency on dbus-glib to 0.82Michael Biebl6-6/+0
dbus-glib >= 0.82 requires dbus >= 1.1 so we can safely remove DBUS_API_SUBJECT_TO_CHANGE.
2010-09-20linux: Check for VT_WAITEVENT ioctl during runtimeMichael Biebl1-9/+49
Since 2782cc8d4950effbc4407455e72bd4750cef6e11 ConsoleKit fails, if it has been compiled on a linux kernel >= 2.6.32 but is run with an older kernel. Check for VT_WAITEVENT ioctl during runtime and fallback to the old behaviour of creating a thread for every possible vt.
2010-09-06linux: Use VT_WAITEVENT if available to avoid spawn too many threadsKan-Ru Chen3-8/+86
Starting from linux kernel 2.6.32 there is a new ioctl VT_WAITEVENT which can monitor vt switches and return new vt number. https://bugs.freedesktop.org/show_bug.cgi?id=17720
2010-08-03Only load seat files with a .seat extensionWilliam Jon McCann2-4/+8