summaryrefslogtreecommitdiff
path: root/src/login/sd-login.c
AgeCommit message (Collapse)Author
2013-10-10login: make sd_session_get_vt() actually workDavid Herrmann
We use VTNR, not VTNr as key. Until now sd_session_get_vt() just returns an error.
2013-10-10login: fix invalid free() in sd_session_get_vt()David Herrmann
We need to clear variables markes as _cleanup_free_. Otherwise, our error-paths might corrupt random memory.
2013-09-16Verify validity of session name when received from outsideZbigniew Jędrzejewski-Szmek
Only ASCII letters and digits are allowed.
2013-09-11sd-login: add a public accessor for the VT numberGiovanni Campagna
The VT number was already part of the DBus API, but was not exposed in the C API.
2013-06-21login: add an api to determine the slice a PID is located in to libsystemd-loginLennart Poettering
2013-06-20sd-login: update machine enumeration/notifications APIs for new ↵Lennart Poettering
/run/systemd/machines/
2013-06-20logind: add infrastructure to keep track of machines, and move to slicesLennart Poettering
- This changes all logind cgroup objects to use slice objects rather than fixed croup locations. - logind can now collect minimal information about running VMs/containers. As fixed cgroup locations can no longer be used we need an entity that keeps track of machine cgroups in whatever slice they might be located. Since logind already keeps track of users, sessions and seats this is a trivial addition. - nspawn will now register with logind and pass various bits of metadata along. A new option "--slice=" has been added to place the container in a specific slice. - loginctl gained commands to list, introspect and terminate machines. - user.slice and machine.slice will now be pulled in by logind.service, since only logind.service requires this slice.
2013-05-07login: add missing _public_ to sd_get_machine_names()Lennart Poettering
2013-05-01cgls: add --machine/-MZbigniew Jędrzejewski-Szmek
cg_get_machine_path is modified to include the escaped machine name + ".nspawn" if the machine argument is nonnull.
2013-04-24login: allow watching virtual machines with sd_get_machine_names()Lennart Poettering
2013-04-24login: add new call sd_get_machine_names() to get a list of current virtual ↵Lennart Poettering
machines and containers
2013-04-22cgroup: make sure all our cgroup objects have a suffix and are properly escapedLennart Poettering
Session objects will now get the .session suffix, user objects the .user suffix, nspawn containers the .nspawn suffix. This also changes the user cgroups to be named after the numeric UID rather than the username, since this allows us the parse these paths standalone without requiring access to the cgroup file system. This also changes the mapping of instanced units to cgroups. Instead of mapping foo@bar.service to the cgroup path /user/foo@.service/bar we will now map it to /user/foo@.service/foo@bar.service, in order to ensure that all our objects are properly suffixed in the tree.
2013-04-18sd-login.c: fixup for d70964d0Harald Hoyer
p pointer is not _cleanup_free_
2013-04-18login/sd-login.c: make use of _cleanup_free_ and friendsHarald Hoyer
2013-04-16nspawn: introduce the new /machine/ tree in the cgroup tree and move ↵Lennart Poettering
containers there Containers will now carry a label (normally derived from the root directory name, but configurable by the user), and the container's root cgroup is /machine/<label>. This label is called "machine name", and can cover both containers and VMs (as soon as libvirt also makes use of /machine/). libsystemd-login can be used to query the machine name from a process. This patch also includes numerous clean-ups for the cgroup code.
2013-04-15sd-login: add a sd_pid_get_user_unit() callLennart Poettering
2013-04-11errno is positiveZbigniew Jędrzejewski-Szmek
Make sure we compare errno against positive error codes. The ones in hwclock.c and install.c can have an impact, the rest are unlikely to be hit or in code that isn't widely used. Also check that errno > 0, to help gcc know that we are returning a negative error code.
2013-04-04login: add sd_login_monitor_get_timeout() public api callLennart Poettering
We don't need this right now, but we should keep our options open, in case we need more than just an fd for waking up.
2013-04-04login: add new public API call sd_login_monitor_get_events() to get poll() ↵Lennart Poettering
flags to wait for We should keep our options open, so that we can watch for POLLOUT later on if we wish to. CUrrently this call will always return POLLIN however.
2013-02-14honor SELinux labels, when creating and writing config filesHarald Hoyer
Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-02-13Revert "log_error() if inotify_add_watch() fails"Lennart Poettering
This reverts commit 2826d14091e43ed3397d862dee79d09d0115c84e. We never should generate log messages from a library.
2013-02-13log_error() if inotify_add_watch() failsHarald Hoyer
[zj: Reworded message s/to watch/to add watch on/ to make it clear that it was the watch init action that failed, and not the "process of watching". I think this way it'll be clearer to people who don't know what inotify does.]
2013-02-13use strneq instead of strncmpThomas Hindoe Paaboel Andersen
2013-01-15login: introduce sd_session_get_tty()Lennart Poettering
2012-09-19util: define union dirent_storage and make use of it everywhereLennart Poettering
Make sure to allocate enough space for readdir_r(). https://bugzilla.redhat.com/show_bug.cgi?id=858754
2012-09-12login: reshuffle meaning of require_active parameterLennart Poettering
2012-09-12logind: Add a two new variables to the user session tracking file.Colin Guthrie
This counts 'online sessions' in addition to 'active sessions' and 'sessions'. In this context, an 'online session' covers all session in the 'active' state in addition to the explicit 'online' state. This provides an easy machanism to determin all relevant sessions easily (i.e. those that are not 'closing') and adds new semantics to the sd-login.c APIs sd_uid_get_sessions() and sd_uid_get_seats() where the require_active argument can be supplied as a value 2 which only lists sessions which are 'online'. This functionality should allow client applications to avoid deadlocks where they only exit when all sessions are complete, such as a the problem where PulseAudio will not exit until all sessions are gone, but in itself prevents the session from exiting.
2012-06-21login: wrap CanTTY and CanGraphical seat attributes in libsystemd-loginLennart Poettering
2012-06-21logind: introduce a state for session, being one of online, active, closingLennart Poettering
online = logged in active = logged in and session is in the fg closing = nominally logged out but some left-over processes still around Related to: https://bugzilla.gnome.org/show_bug.cgi?id=677556
2012-05-30build-sys: fix built with --disable-logindLennart Poettering
2012-04-12relicense to LGPLv2.1 (with exceptions)Lennart Poettering
We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
2012-02-15login: introduce sd_session_get_display()Lennart Poettering
2012-02-14login: add new sd_session_get_type() and sd_session_get_class API callsLennart Poettering
2012-02-13sd-login: if NULL or 0 is passed as first parameter of the sd_xxx functions, ↵Lennart Poettering
work on objects of the calling process
2012-01-13sd-login: teach sd_pid_get_unit() proper handling of instantiated servicesLennart Poettering
2012-01-05login: implement sd_session_get_service()Lennart Poettering
2012-01-04journald: store _SYSTEMD_UNIT= instead of _SYSTEMD_SERVICE= field, since ↵Lennart Poettering
processes might also be related to mount, swap or socket units, not just services
2012-01-03logind: if we can't open /dev/tty0, assume there is no VT subsystem and ↵Lennart Poettering
don't pretend we could do VT switching
2012-01-03login: introduce sd_pid_get_service()Lennart Poettering
2011-12-31logind: move logind into its own subdirectoryLennart Poettering