summaryrefslogtreecommitdiffstats
path: root/src/ck-session.c
Commit message (Collapse)AuthorAgeFilesLines
* get rid of session.d's session_active_changed calloutLennart Poettering2009-08-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'session_active_changed' callout is an invitaton to racy misuses since it splits up the session switches into two events. This patch gets rid of it. At this point there are two known users of the session.d/ callouts: - Suse/Ubuntu ship a script for emulating pam_atconsole style /var/run/console management for supporting D-Bus' at_console feature properly. Both Martin Pitt and Kay Sievers however are happy with having this feature go away. In addition I prepared a patch for D-Bus which makes the need for these scripts go away entirely. That patch is currently awaiting review. - udev's udev-acl tool currently uses this. However this doesn't work correctly anyway since it relies on that the CK database is correctly dumped before the tool is invoked, which CK does not handle properly at this time. In fact fixing this problem is the main reason why I came up with this patch series. Kay is also very interested in seeing the 'session_active_changed' logic go away. A later commit introduces a replacement functionality that is less racy. Please note that this patch does not drop session.d/ in its entirety. Only the 'session_active_changed' type callout is removed. Scripts that only rely on 'session_added'/'session_removed' will continue to work fine, and will continue to be supported.
* Enforce that the env array has the right sizeLennart Poettering2009-08-111-0/+2
| | | | | Hit an assert if folks add env vars but don't increase the env var array size.
* make CK database world readableLennart Poettering2009-08-111-4/+0
| | | | | | | | The CK database shall be readable by the D-Bus daemon which runs under its own user id hence make sure it is readable for non-root processes. To make sure this leaks no information this drops the session cookie from the database.
* don't leak dbus proxyJames Westby2009-02-111-0/+2
|
* update for 0.3.0 releaseWilliam Jon McCann2008-07-301-1/+1
|
* export login session id to the busWilliam Jon McCann2008-05-051-1/+1
|
* install scripts into $(prefix)/lib instead of $libdirWilliam Jon McCann2008-04-181-1/+1
| | | | We don't want scripts going into lib64...
* initial login session id supportWilliam Jon McCann2008-04-031-0/+48
| | | | | | | | Linux audit session id support. Still TODO: * determine if session id should be hidden * export to bus * add to event log * figure out how to add it to non-generated sessions
* guard against writing null string to keyfileWilliam Jon McCann2008-02-121-9/+38
| | | | Also make criticals fatal when starting with --debug.
* fixes for solarisBrian Cameron2008-01-281-1/+2
| | | | | | | | | | Fixes two bugs I found in the code. The first is that we need some NULL protection around the g_strdup_printf where we build CK_SESSION_X11_DISPLAY to avoid a crash. Second, I noticed a bug in the ck_unix_pid_get_hash function where we weren't parsing the data right and causing the hash to not get set properly.
* maintain a file with the dump of the local databaseDavid Zeuthen2007-10-101-0/+38
| | | | | | | | This feature is useful for programs wanting to read the database without going through the D-Bus interface. This is sometimes desirable when both performance and runtime dependencies are important. For security reasons the file is only readable for the super user.
* add a way to synchronously run programs on session add/remove/activity_changeDavid Zeuthen2007-10-041-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for running programs when 1. A session is added 2. A session is removed 3. The activity of a session changes Executables with the suffix .ck in the directories $sysconfdir/ConsoleKit/run-session.d (typically /etc/ConsoleKit/run-session.d) and $libdir/ConsoleKit/run-session.d (typically /usr/lib/ConsoleKit/run-session.d) will be run on each event. The former directory is meant to be used for the system administrator and the latter is meant to be used by programs. Only when all programs in these directories have run, ConsoleKit will resume event processing and e.g. broadcast the event on the system message bus. Hence, this new mechanism can be used to safely (e.g. without race conditions) perform operations on certain resources before programs in the desktop session are told they may use them. The obvious example here is managing ACL's on /dev such that certain device nodes are only available to users in local and active sessions. The environment of the program launched is the environment that the ConsoleKit daemon was launched with and also the following variables (variables tagged with [*] may not be set). CK_SESSION_ID CK_SESSION_TYPE CK_SESSION_SEAT_ID CK_SESSION_USER_UID CK_SESSION_DISPLAY_DEVICE [*] CK_SESSION_X11_DISPLAY_DEVICE [*] CK_SESSION_X11_DISPLAY [*] CK_SESSION_REMOTE_HOST_NAME [*] CK_SESSION_IS_ACTIVE CK_SESSION_IS_LOCAL corresponding to the properties of a Session object in question. Each program is passed exactly one parameter that can assume one of the following values: - session_active_changed: is_active changed - session_added: the session was added - session_removed: the session was removed As a safety hatch, there is a timeout of 15 seconds for each program; if it hasn't exited within 15 seconds, the daemon will send it a SIGTERM signal, and move on to the next program. The daemon is still responsive when the program is running - this is to ensure that the program itself can call into the org.freedesktop.ConsoleKit service.
* untabifyWilliam Jon McCann2007-08-281-4/+4
|
* use inotify to detect activity on tty when possibleWilliam Jon McCann2007-04-051-56/+26
|
* add a glib message to syslog handlerWilliam Jon McCann2007-04-031-16/+15
| | | | | Also add ability to toggle debugging when SIGUSR1 is received.
* dont' mark the user properties to be set in the constructorWilliam Jon McCann2007-03-141-2/+2
| | | | | | | | Now that we have two properties (one deprecated) that refer to the same thing we can't require that they are both set during the constructor. Furthermore, we can't require that either of them are set because we don't know which will be used.
* deprecate the user properties and add unix-user propertiesWilliam Jon McCann2007-03-131-9/+35
| | | | | Also added deprecated notes to the docs. New code should be using GetUnixUser instead of GetUser etc.
* various leak fixesWilliam Jon McCann2007-03-131-13/+19
|
* remove debug noiseWilliam Jon McCann2007-03-061-1/+1
|
* add very basic idle monitoring of text sessions and rework parameter parsingWilliam Jon McCann2007-03-061-22/+201
| | | | | Rework the parameter parsing so it is a bit more robust and so that parameters can get passed to the constructor.
* rename host-name to remote-host-name to make it more intuitiveWilliam Jon McCann2007-03-051-22/+27
|
* add x11-display-device attributeWilliam Jon McCann2007-03-051-9/+51
| | | | | | In certain cases it is necessary to distinguish the display-device (tty of session leader) from the x11-display-device (tty of xorg process).
* add support for glib < 2.12William Jon McCann2007-02-211-2/+25
| | | | Copy the iso8601 function from glib to support versions less than 2.12.
* don't use null parametersWilliam Jon McCann2007-02-211-15/+17
|
* make the idle hint getters sync dbus methodsWilliam Jon McCann2007-02-201-7/+16
| | | | | This makes it easier to use from C code. Also fix a bug where we weren't emitting the argument in the idle-hint-changed signal.
* rename idle methods and signal to indicate they are hintsWilliam Jon McCann2007-02-201-31/+31
| | | | | Rename GetIdle to GetIdleHint (etc) to make it clear that these are not authoritative properties.
* add creation and idle-since timesWilliam Jon McCann2007-02-151-0/+49
| | | | | Added GetCreationTime and GetIdleSince methods. And added the output to the list-sessions tool.
* implement get/set idle methodsWilliam Jon McCann2007-02-151-8/+158
| | | | | Add the GetIdle and SetIdle methods, and the IdleChanged signal. SetIdle is restricted to the uid of the session in question.
* convert all tabs to spacesWilliam Jon McCann2007-02-151-7/+7
|
* Add some more debugging outputWilliam Jon McCann2007-02-061-1/+3
|
* Fix some small leaks. Add --timed-exit to daemon for valgrinding.William Jon McCann2006-11-061-0/+2
|
* Initial importWilliam Jon McCann2006-10-251-0/+744