]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agomeson: add syscall-names-update target
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 14:27:20 +0000 (16:27 +0200)] 
meson: add syscall-names-update target

The calls to find_program("tools/*") are moved earlier so they can be used
in libshared/ (and it doesn't make sense to split them).

3 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)

3 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)

3 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

3 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.

3 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

3 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

3 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.

3 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.

3 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.

3 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
3 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*

3 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

3 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.

3 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

3 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.

3 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.

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

3 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

3 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

3 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.

3 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.

3 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.

3 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.

3 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)

3 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.

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

3 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

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

3 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

3 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

3 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

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

3 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

3 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.

3 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

3 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

3 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.

3 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.

3 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.

3 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).

3 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.

3 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

3 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

3 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

3 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

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

3 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.

3 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

3 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

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

3 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

3 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

3 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.

3 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

3 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

3 years agokernel-install: Add fallback to "Linux" if no machine-id is found 16687/head
Daan De Meyer [Thu, 6 Aug 2020 20:56:36 +0000 (21:56 +0100)] 
kernel-install: Add fallback to "Linux" if no machine-id is found

This allows kernel-install to be used by image builders such as mkosi
which don't have a machine-id available when they call kernel-install.

3 years agobootctl: Remove dependency on machine-id.
Daan De Meyer [Thu, 6 Aug 2020 20:49:31 +0000 (21:49 +0100)] 
bootctl: Remove dependency on machine-id.

The machine-id is used to create a few directories and setup a default
loader entry in loader.conf. Having bootctl create the directories
itself is not particularly useful as it does not put anything in them
and bootctl install is not guaranteed to be called before an initramfs
tool like kernel-install so other programs will always need to have
logic to create the directories themselves if they happen to be called
before bootctl install is called.

On top of this, when using unified kernel images, these are installed to
$BOOT/EFI/Linux which removes the need to have the directories created
by bootctl at all. This further indicates that these directories should
be created by the program that puts something in them rather than by
bootctl.

Removing the machine-id dependency allows bootctl install to be called
even when there's no machine-id in the image. This is useful for image
builders such as mkosi which don't have a machine-id when
installing systemd-boot (via bootctl) because it should only be
generated by systemd when the final image is booted.

The default entry in loader.conf based on the machine-id in loader.conf
is also removed which shouldn't be a massive loss in usability overall.

This commit reverts commit 341890d.

3 years agoMerge pull request #16697 from yuwata/network-fix-suspend-issue
Lennart Poettering [Mon, 10 Aug 2020 18:09:36 +0000 (20:09 +0200)] 
Merge pull request #16697 from yuwata/network-fix-suspend-issue

network: fix suspend issue

3 years agoMerge pull request #16684 from keszybz/assorted-cleanups
Lennart Poettering [Mon, 10 Aug 2020 17:28:05 +0000 (19:28 +0200)] 
Merge pull request #16684 from keszybz/assorted-cleanups

Assorted cleanups

3 years agohwdb: Add ACCEL_MOUNT_MATRIX quirk for Asus M80TA
Nicholas Narsing [Sun, 9 Aug 2020 04:43:26 +0000 (21:43 -0700)] 
hwdb: Add ACCEL_MOUNT_MATRIX quirk for Asus M80TA

3 years agonetwork: wait for previous address removal before configuring static addresses 16697/head
Yu Watanabe [Sat, 8 Aug 2020 03:36:18 +0000 (12:36 +0900)] 
network: wait for previous address removal before configuring static addresses

Fixes #16696.

3 years agonetwork: drop unnecessary bracket
Yu Watanabe [Sat, 8 Aug 2020 03:31:59 +0000 (12:31 +0900)] 
network: drop unnecessary bracket

3 years agonetwork: only process non-error message
Yu Watanabe [Sat, 8 Aug 2020 03:31:12 +0000 (12:31 +0900)] 
network: only process non-error message

3 years agoMerge pull request #16682 from poettering/userdb-gecos-fix
Lennart Poettering [Fri, 7 Aug 2020 20:57:41 +0000 (22:57 +0200)] 
Merge pull request #16682 from poettering/userdb-gecos-fix

