]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoman: document new udevadm lock tool 22867/head
Lennart Poettering [Mon, 28 Mar 2022 13:10:56 +0000 (15:10 +0200)] 
man: document new udevadm lock tool

2 years agoudevadm: add new "lock" verb for locking block devices
Lennart Poettering [Fri, 1 Apr 2022 12:27:45 +0000 (14:27 +0200)] 
udevadm: add new "lock" verb for locking block devices

2 years agohash-funcs: tweak odering in devt_compare_func()
Lennart Poettering [Fri, 1 Apr 2022 12:21:44 +0000 (14:21 +0200)] 
hash-funcs: tweak odering in devt_compare_func()

Let's order dev_t's by their major first, minor secondary. The binary
encoding of the two fields is weirdly interleaved and different in
kernel and glibc, hence let's focus on the generic part that works like
users would expect it.

So far the function is only used to compare for equality, not for
sorting, hence this has no immediate effect.

2 years agoTODO
Lennart Poettering [Mon, 4 Apr 2022 13:20:19 +0000 (15:20 +0200)] 
TODO

2 years agoMerge pull request #22943 from yuwata/dhcp6-client-requet-options
Yu Watanabe [Mon, 4 Apr 2022 13:55:02 +0000 (22:55 +0900)] 
Merge pull request #22943 from yuwata/dhcp6-client-requet-options

sd-dhcp6-client: requet options

2 years agoMerge pull request #22952 from poettering/rework-kvm-hyperv
Yu Watanabe [Mon, 4 Apr 2022 13:53:56 +0000 (22:53 +0900)] 
Merge pull request #22952 from poettering/rework-kvm-hyperv

virt: tweak kvm with hyperv enlightenments

2 years agogpt: introduce common implementation of type uuid search loop
Lennart Poettering [Mon, 4 Apr 2022 10:55:12 +0000 (12:55 +0200)] 
gpt: introduce common implementation of type uuid search loop

2 years agoupdate TODO
Lennart Poettering [Mon, 4 Apr 2022 10:45:21 +0000 (12:45 +0200)] 
update TODO

2 years agovirt: move array iterators to smaller scope, and use right type 22952/head
Lennart Poettering [Mon, 4 Apr 2022 09:27:58 +0000 (11:27 +0200)] 
virt: move array iterators to smaller scope, and use right type

2 years agovirt: make virtualization enum a named type
Lennart Poettering [Mon, 4 Apr 2022 09:19:44 +0000 (11:19 +0200)] 
virt: make virtualization enum a named type

These days we have a mechanism for safely returning errnos in enum
types, via definining -ERRNO_MAX as one special enu value. Let's use
that for Virtualization.

No change in behaviour, just some typesafety improvement.

2 years agovirt: rework kvm with hyperv enlightenment checks a bit
Lennart Poettering [Mon, 4 Apr 2022 08:29:40 +0000 (10:29 +0200)] 
virt: rework kvm with hyperv enlightenment checks a bit

Let's avoid extending the virtualization with an "alias" entry that has
the same string assigned as another.

The only reason this was done was to make the patch small that added a
second CPUID vendor string for kvm to the vm_table[] array. Let's
instead rework the array to use struct elements that match up strings
with ids. Given the array was previously mostly sparse this should be a
general improvement.

Fixes: #22950
Follow-up for: #22945

2 years agosd-dhcp6-client: request several options 22943/head
Yu Watanabe [Fri, 11 Feb 2022 05:59:53 +0000 (14:59 +0900)] 
sd-dhcp6-client: request several options

Even though these options are not currently used by sd-dhcp6-client,
RFC 8415 states these options MUST be requested.

2 years agonetwork: dhcp6: request DNS servers or friends only when they will be used
Yu Watanabe [Sun, 3 Apr 2022 10:34:40 +0000 (19:34 +0900)] 
network: dhcp6: request DNS servers or friends only when they will be used

2 years agodhcp: make option names singular
Yu Watanabe [Sun, 3 Apr 2022 10:44:04 +0000 (19:44 +0900)] 
dhcp: make option names singular

