summaryrefslogtreecommitdiff
path: root/src/login
Commit message (Collapse)AuthorAgeFilesLines
* logind: use free_and_strdup() where appropriateLennart Poettering2020-12-091-11/+1
|
* logind: fix closing of button input devicesLennart Poettering2020-12-091-12/+6
| | | | | | | | | | | | | | | | | | | This is a fix of #17751. Specifically: 1. Sort #include headers again 2. Remove tabs, as per coding style 3. Don't install fds in half-initialized objects 4. Use asynchronous_close() everywhere That all said: Quit frankly, I am not convinced we should do all this at all. If close()ing of these input devices is really that slow, then this should probably be fixed in the kernel, not worked around in userspace like this.
* Update logind-button.cnihilix-melix2020-11-281-3/+6
|
* meson: add option to skip installing to $sysconfdirJörg Thalheim2020-11-121-2/+4
| | | | | | | | | | | | | | | | | | | | | This is useful for development where overwriting files out side the configured prefix will affect the host as well as stateless systems such as NixOS that don't let packages install to /etc but handle configuration on their own. Alternative to https://github.com/systemd/systemd/pull/17501 tested with: $ mkdir inst build && cd build $ meson \ -Dcreate-log-dirs=false \ -Dsysvrcnd-path=$(realpath ../inst)/etc/rc.d \ -Dsysvinit-path=$(realpath ../inst)/etc/init.d \ -Drootprefix=$(realpath ../inst) \ -Dinstall-sysconfdir=false \ --prefix=$(realpath ../inst) .. $ ninja install
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-0950-50/+50
|
* tree-wide: cast result of get_process_comm() to (void) where we ignore itLennart Poettering2020-10-271-1/+1
|
* Merge pull request #17390 from keszybz/logind-notifications-and-linksYu Watanabe2020-10-202-39/+28
|\ | | | | Fix sd_notify() usage in various daemons and update some documentation links
| * logind: minor indentation adjustmentsZbigniew Jędrzejewski-Szmek2020-10-192-26/+24
| |
| * logind: use notify_start/notify_on_cleanupZbigniew Jędrzejewski-Szmek2020-10-191-13/+4
| | | | | | | | Logging about the pid is dropped, pid1 does that better.
* | sd-bus: add custom return code when $XDG_RUNTIME_DIR is not setZbigniew Jędrzejewski-Szmek2020-10-141-1/+1
|/ | | | | | | We would return ENOENT, which is extremely confusing. Strace is not helpful because no *file* is actually missing. So let's add some logs at debug level and also use a custom return code. Let all user-facing utilities print a custom error message in that case.
* Merge pull request #17302 from keszybz/fix-inhibitorsLennart Poettering2020-10-122-1/+4
|\ | | | | Fix inhibitors
| * logind: fix taking of inhibitorsZbigniew Jędrzejewski-Szmek2020-10-101-0/+1
| | | | | | | | Ooops made in 0a9bf7fa593682326f1c5c2d7ec3d29a9d59e5cb.
| * logind: print what action is ignoredZbigniew Jędrzejewski-Szmek2020-10-101-1/+3
| | | | | | | | | | | | | | | | | | | | My logs have lines like this: Oct 10 09:38:38 krowka systemd-logind[1889]: External (2) displays connected. Oct 10 09:38:38 krowka systemd-logind[1889]: Refusing operation, as it is turned off. Without some hint *what* operation is ignored, this is not very informative. (I remember this came up before, but I don't remember why we didn't change this log line back then...)
* | tree-wide: assorted coccinelle fixesFrantisek Sumsal2020-10-092-4/+3
|/
* loginctl: add -P as short for --value --property=Ronan Pigott2020-09-301-1/+6
|
* Merge pull request #17143 from keszybz/late-exec-resolution-altLennart Poettering2020-09-241-2/+1
|\ | | | | Late exec resolution (subset)
| * Add CLOSE_AND_REPLACE helperZbigniew Jędrzejewski-Szmek2020-09-181-2/+1
| | | | | | | | | | | | Similar to free_and_replace. I think this should be uppercase to make it clear that this is a macro. free_and_replace should probably be uppercased too.
* | tree-wide: switch remaining mount() invocations over to mount_nofollow_verbose()Lennart Poettering2020-09-231-4/+5
| | | | | | | | | | | | (Well, at least the ones where that makes sense. Where it does't make sense are the ones that re invoked on the root path, which cannot possibly be a symlink.)
* | logind: use _cleanup_ in one more placeZbigniew Jędrzejewski-Szmek2020-09-221-16/+6
|/
* tree-wide: don't needlessly negate error number passed to bus_error_message()Lennart Poettering2020-09-141-8/+8
| | | | | | Like it's customary in our codebase bus_error_message() internally takes abs() of the passed error anyway, hence no need to explicitly negate it. We mostly got this right, but in too many cases we didn't. Fix that.
* logind: make sure when we are explicitly asked to terminate ↵Lennart Poettering2020-09-114-10/+10
| | | | | | | | | | session/user/seat to use "replace" job mode Otherwise our request will possibly fail if something else is already enqeued, but given this is an explicit user request, let's not allow things to fail. Fixes: #16702
* logind: clarify what the second argument of session_stop() means when calling itLennart Poettering2020-09-115-7/+7
|
* logind: minor simplificationLennart Poettering2020-09-111-4/+3
|
* login: downgrade log level if the error will be ignoredYu Watanabe2020-09-102-3/+5
|
* logind: fix merge issueLennart Poettering2020-09-091-1/+1
| | | | | The two PRs #16664 and #16635 individually passed CI, but when combined cannot build. Since both are merged now, let's fix that.
* login: Add KEY_RESTART handlingRobert Marko2020-09-099-7/+57
| | | | | | | KEY_RESTART is widely used in Linux to indicate device reboot. So lets handle it in the same fashion as KEY_POWER. Signed-off-by: Robert Marko <robert.marko@sartura.hr>
* logind.conf: document UserStopDelaySec in logind.confFranck Bui2020-09-091-0/+1
|
* Merge pull request #16635 from keszybz/do-not-for-each-wordLennart Poettering2020-09-092-14/+23
|\ | | | | Drop FOREACH_WORD
| * logind: use extract_first_word()Zbigniew Jędrzejewski-Szmek2020-09-092-14/+23
| |
* | tree-wide: define iterator inside of the macroZbigniew Jędrzejewski-Szmek2020-09-0810-48/+26
|/
* logind: always check current tag list before using a deviceLennart Poettering2020-09-013-7/+9
|
* logind: only apply ACLs for device currently tagged with "uaccess"Lennart Poettering2020-09-011-0/+4
| | | | | | | This is about security, hence let's be particularly careful here: only devices currenlty tagged with "uaccess" will get ACL management, and it's not sufficient if they once were (though that is used for filtering).
* tree-wide: drop pointless zero initialization (#16900)fangxiuning2020-08-302-2/+2
|
* login/logind: Include sys/stat.h for struct stat usageIkey Doherty2020-08-281-0/+1
| | | | | | | | We need to include `<sys/stat.h>` for usage of the `struct stat` in the Manager struct, much as we already include `<stdbool.h>` for C99 booleans. This helps alleviate another minor build failure on non-glibc systems.
* Replace gendered pronouns with gender neutral ones. (#16844)PhoenixDiscord2020-08-271-1/+1
|
* tree-wide: use sd_bus_error_has_names() in more placesZbigniew Jędrzejewski-Szmek2020-08-241-11/+11
|
* tree-wide: fix spelling of "fallback"Zbigniew Jędrzejewski-Szmek2020-08-201-1/+1
| | | | | | Similarly to "setup" vs. "set up", "fallback" is a noun, and "fall back" is the verb. (This is pretty clear when we construct a sentence in the present continous: "we are falling back" not "we are fallbacking").
* Merge pull request #16543 from poettering/nspawn-run-hostLennart Poettering2020-08-201-3/+2
|\ | | | | nspawn: /run/host/ tweaks
| * core: create per-user inaccessible node from the service managerLennart Poettering2020-08-201-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we'd create them from user-runtime-dir@.service. That has one benefit: since this service runs privileged, we can create the full set of device nodes. It has one major drawback though: it security-wise problematic to create files/directories in directories as privileged user in directories owned by unprivileged users, since they can use symlinks to redirect what we want to do. As a general rule we hence avoid this logic: only unpriv code should populate unpriv directories. Hence, let's move this code to an appropriate place in the service manager. This means we lose the inaccessible block device node, but since there's already a fallback in place, this shouldn't be too bad.
| * nspawn,pid1: pass "inaccessible" nodes from cntr mgr to pid1 payload via ↵Lennart Poettering2020-08-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /run/host Let's make /run/host the sole place we pass stuff from host to container in and place the "inaccessible" nodes in /run/host too. In contrast to the previous two commits this is a minor compat break, but not a relevant one I think. Previously the container manager would place these nodes in /run/systemd/inaccessible/ and that's where PID 1 in the container would try to add them too when missing. Container manager and PID 1 in the container would thus manage the same dir together. With this change the container manager now passes an immutable directory to the container and leaves /run/systemd entirely untouched, and managed exclusively by PID 1 inside the container, which is nice to have clear separation on who manages what. In order to make sure systemd then usses the /run/host/inaccesible/ nodes this commit changes PID 1 to look for that dir and if it exists will symlink it to /run/systemd/inaccessible. Now, this will work fine if new nspawn and new pid 1 in the container work together. as then the symlink is created and the difference between the two dirs won't matter. For the case where an old nspawn invokes a new PID 1: in this case things work as they always worked: the dir is managed together. For the case where different container manager invokes a new PID 1: in this case the nodes aren't typically passed in, and PID 1 in the container will try to create them and will likely fail partially (though gracefully) when trying to create char/block device nodes. THis is fine though as there are fallbacks in place for that case. For the case where a new nspawn invokes an old PID1: this is were the (minor) incompatibily happens: in this case new nspawn will place the nodes in the /run/host/inaccessible/ subdir, but the PID 1 in the container won't look for them there. Since the nodes are also not pre-created in /run/systed/inaccessible/ PID 1 will try to create them there as if a different container manager sets them up. This is of course not sexy, but is not a total loss, since as mentioned fallbacks are in place anyway. Hence I think it's OK to accept this minor incompatibility.
* | user-runtime-dir: deal gracefully with missing logind propertiesLennart Poettering2020-08-201-5/+10
|/ | | | Fixes: #16685
* tree-wide: make use of new relative time events in sd-event.hLennart Poettering2020-07-282-12/+13
|
* logind: Fix org.freedesktop.login1.set-reboot-to-boot-loader-menu saving to ↵Hans de Goede2020-07-211-2/+2
| | | | | | | | | | | | | | | the wrong file in the non EFI case According to the docs, and to the org.freedesktop.login1.get-reboot-to-boot-loader-menu code, the (oneshot) boot-loader-menu timeout should be stored in /run/systemd/reboot-to-boot-loader-menu, but the set method was storing it in /run/systemd/reboot-to-loader-menu. This commit fixes this. Note that the fixed name also is a better match for the dbus call names and matches the related /run/systemd/reboot-to-boot-loader-entry structure, so fixing the set code, rather then the get code + docs seems like the right thing to do here.
* bus: use bus_log_connect_error to print error messagefangxiuning2020-07-211-1/+1
|
* Merge pull request #16385 from JackFangXN/masterLennart Poettering2020-07-082-4/+4
|\ | | | | table add table_log_xx_error()
| * table use table_log_print_error() instead of table_log_show_errorfangxiuning2020-07-082-2/+2
| |
| * table add table_log_sort_error()fangxiuning2020-07-082-2/+2
| |
| * table add table_log_show_error()fangxiuning2020-07-082-2/+2
| |
* | Merge pull request #16344 from keszybz/update-utmp-erofsLennart Poettering2020-07-061-16/+8
|\ \ | |/ |/| Make update-utmp not fail if it only fails to write wtmp records
| * Define _cleanup_ helper for setutxent()+endutxent()Zbigniew Jędrzejewski-Szmek2020-07-051-16/+8
| |