summaryrefslogtreecommitdiff
path: root/src/login
Commit message (Collapse)AuthorAge
...
* logind: open device if neededLennart Poettering2018-05-30
| | | | Fixes: #8291
* logind: cast away return value we don't care aboutLennart Poettering2018-05-30
|
* logind: voidify a function we never check the return value ofLennart Poettering2018-05-30
|
* rules: add a missing comma in 70-uaccess.rules since it improves readabilityFranck Bui2018-05-30
| | | | | | | | | | | rule-syntax-check.py failed with the following error: $ ./test/rule-syntax-check.py ./src/login/70-uaccess.rules Invalid line ./src/login/70-uaccess.rules:31: SUBSYSTEM=="sound", TAG+="uaccess" OPTIONS+="static_node=snd/timer", OPTIONS+="static_node=snd/seq" clause: TAG+="uaccess" OPTIONS+="static_node=snd/timer" The comma is actually optional but the script makes it mandatory which seems a good thing since it improves readability.
* logind: make sure we don't trip up on half-initialized session devicesLennart Poettering2018-05-30
| | | | Fixes: #8035
* logind: check file is device node before using .st_rdevLennart Poettering2018-05-30
|
* logind: let's pack a few struct fields we can packLennart Poettering2018-05-30
|
* logind: fd 0 is a valid fdLennart Poettering2018-05-30
|
* logind: let's reduce one level of indentationLennart Poettering2018-05-30
|
* logind: propagate the right error, don't make up ENOMEMLennart Poettering2018-05-30
|
* logind: rework sd_eviocrevoke()Lennart Poettering2018-05-30
| | | | | Let's initialize static variables properly and get rid of redundant variables.
* logind: trivial improvementsLennart Poettering2018-05-30
| | | | | Just some addition whitespace, some additional assert()s, and removal of redundant variables.
* login: fix user@.service case, so we don't allow nested sessions (#8051)Alan Jenkins2018-05-30
| | | | | | | | | | | | | | > logind sessions are mostly bound to the audit session concept, and audit > sessions remain unaffected by "su", in fact they are defined to be > "sealed off", i.e. in a way that if a process entered a session once, it > will always stay with it, and so will its children, i.e. the only way to > get a new session is by forking off something off PID 1 (or something > similar) that never has been part of a session. The code had a gap. user@.service is a special case PAM session which does not create a logind session. Let's remember to check for it. Fixes #8021
* nologin: extend the /run/nologin descriptions a bit (#8244)Lennart Poettering2018-05-30
| | | | | | | | | | | | This is an attempt to improve #8228 a bit, by extending the /run/nologin a bit, but still keeping it somewhat brief. On purpose I used the vague wording "unprivileged user" rather than "non-root user" so that pam_nologin can be updated to disable its behaviour for members of the "wheel" group one day, and our messages would still make sense. See #8228.
* tree-wide: reopen log when we need to log in FORK_CLOSE_ALL_FDS childrenLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | In a number of occasions we use FORK_CLOSE_ALL_FDS when forking off a child, since we don't want to pass fds to the processes spawned (either because we later want to execve() some other process there, or because our child might hang around for longer than expected, in which case it shouldn't keep our fd pinned). This also closes any logging fds, and thus means logging is turned off in the child. If we want to do proper logging, explicitly reopen the logs hence in the child at the right time. This is particularly crucial in the umount/remount children we fork off the shutdown binary, as otherwise the children can't log, which is why #8155 is harder to debug than necessary: the log messages we generate about failing mount() system calls aren't actually visible on screen, as they done in the child processes where the log fds are closed.
* Add some handling to remaining unlinkat callsZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | | | | | Coverity now started warning about this ("Calling unlinkat without checking return value (as is done elsewhere 12 out of 15 times).", and it is right: most of the time we should at list print a log message so people can figure out something is wrong when this happens. v2: - use warning level in journald too (this is unlikely to happen ever, so it should be safe to something that is visible by default).
* login,user-sessions: always warn when we fail to remove nologin fileZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | This usually is very annoying to users who then cannot log in, so make sure we always warn if that happens (selinux, or whatever other reason). This reverts a790812cb349c5cef95d1b4a20fc80ca08d3a145.
* meson: drop unnecessary "transformation" of policy filesZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | Those files don't contain any @variables@, so the configuration step was just copying them to build/. Let's avoid that, and fix their suffixes while at it.
* Gettextize policy filesGunnar Hjalmarsson2018-05-30
| | | | | | | * Don't merge translations into the files * Add gettext-domain="systemd" to description and message Closes #8162, replaces #8118.
* logind: change check_gc to may_gc everywhereZbigniew Jędrzejewski-Szmek2018-05-30
|
* tree-wide: use path_hash_ops instead of string_hash_ops whenever we key by a ↵Lennart Poettering2018-05-30
| | | | | | path Let's make use of our new hash_ops!
* Suspend on lid close based on power status. (#8016)Simon Fowler2018-05-30
| | | | | | | | This change adds support for controlling the suspend-on-lid-close behaviour based on the power status as well as whether the machine is docked or has an external monitor. For backwards compatibility the new configuration file variable is ignored completely by default, and must be set explicitly before being considered in any decisions.
* login/meson.build: require ACL for uaccess rulesAndrew Jeddeloh2018-05-30
| | | | | Don't install udev rules that requires the uaccess builtin if systemd is being built without the uaccess builtin.
* login/meson.build: require ACL for uaccess rulesAndrew Jeddeloh2018-05-30
| | | | | Don't install udev rules that requires the uaccess builtin if systemd is being built without the uaccess builtin.
* coccinelle: O_NDELAY → O_NONBLOCKLennart Poettering2018-05-30
| | | | | | Apparently O_NONBLOCK is the modern name used in most documentation and for most cases in our sources. Let's hence replace the old alias O_NDELAY and stick to O_NONBLOCK everywhere.
* log: minimize includes in log.hLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | log.h really should only include the bare minimum of other headers, as it is really pulled into pretty much everything else and already in itself one of the most basic pieces of code we have. Let's hence drop inclusion of: 1. sd-id128.h because it's entirely unneeded in current log.h 2. errno.h, dito. 3. sys/signalfd.h which we can replace by a simple struct forward declaration 4. process-util.h which was needed for getpid_cached() which we now hide in a funciton log_emergency_level() instead, which nicely abstracts the details away. 5. sys/socket.h which was needed for struct iovec, but a simple struct forward declaration suffices for that too. Ultimately this actually makes our source tree larger (since users of the functionality above must now include it themselves, log.h won't do that for them), but I think it helps to untangle our web of includes a tiny bit. (Background: I'd like to isolate the generic bits of src/basic/ enough so that we can do a git submodule import into casync for it)
* Comment the fact that some tools need to termintate their bus connect firstFranck Bui2018-05-30
|
* Revert "tree-wide: use _cleanup_(sd_bus_flush_close_unrefp) at various ↵Franck Bui2018-05-30
| | | | | | | | | | | appropriate places" This reverts commit 0b3c84eb7da3a8c28ac248a68228f6a7edbb2e19. The removal of _cleanup_() usages was done on purpose, see cf647b69baee4c478d3909c327e3d917e1563f44. Fixes: #3543
* logind: fix user_object_find()Lennart Poettering2018-05-30
| | | | | | | The logic was completely borked since e4d2984bf8514ab576a66d5ac1f1cde746bb32a3, correct that. CID #1384234
* tree-wide: make the Subscribe() method calls asynchronous tooLennart Poettering2018-05-30
|
* sd-bus: drop references to legacy /var/run D-Bus socketLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | Let's directly reference /run instead, so that we can work without /var being around, or with /var/run being incorrectly set up. Note that we keep the old socket path in place when referencing the system bus of containers, as they might be foreign operating systems, that still don't have adopted /run, and where it makes sense to use the standardized name instead. On local systems, we insist on /run being set up properly however, hence this limitation does not apply. Also, get rid of the UNIX_SYSTEM_BUS_ADDRESS and UNIX_USER_BUS_ADDRESS_FMT defines. They had a purpose when we still did kdbus, as we then had to support two different backends. But since that's gone, we don't need this indirection anymore, hence settle on a one define only.
* tree-wide: install matches asynchronouslyLennart Poettering2018-05-30
| | | | | | | | | Let's remove a number of synchronization points from our service startups: let's drop synchronous match installation, and let's opt for asynchronous instead. Also, let's use sd_bus_match_signal() instead of sd_bus_add_match() where we can.
* tree-wide: make name requesting asynchronous in all our servicesLennart Poettering2018-05-30
| | | | | This optimizes service startup a bit, and makes it less prone to deadlocks.
* process-util: rework wait_for_terminate_and_warn() to take a flags parameterLennart Poettering2018-05-30
| | | | | | | | | | | | | This renames wait_for_terminate_and_warn() to wait_for_terminate_and_check(), and adds a flags parameter, that controls how much to log: there's one flag that means we log about abnormal stuff, and another one that controls whether we log about non-zero exit codes. Finally, there's a shortcut flag value for logging in both cases, as that's what we usually use. All callers are accordingly updated. At three occasions duplicate logging is removed, i.e. where the old function was called but logged in the caller, too.
* process-util: add another fork_safe() flag for enabling LOG_ERR/LOG_WARN loggingLennart Poettering2018-05-30
|
* tree-wide: introduce new safe_fork() helper and port everything overLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new safe_fork() wrapper around fork() and makes use of it everywhere. The new wrapper does a couple of things we previously did manually and separately in a safer, more correct and automatic way: 1. Optionally resets signal handlers/mask in the child 2. Sets a name on all processes we fork off right after forking off (and the patch assigns useful names for all processes we fork off now, following a systematic naming scheme: always enclosed in () – in order to indicate that these are not proper, exec()ed processes, but only forked off children, and if the process is long-running with only our own code, without execve()'ing something else, it gets am "sd-" prefix.) 3. Optionally closes all file descriptors in the child 4. Optionally sets a PR_SET_DEATHSIG to SIGTERM in the child, in a safe way so that the parent dying before this happens being handled safely. 5. Optionally reopens the logs 6. Optionally connects stdin/stdout/stderr to /dev/null 7. Debug logs about the forked off processes.
* logind: use free_and_replace in one spotZbigniew Jędrzejewski-Szmek2018-05-30
| | | | No functional change.
* logind: fix misleading messageZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | This message would also be emitted at boot for any user with linger enabled, so "logged in" is the wrong term to use.
* logind: simplify one conditionalZbigniew Jędrzejewski-Szmek2018-05-30
| | | | Don't bother with removing the directory if we didn't create it.
* Move /var/lib/systemd/linger to /var/lib/elogind/.Sven Eden2018-04-23
|
* Reverted accidential renaming of /run/systemd to /run/elogind. Applications ↵Sven Eden2018-04-23
| | | | using elogind as a drop-in replacement expect the first.
* check_tree.pl: Added *.sym and *.in file handling.Sven Eden2018-03-26
|
* Prep v236 : Add missing SPDX-License-Identifier (5/9) src/loginSven Eden2018-03-26
|
* Prep v236: Apply missing upstream updates to the build systemSven Eden2018-03-13
|
* user-util: add new uid_is_system() helperLennart Poettering2017-12-02
| | | | | | | This adds uid_is_system() and gid_is_system(), similar in style to uid_is_dynamic(). That a helper like this is useful is illustrated by the fact that test-condition.c didn't get the check right so far, which this patch fixes.
* *: fix some inconsistent control statement styleVito Caputo2017-12-01
|
* logind: fix sysfs change trigger codeLennart Poettering2017-11-22
| | | | | We can't create files in sysfs, hence don't bother. Also if we ignore the return value, do so explicitly by casting to void.
* logind: use the new FDSTOREREMOVE=1 sd_notify() messageLennart Poettering2017-11-13
| | | | | | | Let's explicitly tell PID 1 that we don't need an fd anymore, instead of relying exclusively on POLLERR/POLLHUP for it to be removed. Fixes: #6908
* logind: make sure we don't acces m->action_what if it's not initialized (#7475)Lennart Poettering2017-11-27
| | | | Fixes: #7466
* tree-wide: adjust fall through comments so that gcc is happyShawn Landden2017-11-19
| | | | | | | | Distcc removes comments, making the comment silencing not work. I know there was a decision against a macro in commit ec251fe7d5bc24b5d38b0853bc5969f3a0ba06e2