summaryrefslogtreecommitdiff
path: root/src/login
Commit message (Collapse)AuthorAge
* logind: check return value of session_releaseZbigniew Jędrzejewski-Szmek2015-03-15
| | | | | | It allocates memory, so it can fail. CID #1237527.
* logind: explicitly ignore errors we can do nothing aboutZbigniew Jędrzejewski-Szmek2015-03-13
| | | | CID #1237545.
* tree-wide: there is no ENOTSUP on linuxDavid Herrmann2015-03-13
| | | | Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
* login: fix copy-pasto in error pathZbigniew Jędrzejewski-Szmek2015-03-07
| | | | CID #1256583.
* login: make hold-off timeout configurableDavid Herrmann2015-03-06
| | | | | | | | | | | | | | | | | This introduces 'HoldoffTimeoutSec' to logind.conf to make IGNORE_LID_SWITCH_{SUSPEND,STARTUP}_USEC configurable. Background: If an external monitor is connected, or if the system is docked, we want to ignore LID events. This is required to support setups where a laptop is used with external peripherals while the LID is closed. However, this requires us to probe all hot-plugged devices before reacting to LID events. But with modern buses like USB, the standards do not impose any timeout on the slots, so we have no chance to know whether a given slot is used or not. Hence, after resume and startup, we have to wait a fixed timeout to give the kernel a chance to probe devices. Our timeout has always been generous enough to support even the slowest devices. However, a lot of people didn't use these features and wanted to disable the hold-off timer. Now we provide a knob to do that.
* Do not advertise .d snippets over main config fileZbigniew Jędrzejewski-Szmek2015-03-03
| | | | | | | | | | For daemons which have a main configuration file, there's little reason for the administrator to use configuration snippets. They are useful for packagers which need to override settings, but we shouldn't advertise that as the main way of configuring those services. https://bugs.freedesktop.org/show_bug.cgi?id=89397
* user-sessions: move into own subdir and build independently of logindIvan Shapovalov2015-02-27
| | | | | | | Suggested by Zbyszek on IRC. [zj: /run/nologin is used with PAM. systemd-user-session is independent of logind.]
* po: simplify one sentenceZbigniew Jędrzejewski-Szmek2015-02-24
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* logind: fix a typo in a polkit descriptionPiotr Drąg2015-02-21
|
* logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering2015-02-18
| | | | | | Also, allow clients to alter their own objects without any further priviliges. i.e. this allows clients to kill and lock their own sessions without involving PK.
* logind: tell Coverity that we knowingly ignore mkdir()'s return valueLennart Poettering2015-02-10
|
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* remove unused variablesThomas Hindoe Paaboel Andersen2015-02-02
|
* logind: handle closing sessions over daemon restartsMartin Pitt2015-01-28
| | | | | | | | | | | | | | | | | | | | | | It may happen that you have several sessions with the same VT: - Open a session c1 which leaves some processes around, and log out. The session will stay in State=closing and become Active=no. - Log back in on the same VT, get a new session "c2" which is State=active and Active=yes. When restarting logind after that, the first session that matches the current VT becomes Active=yes, which will be c1; c2 thus is Active=no and does not get the usual polkit/device ACL privileges. Restore the "closing" state in session_load(), to avoid treating all restored sessions as State=active. In seat_active_vt_changed(), prefer active sessions over closing ones if more than one session matches the current VT. Finally, fix the confusing comment in session_load() and explain it a bit better. https://launchpad.net/bugs/1415104
* logind: chown+chmod /run/user/$UID if mount(tmpfs) fails with EPERMChristian Seiler2015-01-27
| | | | | | | | | | | In containers without CAP_SYS_ADMIN, it is not possible to mount tmpfs (or any filesystem for that matter) on top of /run/user/$UID. Previously, logind just failed in such a situation. Now, logind will resort to chown+chmod of the directory instead. This allows logind still to work in those environments, although without the guarantees it provides (i.e. users not being able to DOS /run or other users' /run/user/$UID space) when CAP_SYS_ADMIN is available.
* logind: remove per-user runtime dir again if setup failsChristian Seiler2015-01-27
| | | | | | | | | If setup of per-user runtime dir fails, clean up afterwards by removing the directory before returning from the function, so we don't leave the directory behind. If this is not done, the second time the user logs in logind would assume that the directory is already set up, even though it isn't.
* logind: fix sd_eviocrevoke ioctl callPeter Hutterer2015-01-22
| | | | | | | | If the third argument is non-null, the kernel will always error out with EINVAL and devices won't get revoked. Reported-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tmpfiles: add 'a' type to set ACLsZbigniew Jędrzejewski-Szmek2015-01-22
|
* Assorted format fixesZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | Types used for pids and uids in various interfaces are unpredictable. Too bad.
* bus: use EUID over UID and fix unix-credsDavid Herrmann2015-01-18
| | | | | | | | | | | | | | | | | | | | | Whenever a process performs an action on an object, the kernel uses the EUID of the process to do permission checks and to apply on any newly created objects. The UID of a process is only used if someone *ELSE* acts on the process. That is, the UID of a process defines who owns the process, the EUID defines what privileges are used by this process when performing an action. Process limits, on the other hand, are always applied to the real UID, not the effective UID. This is, because a process has a user object linked, which always corresponds to its UID. A process never has a user object linked for its EUID. Thus, accounting (and limits) is always done on the real UID. This commit fixes all sd-bus users to use the EUID when performing privilege checks and alike. Furthermore, it fixes unix-creds to be parsed as EUID, not UID (as the kernel always takes the EUID on UDS). Anyone using UID (eg., to do user-accounting) has to fall back to the EUID as UDS does not transmit the UID.
* logind: hide 'self' links if not availableDavid Herrmann2015-01-18
| | | | | | | If the caller does not run in a session/seat or has no tracked user, hide the /org/freedesktop/login1/.../self links in introspection data. Otherwise, "busctl tree org.freedesktop.login1" tries to query those nodes even though it cant.
* loginctl: fix misuse compound literalsLennart Poettering2015-01-14
| | | | | The lifetime of compound literals is bound to the local scope, we hence cannot refernce them outside of it.
* loginctl: make session/user arguments optional for a number commands, and ↵Lennart Poettering2015-01-09
| | | | | | | | imply calling session/user instead This turns "lock-session", "activate", "unlock-session", "enable-linger", "disable-linger" into commands that take no argument, optionally in which case the callers session/user is implied.
* logind: unify how we cast between uid_t and pointers for hashmap keysLennart Poettering2015-01-09
|
* logind: when a bus call is done on a session, user or seat, optionally ↵Lennart Poettering2015-01-09
| | | | | | | | | | determine them from the caller credentials More specifically, if an operation is requested on a session with an empty name, the caller's session is used. If an operation is requested on a seat with an empty name, the seat of the caller's session is used. Finally, if an operation on the user with UID -1 is requested, the user of the client's session is used (and not the UID of the client!).
* logind: include "self" object links in dbus introspectionLennart Poettering2015-01-09
| | | | Makes "busctl introspect" a lot more fun.
* loginctl: make "loginctl session-status" without session ID show the ↵Lennart Poettering2015-01-09
| | | | | | caller's session status Similar for user-status and seat-status.
* loginctl: port to generic verbs.h APILennart Poettering2015-01-08
|
* systemctl,loginctl: start polkit agent for all polkit enabled operationsLennart Poettering2015-01-08
|
* loginctl: show the 10 most recent log user/session log lines in "loginctl ↵Lennart Poettering2015-01-08
| | | | user-status" and "loginctl session-status"
* Remove "to allow" from policy messagesZbigniew Jędrzejewski-Szmek2015-01-01
| | | | | It carries no additional information and forces a passive sentence structure which is longer and harder to parse.
* machined: ignore spurious errorLennart Poettering2014-12-29
|
* tmpfiles: add new line type 'v' for creating btrfs subvolumesLennart Poettering2014-12-28
|
* loginctl: reindent --help textLennart Poettering2014-12-26
|
* loginctl: add more --help sectionsLennart Poettering2014-12-26
|
* pam_systemd: remove spurious include of <sys/capability.h>Filipe Brandenburger2014-12-25
| | | | | | It does not use any functions or constants from libcap directly. Tested that "pam_systemd.la" builds cleanly and works after this change.
* logind: remove spurious include of <sys/capability.h>Filipe Brandenburger2014-12-25
| | | | | | | | | | They do not use any functions from libcap directly. The CAP_* constants in use through these files come from "missing.h" which will import <linux/capability.h> and complement it with CAP_* constants not defined by the current kernel headers. The "missing.h" header is imported through "util.h" which gets imported in "logind.h". Tested that "systemd-logind" builds cleanly and works after this change.
* sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering2014-12-24
| | | | | | | Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
* build-sys: move core/build.h → shared/build.hLennart Poettering2014-12-23
| | | | | | | | After all, pretty much all our tools include it, and it should hence be shared. Also move sysfs-show.h from core/ to login/, since it has no point to exist in core.
* use correct format typesThomas Hindoe Paaboel Andersen2014-12-11
|
* treewide: correct spacing near eol in code commentsTorstein Husebø2014-12-11
|
* sd-bus: move common errors src/shared/bus-errors.h → ↵Lennart Poettering2014-12-10
| | | | | | src/libsystemd/sd-bus/bus-common-errors.h Stuff in src/shared/ should not use stuff from src/libsystemd/ really.
* tests: use assert_se instead of assertRonny Chevalier2014-11-30
| | | | Otherwise they can be optimized away with -DNDEBUG
* delta: diff returns 1 when files differ, ignore thisZbigniew Jędrzejewski-Szmek2014-11-29
| | | | https://bugs.debian/org/771397
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* sd-bus: rename default bus address constants, they aren't "paths" but ↵Lennart Poettering2014-11-28
| | | | "addresses"
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.