summaryrefslogtreecommitdiffstats
path: root/src/shared (follow)
Commit message (Collapse)AuthorAgeFilesLines
* sysroot: Order systemd-fsck-root after systemd-makefsWill Fancher2022-12-231-1/+10
|
* Merge pull request #25823 from poettering/dissect-diskseqYu Watanabe2022-12-232-27/+69
|\ | | | | gpt-auto: reference dissected partitions to mount via diskseq block device symlinks
| * dissect-image: optionally, reference dissected partition device nodes by diskseqLennart Poettering2022-12-232-21/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful to make the dissection logic at boot a bit safer, as we can reference device nodes by diskseq. This locks down dissection a bit, since it makes it harder to swap out the backing device between the time we dissected and validated it, until we actually mounted it. This is not complete though, as /bin/mount would have to verify the diskseq after opening the diskseq symlink again. See: https://github.com/util-linux/util-linux/issues/1786
| * dissect-image: simplify things by avoiding one string copyLennart Poettering2022-12-231-6/+2
| | | | | | | | | | We don't need the node in its original variable anymore, hence let's just move it over instead of allocating a copy.
* | cryptsetup-fido2: Remove plain mode parameters from `acquire_fido2_key_auto()`Peter Cai2022-12-222-10/+3
| | | | | | | | | | | | | | `acquire_fido2_key_auto()` will not be used in PLAIN mode, and parameters such as the salt will be acquired from the LUKS header. Parameters intended for PLAIN mode are useless in `acquire_fido2_key_auto()`.
* | cryptsetup-fido2: Relocate to libsystemd-sharedPeter Cai2022-12-223-0/+370
|/
* dissect-image: let's lock down fstypes a bitLennart Poettering2022-12-222-0/+42
| | | | | | | | | | | | | | | | | When we dissect images automatically, let's be a bit more conservative with the file system types we are willing to mount: only mount common file systems automatically. Explicit mounts requested by admins should always be OK, but when we do automatic mounts, let's not permit barely maintained, possibly legacy file systems. The list for now covers the four common writable and two common read-only file systems. Sooner or later we might want to add more to the list. Also, it might make sense to eventually make this configurable via the image dissection policy logic.
* tree-wide: use -EBADF moreYu Watanabe2022-12-202-2/+2
|
* tree-wide: introduce PIPE_EBADF macroYu Watanabe2022-12-206-9/+9
|
* Merge pull request #25786 from keszybz/ebadfYu Watanabe2022-12-2048-141/+143
|\ | | | | Use -EBADF for fd initialization
| * tree-wide: use -EBADF also in pipe initializersZbigniew Jędrzejewski-Szmek2022-12-196-7/+9
| | | | | | | | In some places, initialization is dropped when unnecesary.
| * tree-wide: change initialization to use EBADF instead of EBADFDZbigniew Jędrzejewski-Szmek2022-12-191-1/+1
| | | | | | | | | | Those fds never were, so it's not fair to say that they are in "bad state". Let's use the shorter and more direct errno.
| * tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-1945-133/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* | Merge pull request #25783 from keszybz/trivial-cleanupsLennart Poettering2022-12-192-14/+6
|\ \ | | | | | | Trivial cleanups
| * | userdb: fix typoZbigniew Jędrzejewski-Szmek2022-12-191-1/+1
| | |
| * | shared/dns-domain: reduce scope of variable declarationsZbigniew Jędrzejewski-Szmek2022-12-191-13/+5
| |/
* / p11kit: switch to dlopen()Luca Boccassi2022-12-193-58/+187
|/
* Implement SYSTEMD_HOME_MKFS_OPTIONS_* envvars to configure mkfs options for ↵Aidan Dang2022-12-152-2/+9
| | | | homed LUKS directories
* Merge pull request #25718 from yuwata/locale-cleanupsYu Watanabe2022-12-152-81/+120
|\ | | | | locale: avoid TOCTOU in reading config files
| * locale-setup: avoid TOCTOU in reading locale.confYu Watanabe2022-12-142-35/+38
| |
| * locale-setup: make failure in stat() criticalYu Watanabe2022-12-141-2/+4
| | | | | | | | | | The file was created by this function. Hence, the failure is something critical.
| * locale-setup: clear partially loaded context on failureYu Watanabe2022-12-141-6/+3
| |
| * locale-setup: split locale_context_load() into small piecesYu Watanabe2022-12-141-72/+109
| | | | | | | | | | No functional change, just refactoring and preparation for later commits.
* | Merge pull request #24058 from qdeslandes/journald_regex_filteringYu Watanabe2022-12-153-0/+22
|\ \ | | | | | | Allow for journald logs filtering on a per-unit basis
| * | Create hash_ops structure to free keys of type pcre2_codeQuentin Deslandes2022-12-152-0/+12
| | |
| * | journal: log filtering options support in PID1Quentin Deslandes2022-12-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Define new unit parameter (LogFilterPatterns) to filter logs processed by journald. This option is used to store a regular expression which is carried from PID1 to systemd-journald through a cgroup xattrs: `user.journald_log_filter_patterns`.
* | | Merge pull request #25224 from poettering/measure-appendYu Watanabe2022-12-152-1/+24
|\ \ \ | | | | | | | | add --append= switch to systemd-measure
| * | | json: add helper for adding variant to array suppressing duplicatesLennart Poettering2022-12-152-1/+24
| |/ /
* | | mount-util: make mount_switch_root() take a mount propagation flagYu Watanabe2022-12-152-44/+9
| | |
* | | mountpoint-util: rename mount_propagation_flags_to_string() and friends as ↵Yu Watanabe2022-12-152-3/+3
| | | | | | | | | | | | singular
* | | mount-util: mount flag is unsigned longYu Watanabe2022-12-152-4/+3
| | |
* | | mount-util: drop unnecessary inline attributesYu Watanabe2022-12-151-2/+2
|/ /
* | Merge pull request #25723 from keszybz/generators-tmpYu Watanabe2022-12-1510-111/+34
|\ \ | | | | | | Run generators with / ro and /tmp mounted
| * | tree-wide: use mode=0nnn for mount optionZbigniew Jędrzejewski-Szmek2022-12-142-24/+26
| | | | | | | | | | | | | | | | | | This is an octal number. We used the 0 prefix in some places inconsistently. The kernel always interprets in base-8, so this has no effect, but I think it's nicer to use the 0 to remind the reader that this is not a decimal number.
| * | shared: add new safe_fork flag FORK_PRIVATE_TMPZbigniew Jędrzejewski-Szmek2022-12-142-79/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the flag is set, we mount /tmp/ in a way that is suitable for generators and other quick jobs. Unfortunately I had to move some code from shared/mount-util.c to basic/mountpoint-util.c. The functions that are moved are very thin wrappers around mount(2), so this doesn't actually change much in the code split between libbasic and libshared. Implications for the host would be weird if a private mount namespace is not used, so assert on FORK_NEW_MOUNTNS when the flag is used.
| * | treewide: drop "RUN_" from "RUN_WITH_UMASK"Zbigniew Jędrzejewski-Szmek2022-12-137-8/+8
| | | | | | | | | | | | | | | | | | RUN_WITH_UMASK was initially conceived for spawning externals progs with the umask set. But nowadays we use it various syscalls and stuff that doesn't "run" anything, so the "RUN_" prefix has outlived its usefulness.
* | | binfmt: check if binfmt is mounted before applying rulesYu Watanabe2022-12-142-1/+2
| | |
* | | binfmt-util: also check if binfmt is mounted in read-writeYu Watanabe2022-12-141-2/+3
| | |
* | | binfmt-util: split out binfmt_mounted()Yu Watanabe2022-12-141-4/+23
| |/ |/| | | | | | | No functional changes, just refactoring and preparation for later commits.
* | Merge pull request #25726 from dtardon/cleanupsYu Watanabe2022-12-141-4/+1
|\ \ | | | | | | Several small cleanups
| * | btrfs-util: shorten a bitDavid Tardon2022-12-141-4/+1
| |/
* | Merge pull request #25658 from yuwata/fuzz-etc-hostsYu Watanabe2022-12-132-1/+13
|\ \ | | | | | | resolve: dedup entries in /etc/hosts
| * | dns-domain: introduce dns_name_hash_ops_freeYu Watanabe2022-12-132-1/+13
| |/ | | | | | | Preparation for later commits.
* / coredump: cescape invalid json data before loggingZbigniew Jędrzejewski-Szmek2022-12-131-2/+5
|/ | | | | | | | | | | In both cases, the json string is short, so we can print it, which is useful for diagnosing invalid data in packages. But we need escape non-printable characters. https://bugzilla.redhat.com/show_bug.cgi?id=2152685 I went over the rest of the codebase, and it seems that other calls to json_parse() don't have this problem.
* Merge pull request #25375 from PeterCxy/fido2-fixupsLuca Boccassi2022-12-121-43/+32
|\ | | | | Fixups for FIDO2 pre-flight checks
| * libfido2-util: Refactor pre-flight failure handlingPeter Cai2022-12-101-12/+14
| | | | | | | | | | | | | | | | | | | | | | `fido2_is_cred_in_specific_token()` should simply not return error codes for non-fatal errors. For example, `-ENODEV` can be safely translated to a `false` return value. When the pre-flight request is not supported, we should simply return true to instruct the caller to attempt to use the device anyway. All error codes returned by the funtion should now be fatal and logged at error level. Non-fatal errors should only appear in debug logs.
| * libfido2-util: Perform pre-flight checks as well when a specific device path ↵Peter Cai2022-12-101-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is given This prevents unnecessary user interactions when `fido2-device` is set to something other than `auto` -- a case overlooked in the original PR #23577 (and later #25268). We do not move pre-flight checks to `fido2_use_hmac_hash_specific_token` because the behaviors are different between different cases: when the device path is NULL, we try to automatically choose the correct device, in which case pre-flight errors should be "soft" errors, without spamming the tty with error outputs; but when a specific device path is given, a pre-flight request that determined the non-existence of the credential should be treated the same as a failed assertion request.
| * libfido2-util: Disable pre-flight checks for credentials with UVPeter Cai2022-12-101-41/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the FIDO2 spec, tokens may not support pre-flight checks for credentials requiring UV, at least not without at least `pinUvAuthParam` or `uv = true`. Originally, in #25268, this was handled by passing a PIN to satisfy `pinUvAuthParams`, but this is not ideal, since `pinUvAuthParam` can be obtained from either a PIN or a UV verification. Forcing the user to enter the PIN here (which is often just the fallback option on UV devices) is no better than just trying out each device with the actual assertion request. As a result, this commit disables pre-flight checks when the credential requires UV, and instead reverts to the old behavior (trying out each device and each key slot, requiring multiple user interactions) for this type of credentials.
* | sd-id128: fold do_sync flag into Id128FormatFlagYu Watanabe2022-12-121-3/+3
| |
* | sd-id128: make id128_read() or friends return -ENOPKG when the file contents ↵Yu Watanabe2022-12-123-8/+8
|/ | | | | | | | | is "uninitialized" Then, this drops ID128_PLAIN_OR_UNINIT. Also, this renames Id128Format -> Id128FormatFlag, and make it bitfield. Fixes #25634.