summaryrefslogtreecommitdiffstats
path: root/src/ck-seat.c
Commit message (Collapse)AuthorAgeFilesLines
* Add seat.d/ callout directory and guarantee we dump the database before ↵HEADmasterLennart Poettering2009-08-121-10/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | callout invocation This adds a callout directory called seat.d/ that follows the basic session.d/ semantics but works on seats instead of sessions. As replacement for the old session.d/ 'session_active_changed' semantics seat.d/ knows 'seat_active_session_changed'. Which combines the two callouts necessary for session_active_changed into one. This has various advantages: it's not as racy, allows the suppressing of ACL permission changes when switching between sessions of the same user, reduces the amount of disk IO and finally is less ugly. This patch also moves all callout invocations into the CkManager. This has the advantage that we can guarantee to have fully dumped the CK database before the callout. In summary, the session.d/ directory will now get two types of callout invocations: session_added session_removed In contrast, seat.d/ gets three types: seat_added seat_removed seat_active_session_changed The 'seat_active_session_changed' callout type gets two sets of environment variables describing the old resp. the new session that is active. Either set can be left out if no session was active before, or no session will be active after the switch. This is similar to the logic behind D-Bus' NameOwnerChanged. This patch duplicates CkSeat's 'session-removed' signal into 'session-removed-full' (and friends). Reason for that is that the signal forwarded via D-Bus needs the session id as string while the callout code needs the session itself as object. Since at the time of invocation the CkSeat is no longer in the seats hashtable it is hence necessary to pass the object in as argument to the signal handlers, which makes this duplification necessary to not confuse dbus-glib. For a similar reason 'active-session-changed' is duplicated as well.
* database: write the console database to disk before signalling via dbusLennart Poettering2009-08-121-17/+2
| | | | | | | We simply change the order how the signal handlers for D-Bus and the database dumping are registered. According to the gobject docs it is guaranteed that the signal handlers are run in the same order as they are registered, so this should be safe and have the desired effect.
* when printing size_t use %z format stringLennart Poettering2009-08-111-1/+1
|
* fix up signal definitionWilliam Jon McCann2008-07-211-2/+2
|
* use object paths instead of strings for signalsWilliam Jon McCann2008-06-111-2/+2
| | | | Pointed out by Lennart Poettering
* solaris doesn't like printing nullBrian Cameron2008-02-251-1/+1
|
* ck_seat_get_active_session shouldn't return a null ssidWilliam Jon McCann2008-02-121-3/+23
| | | | | Da bus no likey nulls for object paths. Return false and set error if there is no active session.
* guard against writing null string to keyfileWilliam Jon McCann2008-02-121-1/+5
| | | | Also make criticals fatal when starting with --debug.
* add session-type filtering to ck-historyWilliam Jon McCann2008-01-281-0/+2
|
* try to activate x11-display-device not only display-deviceWilliam Jon McCann2008-01-281-2/+5
|
* maintain a file with the dump of the local databaseDavid Zeuthen2007-10-101-2/+84
| | | | | | | | 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.
* remove session/seat from list before signalingWilliam Jon McCann2007-10-101-7/+21
| | | | | | We should remove the session or seat from the lists before calling out or emitting a signal. We steal from the lists and then unref the objects when the signal is complete.
* add a way to synchronously run programs on session add/remove/activity_changeDavid Zeuthen2007-10-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* abstract out the tty device basename stuffWilliam Jon McCann2007-08-211-9/+6
|
* Add preliminary support for seats with devicesWilliam Jon McCann2007-07-201-0/+219
|
* add a glib message to syslog handlerWilliam Jon McCann2007-04-031-11/+10
| | | | | Also add ability to toggle debugging when SIGUSR1 is received.
* add CanActivateSessions to Seat interfaceWilliam Jon McCann2007-03-191-0/+14
| | | | And associated documentation and added to test-fus.
* various leak fixesWilliam Jon McCann2007-03-131-4/+11
|
* use paths.h if availableWilliam Jon McCann2007-03-061-2/+9
|
* allow for the possibility of matching multiple sessions for deviceWilliam Jon McCann2007-03-061-15/+145
| | | | | | | In the event that there is more than one session that matches a particular tty when the VT changes we use the following rule: 1. take the oldest session where display-device == active VT device 2. take the oldest session where x11-display-device == active VT device
* convert all tabs to spacesWilliam Jon McCann2007-02-151-9/+9
|
* use the supplied vt number when updating active sessionWilliam Jon McCann2007-02-121-12/+19
| | | | | Just the use vt number given by the vt-manager instead of asking for the current vt again. A little bit less racy this way.
* Don't keep last session active when switching to a VT withoutWilliam Jon McCann2007-02-061-3/+1
| | | | | a session registered on it. Patch from: David Zeuthen
* Add a script to test FUS related functionality.William Jon McCann2006-10-311-1/+4
| | | | Fix a problem where error was reported twice.
* Initial importWilliam Jon McCann2006-10-251-0/+724