summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | boot: add optional EFI SBAT supportDimitri John Ledkov2021-05-075-6/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add SBAT support, when -Dsbat-distro value is specified. One can use -Dsbat-distro=auto for autodetection of all sbat options. Many meson configure options added to customize SBAT CSV values, but sensible defaults are auto detected by default. SBAT support is required if shim v15+ is used to load systemd-boot binary or kernel.efi (Type II BootLoaderSpec). Fixes #19247
* | | Merge pull request #19545 from poettering/nss-systemd-shadowLennart Poettering2021-05-1010-17/+517
|\ \ \ | | | | | | | | nss-systemd: also expose shadow/gshadow entries from userdb records
| * | | nss-systemd: synthesize NSS shadow/gshadow records from userdb, as wellLennart Poettering2021-05-0810-11/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures we not only synthesize regular paswd/group records of userdb records, but shadow records as well. This should make sure that userdb can be used as comprehensive superset of the classic passwd/group/shadow/gshadow functionality.
| * | | nss-systemd: set USERDB_SUPPRESS_SHADOW flag when looking up user recordsLennart Poettering2021-05-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting the flags means we won#t try to read the data from /etc/shadow when reading a user record, thus slightly making conversion quicker and reducing the chance of generating MAC faults, because we needlessly access a privileged resource. Previously, passing the flag didn't matter, when converting our JSON records to NSS since the flag only had an effect on whether to use NSS getspnam() and related calls or not. But given that we turn off NSS anyway as backend for this conversion (since we want to avoid NSS loops, where we turn NSS data to our JSON user records, and then to NSS forever and ever) it was unnecessary to pass it. This changed in one of the previous commits however, where we added support for reading user definitions from drop-in files, with separate drop-in files for the shadow data.
* | | | Merge pull request #19298 from bluca/cryptsetup_nopassLuca Boccassi2021-05-0917-78/+316
|\ \ \ \ | | | | | | | | | | cryptsetup: add 'headless' parameter to skip password/pin query, allow pin-less enroll on FIDO2, support user presence/verification flags
| * | | | FIDO2: if defined, check for FIDO_ERR_UV_BLOCKEDLuca Boccassi2021-05-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Newer libfido versions added this error, so check for it since it can help the user with a more specific message
| * | | | FIDO2: ask and record whether user verification was used to lock the volumeLuca Boccassi2021-05-077-4/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tokens support authorization via fingerprint or other biometric ID. Add support for "user verification" to cryptenroll and cryptsetup. Disable by default, as it is still quite uncommon.
| * | | | FIDO2: ask and record whether user presence was used to lock the volumeLuca Boccassi2021-05-079-55/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases user presence might not be required to get _a_ secret out of a FIDO2 device, but it might be required to the get actual secret that was used to lock the volume. Record whether we used it in the LUKS header JSON metadata. Let the cryptenroll user ask for the feature, but bail out if it is required by the token and the user disabled it. Enabled by default.
| * | | | FIDO2: support pin-less LUKS enroll/unlockLuca Boccassi2021-05-0711-36/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes: https://github.com/systemd/systemd/issues/19246 Some FIDO2 devices allow the user to choose whether to use a PIN or not and will HMAC with a different secret depending on the choice. Some other devices (or some device-specific configuration) can instead make it mandatory. Allow the cryptenroll user to choose whether to use a PIN or not, but fail immediately if it is a hard requirement. Record the choice in the JSON-encoded LUKS header metadata so that the right set of options can be used on unlock.
| * | | | cryptsetup: add 'headless' parameter to skip password/pin queryLuca Boccassi2021-05-079-4/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On headless setups, in case other methods fail, asking for a password/pin is not useful as there are no users on the terminal, and generates unwanted noise. Add a parameter to /etc/crypttab to skip it.
* | | | | Merge pull request #19552 from yuwata/fix-typo-and-coverty-issuesLuca Boccassi2021-05-095-8/+6
|\ \ \ \ \ | | | | | | | | | | | | Fix typo and coverity issues
| * | | | | tree-wide: fix typoYu Watanabe2021-05-093-3/+3
| | | | | |
| * | | | | userdb: shorten code a bitYu Watanabe2021-05-091-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | Hopefully fixes CID#1452937.
| * | | | | test: add one more assertion to make Coverty happyYu Watanabe2021-05-091-0/+1
|/ / / / / | | | | | | | | | | | | | | | Fixes CID#1452934.
* | | | | networkd: correct batman-adv setting name (GatewayBandwidth) (#19539)Jörg Deckert2021-05-084-4/+8
| |/ / / |/| | | | | | | Co-authored-by: Jörg Deckert <jdeckert@unitas-network.de>
* | | | string-util: explicitly cast character to unsignedYu Watanabe2021-05-081-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also adds comment why we cast to unsigned. Follow-up for 7971f9030ae4bebe0d4a6845ed31584f8ab18103. Addresses the comment https://github.com/systemd/systemd/pull/19544#discussion_r628472794.
* | | | rfc3046 implementationYegor Alexeyev2021-05-0816-44/+318
| |_|/ |/| |
* | | Merge pull request #19438 from poettering/nspawn-uidmapLennart Poettering2021-05-0820-129/+435
|\ \ \ | | | | | | | | nspawn: add support for kernel 5.12 ID mapping mounts
| * | | update TODOLennart Poettering2021-05-071-3/+6
| | | |
| * | | bash: update shell completion for new nspawn optionLennart Poettering2021-05-071-4/+4
| | | |
| * | | man: document new nspawn ID mapping mounts featuresLennart Poettering2021-05-072-41/+63
| | | |
| * | | nspawn: introduce --private-users-ownership=map|autoLennart Poettering2021-05-073-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a two new values to --private-users-ownership=: "map" and "auto". "map" exposes the kernel 5.12 idmap feature pretty much 1:1. It fails if the kernel or used file system doesn't support ID mapping. "auto" is a bit smarter: if we can make ID mapping work, we'll use it, otherwise revert back to classic chown()ing. We'll also use chown()ing if we detect that an image is already ID shifted, both to increase compatibility with the status quo ante, and to simplify our codepaths, since the mappings become a lot simpler if we only have to map from zero to something else, instead of from anything to anything else. The short -U switch, and --private-users=pick will now imply --private-users-ownership=auto instead of --private-users-ownership=chown, since the new logic should be the much better choice.
| * | | nspawn: drop an unnecessary local variableLennart Poettering2021-05-071-3/+3
| | | |
| * | | dissect-image: add support for optionally mounting images with idmapping onLennart Poettering2021-05-078-29/+57
| | | |
| * | | mount-util: add a helper that can add an idmap to an existing mountLennart Poettering2021-05-072-1/+86
| | | | | | | | | | | | | | | | | | | | | | | | This makes use of the new kernel 5.12 APIs to add an idmap to a mount point. It does so by cloning the mountpoint, changing it, and then unmounting the old mountpoint, replacing it later with the new one.
| * | | nspawn: tighten userns UID shift/range checksLennart Poettering2021-05-073-8/+27
| | | | | | | | | | | | | | | | | | | | Let's add a helper that ensures the UID shift/range parameters actually fit together.
| * | | process-util: add option for cloning with CLONE_NEWUSERLennart Poettering2021-05-072-2/+5
| | | | | | | | | | | | | | | | | | | | This is useful for allocating a userns fd later on for use in idmapped mounts.
| * | | mount-util: add helper that ensures something is a mount pointLennart Poettering2021-05-073-5/+25
| | | |
| * | | nspawn: replace boolean --private-user-chown by enumLennart Poettering2021-05-074-31/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces --private-user-chown by an enum value --private-user-ownership=off|chown. Changes otherwise very little. This is mostly preparation for a follow-up commit adding a new "map" mode, using kernel 5.12 UID mapping mounts. Note that this does alter codeflow a bit: the new enum already knows three different values instead of the old true/false pair. Besides "off" and "chown" it knows -EINVAL, i.e. whenever the value wsn't set explicitly. This value is changed to "off" or "chown" before use, thus retaining compat to the status quo before, except it won't override explicit configuration anymore. Thus, if you explicitly request --private-user=pick you can now combine it wiht an explicit --private-user-ownership=off if you like, which will give you a container that runs under its own UID set, but the files will be owned by the original image. Makes not much sense besids maybe debugging, but if requested explicitly I think it's OK to implement.
| * | | nspawn: add high-level option for identity userns mappingLennart Poettering2021-05-071-5/+19
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | userns identity 1:1 mapping is a pretty useful concept since it isolates capability sets between containers and hosts, even if it doesn't map any uid ranges. Let's support it with an explicit concept. (Note that this is identical to --private-users=0:65536 (which in turn is identical to --private-users=0), but I think it makes to emphasize this concept as a high-level one that makes sense to support.)
* | | Merge pull request #19538 from poettering/userdbd-simplify-nss-listingLennart Poettering2021-05-087-355/+156
|\ \ \ | |/ / |/| | userdbd: refactoring to simplify NSS user listing
| * | userdbd: simplify logic for generating NSS listingsLennart Poettering2021-05-072-325/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we basically had two ways to iterate through NSS records: one via the varlink IPC and one via the userdb.[ch] infra, with slightly different implementations. Let's clean this up, and always use userdb.[ch] also when resolving via userdbd. The different codepaths for the NameServiceSwitch and the Multiplexer varlink service now differ only in the different flags passed to the userdb lookup. Behaviour shouldn't change by this. This is mostly refactoring, reducing redundant codepaths.
| * | userdb: add new flag for excluding varlink data in lookupsLennart Poettering2021-05-072-0/+4
| | | | | | | | | | | | This is useful to later-on use the userdb infra for only some sources.
| * | userdb: rename userdb lookup flags a bitLennart Poettering2021-05-076-30/+33
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Let's use "exclude" for flags that really exclude records from our lookup. Let's use "avoid" referring to concepts that when flag is set we'll not use but we have a fallback path for that should yield the same result. Let' use "suppress" for suppressing partial info, even if we return the record otherwise. So far we used "avoid" for all these cases, which was confusing. Whiel we are at it, let's reassign the bits a bit, leaving some space for bits follow-up commits are going to add.
* | Added Teclast X4 ACCEL_MOUNT_MATRIX (#19540)Marco Antonio Mauro2021-05-071-0/+4
| |
* | string-util: fix build error on aarch64Yu Watanabe2021-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following error: ``` In file included from ../src/basic/af-list.h:6, from ../src/basic/af-list.c:7: ../src/basic/string-util.h: In function 'char_is_cc': ../src/basic/string-util.h:133:19: error: comparison is always true due to limited range of data type [-Werror=type-limits] 133 | return (p >= 0 && p < ' ') || p == 127; | ^~ cc1: all warnings being treated as errors ``` Fixes #19543.
* | test: fix partition check in TEST-58-REPARTFrantisek Sumsal2021-05-071-2/+2
| | | | | | | | Follow-up to 1c41c1dc346dd0d5d235fe0866bbe2d9be924dcd.
* | Merge pull request #18863 from keszybz/cmdline-escapingLennart Poettering2021-05-0723-327/+633
|\ \ | | | | | | Escape command lines properly
| * | core,journald: use quoted commandlinesZbigniew Jędrzejewski-Szmek2021-05-052-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think quoting is more useful than not quoting. Without, arguments with whitespace cannot be split correctly. Unlike in coredump, "normal" quoting is used in those two cases. This output is mostly for informational purposes, so the more readable quoting seems apropriate. dbus GetProcesses: $ busctl --user call org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/run_2dr4450e1ae73944194bb6593fcfd255fbe_2eservice org.freedesktop.systemd1.Service GetProcesses a(sus) 2 "/user.slice/user-1000.slice/user@1000.service/app.slice/run-r4450e1ae73944194bb6593fcfd255fbe.service" 131494 "/usr/bin/bash -c \"sleep 100; sleep 20\"" "/user.slice/user-1000.slice/user@1000.service/app.slice/run-r4450e1ae73944194bb6593fcfd255fbe.service" 131496 "sleep 100"
| * | coredump: use "POSIX quotes" for cmdlineZbigniew Jędrzejewski-Szmek2021-05-052-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ coredumpctl info |grep Command Command Line: bash -c kill -SEGV $$ (before) Command Line: bash -c "kill -SEGV \$\$" (road not taken, C quotes) Command Line: bash -c $'kill -SEGV $$' (now, POSIX quotes) Before we wouldn't use any quoting, making it impossible to figure how the command line was split into arguments. We could use "normal" quotes, but this has the disadvantage that the commandline *looks* like it could be pasted into the terminal and executed, but this is not true: various non-printable characters cannot be expressed in this quoting style. (This is not visible in this example). Thus, "POSIX quotes" are used, which should allow any command line to be expressed acurrately and pasted directly into a shell prompt to reexecute. I wonder if we should another field in the coredump entry that simply shows the original cmdline with embedded NULs, in the original /proc/*/cmdline format. This would allow clients to format the data as they see fit. But I think we'd want to keep the serialized form anyway, for backwards compatibility.
| * | man: add an example of coredumpctl outputZbigniew Jędrzejewski-Szmek2021-05-051-4/+34
| | | | | | | | | | | | People like examples. Also shows off the new quoted command line.
| * | test-process-util: add test that prints all cmdlinesZbigniew Jędrzejewski-Szmek2021-05-051-0/+49
| | |
| * | basic/process-util: add mode where posix shell escape is used for quotingZbigniew Jędrzejewski-Szmek2021-05-053-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | The new flag is not used, except in tests, so no functional change yet. This way, the command as shown can be copied-and-pasted into the shell in more cases. For simple cases, shell quoting with "" is enough. But $'' is needed when there are control characters in the command.
| * | test-process-util: run fewer getpid() testsZbigniew Jędrzejewski-Szmek2021-05-051-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Significant time was spent in the getpid() measurement code, which is not very important. So let's optimize this a bit by running the slower version less times, and only running both tests a lesser amount of times unless slow tests are enabled. This gives the better accuracy then before in slow mode, and still reasonable accuracy in fast mode without a noticable slowdown.
| * | test-process-util: add more debug logging but hide most of it by defaultZbigniew Jędrzejewski-Szmek2021-05-051-15/+60
| | | | | | | | | | | | | | | | | | It makes little sense to always print the stuff that is fully deterministic and verified by asserts. It can be opted-in with $SYSTEMD_LOG_LEVEL when developing the tests or debugging a failure.
| * | basic/process-util: allow quoting of commandlinesZbigniew Jędrzejewski-Szmek2021-05-054-36/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the new functionality is controlled by an option, this causes no change in output yet, except tests. The login in the old branch of !(flags & PROCESS_CMDLINE_QUOTE) is essentially unmodified. But there is an important difference in behaviour: instead of unconditionally reading the whole virtual file, we now read only 'max_columns' bytes. This makes out code to write process lists quite a bit more efficient when there are processes with long command lines.
| * | test-utf8: hide most output by defaultZbigniew Jędrzejewski-Szmek2021-05-051-9/+13
| | | | | | | | | | | | | | | Unless one is working on the code, there is little reason to write most of the output. So let's hide it unless requested with SYSTEMD_LOG_LEVEL=debug.
| * | basic/escape: allow truncation mode where "…" is always appendedZbigniew Jędrzejewski-Szmek2021-05-056-38/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we would append "…" or "..." when the string was wider than the specified output width. But let's add a mode where the caller knows that the string being passed is already truncated. The condition for jumping back in utf8_escape_non_printable_full() was off-by-one. But we only jumped to that label after doing a check with a stronger condition, so I think it didn't matter. Now it matters because we'd output the forced ellipsis one column too early.
| * | basic/escape: flagsify xescape_full()Zbigniew Jędrzejewski-Szmek2021-05-054-12/+18
| | |
| * | test-fileio: modernizationZbigniew Jędrzejewski-Szmek2021-05-051-13/+44
| | |