summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-05-06trivial: update valgrind commandEric Koegel1-3/+7
This way it can easily be hooked into the serivce startup and report any leaks for an entire lifecycle.
2017-05-06Check passed in variables for NULL before usingEric Koegel2-1/+8
2017-05-06Fix ref count warning messages in ck-inhibitEric Koegel2-14/+8
Commit 635648deede5a4 has the side effect of causing a warning message when the uninhibit signals are sent during the finalize phase as we can't take a reference there. So we'll need to check to see if the object was destroyed before sending each emit message. Additionally, in the manager, move the disconnect signal handler up since we'll be removing that inhibit anyway. This should fix: https://github.com/ConsoleKit2/ConsoleKit2/issues/92 https://github.com/ConsoleKit2/ConsoleKit2/issues/87
2017-05-04Turn a harmless warning message into a debug oneEric Koegel1-1/+4
This way users don't have to see the warnings about not being able to read a processes environment file. Fixes: https://github.com/ConsoleKit2/ConsoleKit2/issues/79
2017-05-04fix coverity cid 178982 Resource leakEric Koegel1-0/+2
2017-05-04trivial: docs cleanupEric Koegel1-4/+0
2017-05-04Prevent a use-after-free in while emitting signal changesEric Koegel1-1/+16
We need to keep a ref while sending all the inhibit change messages. Fixes: https://github.com/ConsoleKit2/ConsoleKit2/issues/87
2017-05-04Add support for server managed FDsEric Koegel14-55/+2115
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-01-25Add a few more display manager users.Antoine Jacoutot1-3/+6
On OpenBSD, system users start with an underscore.
2016-09-28OpenBSD: adapt to recent kvm(3) restrictionsAntoine Jacoutot1-1/+1
OpenBSD no longer allows accessing /dev/mem via kvm(3) so change the kvm_openfiles(3) flag from O_RDONLY to KVM_NO_FILES; actually it should have been this way since the beginning and matches what NetBSD does.
2016-09-26Merge pull request #82 from tw4452852/memory_leakageEric Koegel3-6/+18
fix some memory leakages
2016-09-22fix some memory leakagesTw3-6/+18
fix issue #77 Signed-off-by: Tw <tw19881113@gmail.com>
2016-09-22fix memory corruption due to delete session recursivelyTw1-14/+47
fix issue #80 Signed-off-by: Tw <tw19881113@gmail.com>
2016-09-05Use UID of logged in user instead UID of session leader processNikolai A. Dubinin3-4/+7
2016-07-15Fix a reversed condition for invalid device on NetBSDOBATA Akio1-1/+1
2016-06-30Freebsd: Fix session activationEric Koegel3-5/+11
On Freebsd (10.3), quite often X11 sessions do not become active. If they are active, switching the virtual console and then later return to X causes the X session to be inactive. I believe this has something to do with how the FreeBSD sc/vt drivers initialize the devices (and when). I have a patch to fix the issue attached. This problem is present all the way back to version 0.45. I noticed that some time ago, someone tried to fix this issue by using /dev/consolectl, but this device is never used because isatty() is false on /dev/consolectl. I have an attached patch that gets ConsoleKit to use /dev/consolectl and now session activation and VT switching work. Patch and bug report by Victor Bergman. https://github.com/ConsoleKit2/ConsoleKit2/issues/71 Signed-off-by: Eric Koegel <eric.koegel@gmail.com>
2016-06-10mount tmpfs with correct selinux labelsJason Zaman1-1/+9
Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-06-10Initialize/finish sysdeps when bus is aquired/lostJason Zaman1-0/+4
Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-06-10Add ck_sysdeps_init/fini functionsJason Zaman7-0/+70
Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-06-10ck-sysdeps-linux: Add selinux lib functionsJason Zaman1-0/+89
Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-06-10Add configure.ac checks for SELinuxJason Zaman1-0/+1
Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-04-15Turn the first pid move warning into a debugEric Koegel1-5/+3
2016-04-10Attempt to use 'cpuaccount' if 'all' cgroup fails on pid moveEric Koegel1-2/+14
For whatever reason, sometimes moving the pid into all the cgroups with cgmanager fails, but we only require cpuaccount for our internal use so try that as a fallback.
2016-04-10Remove the root restriction for runtime dirsEric Koegel1-5/+0
2016-03-20Improve documentation for XDG_RUNTIME_DIREric Koegel1-0/+2
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-03-16Add a 'User' section to the ck databaseEric Koegel1-1/+126
This will list the sessions assigned to the user and if at least one of them is local.
2016-03-14Properly filter the sessions for the specified userEric Koegel1-4/+36
2016-03-01login_session_id will be G_MAXUINT32 when unsetEric Koegel1-2/+2
This will fix the display of ck-list-sessions on a 64-bit system and CK2 won't try to compare to a bogus ssid.
2016-02-29Don't set a default tmpfs sizeEric Koegel4-4/+4
There's no need to make the mount options more complicated than they need to be.
2016-02-29Handle the legacy 'user' property as an override settingEric Koegel1-0/+7
A DM can set the 'user' property rather than the 'unix-user' as an override to force a specific uid during session startup. We just need to convert that back to a 'unix-user' in the session leader before handing that data back to the manager.
2016-02-14Add a 'Seats' section to the CK databaseEric Koegel1-0/+30
This way applications can know which seats are available and can easily walk the list to gather whatever information they need. The section will be something like [Seats] seats=/org/freedesktop/ConsoleKit/Seat1 /org/freedesktop/ConsoleKit/Seat2
2016-02-02Change owner of newly created cgroup to owner of progress group leaderMoritz Maxeiner1-0/+20
2016-02-01Create cgroup on all controllers managed by cgmanagerMoritz Maxeiner1-3/+3
2016-01-26Add the netbsd tmpfs functionsEric Koegel1-0/+56
2016-01-23trivial: Always return TRUE from gdbus methodsEric Koegel1-1/+1
2016-01-23Be extra safe with the XDG_RUNTIME_DIR setupEric Koegel2-7/+12
Ensure old runtime dir is clean before using it in case we crashed on the last run. Lockdown the dbus properties of CkSession because we use those properties internally and they shouldn't change.
2016-01-23Implement XDG_RUNTIME_DIREric Koegel12-1/+484
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-21Merge pull request #60 from msekletar/active-sessionEric Koegel1-2/+2
When assigning session to active VT prefer graphical sessions
2016-01-19When assigning session to active VT prefer graphical sessionsMichal Sekletar1-2/+2
I case when we launch graphical session on top of text session on the same VT we want to mark newly created graphical session as active.
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-11Minor cleanupEric Koegel1-4/+2
Signed-off-by: Eric Koegel <eric.koegel@gmail.com>
2016-01-11Check for enough swap space before allowing hibernate operationRobby Workman1-1/+82
This code is from the upower-0.9 branch with very little change, so it's not really fair to call me the author... Consider this a first attempt at addressing CK2 Issue #55 Signed-off-by: Eric Koegel <eric.koegel@gmail.com>
2015-10-10Fix behavior of ck_process_stat_get_tty on NetBSDOBATA Akio1-22/+6
To fit Linux's one * return NULL if invalid tty * return allocated string otherwise
2015-10-10Fix pid detection with ck_get_socket_perr_credentials on NetBSDOBATA Akio1-0/+20
NetBSD 5 and later have getpeereid(3), but it only for euid. Use getsockopt(2) with LOCAL_PEEREID if available in priority to it.
2015-09-15Merge pull request #50 from obache/neatsrc/netbsd-supportEric Koegel3-3/+509
Add NetBSD support
2015-09-10Apply overlooked PREFIX/lib -> LIBDIR substitutionEric Hameleers1-1/+1
2015-09-09Add NetBSD supportOBATA Akio3-3/+509
* 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-24Filter out the kdm userIvailo Monev1-2/+3
2015-08-24Merge pull request #43 from rworkman/trivialEric Koegel1-1/+1
Fix some libdir/scripts stuff missed in 4d87a25ea0af
2015-08-23Fix some libdir/scripts stuff missed in 4d87a25ea0afRobby Workman1-1/+1