userdb: mangle GECOS field if necessary

3 years agouser-record: deal with invalid GECOS fields gracefully 16682/head
Lennart Poettering [Thu, 6 Aug 2020 15:00:07 +0000 (17:00 +0200)] 
user-record: deal with invalid GECOS fields gracefully

Let's fix up invalid GECOS fields both when we convert from NSS to JSON
and the other way round.

Kinda sucks we have to do that, but NSS does it when writing data to
/etc/passwd, so let's do the same.

Fixes: #16668
3 years agouser-util: add mangle_gecos() call for turning strings into fields suitable as GECOS...
Lennart Poettering [Thu, 6 Aug 2020 14:46:18 +0000 (16:46 +0200)] 
user-util: add mangle_gecos() call for turning strings into fields suitable as GECOS fields

3 years agofix typo in systemctl help
Matt Fenwick [Fri, 7 Aug 2020 14:43:11 +0000 (10:43 -0400)] 
fix typo in systemctl help

3 years agoMerge pull request #16604 from poettering/tmpfiles-image
Zbigniew Jędrzejewski-Szmek [Fri, 7 Aug 2020 08:08:42 +0000 (10:08 +0200)] 
Merge pull request #16604 from poettering/tmpfiles-image

add --image= switch to tmpfiles, sysusers, journalctl

3 years agojournalctl: in "-o cat" mode show color
Lennart Poettering [Thu, 6 Aug 2020 22:00:26 +0000 (00:00 +0200)] 
journalctl: in "-o cat" mode show color

Let's provide a modicum of niceness, even in this barebones mode.

Fixes: #16232
3 years agounits: order systemd-user-sessions.service after home.mount
Lennart Poettering [Thu, 6 Aug 2020 21:33:29 +0000 (23:33 +0200)] 
units: order systemd-user-sessions.service after home.mount

This should make /home as automount work reasonably well.

If /home is an automount this has little effect at boot, because if the
automount is not triggered it doesn't matter how the associated mount is
ordered.

It does matter at shutdown however, where home.mount is likely active
now. There the ordering means we'll end sessions first, and only then
deactivate home.mount.

Fixes: #16291
3 years agoupdate TODO 16690/head
Lennart Poettering [Thu, 6 Aug 2020 15:46:56 +0000 (17:46 +0200)] 
update TODO

3 years agodocs: document new description field
Lennart Poettering [Thu, 6 Aug 2020 15:44:57 +0000 (17:44 +0200)] 
docs: document new description field

Also, explain GECOS syntax requirements.

3 years agocore,home,machined: generate description fields for all groups we synthesize
Lennart Poettering [Thu, 6 Aug 2020 15:41:05 +0000 (17:41 +0200)] 
core,home,machined: generate description fields for all groups we synthesize

3 years agouserdb: add "description" field to group records
Lennart Poettering [Thu, 6 Aug 2020 15:35:34 +0000 (17:35 +0200)] 
userdb: add "description" field to group records

User records have the realname/gecos fields, groups never had that, but
it would really be useful to have it, hence let's add it with similar
semantics.

We enforce the same syntax as for GECOS, since it's better to start with
strict rules and losen them later instead of the opposite.

3 years agoupdate TODO
Lennart Poettering [Thu, 6 Aug 2020 22:02:17 +0000 (00:02 +0200)] 
update TODO

3 years agoman: clarify that LogNamespace= is for system services only
Lennart Poettering [Thu, 6 Aug 2020 13:27:00 +0000 (15:27 +0200)] 
man: clarify that LogNamespace= is for system services only

Fixes: #16638
3 years agoMerge pull request #16321 from bluca/mount_images
Zbigniew Jędrzejewski-Szmek [Thu, 6 Aug 2020 16:23:03 +0000 (18:23 +0200)] 
Merge pull request #16321 from bluca/mount_images

core: new feature MountImages

3 years ago_sd-common.h: avoid parsing errors with Coverity
Kamil Dudka [Wed, 5 Aug 2020 21:53:40 +0000 (23:53 +0200)] 
_sd-common.h: avoid parsing errors with Coverity