2 years agosd-dhcp6-client: sort requesting options
Yu Watanabe [Fri, 1 Apr 2022 16:13:24 +0000 (01:13 +0900)] 
sd-dhcp6-client: sort requesting options

2 years agosd-dhcp6-client: rename req_opts_len -> n_req_opts
Yu Watanabe [Fri, 1 Apr 2022 16:11:32 +0000 (01:11 +0900)] 
sd-dhcp6-client: rename req_opts_len -> n_req_opts

As 'len' is confusing and we may misunderstand it as the size of
the buffer instead of the number of options.

2 years agoIdentify kvm + hv_passthrough as "kvm"
Brett Holman [Thu, 31 Mar 2022 20:04:57 +0000 (14:04 -0600)] 
Identify kvm + hv_passthrough as "kvm"

2 years agobuild(deps): bump meson from 0.61.2 to 0.62.0 in /.github/workflows
dependabot[bot] [Fri, 1 Apr 2022 09:04:31 +0000 (09:04 +0000)] 
build(deps): bump meson from 0.61.2 to 0.62.0 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 0.61.2 to 0.62.0.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/0.61.2...0.62.0)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump actions/labeler from 3.1.0 to 4
dependabot[bot] [Fri, 1 Apr 2022 09:04:12 +0000 (09:04 +0000)] 
build(deps): bump actions/labeler from 3.1.0 to 4

Bumps [actions/labeler](https://github.com/actions/labeler) from 3.1.0 to 4.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/3d612d72e6784a1a65365cc6d33b5a001c12bf10...9fd24f1f9d6ceb64ba34d181b329ee72f99978a0)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump actions/checkout from 2.4.0 to 3
dependabot[bot] [Fri, 1 Apr 2022 09:04:08 +0000 (09:04 +0000)] 
build(deps): bump actions/checkout from 2.4.0 to 3

Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/ec3a7ce113134d7a93b817d10a8272cb61118579...a12a3943b4bdde767164f792f33f40b04645d846)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump github/codeql-action from 1.1.3 to 2.1.6
dependabot[bot] [Fri, 1 Apr 2022 09:04:02 +0000 (09:04 +0000)] 
build(deps): bump github/codeql-action from 1.1.3 to 2.1.6

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.1.3 to 2.1.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/75f07e7ab2ee63cba88752d8c696324e4df67466...28eead240834b314f7def40f6fcba65d100d99b1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump github/super-linter from 4.8.5 to 4.9.1
dependabot[bot] [Fri, 1 Apr 2022 09:04:17 +0000 (09:04 +0000)] 
build(deps): bump github/super-linter from 4.8.5 to 4.9.1

