]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoMerge pull request #16221 from bluca/show_microsec
Lennart Poettering [Thu, 20 Aug 2020 11:15:04 +0000 (13:15 +0200)] 
Merge pull request #16221 from bluca/show_microsec

systemctl: add --timestamp to change timestamp print format

4 years agouser-runtime-dir: deal gracefully with missing logind properties
Lennart Poettering [Wed, 19 Aug 2020 15:05:44 +0000 (17:05 +0200)] 
user-runtime-dir: deal gracefully with missing logind properties

Fixes: #16685
4 years agoMerge pull request #16559 from benzea/benzea/memory-recursiveprot
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 11:05:07 +0000 (13:05 +0200)] 
Merge pull request #16559 from benzea/benzea/memory-recursiveprot

mount-setup: Enable memory_recursiveprot for cgroup2

4 years agoMerge pull request #16677 from poettering/statx-mntid
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:58:14 +0000 (10:58 +0200)] 
Merge pull request #16677 from poettering/statx-mntid

make use of new kernel 5.8 statx() mount id/mountpoint APIs

4 years agoMerge pull request #16782 from keszybz/seccomp-use-cleanup
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:27:55 +0000 (10:27 +0200)] 
Merge pull request #16782 from keszybz/seccomp-use-cleanup

Use less iffedeffery around syscall names and _cleanup_ in one more place