The commit 1070d271fa8fa553d57dd5f74dd1e3f60732d0b9 which was supposed
too fix this does not seem to take effect any more.  We get again 34%
compilation success rate while scanning systemd itself.  Moreover, the
installed header file breaks compilation of programs that include it:

"/usr/include/systemd/_sd-common.h", line 23: error #35: #error directive: "Do
          not include _sd-common.h directly; it is a private header."
  #  error "Do not include _sd-common.h directly; it is a private header."
     ^

3 years agoupdate TODO
Lennart Poettering [Thu, 6 Aug 2020 12:08:25 +0000 (14:08 +0200)] 
update TODO

3 years agocore: new feature MountImages 16321/head
Luca Boccassi [Tue, 14 Jul 2020 15:18:41 +0000 (16:18 +0100)] 
core: new feature MountImages

Follows the same pattern and features as RootImage, but allows an
arbitrary mount point under / to be specified by the user, and
multiple values - like BindPaths.

Original implementation by @topimiettinen at:
https://github.com/systemd/systemd/pull/14451
Reworked to use dissect's logic instead of bare libmount() calls
and other review comments.
Thanks Topi for the initial work to come up with and implement
this useful feature.

3 years agostrv: add strv_split_colon_pairs function
Luca Boccassi [Tue, 7 Jul 2020 16:12:48 +0000 (17:12 +0100)] 
strv: add strv_split_colon_pairs function

Given a string in the format 'one:two three four:five', returns a string
vector with each word. If the second element of the tuple is not
present, an empty string is returned in its place, so that the vector
can be processed in pairs.

[zjs: use EXTRACT_UNESCAPE_SEPARATORS instead of EXTRACT_CUNESCAPE_RELAX.
This way we do escaping exactly once and in normal strict mode.]

3 years agobasic/extract-word: add EXTRACT_UNESCAPE_SEPARATORS mode
Zbigniew Jędrzejewski-Szmek [Mon, 3 Aug 2020 17:06:16 +0000 (19:06 +0200)] 
basic/extract-word: add EXTRACT_UNESCAPE_SEPARATORS mode

This allows separators to be escaped, for example to allow
"a\:b:c", to be treated as "a:b", "c" with ":" as the separator.

3 years agoupdate TODO 16604/head
Lennart Poettering [Tue, 28 Jul 2020 16:31:48 +0000 (18:31 +0200)] 
update TODO

3 years agoman: document the new --image= switches in journalctl/sysusers/tmpfiles
Lennart Poettering [Tue, 28 Jul 2020 17:28:43 +0000 (19:28 +0200)] 
man: document the new --image= switches in journalctl/sysusers/tmpfiles

3 years agojournalctl: add --image= switch
Lennart Poettering [Tue, 28 Jul 2020 17:18:05 +0000 (19:18 +0200)] 
journalctl: add --image= switch

3 years agosysusers: add support for a --image= switch
Lennart Poettering [Tue, 28 Jul 2020 16:32:07 +0000 (18:32 +0200)] 
sysusers: add support for a --image= switch

3 years agotmpfiles: support --image= similar to --root=
Lennart Poettering [Tue, 28 Jul 2020 16:22:53 +0000 (18:22 +0200)] 
tmpfiles: support --image= similar to --root=

3 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.

3 years agotest: add another test case for extract_many_words
Luca Boccassi [Tue, 7 Jul 2020 16:10:47 +0000 (17:10 +0100)] 
test: add another test case for extract_many_words

Covers some functionality that we want to use for config tuples

3 years agotmpfiles: properly prefix paths in debug outputs
Lennart Poettering [Tue, 28 Jul 2020 15:53:21 +0000 (17:53 +0200)] 
tmpfiles: properly prefix paths in debug outputs

This is otherwise very confusing...

3 years agotmpfiles: we don't support the combination of --root and --user, hence refuse it
Lennart Poettering [Tue, 28 Jul 2020 15:52:48 +0000 (17:52 +0200)] 
tmpfiles: we don't support the combination of --root and --user, hence refuse it