Bumps [github/super-linter](https://github.com/github/super-linter) from 4.8.5 to 4.9.1.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/b8641364ca9a79b3cf07f3c4c59a82709cd39094...3792fe5373cf2f5b22d590fcbbc4533d735c573e)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoveritysetup: fix memory corruption
Lennart Poettering [Fri, 1 Apr 2022 15:01:29 +0000 (17:01 +0200)] 
veritysetup: fix memory corruption

We must copy the option string, since in one case we are called with a
pointer into dynamic memory that will be freed by the caller.

As discussed here: https://github.com/systemd/systemd/pull/22908/files#r839394490

Follow-up for: #22908

2 years agoMerge pull request #22939 from yuwata/tree-wide-space
Yu Watanabe [Fri, 1 Apr 2022 16:32:26 +0000 (01:32 +0900)] 
Merge pull request #22939 from yuwata/tree-wide-space

tree-wide: add space after if, switch, for, and while

2 years agotree-wide: fix typo
Yu Watanabe [Fri, 1 Apr 2022 15:34:27 +0000 (00:34 +0900)] 
tree-wide: fix typo

2 years agoudev: add /dev/disk/by-diskseq symlink for block devices
Lennart Poettering [Thu, 31 Mar 2022 08:10:37 +0000 (10:10 +0200)] 
udev: add /dev/disk/by-diskseq symlink for block devices

This adds another symlink for block devices:

    /dev/disk/by-diskseq/<number>

where the number is the diskseq number as exposed by the kernel. It's
useful for apps because they can use it to open a device by diskseq, in
a way that is safe against device node reuse. I.e. if a device node path
like this is passed to an app it could open the device node via the
symlink and also parse the diskseq from the path. Once the device is
opened it could compare the parsed diskseq with the one returned by
BLKGETDISKSEQ on the open node, and if it matches they know they are
talking to the right device.

Fixes: #22906
2 years agoMerge pull request #22926 from bluca/analyze_offline_filter
Yu Watanabe [Fri, 1 Apr 2022 14:43:18 +0000 (23:43 +0900)] 
Merge pull request #22926 from bluca/analyze_offline_filter

analyze: fix offline checks for syscall filter and 'native' architecture

2 years agoMerge pull request #22921 from poettering/uid-range-tweaks
Lennart Poettering [Fri, 1 Apr 2022 13:58:55 +0000 (15:58 +0200)] 
Merge pull request #22921 from poettering/uid-range-tweaks

userns uid range tweaks: taint systemd if assigned userns uid range too short, and show userns uid range in userdbctl output

2 years agotree-wide: add a space after if, switch, for, and while 22939/head
Yu Watanabe [Fri, 1 Apr 2022 13:37:21 +0000 (22:37 +0900)] 
tree-wide: add a space after if, switch, for, and while

2 years agotest: add space between arguments
Yu Watanabe [Fri, 1 Apr 2022 13:28:13 +0000 (22:28 +0900)] 
test: add space between arguments

2 years agopath-util: use STR_IN_SET() where appropriate
Lennart Poettering [Fri, 1 Apr 2022 12:26:50 +0000 (14:26 +0200)] 
path-util: use STR_IN_SET() where appropriate

2 years agonotify: remove spurious whitespace
Lennart Poettering [Fri, 25 Mar 2022 11:03:17 +0000 (12:03 +0100)] 
notify: remove spurious whitespace

2 years agoMerge pull request #22934 from poettering/tls-test-fix-root
Lennart Poettering [Fri, 1 Apr 2022 13:22:43 +0000 (15:22 +0200)] 
Merge pull request #22934 from poettering/tls-test-fix-root

tests: make test-resolved-stream suceed even when run as root with restrictive access mode on build tree dir

2 years agoprocess-util: refactor APIs for reading /proc/self/xyz symlinks
Lennart Poettering [Fri, 1 Apr 2022 08:43:49 +0000 (10:43 +0200)] 
process-util: refactor APIs for reading /proc/self/xyz symlinks

The three functions for reading cwd, exe and root symlinks of processes
already share a common core: get_process_link_contents(). Let's refactor
that a bit, and move formatting of the /proc/self/ path into this helper
function instead of doing that in the caller, thus sharing more code.

While we are at it, make the return parameters optional, in case the
information if the links are readable is interesting, but the contents
is not. (This also means safe_getcwd() and readlinkat_malloc() are
updated to make the return parameter optional, as these are called by
the relevant three functions)

2 years agoanalyze: fix offline check for syscal filter 22926/head
Luca Boccassi [Thu, 31 Mar 2022 23:54:53 +0000 (00:54 +0100)] 
analyze: fix offline check for syscal filter

The deny/allow list check was inverted, if we are deny listing and the
hashmap contains the syscall then that's good

Fixes https://github.com/systemd/systemd/issues/22914

2 years agoanalyze: fix offline check for 'native' syscall architecture
Luca Boccassi [Thu, 31 Mar 2022 23:53:29 +0000 (00:53 +0100)] 
analyze: fix offline check for 'native' syscall architecture

Enum values are stored in the set, not strings

2 years agoMerge pull request #22872 from yuwata/udevadm-wait
Yu Watanabe [Fri, 1 Apr 2022 09:41:03 +0000 (18:41 +0900)] 
Merge pull request #22872 from yuwata/udevadm-wait

udevadm: introduce 'wait' command

2 years agouserdbctl: also show available UID range in current userns 22921/head
Lennart Poettering [Thu, 31 Mar 2022 13:22:33 +0000 (15:22 +0200)] 
userdbctl: also show available UID range in current userns

Containers generally have a smaller UID range assigned than host
systems. Let's visualize this in the user/group tables. We insert
markers for unavailable regions. This way display is identical to status
quo ante on host systems, but in containers unavailable ranges will be
shown as that.

And while we are at it, also hide well-known UID ranges when they are
outside of userns uid_map range. This is mostly about the "container"
range. It's pointless showing the cotnainer range (i.e. a range UID >
65535) if that range isn#t available in the container anyway.