4 years agohwdb: ACCEL_MOUNT_MATRIX for Irbis TW118 (#16786)
brainrom [Thu, 20 Aug 2020 08:23:35 +0000 (13:23 +0500)] 
hwdb: ACCEL_MOUNT_MATRIX for Irbis TW118 (#16786)

This was required to get orientation sensor work properly in my tablet.

4 years agoMerge pull request #16790 from poettering/core-if-block-merge
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:15:01 +0000 (10:15 +0200)] 
Merge pull request #16790 from poettering/core-if-block-merge

core: merge a few if blocks

4 years agobasic/virt: treat "pouch" as a container type (id: pouch)
Wen Yang [Wed, 19 Aug 2020 11:47:03 +0000 (19:47 +0800)] 
basic/virt: treat "pouch" as a container type (id: pouch)

4 years agoMerge pull request #16792 from poettering/machine-id-chroot
Anita Zhang [Thu, 20 Aug 2020 06:21:56 +0000 (23:21 -0700)] 
Merge pull request #16792 from poettering/machine-id-chroot

machine-id-setup: don't use KVM or container manager supplied uuid if…

4 years agoMerge pull request #16793 from poettering/path-join-more
Anita Zhang [Thu, 20 Aug 2020 06:12:50 +0000 (23:12 -0700)] 
Merge pull request #16793 from poettering/path-join-more

path-lookup: path_join() all the things!

4 years agoman: Fix typo in systemd-tmpfiles
Phaedrus Leeds [Wed, 19 Aug 2020 16:36:32 +0000 (09:36 -0700)] 
man: Fix typo in systemd-tmpfiles

4 years agopath-lookup: path_join() all the things! 16793/head
Lennart Poettering [Wed, 19 Aug 2020 16:27:52 +0000 (18:27 +0200)] 
path-lookup: path_join() all the things!

When we talk about paths, better use path_join(), who knows what callers
pass to us, i.e. prefixed with "/" or not.

4 years agomachine-id-setup: don't use KVM or container manager supplied uuid if in chroot env 16792/head
Lennart Poettering [Wed, 19 Aug 2020 15:07:41 +0000 (17:07 +0200)] 
machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env

Fixes: #16758
4 years agomount-setup: drop pointless zero initialization 16790/head
Lennart Poettering [Wed, 19 Aug 2020 15:47:32 +0000 (17:47 +0200)] 
mount-setup: drop pointless zero initialization

4 years agocore: merge a few if blocks
Lennart Poettering [Wed, 19 Aug 2020 15:45:33 +0000 (17:45 +0200)] 
core: merge a few if blocks

arg_system == true and getpid() == 1 hold under the very same condition
this early in the main() function (this only changes later when we start
parsing command lines, where arg_system = true is set if users invoke us
in test mode even when getpid() != 1.

Hence, let's simplify things, and merge a couple of if branches and not
pretend they were orthogonal.

4 years agosystemctl: add --timestamp to change timestamp print format 16221/head
Luca Boccassi [Fri, 19 Jun 2020 10:26:22 +0000 (11:26 +0100)] 
systemctl: add --timestamp to change timestamp print format

Timestamps for unit start/stop are recorded with microsecond granularity,
but status and show truncate to second granularity by default.
Add a --timestamp=pretty|us|utc option to allow including the microseconds
or to use the UTC TZ to all timestamps printed by systemctl.

4 years agobasic/time-util: add function to format timestamps with different styles
Luca Boccassi [Fri, 19 Jun 2020 10:24:09 +0000 (11:24 +0100)] 
basic/time-util: add function to format timestamps with different styles

Instead of a multiple fixed format helper functions, add an enum and
a single helper, so that it's easier to extend in the future.

4 years agohomed: default to "btrfs" as fs type in the LUKS backend
Lennart Poettering [Tue, 18 Aug 2020 13:11:06 +0000 (15:11 +0200)] 
homed: default to "btrfs" as fs type in the LUKS backend

Apparently both Fedora and suse default to btrfs now, it should hence be
good enough for us too.

This enables a bunch of really nice things for us, most importanly we
can resize home directories freely (i.e. both grow *and* shrink) while
online. It also allows us to add nice subvolume based home directory
snapshotting later on.

Also, whenever we mention the three supported types, alaways mention
them in alphabetical order, which is also our new order of preference.

4 years agoMerge pull request #16771 from poettering/dyn-pwq
Lennart Poettering [Wed, 19 Aug 2020 13:40:41 +0000 (15:40 +0200)] 
Merge pull request #16771 from poettering/dyn-pwq

make libpwquality a dlopen() dependency + use it in systemd-firstboot, too

4 years agoMerge pull request #16762 from poettering/homed-fixlets
Zbigniew Jędrzejewski-Szmek [Wed, 19 Aug 2020 09:43:49 +0000 (11:43 +0200)] 
Merge pull request #16762 from poettering/homed-fixlets

homed: five fixlets

4 years agoman: Improve MemoryMin=/MemoryLow= description 16559/head
Benjamin Berg [Fri, 24 Jul 2020 11:17:23 +0000 (13:17 +0200)] 
man: Improve MemoryMin=/MemoryLow= description

The description didn't really explain how the distribution mechanism
works exactly and the relationship of leaf and slice units.

Update the documentation and also explicitly explain the expected
behaviour as it is created by the memory_recursiveprot cgroup2 mount
option.

4 years agomount-setup: Enable memory_recursiveprot for cgroup2
Benjamin Berg [Thu, 23 Jul 2020 10:56:32 +0000 (12:56 +0200)] 
mount-setup: Enable memory_recursiveprot for cgroup2

When available, enable memory_recursiveprot. Realistically it always
makes sense to delegate MemoryLow= and MemoryMin= to all children of a
slice/unit.

The kernel option is not enabled by default as it might cause
regressions in some setups. However, it is the better default in
general, and it results in a more flexible and obvious behaviour.

The alternative to using this option would be for user's to also set
DefaultMemoryLow= on slices when assigning MemoryLow=. However, this
makes the effect of MemoryLow= on some children less obvious, as it
could result in a lower protection rather than increasing it.

From the kernel documentation:

  memory_recursiveprot

        Recursively apply memory.min and memory.low protection to
        entire subtrees, without requiring explicit downward
        propagation into leaf cgroups.  This allows protecting entire
        subtrees from one another, while retaining free competition
        within those subtrees.  This should have been the default
        behavior but is a mount-option to avoid regressing setups
        relying on the original semantics (e.g. specifying bogusly
        high 'bypass' protection values at higher tree levels).

This was added in kernel commit 8a931f801340c (mm: memcontrol:
recursive memory.low protection), which became available in 5.7 and was
subsequently fixed in kernel 5.7.7 (mm: memcontrol: handle div0 crash
race condition in memory.low).

4 years agoshared/seccomp: use _cleanup_ in one more place 16782/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 15:06:28 +0000 (17:06 +0200)] 
shared/seccomp: use _cleanup_ in one more place

(cherry picked from commit 27605d6a836d85563faf41db9f7a72883d44c0ff)

4 years agoshared/seccomp: do not use ifdef guards around textual syscall names
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 14:10:47 +0000 (16:10 +0200)] 
shared/seccomp: do not use ifdef guards around textual syscall names