--user only really works with certain env vars such as XDG_RUNTIME_DIR
set, but that's just weird if --root= is used.

3 years agotmpfiles: add new switch -E for quickly excluding /proc, /dev, /sys and /run
Lennart Poettering [Tue, 28 Jul 2020 15:52:23 +0000 (17:52 +0200)] 
tmpfiles: add new switch -E for quickly excluding /proc, /dev, /sys and /run

3 years agoanalyze: fix 'cat-config systemd/zram-generator.conf'
Zbigniew Jędrzejewski-Szmek [Sat, 1 Aug 2020 10:25:56 +0000 (12:25 +0200)] 
analyze: fix 'cat-config systemd/zram-generator.conf'

Also makes this work for various systemd config files that support .d.

3 years agoselinux: improve comment about getcon_raw semantics
Axel Rasmussen [Mon, 3 Aug 2020 16:19:49 +0000 (09:19 -0700)] 
selinux: improve comment about getcon_raw semantics

This code was changed in this pull request:
https://github.com/systemd/systemd/pull/16571

After some discussion and more investigation, we better understand
what's going on. So, update the comment, so things are more clear
to future readers.

3 years agoUpdate DISCOVERABLE_PARTITIONS.md
Marc Kleine-Budde [Wed, 5 Aug 2020 12:10:21 +0000 (14:10 +0200)] 
Update DISCOVERABLE_PARTITIONS.md

This patch fixes a typo in the link to the systemd-id128 documentation.

3 years agoman: fix typo 16684/head
Zbigniew Jędrzejewski-Szmek [Wed, 5 Aug 2020 17:44:53 +0000 (19:44 +0200)] 
man: fix typo

3 years agodocs: rework awkward sentence in AUTOMATIC_BOOT_ASSESSMENT
Zbigniew Jędrzejewski-Szmek [Wed, 5 Aug 2020 17:44:37 +0000 (19:44 +0200)] 
docs: rework awkward sentence in AUTOMATIC_BOOT_ASSESSMENT

3 years agobless-boot: add missing verb to --help
Zbigniew Jędrzejewski-Szmek [Wed, 5 Aug 2020 10:16:03 +0000 (12:16 +0200)] 
bless-boot: add missing verb to --help

There is also "help" verb which duplicates the --help option. I don't
think we should advertise it.

3 years agotest-nss: do not assume all symbols are defined
Zbigniew Jędrzejewski-Szmek [Tue, 4 Aug 2020 18:14:00 +0000 (20:14 +0200)] 
test-nss: do not assume all symbols are defined

It is OK for some symbols to be missing. With this change, "test-nss sss" can
be used to test nss-sss without crashing.

$ build-rawhide/test-nss sss fedoraproject.org
======== sss ========
_nss_sss_gethostbyname4_r not defined

_nss_sss_gethostbyname3_r not defined

_nss_sss_gethostbyname3_r not defined

_nss_sss_gethostbyname3_r not defined

_nss_sss_gethostbyname3_r not defined

_nss_sss_gethostbyname2_r("fedoraproject.org", AF_INET) → status=NSS_STATUS_NOTFOUND
                   errno=0/--- h_errno=-1/Resolver internal error

_nss_sss_gethostbyname2_r("fedoraproject.org", AF_INET6) → status=NSS_STATUS_NOTFOUND
                   errno=0/--- h_errno=-1/Resolver internal error

_nss_sss_gethostbyname2_r("fedoraproject.org", *) → status=NSS_STATUS_UNAVAIL
                   errno=97/EAFNOSUPPORT h_errno=-1/Resolver internal error

_nss_sss_gethostbyname2_r("fedoraproject.org", AF_UNIX) → status=NSS_STATUS_UNAVAIL
                   errno=97/EAFNOSUPPORT h_errno=-1/Resolver internal error

_nss_sss_gethostbyname_r("fedoraproject.org") → status=NSS_STATUS_NOTFOUND
                   errno=0/--- h_errno=-1/Resolver internal error