2 years agoupdate TODO
Lennart Poettering [Thu, 31 Mar 2022 12:39:24 +0000 (14:39 +0200)] 
update TODO

2 years agopid1: add taint flag if uid/gid userns range too small
Lennart Poettering [Thu, 31 Mar 2022 12:37:29 +0000 (14:37 +0200)] 
pid1: add taint flag if uid/gid userns range too small

This will taint systemd if invoked in containers that do not have the
full 16bit range of UIDs defined.

we pretty much need uid root…nobody to be defined for a variety of
purposes, hence let's add this taint flag. Of course taints are
graceful, but it at least communicates the mess in some way...

2 years agouid-range: replace uid_range_contains() by more generalized uid_range_covers()
Lennart Poettering [Thu, 31 Mar 2022 12:28:32 +0000 (14:28 +0200)] 
uid-range: replace uid_range_contains() by more generalized uid_range_covers()

The former checks if one UID is inside the uid range set. The latter
checks if a full UID range is inside the uid range set. The former is
hence a special case of the latter.

2 years agouid-range: add some overflow checks
Lennart Poettering [Thu, 31 Mar 2022 12:28:00 +0000 (14:28 +0200)] 
uid-range: add some overflow checks

2 years agouid-range: add new uid_range_load_userns() for loading /proc/self/uid_map
Lennart Poettering [Thu, 31 Mar 2022 11:28:54 +0000 (13:28 +0200)] 
uid-range: add new uid_range_load_userns() for loading /proc/self/uid_map

2 years agotest: port test-uid-range to tests.h
Lennart Poettering [Thu, 31 Mar 2022 11:11:16 +0000 (13:11 +0200)] 
test: port test-uid-range to tests.h

2 years agouid-range: use size_t for array size
Lennart Poettering [Thu, 31 Mar 2022 10:56:24 +0000 (12:56 +0200)] 
uid-range: use size_t for array size

2 years agotest-resolved-stream: before entering user/network namespaces check if that's safe 22934/head
Lennart Poettering [Fri, 1 Apr 2022 08:56:41 +0000 (10:56 +0200)] 
test-resolved-stream: before entering user/network namespaces check if that's safe

I regularly run my tests also as root, since some of the tested code
uses privileged APIs. The test-resolved-stream so far tried to run its
tests in a user/network namespace if that can be allocated. This caused
the tests to fail on my system where once the user namespace is opened
access to the build tree in my $HOME is prohibited (due to restricted
access modes on my home dir). Let's add a check for that: before
actually isolating the test in a user/network namespace, let's see if
that would make it impossible for us to access the build tree (which we
need to do load the TLS certificates the test requires).

This should make the test pass when run as root from a build tree with
restrictive access mode.

2 years agotests: modernize load_testdata_env() a bit
Lennart Poettering [Fri, 1 Apr 2022 08:52:47 +0000 (10:52 +0200)] 
tests: modernize load_testdata_env() a bit

Let's add assert() around everyhing we don't expect to fail.

Port to path_extract_directory().

Log errrors from load_env_file_pairs() which we ignore.

2 years agoupdate TODO
Lennart Poettering [Fri, 1 Apr 2022 09:03:15 +0000 (11:03 +0200)] 
update TODO

2 years agoudev: use sd_device_open() where appropriate 22872/head
Yu Watanabe [Wed, 30 Mar 2022 20:04:56 +0000 (05:04 +0900)] 
udev: use sd_device_open() where appropriate