It is possible that we will be running with an upgraded libseccomp, in which
case libseccomp might know the syscall name, even if the number is not known at
the time when systemd is being compiled. The guard only serves to break such
upgrades, by requiring that we also recompile systemd.

For s390-specific syscalls, use a define to exclude them, so that that we don't
try to filter them on other arches.

(cherry picked from commit 6cf852e79eb0eced2f77653941f9c75c3bd79386)

4 years agoMerge pull request #16640 from keszybz/various-patches
Lennart Poettering [Wed, 19 Aug 2020 08:30:45 +0000 (10:30 +0200)] 
Merge pull request #16640 from keszybz/various-patches

Improve systemd-analyze security a bit and other assorted bits

4 years agomeson: add min version for libfdisk
Anita Zhang [Tue, 18 Aug 2020 06:09:38 +0000 (23:09 -0700)] 
meson: add min version for libfdisk

Was trying to run src/partition/test-repart.sh on CentOS 8 and the first
resize call kept failing with ERANGE. Turned out that CentOS 8 comes
with libfdisk-devel-2.32.1 which is missing
https://github.com/karelzak/util-linux/commit/2f35c1ead621f42f32f7777232568cb03185b473
(in libfdisk 2.33 and up).

4 years agoupdate TODO 16677/head
Lennart Poettering [Wed, 5 Aug 2020 22:03:23 +0000 (00:03 +0200)] 
update TODO

4 years agomountpoint-util: use new kernel 5.8 statx() API for determining mount points
Lennart Poettering [Wed, 5 Aug 2020 21:53:42 +0000 (23:53 +0200)] 
mountpoint-util: use new kernel 5.8 statx() API for determining mount points

We finally have an explicit API for this in the kernel. It's great and
simple. Let's use it!

4 years agomountpoint-util: use new kernel 5.8 statx() API for determining mnt_id
Lennart Poettering [Wed, 5 Aug 2020 21:28:21 +0000 (23:28 +0200)] 
mountpoint-util: use new kernel 5.8 statx() API for determining mnt_id

The kernel finally has a proper API to determine the mnt_id of a file.
Let's use it.

This adds support for the STATX_MNT_ID field of statx(), added in
kernel 5.8.

4 years agomountpoint-util: minor modernizations
Lennart Poettering [Wed, 5 Aug 2020 21:28:14 +0000 (23:28 +0200)] 
mountpoint-util: minor modernizations

4 years agoupdate TODO 16771/head
Lennart Poettering [Tue, 18 Aug 2020 08:41:18 +0000 (10:41 +0200)] 
update TODO

4 years agofirstboot: hook up with libpwquality
Lennart Poettering [Tue, 18 Aug 2020 08:37:44 +0000 (10:37 +0200)] 
firstboot: hook up with libpwquality

4 years agohome: make libpwquality dep a runtime dlopen() one
Lennart Poettering [Tue, 18 Aug 2020 07:56:56 +0000 (09:56 +0200)] 
home: make libpwquality dep a runtime dlopen() one

Also, let's move the glue for this to src/shared/ so that we later can
reuse this in sysemd-firstboot.

Given that libpwquality is a more a leaf dependency, let's make it
runtime optional, so that downstream distros can downgrade their package
deps from Required to Recommended.

4 years agoMerge pull request #16780 from alyssais/grammar
Anita Zhang [Wed, 19 Aug 2020 05:41:34 +0000 (22:41 -0700)] 
Merge pull request #16780 from alyssais/grammar

load-fragment: fix grammar in error messages

4 years agoload-fragment: fix grammar in error messages 16780/head
Alyssa Ross [Tue, 18 Aug 2020 20:56:59 +0000 (20:56 +0000)] 
load-fragment: fix grammar in error messages

