summaryrefslogtreecommitdiffstats
path: root/src/ck-manager.c
Commit message (Collapse)AuthorAgeFilesLines
* Add seat.d/ callout directory and guarantee we dump the database before ↵HEADmasterLennart Poettering2009-08-121-15/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-10/+19
| | | | | | | 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.
* make CK database world readableLennart Poettering2009-08-111-1/+1
| | | | | | | | 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.
* Port to PolicyKit 1.0 apisMatthias Clasen2009-07-201-468/+205
|
* avoid a (harmless) warning messageMatthias Clasen2009-07-161-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=21310
* don't allow reboot if PolicyKit and RBAC are disabledWilliam Jon McCann2008-07-301-13/+14
|
* use object paths for seat added/removed signals per specWilliam Jon McCann2008-07-221-4/+4
|
* export login session id to the busWilliam Jon McCann2008-05-051-0/+9
|
* always try to detect parameters for sessionWilliam Jon McCann2008-04-191-11/+5
| | | | | Treat the parameters passed in via OpenSessionWithParameters as overrides.
* install scripts into $(prefix)/lib instead of $libdirWilliam Jon McCann2008-04-181-2/+2
| | | | We don't want scripts going into lib64...
* return PolicyKit results when not privileged for actionWilliam Jon McCann2008-04-161-2/+3
|
* always create the directories we needWilliam Jon McCann2008-02-251-24/+39
|
* ck_seat_get_active_session shouldn't return a null ssidWilliam Jon McCann2008-02-121-20/+11
| | | | | Da bus no likey nulls for object paths. Return false and set error if there is no active session.
* add support for logging start/stop/restartWilliam Jon McCann2008-01-291-4/+55
| | | | Also enable reporting this information with ck-history.
* make polkit optional and use RBAC on SolarisBrian Cameron2008-01-281-1/+70
| | | | | | | | | | | | | | | | This patch makes polkit an optional dependency. If present it builds with it. If not, polkit support is disabled. This patch also adds a --enable-rbac-shutdown=<key> option. If set, then ConsoleKit will allow shutdown/reboot if the user has the RBAC key authorization defined. For example, since the GDM GUI program runs as the "gdm" user, setting the key for the "gdm" user allows the login program to shutdown and reboot via ConsoleKit. Also this patch modifies the tools/solaris/ck-system-restart and tools/solaris/ck-system-stop scripts to call "/sbin/init 6" and "/sbin/init 5", which are the right commands for Solaris.
* be a little smarter about how we compute the number of usersWilliam Jon McCann2008-01-231-2/+94
|
* history should log to /var/log not /var/runWilliam Jon McCann2008-01-231-1/+1
|
* actually register the error type with dbusWilliam Jon McCann2008-01-231-0/+1
|
* add GetSessions method to Manager interfaceWilliam Jon McCann2008-01-231-0/+25
|
* add error type to managerWilliam Jon McCann2008-01-231-0/+22
|
* initial stop/restart supportWilliam Jon McCann2008-01-221-58/+609
| | | | | | Add Stop and Restart methods to the Manager object. We'll rename the Manager object to System in the near future. Use libpolkit to determine authorization.
* dump session leader infoWilliam Jon McCann2007-10-221-0/+9
|
* move session leader stuff into a separate classWilliam Jon McCann2007-10-221-377/+105
| | | | This will make it easier to dump/restore.
* add last mode, filtering by user/seat; shorten logged idsWilliam Jon McCann2007-10-211-10/+24
|
* add a basic ck-history commandWilliam Jon McCann2007-10-171-21/+21
| | | | | Refactor some event logging code to share with ck-history. At the moment the command only prints the events.
* add event logging capabilityWilliam Jon McCann2007-10-161-6/+334
| | | | | | | | This adds the ability to log events to a history file. One idea is to be able to provide wtmp like functionality. The next step is to add a seat-aware "last" command. This will be very useful for creating graphical logins that remember the most recent/frequent logins.
* maintain a file with the dump of the local databaseDavid Zeuthen2007-10-101-5/+199
| | | | | | | | 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-12/+45
| | | | | | 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.
* untabifyWilliam Jon McCann2007-08-281-8/+8
|
* move all proc stuff into ck-sysdepsWilliam Jon McCann2007-08-161-25/+27
|
* Add preliminary support for seats with devicesWilliam Jon McCann2007-07-201-2/+52
|
* add a glib message to syslog handlerWilliam Jon McCann2007-04-031-21/+20
| | | | | Also add ability to toggle debugging when SIGUSR1 is received.
* add unix-user to parse listWilliam Jon McCann2007-04-021-1/+1
| | | | Oops.
* deprecate the user properties and add unix-user propertiesWilliam Jon McCann2007-03-131-8/+17
| | | | | Also added deprecated notes to the docs. New code should be using GetUnixUser instead of GetUser etc.
* various leak fixesWilliam Jon McCann2007-03-131-3/+35
|
* add uuid to cookieWilliam Jon McCann2007-03-091-1/+9
|
* check for empty strings as well as nullWilliam Jon McCann2007-03-061-7/+9
|
* use a slightly more sophisticated rule for adding sessions to static seatWilliam Jon McCann2007-03-061-5/+32
|
* add x11-display-device to parse tableWilliam Jon McCann2007-03-051-6/+7
|
* rename host-name in one more placeWilliam Jon McCann2007-03-051-6/+6
|
* use an async job to collect session infoWilliam Jon McCann2007-03-051-76/+202
| | | | | Use an async helper job to collect session info for the OpenSession() method.
* lay the groundwork for making open session asyncWilliam Jon McCann2007-02-281-118/+252
| | | | | | | | | | Restructure things a bit so that we can be completely async about creating sessions. We want to do this so we can use callouts to gather session info or to verify info. Also make the OpenSession create a parameter list and then create the session rather than creating the session and changing attributes. This is less racy and the session will be complete and correct before any signals are emitted.
* rename some items in proc.h api; add some more error checkingWilliam Jon McCann2007-02-261-38/+66
| | | | | Make the proc.h API more coherent. Convert some warnings to debug statements. Fix two leaks. Add more error checking.
* add support for glib < 2.12William Jon McCann2007-02-211-1/+24
| | | | Copy the iso8601 function from glib to support versions less than 2.12.
* make separate test scripts for open session methodsWilliam Jon McCann2007-02-211-0/+1
|
* add a system-idle-hint and system-idle-since-hintWilliam Jon McCann2007-02-201-18/+142
| | | | | The system idle hint is TRUE when there are no busy (ie non-idle) sessions. So the system is idle when there are no sessions or all sessions are idle.
* restrict access to CloseSessionWilliam Jon McCann2007-02-151-0/+77
| | | | Only allow the uid and pid that opened the session to close it.
* convert all tabs to spacesWilliam Jon McCann2007-02-151-77/+77
|
* Add some more debugging outputWilliam Jon McCann2007-02-061-1/+7
|
* Fix some small leaks. Add --timed-exit to daemon for valgrinding.William Jon McCann2006-11-061-1/+10
|