summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add seat.d/ callout directory and guarantee we dump the database before ↵HEADmasterLennart Poettering2009-08-125-25/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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.
* database: write the console database to disk before signalling via dbusLennart Poettering2009-08-123-27/+23
| | | | | | | 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.
* 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.
* when printing size_t use %z format stringLennart Poettering2009-08-111-1/+1
|
* make CK database world readableLennart Poettering2009-08-113-6/+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.
* get rid of ck_seat_set_active_session() prototype since no such function existsLennart Poettering2009-08-111-3/+0
|
* Move ck_session_run_programs() from ck-run-programs.h to ck-session.hLennart Poettering2009-08-112-3/+3
| | | | It's a method of CkSession hence it belongs in ck-session.h
* Port to PolicyKit 1.0 apisMatthias Clasen2009-07-203-468/+220
|
* avoid a (harmless) warning messageMatthias Clasen2009-07-161-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=21310
* fix a bunch of xml validation errorsWilliam Jon McCann2009-07-162-3/+4
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=20232
* fix parsing log entries with no bodyWilliam Jon McCann2009-02-121-8/+17
|
* don't leak dbus proxyJames Westby2009-02-111-0/+2
|
* fix zero-sized struct/unionWilliam Jon McCann2009-02-111-0/+4
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=18149
* serialize removals, and avoid using freed data caused by removalsJames Westby2009-02-111-32/+94
| | | | | | | | | | | | | | | | | I changed the code to also loop through watch->notifies when removing the watch due to inotify, and NULL each notify->watch reference, the code then checks this before trying to delete the watch itself if asked to remove the notify. In order to prevent other race conditions in this area I also made the inotify code not pass a watch to emit_events_in_idle, as the watch may get freed in the meantime. It instead passes the wd and the emit loop looks up the watch, discarding the event if the watch has been removed. I did however leave in the code that checks for a removed watch before doing anything with inotify, as I hoped that this would just optimise this case.
* close directory to fix leakSteve Langasek2009-02-111-0/+1
| | | | | | | | | | Chris Jones observed that console-kit-daemon had open a large number of redundant file descriptors, pointing to /etc/ConsoleKit/run-session.d and /usr/lib/ConsoleKit/run-session.d. It turns out that ck_run_programs() doesn't close the directory handles after iterating, resulting in a fd leak and a small memory leak. The attached patch corrects this.
* check the result of the fchown callWilliam Jon McCann2008-10-021-1/+6
|
* don't close the log file fd twiceWilliam Jon McCann2008-10-021-4/+6
| | | | Fixes #17866
* update for 0.3.0 releaseWilliam Jon McCann2008-07-301-1/+1
|
* don't allow reboot if PolicyKit and RBAC are disabledWilliam Jon McCann2008-07-301-13/+14
|
* use spec files directly as introspection xml and try to generate docs on the flyWilliam Jon McCann2008-07-237-199/+955
| | | | | | At one point we had to strip out the docs because dbus-glib didn't support unknown tags. Apparently this is now fixed. Also install the xml to /usr/share/dbus-1/interfaces.
* use object paths for seat added/removed signals per specWilliam Jon McCann2008-07-221-4/+4
|
* regenerate the docs and xml from the specWilliam Jon McCann2008-07-221-0/+3
|
* fix up signal definitionWilliam Jon McCann2008-07-211-2/+2
|
* fix UnixUser to be uintWilliam Jon McCann2008-06-111-5/+2
| | | | Pointed out by Lennart Poettering
* use object paths instead of strings for signalsWilliam Jon McCann2008-06-111-2/+2
| | | | Pointed out by Lennart Poettering
* cleanly shutdown event logging threadWilliam Jon McCann2008-05-052-4/+32
|
* export login session id to the busWilliam Jon McCann2008-05-055-4/+29
|
* exit with the bus now that we're activated by the busWilliam Jon McCann2008-05-051-57/+8
|
* make sure to add all override parametersWilliam Jon McCann2008-04-192-9/+23
|
* fix the script to work with recent dbus-python api changesWilliam Jon McCann2008-04-192-11/+10
|
* always try to detect parameters for sessionWilliam Jon McCann2008-04-194-45/+155
| | | | | Treat the parameters passed in via OpenSessionWithParameters as overrides.
* install scripts into $(prefix)/lib instead of $libdirWilliam Jon McCann2008-04-183-4/+4
| | | | We don't want scripts going into lib64...
* return PolicyKit results when not privileged for actionWilliam Jon McCann2008-04-161-2/+3
|
* initial login session id supportWilliam Jon McCann2008-04-037-0/+141
| | | | | | | | 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
* always create the directories we needWilliam Jon McCann2008-02-253-40/+95
|
* properly get display device on SolarisSimon Zheng2008-02-251-4/+12
| | | | | | | | | | | | | | Mapping between device path and (major, minor). "/dev/vt" -- (15,*) "/dev/pts" -- (24,*) "/dev/console" -- (0,0) "NO_TTY_VALUE" - (-1,-1) Also, solaris VT device is named like this. /dev/console --- VT #1 /dev/vt/2 --- VT #2 /dev/vt/3 --- VT #3 /dev/vt/N --- VT #4
* fix solaris x11-display-device when no vt availableBrian Cameron2008-02-251-0/+11
| | | | | | This patch fixes ConsoleKit so it sets x11-display-device to "/dev/console" when not using VT.
* solaris doesn't like printing nullBrian Cameron2008-02-251-1/+1
|
* fix display of active vt when vt is disabledBrian Cameron2008-02-251-2/+6
| | | | | | | | | This fixes the Active device so it is set to "/dev/console" when not using VT. Without this patch, the syslog reports messages like: Active device: /dev/vt/3508388860 Which is obviously wrong if not using VT at all.
* fix solaris vt handling to work when no vt availableBrian Cameron2008-02-251-3/+5
| | | | | | This fixes the patch that Simon Zhang sent you earlier so that it builds on machines without VT.
* improve supporting Solaris VT switchingSimon Zheng2008-02-192-1/+60
| | | | | | | | | | | | | | | Here's a patch for ConsoleKit to improve supporting Solaris VT. Two changes are made. - Solaris supports synchronous event notification in STREAMS. Using this, we can avoid creating many threads for idle VTs. By setting the S_MSG flag in an I_SETSIG STREAMS ioctl, applications can get a synchronous notification of VT switching. In other words, these processes are able to receive a SIGPOLL signal when a VT switching succeeds. - Change a little command line of getting maximum vt console numbers.
* don't include paths.h on systems that don't have itWilliam Jon McCann2008-02-191-1/+0
|
* create the log file with S_IROTH and don't touch the log on buildWilliam Jon McCann2008-02-132-3/+2
|
* ck_seat_get_active_session shouldn't return a null ssidWilliam Jon McCann2008-02-123-24/+35
| | | | | 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-123-10/+48
| | | | Also make criticals fatal when starting with --debug.
* reverse the sense of the dbus policyWilliam Jon McCann2008-02-121-0/+517
| | | | | Deny first and then allow. Add a simple test script to check method access policy.
* fix typo in dbus policy fileWilliam Jon McCann2008-02-111-1/+1
|
* touch the history file to create it for people not using packagesWilliam Jon McCann2008-02-071-0/+2
|
* mkdir /var/log/ConsoleKit at install timeWilliam Jon McCann2008-02-061-0/+1
|