4 years agoFix function description in logind man page
Nicolas Fella [Tue, 18 Aug 2020 20:36:47 +0000 (22:36 +0200)] 
Fix function description in logind man page

Fix a presumed copy&paste error. SetLockedHint corresponds to the "locked hint", not the "idle hint".

4 years agonetwork: do not fail if UseMTU=yes on DHCP lease lost
Yu Watanabe [Tue, 18 Aug 2020 10:21:25 +0000 (19:21 +0900)] 
network: do not fail if UseMTU=yes on DHCP lease lost

This fixes a bug introduced by 6906794dd1698954b349ec3ec84f1494ecd63cd3.

Fixes #16768.

4 years agoMerge pull request #16687 from DaanDeMeyer/bootloader-machine-id
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 13:05:26 +0000 (15:05 +0200)] 
Merge pull request #16687 from DaanDeMeyer/bootloader-machine-id

Allow bootctl and kernel-install to be called without /etc/machine-id present

4 years agohomework: downgrade chattr failure log message 16762/head
Lennart Poettering [Mon, 17 Aug 2020 20:07:55 +0000 (22:07 +0200)] 
homework: downgrade chattr failure log message

NOCOW is a btrfs-only thing hence don't log louder than necessary if we
don't have it.

4 years agohomework: explicitly close cryptsetup context, to not keep loopback device busy
Lennart Poettering [Mon, 17 Aug 2020 20:09:04 +0000 (22:09 +0200)] 
homework: explicitly close cryptsetup context, to not keep loopback device busy

The cryptsetup context pins the loop device even after deactivation.
Let's explicitly release the context to make sure the subsequent
loopback device detaching works cleanly.

4 years agohomework: correct error passed into log message
Lennart Poettering [Mon, 17 Aug 2020 18:20:47 +0000 (20:20 +0200)] 
homework: correct error passed into log message

4 years agohomework: sync everything to disk before we rename LUKS loopback file into place
Lennart Poettering [Mon, 17 Aug 2020 17:54:38 +0000 (19:54 +0200)] 
homework: sync everything to disk before we rename LUKS loopback file into place

This how this works on Linux: when atomically creating a file we need to
fully populate it under a temporary name and then when we are fully
done, sync it and the directory it is contained in, before renaming it
to the final name.

4 years agohomed: downgrade quota message in containers
Lennart Poettering [Mon, 17 Aug 2020 16:19:30 +0000 (18:19 +0200)] 
homed: downgrade quota message in containers

quota syscalls and operations are typically prohibited in containers.
Let's not make noise about that, needlessly.

4 years agolog: don't explicitly re-open log for failed assertions
Franck Bui [Mon, 3 Aug 2020 15:50:11 +0000 (17:50 +0200)] 
log: don't explicitly re-open log for failed assertions

This was needed before commit 16e4fd87c5be06d2b7a3b368205c8c5bab9df32a added a
mode that opens the log fds for every single log message. This mode is used in
execute.c since then making the explicit call to log_open unnecessary.

This basically reverts ea89a119cda917a17bd186b3c13197acfd655b12.

4 years agoresolve: lift limits on search domains count or length
Dimitri John Ledkov [Fri, 7 Aug 2020 11:47:09 +0000 (12:47 +0100)] 
resolve: lift limits on search domains count or length

glibc 2.26 lifted restrictions on search domains count or length to
unlimited. This has also been backported to 2.17 in some distributions (RHEL 7
and derivatives). Other softwares may have their own limits for search domains,
but we should not restrict what is written out any more.

https://sourceware.org/legacy-ml/libc-announce/2017/msg00001.html

4 years agoMerge pull request #16761 from keszybz/missing-syscall-cleanup
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 08:01:19 +0000 (10:01 +0200)] 
Merge pull request #16761 from keszybz/missing-syscall-cleanup

Missing syscall cleanup

4 years agomissing_syscall: do not use function name that may conflict with glibc 16761/head
Zbigniew Jędrzejewski-Szmek [Sun, 16 Aug 2020 14:19:29 +0000 (16:19 +0200)] 
missing_syscall: do not use function name that may conflict with glibc