2 years agotest: add test for sd_device_open()
Yu Watanabe [Wed, 30 Mar 2022 18:54:41 +0000 (03:54 +0900)] 
test: add test for sd_device_open()

2 years agosd-device: introduce sd_device_open()
Yu Watanabe [Wed, 30 Mar 2022 18:29:23 +0000 (03:29 +0900)] 
sd-device: introduce sd_device_open()

We usually open() device node obtained by sd_device_get_devname().
However, the device node corresponds to the sd-device object may be
already removed, and another device node with the same path may be
created, hence an unexpected device may be opened.

The sd_device_open() opens device node, and checks the devnum and
diskseq of opened devnum, to avoid the above possibility.

Prompted by https://github.com/systemd/systemd/issues/22906#issuecomment-1082736443.

2 years agofd-util: rename loop_get_diskseq() -> fd_get_diskseq()
Yu Watanabe [Wed, 30 Mar 2022 18:25:45 +0000 (03:25 +0900)] 
fd-util: rename loop_get_diskseq() -> fd_get_diskseq()

And move it from loop-util.[ch] -> fd-util.[ch]

2 years agobasic/missing: move BLKGETDISKSEQ to missing_fs.h
Yu Watanabe [Wed, 30 Mar 2022 18:23:33 +0000 (03:23 +0900)] 
basic/missing: move BLKGETDISKSEQ to missing_fs.h

As it is defined at linux/fs.h.

2 years agotest: replace helper_wait_for_dev() with 'udevadm wait'
Yu Watanabe [Fri, 25 Mar 2022 20:38:18 +0000 (05:38 +0900)] 
test: replace helper_wait_for_dev() with 'udevadm wait'

2 years agoudevadm: introduce new 'wait' command
Yu Watanabe [Fri, 25 Mar 2022 20:01:40 +0000 (05:01 +0900)] 
udevadm: introduce new 'wait' command

Prompted by https://github.com/systemd/systemd/pull/22717#issuecomment-1067348496.

The new command 'udevadm wait' waits for device or device symlink being
created. This may be useful to wait for a device is processed by udevd
after e.g. formatting or partitioning the device.

2 years agotest: add more tests for sd_device_new_from_xxx()
Yu Watanabe [Mon, 28 Mar 2022 18:57:49 +0000 (03:57 +0900)] 
test: add more tests for sd_device_new_from_xxx()

2 years agosd-device: introduce sd_device_new_from_devname()
Yu Watanabe [Sun, 27 Mar 2022 14:38:36 +0000 (23:38 +0900)] 
sd-device: introduce sd_device_new_from_devname()

and sd_device_new_from_path() which takes devname or syspath.

2 years agosystemctl: show tainted state
Lennart Poettering [Wed, 30 Mar 2022 14:11:28 +0000 (16:11 +0200)] 
systemctl: show tainted state

2 years agopid1: check for kernels older than baseline
Lennart Poettering [Wed, 30 Mar 2022 08:46:16 +0000 (10:46 +0200)] 
pid1: check for kernels older than baseline

Let's make this detectable explicitly.

2 years agoMerge pull request #22923 from poettering/userns-check-refactor
Luca Boccassi [Thu, 31 Mar 2022 21:11:03 +0000 (22:11 +0100)] 
Merge pull request #22923 from poettering/userns-check-refactor

virt: minor running_in_userns() modernizations

2 years agoMerge pull request #22919 from poettering/cryptsetup-tweaks
Lennart Poettering [Thu, 31 Mar 2022 14:50:37 +0000 (16:50 +0200)] 
Merge pull request #22919 from poettering/cryptsetup-tweaks

various minor tweaks to cryptsetup/veritysetup/integritysetup

2 years agovirt: use read_virtual_file() for reading /proc/self/setgroups 22923/head
Lennart Poettering [Thu, 31 Mar 2022 11:28:18 +0000 (13:28 +0200)] 
virt: use read_virtual_file() for reading /proc/self/setgroups

2 years agovirt: simplify userns_has_mapping() by using fscanf() instead of scanf()
Lennart Poettering [Thu, 31 Mar 2022 11:27:21 +0000 (13:27 +0200)] 
virt: simplify userns_has_mapping() by using fscanf() instead of scanf()

