summaryrefslogtreecommitdiff
path: root/src/shared
Commit message (Collapse)AuthorAgeFilesLines
* fileio: fileno() can realistically return -1Lennart Poettering2020-04-131-2/+4
| | | | | | | | | | | | | | An stdio FILE* stream usually refers to something with a file descriptor, but that's just "usually". It doesn't have to, when taking fmemopen() and similar into account. Most of our calls to fileno() assumed the call couldn't fail. In most cases this was correct, but in some cases where we didn't know whether we work on files or memory we'd use the returned fd as if it was unconditionally valid while it wasn't, and passed it to a multitude of kernel syscalls. Let's fix that, and do something reasonably smart when encountering this case. (Running test-fileio with this patch applied will remove tons of ioctl() calls on -1).
* Merge pull request #15377 from poettering/userdb-no-shadowZbigniew Jędrzejewski-Szmek2020-04-116-46/+79
|\ | | | | don't try to access shadow from logind
| * userdb: when doing client-side NSS look-ups optionally avoid shadow look-upsLennart Poettering2020-04-096-46/+79
| |
* | Merge pull request #15392 from keszybz/flag-helperZbigniew Jędrzejewski-Szmek2020-04-111-4/+1
|\ \ | | | | | | Flag setting helper and some other minor cleanups
| * | Add yet another tiny helper to manipulate flagsZbigniew Jędrzejewski-Szmek2020-04-101-4/+1
| | |
* | | bus: add sd_bus_message_new_method_call() helperVito Caputo2020-04-102-0/+12
| | | | | | | | | | | | adds BusLocator variant called bus_message_new_method_call()
* | | bus: s/BusAddress/BusLocator/Vito Caputo2020-04-102-38/+38
| | | | | | | | | | | | | | | Mechanical rename in response to https://github.com/systemd/systemd/pull/15331#issuecomment-611472240
* | | Merge pull request #15352 from poettering/user-group-name-valdity-reworkLennart Poettering2020-04-095-14/+15
|\ \ \ | | | | | | | | user/group name validity rework
| * | | user-util: rework how we validate user namesLennart Poettering2020-04-085-14/+15
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reworks the user validation infrastructure. There are now two modes. In regular mode we are strict and test against a strict set of valid chars. And in "relaxed" mode we just filter out some really obvious, dangerous stuff. i.e. strict is whitelisting what is OK, but "relaxed" is blacklisting what is really not OK. The idea is that we use strict mode whenver we allocate a new user (i.e. in sysusers.d or homed), while "relaxed" mode is when we process users registered elsewhere, (i.e. userdb, logind, …) The requirements on user name validity vary wildly. SSSD thinks its fine to embedd "@" for example, while the suggested NAME_REGEX field on Debian does not even allow uppercase chars… This effectively liberaralizes a lot what we expect from usernames. The code that warns about questionnable user names is now optional and only used at places such as unit file parsing, so that it doesn't show up on every userdb query, but only when processing configuration files that know better. Fixes: #15149 #15090
* | | Merge pull request #15332 from keszybz/coredump-filterLennart Poettering2020-04-095-0/+116
|\ \ \ | |_|/ |/| | CoredumpFilter=
| * | manager: add CoredumpFilter= settingZbigniew Jędrzejewski-Szmek2020-04-094-0/+23
| | | | | | | | | | | | Fixes #6685.
| * | Add parser and printer for coredump filter maskZbigniew Jędrzejewski-Szmek2020-04-093-0/+93
| |/
* | Merge pull request #15345 from keszybz/systemctl-show-spacesLennart Poettering2020-04-091-9/+12
|\ \ | | | | | | Show Environment= entries with spaces in systemctl
| * | systemctl: show Environment entries with whitespaceZbigniew Jędrzejewski-Szmek2020-04-091-9/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the Environment entries more round-trippable: a similar format is used for input and output. It is certainly more useful for users, because showing [unprintable] on anything non-trivial makes systemctl show -p Environment useless in many cases. Fixes: #14723 and https://bugzilla.redhat.com/show_bug.cgi?id=1525593. $ systemctl --user show -p Environment run-*.service Environment=ASDF=asfd "SPACE= " Environment=ASDF=asfd "SPACE=\n\n\n" Environment=ASDF=asfd "TAB=\t\\" "FOO=X X"
* | sleep: improve log msg slightlyLennart Poettering2020-04-091-1/+1
| | | | | | | | | | | | | | Let's make the log msgs a bit longer, to make clearer what is going on here... Prompted bymy attempts to debug #15354
* | bus: introduce some sd-bus convenience helpersVito Caputo2020-04-042-0/+158
|/ | | | | | | | | | | | | | | | | | Many of the convenience functions from sd-bus operate on verbose sets of discrete strings for destination/path/interface/member. For most callers, destination/path/interface are uniform, and just the member is distinct. This commit introduces a new struct encapsulating the destination/path/interface pointers called BusAddress, and wrapper functions which take a BusAddress* instead of three strings, and just pass the encapsulated strings on to the sd-bus convenience functions. Future commits will update call sites to use these helpers throwing out a bunch of repetitious destination/path/interface strings littered throughout the codebase, replacing them with some appropriately named static structs passed by pointer to these new helpers.
* shared/dissect-image: log messages from cryptsetupTopi Miettinen2020-04-031-0/+4
| | | | | | | | | | | | | | Before: ``` write(2, "Device /dev/loop1p1 is too small.\n", 34) = -1 ENOTCONN (Transport endpoint is not connected) ``` After: ``` $ journalctl -b -e | grep 'too small' Apr 02 16:53:30 loora systemd[343579]: Device /dev/loop1p1 is too small. ```
* *: convert amenable fdopen calls to take_fdopenVito Caputo2020-03-314-10/+5
| | | | | Mechanical change to eliminate some cruft by using the new take_fdopen{_unlocked}() wrappers where trivial.
* Merge pull request #14338 from keszybz/functional-test-reworkFrantisek Sumsal2020-03-302-11/+15
|\ | | | | Functional test rework
| * tests: move unit files to units/ subdirectoryZbigniew Jędrzejewski-Szmek2020-03-192-11/+15
| | | | | | | | | | We have a bazillion of those unit files, and keeping them all directly in tests/ has become rather unwieldy.
* | Move path-lookup.c to src/basicZbigniew Jędrzejewski-Szmek2020-03-273-941/+0
| | | | | | | | | | I want to use it from sd-path later on so it needs to be moved out of src/shared (libsystemd is not allowed to use code from src/shared).
* | Split out generator directory setup to a src/core/generator-setup.cZbigniew Jędrzejewski-Szmek2020-03-272-59/+0
| | | | | | | | Those functions have only one non-test user, so we can move them to src/core/.
* | shared- bride util allign bridge_state_tableSusant Sahani2020-03-261-1/+1
| |
* | Merge pull request #15224 from ssahani/geneveZbigniew Jędrzejewski-Szmek2020-03-263-0/+31
|\ \ | | | | | | networkctl: Display more geneve properties
| * | network: Introduce geneve utilSusant Sahani2020-03-253-0/+31
| | |
* | | path-lookup: Use default value for XDG_CONFIG_DIRS if environment is not setDavid Edmundson2020-03-261-4/+5
| | | | | | | | | | | | | | | If XDG_CONFIG_DIRS is unset, the specification says we should assume /etc/xdg.
* | | shared: Introduce bridge utilSusant Sahani2020-03-243-0/+35
|/ /
* | Merge pull request #15153 from keszybz/man-bus-addressZbigniew Jędrzejewski-Szmek2020-03-191-26/+6
|\ \ | |/ |/| Add two man pages for sd-bus
| * bus: drop dead code for kdbus supportZbigniew Jędrzejewski-Szmek2020-03-181-26/+6
| | | | | | | | | | sd_bus_try_close() always returns -EOPNOTSUPP if bus is a valid object. It nevers returns -EBUSY. So we'd always go into the "fallback" path.
* | core: add support for setting CPUAffinity= to special "numa" valueMichal Sekletár2020-03-162-2/+10
| | | | | | | | | | | | | | systemd will automatically derive CPU affinity mask from NUMA node mask. Fixes #13248
* | shared: split out NUMA code from cpu-set-util.c to numa-util.cMichal Sekletár2020-03-166-114/+171
|/
* shared/ask-password-api: do not show hint on echoChristian Hesse2020-03-121-1/+1
| | | | | | | | Giving --echo to systemd-ask-password allows to echo the user input instead of masking it. This is useful when querying for usernames or similar. Showing "(press TAB for no echo)" does not make sense there, so do not. Note that pressing TAB or ESC still disables echo.
* format-table: allow hiding a specific columnFrantisek Sumsal2020-03-112-0/+48
| | | | without having to specify the whole display map
* dissect-image: avoid scanning partitionsTopi Miettinen2020-03-101-4/+5
| | | | | | In case the dissected image has a filesystem, don't scan for partitions. This avoids problems with services using a `RootImage=` in early boot when udevd is not yet started.
* Support compiling with clang and gnu11 standardDenis Pronin2020-03-091-11/+24
| | | | Signed-off-by: Denis Pronin <dannftk@yandex.ru>
* udev: support to update flow control parameterYu Watanabe2020-03-072-0/+50
| | | | Closes #14770.
* path-lookup: Allow setting generator paths via environmentBenjamin Berg2020-03-041-24/+77
| | | | | | | | This adds SYSTEMD_GENERATOR_PATH and SYSTEMD_ENVIRONMENT_GENERATOR_PATH environment variables that will be read in the same manner as SYSTEMD_UNIT_PATH is. i.e. if set, these paths will be used and a trailing empty entry means that the usual paths will be appended, while no trailing entry means that solely the given paths are used.
* path-lookup: Split out helper to get paths from environmentBenjamin Berg2020-03-041-17/+33
| | | | This is so that we can use the same pattern for other sets of paths.
* core: Move environment generator path lookup into path-lookup.cBenjamin Berg2020-03-042-0/+15
|
* make namespace_flags_to_string() not return empty stringYu Watanabe2020-03-032-7/+1
| | | | | | | | | | This improves the following debug log. Before: systemd[1162]: Restricting namespace to: . After: systemd[1162]: Restricting namespace to: n/a.
* tree-wide: fix spelling of lookup and setup verbsZbigniew Jędrzejewski-Szmek2020-03-031-1/+1
| | | | "set up" and "look up" are the verbs, "setup" and "lookup" are the nouns.
* Merge pull request #14992 from keszybz/syslog-address-length-fixZbigniew Jędrzejewski-Szmek2020-03-022-10/+15
|\ | | | | Syslog address length fix
| * ask-password-api: drop unneeded parenthesesZbigniew Jędrzejewski-Szmek2020-03-021-2/+1
| |
| * tree-wide: use the return value from sockaddr_un_set_path()Zbigniew Jędrzejewski-Szmek2020-03-022-8/+14
| | | | | | | | | | | | | | | | | | It fully initializes the address structure, so no need for pre-initialization, and also returns the length of the address, so no need to recalculate using SOCKADDR_UN_LEN(). socklen_t is unsigned, so let's not use an int for it. (It doesn't matter, but seems cleaner and more portable to not assume anything about the type.)
* | shared/logs-show: Remove unused OUTPUT_FOLLOWHATAYAMA Daisuke2020-03-022-70/+58
|/ | | | | | | | | | | | | As of the commit aae9a96d4b3a8562af9e8c6a23871b442645b954 removing --follow option in systemctl command, OUTPUT_FOLLOW has never been set anywhere. Let's remove it. The condition expression of the if-statement in show_journal() that refers to OUTPUT_FOLLOW now thus evaluates always to true. Hence, the call of sd_journal_wait() is in dead code, and the outer infinite for-loop is meaningless, which we remove as cleanup. There is no functional change by this commit.
* Merge pull request #14964 from yuwata/conf-parser-fix-line-numberAnita Zhang2020-02-271-1/+3
|\ | | | | conf-parser: fix line number in error message
| * conf-parser: fix line number in error messageYu Watanabe2020-02-281-1/+3
| | | | | | | | Fixes #14929.
* | Merge pull request #14965 from keszybz/journal-rotation-hintAnita Zhang2020-02-273-3/+22
|\ \ | |/ |/| systemctl: be more specific when emitting warning about rotated journal
| * systemctl: be more specific when emitting warning about rotated journalZbigniew Jędrzejewski-Szmek2020-02-273-3/+22
| | | | | | | | | | See inline comment for disucssion. Fixes #14281.
* | Merge pull request #14953 from yuwata/userdb-fix-groupdbYu Watanabe2020-02-271-10/+2
|\ \ | | | | | | userdb: make groupdb_all() always set iterator when it returns >= 0