summaryrefslogtreecommitdiffstats
path: root/src/login (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #18616 from keszybz/argv-fuzzer-quick-fixLennart Poettering2021-02-161-3/+3
|\ | | | | fuzz-systemctl-parse-argv: avoid "leak" of bus object
| * tree-wide: return NULL from freeing functionsZbigniew Jędrzejewski-Szmek2021-02-161-3/+3
| | | | | | | | | | | | I started working on this because I wanted to change how DEFINE_TRIVIAL_CLEANUP_FUNC is defined. Even independently of that change, it's nice to make make things more consistent and predictable.
* | logind: Restore chvt as non-root user without polkitJoshua Watt2021-02-166-54/+44
|/ | | | | | | | | | | | | | | 4acf0cfd2f ("logind: check PolicyKit before allowing VT switch") broke the ability to write user sessions that run graphical sessions (e.g. weston/X11). This was partially amended in 19bb87fbfa ("login: allow non-console sessions to change vt") by changing the default PolicyKit policy so that non-root users with a session are again allowed to switch the VT. This makes the policy when PolKit is not enabled (as on many embedded systems) closer the default PolKit policy and allows launching graphical sessions as a non-root user. Closes #17473 Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
* systemctl,loginctl,machinectl: use a shared helper for arg_signalZbigniew Jędrzejewski-Szmek2021-02-141-8/+4
| | | | | I seems frivolous to yet another two -util.[ch] files, but the helper should be in shared/ and it doesn't seem to fit anywhere else.
* Merge pull request #11484 from keszybz/udevadm-error-logsYu Watanabe2021-02-105-13/+11
|\ | | | | Use real return codes in _from_string() functions
| * tree-wide: propagate error code from _from_string() functionsZbigniew Jędrzejewski-Szmek2021-02-101-4/+2
| | | | | | | | Now that we know we have something useful, no need to make an answer up.
| * tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-104-9/+9
| | | | | | | | | | | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
* | inhibit: cut off overly long "who" fieldsLennart Poettering2021-02-091-0/+1
|/ | | | | | | | systemd-inhibit when invoked with a command line will put the whole command line in the "who" field of the inhibitor lock. This can get extremely long for shell expressions, making the table "systemd-inhibit --list" shows ridiculously weirdly formatted. Let's put a limit on the column width: half of the screen, not more.
* Merge pull request #18375 from yuwata/cli-tools-also-read-kernel-command-lineZbigniew Jędrzejewski-Szmek2021-02-082-2/+2
|\ | | | | tree-wide: make CLI tools also read kernel command line when run as service
| * tree-wide: enable colorized logging for daemons when run in consoleYu Watanabe2021-01-312-2/+2
| | | | | | | | It may be useful when debugging daemons.
* | logind: simplify flags handling a bitLennart Poettering2021-02-031-12/+18
| | | | | | | | | | | | | | | | | | | | | | Let's split out the two codepaths a bit, and emphasize which ones it the new-style and which the old-style codepath, and let's clearly convert the params of the old-stye into the new style for further processing, so that the old style path is brief and isolated. No change in behaviour. Follow-up for: 8885fed4e3a52cf1bf105e42043203c485ed9d92
* | logind: Introduce RebootWithFlags and othersDeepak Rawat2021-02-021-14/+83
|/ | | | | Add new systemd-logind WithFlags version for Reboot and others. These methods add a unit64 parameter, with which can send additional control flags.
* tree-wide: Drop custom formatting for print() help messagesDaan De Meyer2021-01-312-11/+10
| | | | | | | | | | | | I think this formatting was originally used because it simplified adding new options to the help messages. However, these days, most tools their help message end with "\nSee the %s for details.\n" so the final line almost never has to be edited which eliminates the benefit of the custom formatting used for printf() help messages. Let's make things more consistent and use the same formatting for printf() help messages that we use everywhere else. Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
* tree-wide: add spdx header on all scripts and helpersZbigniew Jędrzejewski-Szmek2021-01-281-0/+1
| | | | | | Even though many of those scripts are very simple, it is easier to include the header than to try to say whether each of those files is trivial enough not to require one.
* logind: Use hashmap_ensure_putSusant Sahani2021-01-201-5/+4
|
* meson: move test or fuzzer definitions to relevant meson.build in subdirectoriesYu Watanabe2021-01-181-0/+14
|
* login: move src/login/logind-acl.[ch] -> src/shared/devnode-acl.[ch]Yu Watanabe2021-01-184-297/+1
| | | | | | The files are used by logind and udevd. And the functions in the files are not specific to logind, and quite general enough to move to libshared.
* Add install-sysconfdir=no-samples option for (non-)installation of sample ↵Josh Triplett2021-01-141-1/+1
| | | | | | | | | | | | | configs By default, systemd installs various sample configuration files containing commented-out defaults. Systems seeking to minimize the number of files in /etc may wish to install directories and configuration files that have semantic effects, but not install not commented-out sample configuration files. Turn install-sysconfdir into a multi-valued option, with a "no-samples" value to skip installing sample-only configuration files.
* 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).