And while we are at it, also fix propagation of an uninitialized errno
error.

2 years agocryptsetup: fall back to traditional unlocking if any TPM2 operation fails
Antonio Alvarez Feijoo [Thu, 31 Mar 2022 08:09:29 +0000 (10:09 +0200)] 
cryptsetup: fall back to traditional unlocking if any TPM2 operation fails

If any TPM2 operation fails, the boot process should continue and
prompt for a text password (if configured to do so).

Fixes #22870

2 years agoupdate TODO
Lennart Poettering [Thu, 31 Mar 2022 12:27:13 +0000 (14:27 +0200)] 
update TODO

2 years agoSupport -D_FORTIFY_SOURCE=3 by using __builtin_dynamic_object_size.
Martin Liska [Thu, 31 Mar 2022 08:27:45 +0000 (10:27 +0200)] 
Support -D_FORTIFY_SOURCE=3 by using __builtin_dynamic_object_size.

As explained in the issue, -D_FORTIFY_SOURCE=3 requires usage
of __builtin_dynamic_object_size in MALLOC_SIZEOF_SAFE macro.

Fixes: #22801
2 years agomeson: build kernel-install man page when necessary
Franck Bui [Thu, 31 Mar 2022 09:17:10 +0000 (11:17 +0200)] 
meson: build kernel-install man page when necessary

2 years agoFix "link-local" language inconsistencies
Sebastian Pucilowski [Thu, 31 Mar 2022 05:31:28 +0000 (16:31 +1100)] 
Fix "link-local" language inconsistencies

"Link-local" and "link local" are used throughout man pages and program
output, with the former used far more than the latter. This commit makes
it consistent throughout the project.

2 years agointegritysetup: also validate volume name 22919/head
Lennart Poettering [Thu, 31 Mar 2022 09:22:07 +0000 (11:22 +0200)] 
integritysetup: also validate volume name

Exactly like for veritysetup/cryptsetup

2 years agointegritysetup: also port to mangle_none()
Lennart Poettering [Thu, 31 Mar 2022 09:21:37 +0000 (11:21 +0200)] 
integritysetup: also port to mangle_none()

Let's make the tool work more like veritysetup/cryptsetup in this regard
too.

2 years agointegritysetup: log when attempted to detach already detached volume
Lennart Poettering [Thu, 31 Mar 2022 09:20:25 +0000 (11:20 +0200)] 
integritysetup: log when attempted to detach already detached volume

To make the tool behave more like cryptsetup/veritysetup

2 years agointegritysetup: rename action → verb, to match other code
Lennart Poettering [Thu, 31 Mar 2022 09:20:01 +0000 (11:20 +0200)] 
integritysetup: rename action → verb, to match other code

2 years agotree-wide: unify some code that looks for --help in the command line
Lennart Poettering [Thu, 31 Mar 2022 09:09:48 +0000 (11:09 +0200)] 
tree-wide: unify some code that looks for --help in the command line

2 years agoveritysetup: do some superficial checking on volume name
Lennart Poettering [Thu, 31 Mar 2022 09:03:06 +0000 (11:03 +0200)] 
veritysetup: do some superficial checking on volume name

cryptsetup does this too, so let's better be safe here, too.

2 years agoveritysetup: mangle option strings like in cryptsetup
Lennart Poettering [Thu, 31 Mar 2022 09:01:52 +0000 (11:01 +0200)] 
veritysetup: mangle option strings like in cryptsetup

2 years agoveritysetup: give command line parameters proper names
Lennart Poettering [Thu, 31 Mar 2022 08:52:50 +0000 (10:52 +0200)] 
veritysetup: give command line parameters proper names

Accessing the various arguments always through argv[] is nasty, since
it's not obvious what we are talking about here. Let's give things nice
names.

We did the same in cryptsetup a while back.

2 years agocryptsetup: adjust some log levels
Lennart Poettering [Thu, 31 Mar 2022 08:49:30 +0000 (10:49 +0200)] 
cryptsetup: adjust some log levels

