summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2021-07-04show session-service in ck-list-sessionsRobert Nagy1-0/+5
2017-06-22fix: FreeBSD session activationEric Koegel1-0/+76
This is based heavily on the work of Jesper Schmitz Mouridsen in: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=179399&action=diff from: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202269 Fixes: https://github.com/ConsoleKit2/ConsoleKit2/issues/85
2017-06-21fix: clean up clang warningsEric Koegel1-1/+1
2017-05-22fix: add session class + state to ck-list-sessionsEric Koegel1-5/+26
2017-05-21fix: remove the rest of the gcc warningsEric Koegel1-3/+3
2017-05-21fix: remove warnings about signed/unsigned comparisonsEric Koegel1-3/+3
2017-05-21chore: simplify configure.acEric Koegel1-15/+36
Pull in the m4 macros from the xfce4-dev-tools so we have ways to simplify and shorten the configure.ac file.
2017-05-06trivial: fix a gcc compiler warningEric Koegel1-1/+1
2017-05-06Drop the seat late rulesEric Koegel2-16/+1
This was copied over from systemd but we aren't using it. Fixes: https://github.com/ConsoleKit2/ConsoleKit2/issues/93
2017-05-04fix coverity cid 64730 Use of untrusted string valueEric Koegel1-1/+19
2017-05-04fix coverity cid 178980 Constant expression resultEric Koegel1-1/+1
2017-05-04Handle runtimedir not being created/setEric Koegel1-3/+6
For: https://github.com/ConsoleKit2/ConsoleKit2/issues/74
2017-05-04Add support for server managed FDsEric Koegel2-7/+92
These will be needed by session compositors that don't want to run as root. It should also allow xorg to run as a user as well. This is what logind exports and session controllers like KDE expect. This adds a udev, evdev, libdevattr, and none backend for device management. More can be added in the future. This code is based on code in logind, dragonfly BSD's weston diffs, and libweston; See: https://freedesktop.org/wiki/Software/systemd/logind/ https://github.com/DragonFlyBSD/DeltaPorts/tree/master/ports/graphics/weston/newport https://cgit.freedesktop.org/wayland/weston/
2017-05-04Update udev rulesEric Koegel4-3/+79
2017-01-25Do the same for FreeBSD as well.Antoine Jacoutot1-0/+2
2017-01-25Fix for OpenBSD VT device naming scheme.Antoine Jacoutot1-0/+2
2016-04-21ck-remove-directory: remove dest dir as real userMatt Whitlock1-6/+25
Attempting to remove "<rundir>/user/<uid>" as user <uid> fails because the user typically does not own the "<rundir>/user" directory. This failure causes remove_dest_dir() to call g_error(), which raises a SIGTRAP. This causes a trap diagnostic message to be emitted to the kernel log, which is undesirable. This commit changes remove_dest_dir() so that it removes the contents of the dest dir as user <uid> and then removes the dest dir itself as the real user invoking ck-remove-directory (probably root).
2016-04-21ck-remove-directory: remove unused dest parameter on become_userMatt Whitlock1-7/+2
The dest parameter is irrelevant to the function become_user, and it's already checked for NULL immediately before become_user() is called, so remove the redundant (and misplaced) check in become_user and remove the extraneous parameter.
2016-04-21ck-remove-directory: return exit code 0 on successMatt Whitlock1-3/+1
remove_dest_dir() returns the return value of nftw(), which is specified to return 0 on success. The main function was previously returning (ret != TRUE), which would be true in the successful case, as (0 != !0), but true becomes 1 when converted to an int, and a 1 exit code from a process conventionally indicates failure. This commit corrects main's return statement so that a successful run of remove_dest_dir() causes the process to return exit code 0.
2016-04-10Remove the root restriction for runtime dirsEric Koegel1-10/+0
2016-03-20Improve documentation for XDG_RUNTIME_DIREric Koegel1-2/+6
1) Add what it may fail with and when it was added to the docs. 2) Add a description to the man page. 3) Add it to the ck-list-sessions output
2016-01-23Implement XDG_RUNTIME_DIREric Koegel3-0/+182
This adds support for implementing the runtime dir spec. ConsoleKit2 will create $RUNDIR/users on the first session creation and then $RUNDIR/users/$uid for each user logging in that keeps an active session. CK2 will clean up the $uid folder once all sessions of that user have been closed. CK2 will also attempt to mount the user's rundir as a tmpfs mount owned by the user. This way if CK2 crashes the directory will get cleaned up on next system restart. CK2 will not create a runtime dir for root. http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html https://github.com/ConsoleKit2/ConsoleKit2/issues/41
2016-01-19Fix undefined behaviorMichal Sekletar1-1/+1
It is unlikely that ck-log-system-start would crash because of this, but still it is better to have it fixed.
2016-01-13Updates for 1.0.1 release1.0.1Eric Koegel1-0/+5
2015-10-10Fix for NetBSD VT device naming schemeOBATA Akio1-0/+4
2015-09-09Add NetBSD supportOBATA Akio6-0/+70
* based on patches for ConsoleKit 0.3.0 from NetBSD Packages Collection * catch up with help from sysdep implementation for OpenBSD and FreeBSD * ck-system-suspend is based on NetBSD powerd(8) sleep_button script
2015-08-24Merge pull request #43 from rworkman/trivialEric Koegel1-2/+2
Fix some libdir/scripts stuff missed in 4d87a25ea0af
2015-08-23Fix some libdir/scripts stuff missed in 4d87a25ea0afRobby Workman1-2/+2
2015-08-22Revert "Minor code refactoring"Eric Koegel1-3/+0
This reverts commit bee63889f4a0b8f57807a61d8396346cec8cd5b1. There are some cases where ConsoleKit2 would crash after successfully suspending so revert this commit.
2015-08-09Minor code refactoringEric Koegel1-0/+3
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-07-14Respect multilib/multiarch filesystem layoutsKylie McClain3-3/+3
Adapted from https://bugs.freedesktop.org/show_bug.cgi?id=24608
2015-07-05mark sessions as local explicitly when not build with PAM supportIvailo Monev1-1/+14
2015-06-14list-sessions: Log NULL properties as a debug messageEric Koegel1-1/+1
So we don't spam the console when things like the login session id aren't available.
2015-06-08Fix Coverity CID 95916 Identical code for different branchesEric Koegel1-2/+1
2015-06-08Port list-sessions.c to GDBusEric Koegel1-145/+119
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-05-17Remove the pam-foreground-compat.ckEric Koegel2-27/+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.
2014-12-11Fixup a couple of missed hardcoded /var/run/ usagesRobby Workman1-1/+1
2014-12-08Add --with-rundir configure flagRobby Workman3-2/+3
This allows use of /run on tmpfs instead of /var/run without downstream symlink magic or patches.
2014-11-30Fix pam-foreground-compat installEric Koegel1-7/+8
The pam-foreground-compat.ck script should be installed without requring udev.
2014-11-27openbsd: cleanups and sync with ConsoleKit portAntoine Jacoutot9-107/+8
We never needed to use an external helper script with the original ConsoleKit for ck-get-x11-*, so drop these. Make sure we install the other tools and simplify the scripts in the process.
2014-10-20Add HybridSleep support and change CanSleepEric Koegel8-0/+29
Emulate the logind API to make it more easier for porting to ConsoleKit2 for the CanSuspend/CanHibernate/CanHybridSleep methods. They now return: yes - system can and user explicitly authorized by polkit, rbac, or neither is running no - system can and user explicitly unauthorized by polkit or rbac challenge - system can and user requires elevation via polkit na - system does not support it (hardware or backend support missing). The auth methods have been removed. Currently HybridSleep only works on Linux.
2014-10-19Merge branch 'dbus-api-additions'Eric Koegel12-0/+88
Implement the Suspend/Hibernate DBUS APIs for: https://github.com/ConsoleKit2/ConsoleKit2/issues/3 Conflicts: configure.ac
2014-10-14Add the suspend/hibernate scriptsEric Koegel12-0/+88
Also add the test-inhibit.c file to the repo, oops.
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-12Mark more user strings for i18nEric Koegel2-4/+6
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 Koegel11-2/+88
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-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