summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-10-19Updates prior to release0.9.0Eric Koegel3-3/+32
2014-10-19Delete any lingering inhibit pipes on startupEric Koegel1-0/+38
If ConsoleKit crashes (post the backtrace as a bug please!) or if the computer crashes (don't report this :) then there may be stale inhibit pipe files in the directory. Clean those up on startup (and shutdown just to be extra safe).
2014-10-19Install 90-consolekit script to xinitrc dirEric Koegel1-0/+5
This installs an Xsession.d script for ck-launch-session. By default the script is installed to /etc/X11/xinit/xinitrc.d but can be changed by a --with-xinitrc-dir configure switch.
2014-10-19Fix make distcheck when installing log fileEric Koegel3-4/+20
2014-10-19Add --with-logrotate-dir configure optionEric Koegel2-1/+18
We now install the logrotate file and default to /etc/logrotate.d as the default to install to.
2014-10-19Add additional files to data folderEric Koegel3-0/+42
Add the logrotate and Xsession.d script for ck-launch-session to the data folder so it's easier for distros to include it. These files were pulled from the Debian ConsoleKit package: http://ftp.de.debian.org/debian/pool/main/c/consolekit/consolekit_0.4.6-5.debian.tar.xz
2014-10-19Update .pot fileEric Koegel2-21/+21
And fix minor issue with configure.ac from the last merge.
2014-10-19Merge branch 'dbus-api-additions'Eric Koegel33-29/+2207
Implement the Suspend/Hibernate DBUS APIs for: https://github.com/ConsoleKit2/ConsoleKit2/issues/3 Conflicts: configure.ac
2014-10-19g_assert_false is too newEric Koegel1-11/+11
2014-10-19g_return_val_if_fail can't be used in void functionEric Koegel1-1/+1
2014-10-19Make the inhibit locks inhibit the actionsEric Koegel2-73/+44
Also refactors some of the logging code to remove duplications. Not sure if the can or auth checks should return FALSE if there's an inhibit lock on the action... but that can be easily added in the future.
2014-10-19Fix hibernate on FreeBSDEric Koegel2-3/+3
And g_assert_nonnull requires glib 2.40 so we'll do without it.
2014-10-19Hook up the inhibit managerEric Koegel1-1/+27
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-14Allow the dbus callsEric Koegel1-0/+21
2014-10-14Update documentationEric Koegel3-5/+5
2014-10-14Add the suspend/hibernate scriptsEric Koegel14-0/+252
Also add the test-inhibit.c file to the repo, oops.
2014-10-14Parse the what portion for inhibitEric Koegel2-16/+176
2014-10-14trivial: improve READMEEric Koegel1-1/+24
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 Koegel4-2/+249
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 event->type = CK_LOG_EVENT_SYSTEM_START in historyEric Koegel1-4/+3
When the type = CK_LOG_EVENT_SYSTEM_START we can't cast the event to CkLogSeatSessionAddedEvent. Also find_first_matching_system_stop_event doesn't care about the 2nd argument so just make it NULL to make it clear we aren't expecting to pass something of value in.
2014-10-13Use 64-bit time_tajacoutot1-4/+11
GLib's struct GTimeVal declares tv_sec as glong (will break around 2038). Our struct timeval declares tv_sec as time_t... warning: passing argument 1 of 'ctime' from incompatible pointer type Taken from: http://anoncvs.estpak.ee/cgi-bin/cgit/openbsd-ports/tree/sysutils/consolekit/patches/patch-tools_ck-history_c
2014-10-13Fix another warning: "_FORTIFY_SOURCE" redefinedEric Koegel1-1/+4
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 Koegel10-6/+322
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-12trivial: update READMEEric Koegel1-0/+10
2014-10-12Update docsEric Koegel3-9/+32
2014-10-12trivial: add copyright/version infoEric Koegel3-3/+28
2014-10-12Really fix building on OpenBSDEric Koegel1-15/+15
2014-10-12Fix build on OpenBSDEric Koegel1-12/+12
2014-10-12Mark more user strings for i18nEric Koegel4-6/+24
2014-10-12Limit max username length to 24Eric Koegel1-1/+1
64 makes really long lines using ck-history on the cli, change it down to 24. If this becomes a problem we can add an option to display more characters.
2014-10-12Add i18n supportEric Koegel22-28/+1411
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-11trivial: update NEWSEric Koegel1-0/+40
2014-10-10Argument cannot be negativeEric Koegel1-1/+4
1) sysconf returns a long so make bufsize one. 2) sysconf call can fail and return -1, handle that condition. 3) if sysconf does fail a negative value would be sent to calloc which expects a positive value.
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 Koegel5-0/+293
The initial work in progress to add in suspend/hibernate and the inhibit locks.
2014-10-09trivial: update AUTHORSEric Koegel1-0/+5
2014-10-08ck-log-system-start: always create log directoryDaniel Drake1-0/+16
Some embedded setups (like OLPC) don't disk-back /var/log (e.g. enabled by Fedora's readonly-root functionality), so this will be empty on every boot. In this setup, ck-log-system-start fails because /var/log/ConsoleKit doesn't exist. Fix this by copying in mkdir code from ck-event-logger.c:open_log_file which already correctly handles this situation. Reported in: http://lists.freedesktop.org/archives/consolekit/2011-September/000148.html
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-08Fix ck-history truncating login namesEric Koegel1-11/+13
When not in compat-mode the max login name length is 64 which should cover most sane uses. Additionally this patch makes the command line options show up in --help. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=36364
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.