summaryrefslogtreecommitdiff
path: root/src/login
Commit message (Collapse)AuthorAgeFilesLines
...
* logind: minor whitespace fixLennart Poettering2022-03-091-7/+7
|
* logind: rename ActionTableItem → HandleActionDataLennart Poettering2022-03-095-19/+19
| | | | | | | | It stores meta-info about various HandleActions, hence let's name it after that. The fact that it can be seen as stored inside some form of a table is an implementation detail of logind-action.c, and should not leak into other modules, hence let's focus on what it is, not how it is stored.
* logind: replace handle_action_valid() macro by inline functionLennart Poettering2022-03-091-2/+4
| | | | | | The old macro will double evaluation and has no protection against operator precedence issues. Let's fix that by using an inline func instead, which also gives us typesafety.
* logind: use mfree instead of freepLudwig Nussel2022-03-071-2/+2
|
* Merge pull request #22644 from keszybz/meson-no-splitZbigniew Jędrzejewski-Szmek2022-03-031-44/+42
|\ | | | | Use normal lists in meson instead of splitting on whitespace
| * meson: move files' closing brace to separate lineZbigniew Jędrzejewski-Szmek2022-03-031-3/+6
| |
| * meson: do not use split() in file listsZbigniew Jędrzejewski-Szmek2022-03-021-44/+39
| | | | | | | | | | | | | | | | | | | | | | The approach to use '''…'''.split() instead of a list of strings was initially used when converting from automake because it allowed identical blocks of lines to be used for both, making the conversion easier. But over the years we have been using normal lists more and more, especially when there were just a few filenames listed. This converts the rest. No functional change.
* | logind: load scheduled shutdown on restartLudwig Nussel2022-02-284-67/+148
| | | | | | | | | | Make sure logind doesn't forget about a scheduled shutdown, even if it gets restarted eg due to a package update.
* | logind: fix handle_action_valid()Ludwig Nussel2022-02-282-2/+2
|/
* tree-wide: use timestamp_is_set() moreLennart Poettering2022-02-222-3/+3
|
* logind: fix bool/int confusion for KillUserProcesses bus propertyLennart Poettering2022-02-161-1/+1
| | | | | | | sd-bus for compat with old C expects "int" for booleans. Internally we prefer to use C99 "bool" however. When pointing a pointer to it, we need to handle the fact that they are typically differently sized, hence use te right accessors for it.
* logind: fix internal types used for EnableWallMessagesLennart Poettering2022-02-162-5/+5
| | | | | | | | The value is used as a boolean, but stored in an unsigned. It's exposed with sd-bus default boolean handling which however expects a (signed) int. Let's clear this up, and use "bool" for this everywhere in non-local scope, and make sure that when we pass it to sd-bus we properly pass an "int".
* Merge pull request #22487 from poettering/bootspec-source-flagsYu Watanabe2022-02-151-3/+3
|\ | | | | bootctl: show all discovered entries, but show state + type in details
| * bootctl: show more information about boot entry state in listLennart Poettering2022-02-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's improve display of boot entries and show what type they have (i.e. boot loader spec type 1, or type 2, or auto-discovered or reported by boot loader), and in particular mark entries the boot loader discovered but we can't find (i.e. that likely vanished, or possibly couldn't be found due to a misconfiguration) and that the boot loader didn't find but we see (which are new, or possibly also the result of misconfiguraiton). This is supposed to be a replacement for #22161, but instead of hiding vanished entries, highlights them, which I think is more appropriate for a low-level tool such bootctl. Replaces: #22161 #22398
| * Revert "bootctl: Ignore boot entries (continue #22041)"Lennart Poettering2022-02-141-2/+2
| |
* | logind: more verbose struct initializationLudwig Nussel2022-02-141-94/+90
| |
* | logind: increase max wall message length to 4096Ludwig Nussel2022-02-141-8/+13
| |
* | logind: style fixesLudwig Nussel2022-02-143-19/+9
| |
* | logind: add handle enum to structLudwig Nussel2022-02-144-12/+18
|/ | | | | Avoid pointer arithmetic at the expense of repeating the enum value in the struct.
* login: typo fixMichael Biebl2022-02-081-1/+1
|
* Merge pull request #22300 from yuwata/bus-fix-error-handlingLuca Boccassi2022-01-311-3/+7
|\ | | | | tree-wide: fix bus method error handling
| * login: use bus_error_message() at one more placeYu Watanabe2022-01-301-3/+7
| |
* | Merge pull request #21838 from lnussel/logind-refactorYu Watanabe2022-01-318-333/+358
|\ \ | |/ |/| Logind shutdown refactor
| * logind: refactorLudwig Nussel2022-01-258-338/+306
| | | | | | | | | | | | | | Avoid hardcoded strings and string compares related to shutdown actions. Instead put everything into a common structure. Reuse existing HandleAction as index since it's already exposed as property for the button handlers.
| * logind: require polkit auth for cancelling shutdownsLudwig Nussel2022-01-251-2/+32
| |
| * logind: fix wall messages for direct shutdown callsLudwig Nussel2022-01-251-0/+14
| | | | | | | | | | | | | | | | The wall mechanism uses the scheduled_shutdown_type to determine what message to send so it needs to be filled in also for the cases that call for shutdown without schedule. It's really a hackish way. The overall code needs refacturing.
| * logind: enable wall messages by defaultLudwig Nussel2022-01-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | Something calling directly into the dbus interface to request a shutdown may not bother turning wall messages on explicitly. This has the convenient side effect that no separate polkit auth is required to turn on wall messages. Was annoying as having a wall message is the default behavior of the commandline tools. Now it's the other way around ie eg systemctl reboot --no-wall requires auth to explicitly turn off the wall message.
| * logind: fix wall message for immediate shutdownsLudwig Nussel2022-01-252-19/+31
| | | | | | | | | | An elapse time of zero means NOW which should trigger a wall message.
* | logind.conf: Fix name of option: RuntimeDirectoryInodes -> ↵Arfrever Frehtes Taifersar Arahesis2022-01-271-1/+1
| | | | | | | | RuntimeDirectoryInodesMax
* | user-runtime-dir: error out immediately if mkdir failsZbigniew Jędrzejewski-Szmek2022-01-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We try to create two directories: /run/user and /run/user/<UID>. For the first we check the return value and error out if creation fails. But for the second one we continued based on the assumption that the subsequent mount will immediately fail anyway. But this has the disadvantage that we get a somewhat confusing error message: janv. 23 22:04:31 nsfw systemd-user-runtime-dir[1660]: Failed to mount per-user tmpfs directory /run/user/1000: No such file or directory Let's instead fail immediately with a precise error message. For https://bugzilla.redhat.com/show_bug.cgi?id=2044100.
* | bootctl: removed unused parameter only_autoGoffredo Baroncelli2022-01-181-2/+2
|/ | | | | | | | Remove the parameter 'only_auto' from the function boot_entries_augment_from_loader() because each caller set it always to true. Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
* Merge pull request #22092 from keszybz/docs-linksZbigniew Jędrzejewski-Szmek2022-01-121-1/+1
|\ | | | | Add more doc pages, adjust links, add explanatory headers to examples and relax license to CC-0
| * policy files: adjust landing page linkZbigniew Jędrzejewski-Szmek2022-01-121-1/+1
| |
* | meson: Use files() for testsJan Janssen2022-01-111-3/+3
|/ | | | | | Not having to provide the full path in the source tree is much nicer and the produced lists can also be used anywhere in the source tree.
* logind: do not propagate error in delayed actionZbigniew Jędrzejewski-Szmek2022-01-051-6/+2
| | | | | | | | | | | If the action failed, we should log about the issue, and continue. Exiting would bring the graphical session down, which of course is not appreciated by users. As documented in previous commits, a non-negative return from the callback doesn't matter, so the callback is simplified a bit. Fixes #21991.
* logind: Use new macrosNishal Kulkarni2021-12-194-508/+392
| | | | | | Migrate logind to use the new macros to declare a D-Bus method or signal. Replaced SD_BUS_METHOD_WITH_NAMES with SD_BUS_METHOD_WITH_ARGS. Replaced SD_BUS_SIGNAL_WITH_NAMES with SD_BUS_SIGNAL_WITH_ARGS.
* meson: stop building out convenience libraries by defaultZbigniew Jędrzejewski-Szmek2021-12-161-1/+2
| | | | | | | | | | | | | | | | | The meson default for static_library() are: build_by_default=true, install=false. We never interact with the static libraries, and we only care about them as a stepping-stone towards the installable executables or libraries. Thus let's only build them if they are a dependency of something else we are building. While at it, let's drop install:false, since this appears to be the default. This change would have fixed the issue with lib_import_common failing to build too: we wouldn't attempt to build it. In practice this changes very little, because we generally only declare static libraries where there's something in the default target that will make use of them. But it seems to be a better pattern to set build_by_default to false.
* Define FOREACH_DIRENT through FOREACH_DIRENT_ALLZbigniew Jędrzejewski-Szmek2021-12-151-5/+0
| | | | As in the previous commit, 'de' is used as the iterator variable name.
* tree-wide: make FOREACH_DIRENT_ALL define the iterator variableZbigniew Jędrzejewski-Szmek2021-12-151-4/+1
| | | | | | | | | The variable is not useful outside of the loop (it'll always be null after the loop is finished), so we can declare it inline in the loop. This saves one variable declaration and reduces the chances that somebody tries to use the variable outside of the loop. For consistency, 'de' is used everywhere for the var name.
* hwdb: Allow console users access to rfkillBastien Nocera2021-12-061-0/+3
| | | | | | | This rule has been shipped in Fedora's gnome-bluetooth package for 10 years and is used by the gnome-settings-daemon rfkill plugin (used by gnome-bluetooth, gnome-shell, and gnome-control-center) to monitor and change software rfkill switch settings.
* pam_systemd: Check also abstract socket for X11Topi Miettinen2021-11-281-23/+37
| | | | | | | | | | | | | | | It seems that `pam_systemd` was the only thing left that wanted to use sockets in file system path `/tmp/.X11-unix/X*`. X11 apps actually prefer using the abstract socket version. This allows running Xserver with `-nolisten tcp -nolisten unix`, which makes the server only listen to an abstract socket. Also in my setup, Xserver is running as a separate system service instead of starting from display manager service, and now `PrivateTmp=yes` can be used for both. The file system of the display manager service is inherited by user apps and now their `/tmp` will be separate from `/tmp` of PID1 namespace as well as `/tmp` of Xserver.
* shared: clean up mkdir.h/label.h situationLennart Poettering2021-11-167-6/+7
| | | | | | | | | | Previously the mkdir_label() family of calls was implemented in src/shared/mkdir-label.c but its functions partly declared ins src/shared/label.h and partly in src/basic/mkdir.h (!!). That's weird (and wrong). Let's clean this up, and add a proper mkdir-label.h matching the .c file.
* tree-wide: use new RET_NERRNO() helper at various placesLennart Poettering2021-11-164-25/+6
|
* shared: split out UID allocation range stuff from user-record.hLennart Poettering2021-11-131-0/+1
| | | | | | | | user-record.[ch] are about the UserRecord JSON stuff, and the UID allocation range stuff (i.e. login.defs handling) is a very different thing, and complex enough on its own, let's give it its own c/h files. No code changes, just some splitting out of code.
* logind: downgrade message about /run/utmp missing to LOG_DEBUGLennart Poettering2021-11-091-1/+3
| | | | | This isn't really anything to really complain about, let's debug log about this, and continue quietly as if utmp was empty.
* build: preserve correct mode when generating files via jinja2Christian Brauner2021-11-081-2/+1
| | | | | | | | | When using "capture : true" in custom_target()s the mode of the source file is not preserved when the generated file is not installed and so needs to be tweaked manually. Switch from output capture to creating the target file and copy the permissions from the input file. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
* Merge pull request #20138 from keszybz/coding-style-variable-declsLuca Boccassi2021-11-054-17/+24
|\ | | | | A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
| * Make pager_open() return voidZbigniew Jędrzejewski-Szmek2021-11-032-8/+8
| |
| * tree-wide: warn when sd_notify fails with READY=1 or FDSTOREREMOVE=1Zbigniew Jędrzejewski-Szmek2021-11-032-9/+16
| | | | | | | | | | | | | | | | Most sd_notify() calls are like log_info() — the result is only informative and if they fail, it's best ignore this. But if a call with READY=1 fails, the unit may enter a failed state, so we should warn about this. Similarly for FSTOREREMOVE=1: the manager may be left with a stale fd, at least wasting resources.
* | tree-wide: do not print hint about -M if -M is already usedZbigniew Jędrzejewski-Szmek2021-11-042-2/+2
|/ | | | | | | | (Or when -H is used, since -H and -M are incompatible.) Note that the slightly unusual form with separate boolean variables (hint_vars, hint_addr) instead of e.g. a const char* variable to hold the message, because this way we don't trigger the warning about non-literal format.