This was done for all replacements back in 5187dd2c403caf92d09f3491e41f1ceb3f10491f,
but some newer stuff didn't do this.

4 years agomissing_syscall: fix pidfd_{send_signal,open} numbers for alpha
Zbigniew Jędrzejewski-Szmek [Sat, 15 Aug 2020 17:01:23 +0000 (19:01 +0200)] 
missing_syscall: fix pidfd_{send_signal,open} numbers for alpha

Also order the syscalls by syscall number for easier comparisons with the
kernel headers.

Fixup for 5f152f43d04e5aad6a3f98f45f020a66e3aac717.

4 years agomissing_syscall: add forgotten check for __NR_get_mempolicy nonnegativity
Zbigniew Jędrzejewski-Szmek [Sat, 15 Aug 2020 16:54:18 +0000 (18:54 +0200)] 
missing_syscall: add forgotten check for __NR_get_mempolicy nonnegativity

We do it in other cases, we should here too.

Fixup for b070c7c0e13.

4 years agoshared/cgroup-setup: reduce scope of variables 16640/head
Zbigniew Jędrzejewski-Szmek [Fri, 31 Jul 2020 08:49:57 +0000 (10:49 +0200)] 
shared/cgroup-setup: reduce scope of variables

4 years agobasic/utf8: rename parameter
Zbigniew Jędrzejewski-Szmek [Thu, 30 Jul 2020 15:08:39 +0000 (17:08 +0200)] 
basic/utf8: rename parameter

Every time I was using this function I had to check whether "newline"
means that newlines are good or bad.

4 years agobasic/string-util: reduce scope of variables
Zbigniew Jędrzejewski-Szmek [Thu, 30 Jul 2020 15:00:25 +0000 (17:00 +0200)] 
basic/string-util: reduce scope of variables

4 years agojournal: adjust line about when the journal begins and ends
Zbigniew Jędrzejewski-Szmek [Fri, 24 Jul 2020 10:19:08 +0000 (12:19 +0200)] 
journal: adjust line about when the journal begins and ends

This comes up occasionally with new users. The phrase "Logs begin ..." is
ambiguous because it can be taken to mean the logs being displayed or all logs
(the intended meaning). Let's rephrase this as "Journal begins ..." to make
this clearer.

4 years agoanalyze-security: include an actual syscall name in the message
Zbigniew Jędrzejewski-Szmek [Sat, 1 Aug 2020 09:41:57 +0000 (11:41 +0200)] 
analyze-security: include an actual syscall name in the message

This information was already available in the debug output, but I think it
is good to include it in the message in the table. This makes it easier to wrap
one's head around the allowlist/denylist filtering.

4 years agotest: accept that char device 0/0 can now be created witout privileges
Lennart Poettering [Fri, 14 Aug 2020 19:50:55 +0000 (21:50 +0200)] 
test: accept that char device 0/0 can now be created witout privileges

Fixes: #16721
4 years agohwdb: ACCEL_MOUNT_MATRIX quirk for Acer SP111-32*
Grant Mathews [Sun, 16 Aug 2020 19:16:22 +0000 (12:16 -0700)] 
hwdb: ACCEL_MOUNT_MATRIX quirk for Acer SP111-32*

4 years agosocket-netlink: make address argument const
Lennart Poettering [Mon, 17 Aug 2020 08:51:17 +0000 (10:51 +0200)] 
socket-netlink: make address argument const

4 years agoman: move 'files' module in NSS 'hosts:' line before myhostname
Lennart Poettering [Mon, 17 Aug 2020 07:10:32 +0000 (09:10 +0200)] 
man: move 'files' module in NSS 'hosts:' line before myhostname

I am pretty sure /etc/hosts (i.e. an explicitly configured, local,
trusted database) should be useful for overriding the automatic
myhostname logic.

resolved's internal logic handles it that way and hence we should
suggest it in the NSS fallback line, too.

Let's also bring the factory file back into sync with what the docs say.

And update the prose a bit too, to actually match what we recommend.

4 years agotools/make-man-index: fix purpose text that contains tags
Haochen Tong [Sun, 16 Aug 2020 01:28:46 +0000 (03:28 +0200)] 
tools/make-man-index: fix purpose text that contains tags