Let's upgrade log levels of some noteworthy messages from LOG_DEBUG to
LOG_NOTICE. These messages contain information that previous log
messages in the error path didn't say, namely that we'll now fall back
to traditional unlocking.

Note that this leaves similar log messages for cases where
TPM2/PKCS#11/FIDO2 support is disabled at build at LOG_DEBUG, since in
that case nothing really failed, we just systematically can't do
TPM2/PKCS#11/FIDO2 and hence it is pointless and not actionable for
users to do anything about it...

2 years agocryptsetup: add helper for mangling "none" option strings
Lennart Poettering [Thu, 31 Mar 2022 08:48:37 +0000 (10:48 +0200)] 
cryptsetup: add helper for mangling "none" option strings

let's unify some code here, and let's do so in cryptsetup-util.h so that
we can later reuse this in integritysetup/veritysetup

2 years agocryptsetup: rename functions that try to do FIDO2/TPM2/PKCS#11 via cryptsetup plugins...
Lennart Poettering [Thu, 31 Mar 2022 08:47:24 +0000 (10:47 +0200)] 
cryptsetup: rename functions that try to do FIDO2/TPM2/PKCS#11 via cryptsetup plugins to say so

The are so many different flavours of functions that attach volumes,
hence say explicitly that these are about libcryptsetup plugins, and
nothing else.

Just some renaming, no code changes beyond that.

2 years agoMerge pull request #22899 from yuwata/network-ignore-carrier-loss
Yu Watanabe [Thu, 31 Mar 2022 02:40:30 +0000 (11:40 +0900)] 
Merge pull request #22899 from yuwata/network-ignore-carrier-loss

network: automatically determine timeout of waiting for carrier regain

2 years agonetwork: shorten code a bit 22899/head
Yu Watanabe [Tue, 29 Mar 2022 16:04:26 +0000 (01:04 +0900)] 
network: shorten code a bit

Currently, there exist only two MTU sources, static and DHCPv4, and they
are exclusive. Hence, it is not necessary to check the existence of the
MTU option in the acquired DHCP lease. Let's unconditionally reset the
MTU. Note that, if the current and original MTU are equivalent, then
link_request_to_set_mtu() handles that gracefully.

2 years agonetwork: automatically determine timeout of waiting for carrier regain
Yu Watanabe [Tue, 29 Mar 2022 15:52:09 +0000 (00:52 +0900)] 
network: automatically determine timeout of waiting for carrier regain

The commit 6706ce2fd2a13df0ae5e469b72d688eaf643dac4 made
IgnoreCarrierLoss= setting also take timespan, to make users handle
issues like #18738 or #20887. But still users needed to explicitly set
a timespan.

This makes networkd automatically determine the timeout when the
situations #18738 or #19832 is detected. Unfortunately, still users have
issue #20887 need to specify a value.

Closes #19832.

2 years agoMerge pull request #22913 from yuwata/sd-device-cleanups
Yu Watanabe [Thu, 31 Mar 2022 00:24:38 +0000 (09:24 +0900)] 
Merge pull request #22913 from yuwata/sd-device-cleanups

sd-device,udev: several cleanups

2 years agoveritysetup: fix parsing of root-hash-signature= option
Zbigniew Jędrzejewski-Szmek [Wed, 30 Mar 2022 07:38:33 +0000 (09:38 +0200)] 
veritysetup: fix parsing of root-hash-signature= option

The function was named confusingly and we managed to confused ourselves. The
parameter was assigned incorrectly and then reassigned correctly in the caller.
Let's simplify the whole thing by just saving the optarg param.

I considered moving the unhexmemming and/or reading of the file to the parse
function, but decided against it. I think it's nicer to parse all options
before opening external files.

2 years agoudev: rename functions to emphasize whole disk is locked 22913/head
Yu Watanabe [Wed, 30 Mar 2022 19:31:46 +0000 (04:31 +0900)] 
udev: rename functions to emphasize whole disk is locked