4 years agotest-fs-util: skip encrypted path test if we get EACCES
Topi Miettinen [Mon, 17 Aug 2020 09:08:57 +0000 (12:08 +0300)] 
test-fs-util: skip encrypted path test if we get EACCES

Unprivileged test-fs-util fails on my system since /sys/dev/block is
inaccessible for unprivileged users, so let's skip encrypted path test if we
get EACCES or similar.

4 years agoREADME: fix indentation
Lennart Poettering [Sun, 16 Aug 2020 16:25:18 +0000 (18:25 +0200)] 
README: fix indentation

All paragraphs are indented to 8 spaces, but one. Fix that.

4 years agoupdate TODO
Lennart Poettering [Mon, 17 Aug 2020 07:10:15 +0000 (09:10 +0200)] 
update TODO

4 years agoNewer Glibc use faccessat2 to implement faccessat
Michael Scherer [Sat, 15 Aug 2020 16:12:02 +0000 (18:12 +0200)] 
Newer Glibc use faccessat2 to implement faccessat

cf https://repo.or.cz/glibc.git/commit/3d3ab573a5f3071992cbc4f57d50d1d29d55bde2

This cause breakage on Fedora Rawhide: https://bugzilla.redhat.com/show_bug.cgi?id=1869030

4 years agoMerge pull request #16705 from bluca/verity_udev_wait
Lennart Poettering [Fri, 14 Aug 2020 18:14:57 +0000 (20:14 +0200)] 
Merge pull request #16705 from bluca/verity_udev_wait

Verity: use udev to wait for symlink creation on concurrent activations

4 years agoshared/udev-util: fix sd_device leak in device_wait_for_initialization 16705/head
Luca Boccassi [Fri, 14 Aug 2020 10:05:42 +0000 (11:05 +0100)] 
shared/udev-util: fix sd_device leak in device_wait_for_initialization

If the caller doesn't pass a return pointer, or if sd_event_loop fails
after the device was found and referenced, it never gets dereferenced.

4 years agotree-wide: enable/disable libcrypsetup debug output depending on our level
Luca Boccassi [Mon, 10 Aug 2020 10:45:07 +0000 (11:45 +0100)] 
tree-wide: enable/disable libcrypsetup debug output depending on our level

Avoid always setting to debug, as it will incur in many more callbacks from
libcrypsetup that then get discarded, wasting resources.

4 years agodissect: yield for 2ms when a verity device cannot be opened before retrying
Luca Boccassi [Mon, 10 Aug 2020 10:22:30 +0000 (11:22 +0100)] 
dissect: yield for 2ms when a verity device cannot be opened before retrying

If we don't succeed on the first try it's because another process is
opening the same device. Do a microsleep for 2ms to increase the
chances it has completed the next time around the loop.

4 years agodissect: account for EBUSY when verity device already exists
Luca Boccassi [Mon, 10 Aug 2020 10:15:48 +0000 (11:15 +0100)] 
dissect: account for EBUSY when verity device already exists

In some cases, libdevmapper/libcrypsetup might return EBUSY instead of
EEXIST when opening a shared device. Treat it in the same way.

4 years agodissect: wait for udev event if verity device not yet available
Luca Boccassi [Mon, 10 Aug 2020 10:19:22 +0000 (11:19 +0100)] 
dissect: wait for udev event if verity device not yet available

The symlink /dev/mapper/dm_name is created by udev after a mapper
device is set up. So libdevmapper/libcrypsetup might tell us that
a verity device exists, but the symlink we use as the source for
the mount operation might not be there yet.
Instead of falling back to a new unique device set up, wait for
the udev event matching on the expected devlink for at least 100ms
(after which the benefits of sharing a device in terms of setup
time start to disappear - on my production machines, opening a new
verity device seems to take between 150ms and 300ms)

4 years agoudev-util: add device_wait_for_devlink
Luca Boccassi [Mon, 10 Aug 2020 10:24:51 +0000 (11:24 +0100)] 
udev-util: add device_wait_for_devlink

Allows to wait for an event by matching on the devlink that gets
created.

4 years agonamespace: fix minor memory leak
Lennart Poettering [Fri, 14 Aug 2020 09:07:18 +0000 (11:07 +0200)] 
namespace: fix minor memory leak

4 years agoMerge pull request #16612 from poettering/dissect-copy
Lennart Poettering [Thu, 13 Aug 2020 09:26:49 +0000 (11:26 +0200)] 
Merge pull request #16612 from poettering/dissect-copy

teach systemd-dissect file copying, and make it officially supported, move to /usr/bin + man page

4 years agoupdate TODO 16612/head
Lennart Poettering [Tue, 28 Jul 2020 21:43:26 +0000 (23:43 +0200)] 
update TODO

4 years agotest: update tests to use new JSON output instead of human readable output
Lennart Poettering [Tue, 11 Aug 2020 21:32:19 +0000 (23:32 +0200)] 
test: update tests to use new JSON output instead of human readable output

4 years agodissect: add support for outputting JSON
Lennart Poettering [Tue, 11 Aug 2020 21:16:44 +0000 (23:16 +0200)] 
dissect: add support for outputting JSON

4 years agojson: add helpers for dealing with id128 + strv
Lennart Poettering [Tue, 11 Aug 2020 21:16:28 +0000 (23:16 +0200)] 
json: add helpers for dealing with id128 + strv

4 years agoman: document systemd-dissect
Lennart Poettering [Wed, 29 Jul 2020 13:43:43 +0000 (15:43 +0200)] 
man: document systemd-dissect

4 years agomeson: move systemd-dissect to /usr/bin
Lennart Poettering [Wed, 29 Jul 2020 13:39:33 +0000 (15:39 +0200)] 
meson: move systemd-dissect to /usr/bin

4 years agodissect: show proper error strings for more errors
Lennart Poettering [Tue, 11 Aug 2020 13:59:44 +0000 (15:59 +0200)] 
dissect: show proper error strings for more errors

Also, make inability to decrypt and EBUSY a non-fatal issue, since we
still are able to display the mount table then.

4 years agodissect: introduce new helper dissected_image_mount_and_warn() and use it everywhere
Lennart Poettering [Tue, 11 Aug 2020 13:56:12 +0000 (15:56 +0200)] 
dissect: introduce new helper dissected_image_mount_and_warn() and use it everywhere

4 years agodissect: use recognizable error if we are supposed to mount an encrypted fs
Lennart Poettering [Tue, 11 Aug 2020 13:54:16 +0000 (15:54 +0200)] 
dissect: use recognizable error if we are supposed to mount an encrypted fs

Also, document EBUSY

4 years agodissect: immediately close pipes when we determined we have no data for them
Lennart Poettering [Wed, 29 Jul 2020 13:17:22 +0000 (15:17 +0200)] 
dissect: immediately close pipes when we determined we have no data for them

This effectively makes little difference because we exit soon later
anyway, which will close the fds, too. However, it's still useful since
it means the parent will get EOF events on them in the order we process
things and isn't delayed to process the data from the pipes until the
child dies.

4 years agodissect: properly propagate some relevant dissection errors
Lennart Poettering [Wed, 29 Jul 2020 13:16:27 +0000 (15:16 +0200)] 
dissect: properly propagate some relevant dissection errors

Let's send some specific error codes from helper process to parent via
the return value, and convert them back there.

4 years agodissect: beef up dissection output
Lennart Poettering [Wed, 29 Jul 2020 13:15:07 +0000 (15:15 +0200)] 
dissect: beef up dissection output

Let's use a proper table for outputting partition information. Let's
also put the general information about the image first, and the table
after that.

Moreover, dissect the image before showing any output, so that we can
early on return an error if the image is not valid.

4 years agodissect: load verity metadata earlier
Lennart Poettering [Wed, 29 Jul 2020 13:13:20 +0000 (15:13 +0200)] 
dissect: load verity metadata earlier

That way we can turn off kernel partition scanning if verity data is
available (as we don't support verity for full GPT images, only for
simple file system images).

4 years agodissect: show more information in output
Lennart Poettering [Tue, 28 Jul 2020 21:49:35 +0000 (23:49 +0200)] 
dissect: show more information in output