2 years agoudev: ignore one more error in device_get_block_device()
Yu Watanabe [Wed, 30 Mar 2022 19:26:22 +0000 (04:26 +0900)] 
udev: ignore one more error in device_get_block_device()

2 years agosd-device: do not ignore critical errors in device_new_from_child()
Yu Watanabe [Wed, 30 Mar 2022 19:14:49 +0000 (04:14 +0900)] 
sd-device: do not ignore critical errors in device_new_from_child()

2 years agosd-device: use path_extract_directory() at one more place
Yu Watanabe [Wed, 30 Mar 2022 19:11:30 +0000 (04:11 +0900)] 
sd-device: use path_extract_directory() at one more place

2 years agosd-device: try to get DISKSEQ from uevent file
Yu Watanabe [Wed, 30 Mar 2022 18:27:17 +0000 (03:27 +0900)] 
sd-device: try to get DISKSEQ from uevent file

Otherwise, if the sd-device object is created from e.g. syspath, then
sd_device_get_diskseq() returns -ENOENT.

2 years agosd-device: drop /sys/subsystem support
Yu Watanabe [Mon, 28 Mar 2022 19:04:54 +0000 (04:04 +0900)] 
sd-device: drop /sys/subsystem support

Follow-ups for 37cf83d9bfdd9f6859b6f2654d8ec3bbb17873b2.

2 years agoman: update root-hash-signature option with value
Gaël PORTAY [Thu, 25 Feb 2021 18:02:26 +0000 (13:02 -0500)] 
man: update root-hash-signature option with value

This documents two possible values expected by the option
root-hash-signature for veritytab and veritysetup-generator.

2 years agoudev: do not use sd_event_source_disable_unref() at more places
Yu Watanabe [Wed, 30 Mar 2022 17:04:44 +0000 (02:04 +0900)] 
udev: do not use sd_event_source_disable_unref() at more places

Fixes a bug introduced by 9612da361a825d70a9fd392f3ee5a53bf8896887.

Follow-up for f777e745a7966ea52ef29f9e4edfdd16874cfe86.

2 years agoudev: do not append unknown errno or signal name
Yu Watanabe [Wed, 30 Mar 2022 09:39:50 +0000 (18:39 +0900)] 
udev: do not append unknown errno or signal name

Follow-up for 6467bda59d571696b645e8bbdf31926676890956.

Addresses https://github.com/systemd/systemd/pull/22871#discussion_r837705779.

2 years agoupdate TODO
Lennart Poettering [Wed, 30 Mar 2022 08:45:31 +0000 (10:45 +0200)] 
update TODO

2 years agoci: drop clang 11 & add clang 14
Frantisek Sumsal [Wed, 30 Mar 2022 09:32:31 +0000 (11:32 +0200)] 
ci: drop clang 11 & add clang 14

2 years agofix typo
Yu Watanabe [Wed, 30 Mar 2022 12:10:06 +0000 (21:10 +0900)] 
fix typo

2 years agoNEWS: specify that public headers are still C89
Luca Boccassi [Tue, 29 Mar 2022 20:54:01 +0000 (21:54 +0100)] 
NEWS: specify that public headers are still C89

2 years agoNEWS: mention that C11 is now used
Luca Boccassi [Tue, 29 Mar 2022 20:52:21 +0000 (21:52 +0100)] 
NEWS: mention that C11 is now used

2 years agoNEWS: add entry for the unit enablement stuff v251-rc1
Zbigniew Jędrzejewski-Szmek [Tue, 29 Mar 2022 18:28:47 +0000 (20:28 +0200)] 
NEWS: add entry for the unit enablement stuff

It should be merged soon.

2 years agotest-systemctl-enable: skip test for %v if kver is not a valid instance
Zbigniew Jędrzejewski-Szmek [Tue, 29 Mar 2022 20:39:08 +0000 (22:39 +0200)] 
test-systemctl-enable: skip test for %v if kver is not a valid instance

On arm, we'd fail with:
target@v:5.16.8-200.fc35.armv7hl+lpae.socket: not a valid unit name "target@v:5.16.8-200.fc35.armv7hl+lpae.socket": Invalid argument