Let's show size and image filename.

4 years agodissect: add support for copying files in/out of image
Lennart Poettering [Tue, 28 Jul 2020 17:47:43 +0000 (19:47 +0200)] 
dissect: add support for copying files in/out of image

4 years agocopy: add copy_access() helper for copying access mode
Lennart Poettering [Tue, 28 Jul 2020 21:38:23 +0000 (23:38 +0200)] 
copy: add copy_access() helper for copying access mode

4 years agodissect: optionally mkdir directory to overmount
Lennart Poettering [Tue, 28 Jul 2020 16:50:17 +0000 (18:50 +0200)] 
dissect: optionally mkdir directory to overmount

4 years agomkdir: handle mkdir_p() of simple filename gracefully
Lennart Poettering [Tue, 28 Jul 2020 16:49:55 +0000 (18:49 +0200)] 
mkdir: handle mkdir_p() of simple filename gracefully

4 years agodissect: support --discard=list
Lennart Poettering [Tue, 28 Jul 2020 21:39:09 +0000 (23:39 +0200)] 
dissect: support --discard=list

4 years agofirstboot: move --image= logic into common code
Lennart Poettering [Tue, 28 Jul 2020 16:16:19 +0000 (18:16 +0200)] 
firstboot: move --image= logic into common code

That way we can reuse it in tmpfiles/sysusers/journalctl and so on.

4 years agoMerge pull request #16678 from poettering/loop-configure
Lennart Poettering [Tue, 11 Aug 2020 20:22:27 +0000 (22:22 +0200)] 
Merge pull request #16678 from poettering/loop-configure

loop-util: use new LOOP_CONFIGURE ioctl added in kernel 5.8

4 years agoman: fix incorrectly placed full stop
Lennart Poettering [Tue, 11 Aug 2020 12:50:32 +0000 (14:50 +0200)] 
man: fix incorrectly placed full stop

4 years agoupdate TODO 16678/head
Lennart Poettering [Thu, 6 Aug 2020 08:41:20 +0000 (10:41 +0200)] 
update TODO

4 years agoloop-util: use new LOOP_CONFIGURE ioctl
Lennart Poettering [Thu, 6 Aug 2020 07:47:14 +0000 (09:47 +0200)] 
loop-util: use new LOOP_CONFIGURE ioctl

LOOP_CONFIGURE allows us to configure a loopback device in one ioctl
instead of two, which is not just faster but also removes the race that
udev might start probing the device before we adjusted things properly.

Unfortunately LOOP_CONFIGURE is broken in regards to LO_FLAGS_PARTSCAN
as of kernel 5.8.0. This patch contains a work-around for that, to
fallback to old behaviour if partition scanning is requested but does
not work. Sucks a bit.

Proposed upstream fix for that issue:

https://lkml.org/lkml/2020/8/6/97

4 years agodissect: use new blockdev_partscan_enabled() API where appropriate
Lennart Poettering [Thu, 6 Aug 2020 08:35:29 +0000 (10:35 +0200)] 
dissect: use new blockdev_partscan_enabled() API where appropriate

4 years agoblockdev-util: add correct API for detecting if block device has partition scanning...
Lennart Poettering [Thu, 6 Aug 2020 08:31:19 +0000 (10:31 +0200)] 
blockdev-util: add correct API for detecting if block device has partition scanning enabled

Instead of checking the loopback ioctls, let's check sysfs, so that we
catch all kinds of block devices, not just loopback block devices.

4 years agoMerge pull request #16690 from poettering/userdb-group-desc
Anita Zhang [Tue, 11 Aug 2020 07:27:54 +0000 (00:27 -0700)] 
Merge pull request #16690 from poettering/userdb-group-desc

description field for group records

4 years agounits: order volatile-root after repart
Lennart Poettering [Mon, 10 Aug 2020 17:56:17 +0000 (19:56 +0200)] 
units: order volatile-root after repart

Let's make sure systemd-repart can still see the real device before we
replace its mount with an overlay mount, and thus order repart before
volatile-root.

See: https://lists.freedesktop.org/archives/systemd-devel/2020-July/044896.html