]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agocore: fix compilation with gcc -O3
Zbigniew Jędrzejewski-Szmek [Sat, 9 May 2020 06:53:27 +0000 (08:53 +0200)] 
core: fix compilation with gcc -O3

../src/core/path.c: In function ‘path_serialize’:
../src/core/path.c:616:24: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  616 |                 (void) serialize_item_format(f, "path-spec", "%s %%i %%s",
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  617 |                                              path_type_to_string(s->type) //,
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  618 |                                              //                                             s->previous_exists,
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  619 |                                              //                                             s->path
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  620 |                 );
      |                 ~
In function ‘path_spec_dump’,
    inlined from ‘path_dump’ at ../src/core/path.c:392:17:
../src/core/path.c:226:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  226 |         fprintf(f,
      |         ^~~~~~~~~~
  227 |                 "%s%s: %s\n",
      |                 ~~~~~~~~~~~~~
  228 |                 prefix,
      |                 ~~~~~~~
  229 |                 path_type_to_string(s->type),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  230 |                 s->path);
      |                 ~~~~~~~~

s->type should be valid here, so let's just add an assert.

For https://github.com/systemd/systemd/issues/6119#issuecomment-626073743.

4 years agocifuzz: fuzz the master branch on push
Frantisek Sumsal [Fri, 8 May 2020 18:14:19 +0000 (20:14 +0200)] 
cifuzz: fuzz the master branch on push

Apart from running CIFuzz for each relevant PR, let's run it
unconditionally for each push to master to detect possible issues
(caused by ignored PRs, etc.).

Followup to 94f660a8fe6144b9153c8acaf9e6bb9e47e14b97.

4 years agocifuzz: run only for relevant PRs
Frantisek Sumsal [Fri, 8 May 2020 16:46:46 +0000 (18:46 +0200)] 
cifuzz: run only for relevant PRs

Fuzz only PRs with relevant changes (source code and fuzzer corpora) to
save resources.

4 years agoMerge pull request #15703 from poettering/homed-tweak-default-storage
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2020 14:57:14 +0000 (16:57 +0200)] 
Merge pull request #15703 from poettering/homed-tweak-default-storage

homed: avoid double encryption

4 years agoMerge pull request #15651 from poettering/newlocale-check
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2020 09:31:34 +0000 (11:31 +0200)] 
Merge pull request #15651 from poettering/newlocale-check

check if locales are installed before using them

4 years agohomectl: color disk free output if low on free space
Lennart Poettering [Thu, 7 May 2020 16:47:28 +0000 (18:47 +0200)] 
homectl: color disk free output if low on free space

4 years agohwdb: Fix accel orientation quirk for Medion Akoya E2215T MD60198
Hans de Goede [Thu, 7 May 2020 21:16:21 +0000 (23:16 +0200)] 
hwdb: Fix accel orientation quirk for Medion Akoya E2215T MD60198

Commit 3d864658ea01 ("hwdb: assume all Medion Akoya E-models have the
same matrix"), unified the entries for most Medion Akoya E* modes,
including the entry for the Medion Akoya E2215T MD60198.

But the accelerometer on the E2215T has an ACPI-id of KIOX000A, rather
then KIOX010A as the other models have, so that commit broke the
ACCEL_MOUNT_MATRIX for the E2215T.

Add a separate match for the E2215T so that it gets the correct
ACCEL_MOUNT_MATRIX again.

4 years agoMerge pull request #15718 from poettering/tmpfiles-offline
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2020 09:22:19 +0000 (11:22 +0200)] 
Merge pull request #15718 from poettering/tmpfiles-offline

tmpfiles: read /etc/passwd + /etc/group with fgetpwent()/fgetgrent() if --root= is specified

4 years agoMerge pull request #15623 from poettering/cmsg-cleanup
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2020 09:05:06 +0000 (11:05 +0200)] 
Merge pull request #15623 from poettering/cmsg-cleanup

various CMSG_xyz clean-ups, split out of #15571

4 years agoupdate TODO 15703/head
Lennart Poettering [Tue, 5 May 2020 06:38:29 +0000 (08:38 +0200)] 
update TODO

4 years agoman: document homed.conf
Lennart Poettering [Tue, 5 May 2020 09:02:12 +0000 (11:02 +0200)] 
man: document homed.conf

4 years agohomed: make default storage/file system type configurable in homed.conf
Lennart Poettering [Tue, 5 May 2020 07:57:04 +0000 (09:57 +0200)] 
homed: make default storage/file system type configurable in homed.conf

4 years agohomed: move supported_fstype() to home-util.c
Lennart Poettering [Tue, 5 May 2020 07:55:53 +0000 (09:55 +0200)] 
homed: move supported_fstype() to home-util.c

That way we can use it from other modules too. Just some shifting
around, no change in behaviour.

4 years agohomed: tweak logic for picking a default storage and file system
Lennart Poettering [Fri, 1 May 2020 17:42:56 +0000 (19:42 +0200)] 
homed: tweak logic for picking a default storage and file system

Let's make the logic a bit smarter: if we detect that /home is
encrypted, let's avoid double encryption and prefer plain
directory/subvolumes instead of our regular luks images.

Also, allow configuration go storage/file system via an env var passed
to homework. In a later commit, let's then change homed to initialize
that env var from a config file setting, when invoking homework.

4 years agohome: when adding a binding for a user record, use common code for determining automa...
Lennart Poettering [Fri, 1 May 2020 17:40:39 +0000 (19:40 +0200)] 
home: when adding a binding for a user record, use common code for determining automatic image path

Make use of the new user_record_build_image_path() helper the previous
commit added to share some code.

Also, let's make sure we update all parsed-out fields with the new data
from the binding, so that the parsed-out fields are definitely
up-to-date.

4 years agouser-record: split out code that generates automatic image path for records
Lennart Poettering [Fri, 1 May 2020 17:39:07 +0000 (19:39 +0200)] 
user-record: split out code that generates automatic image path for records

No change of behaviour, just some refactoring, so that we can use this
new helper function elswhere, too.

4 years agofs-util: add helper path_is_encrypted() that checks if a file system is encrypted
Lennart Poettering [Fri, 1 May 2020 17:37:24 +0000 (19:37 +0200)] 
fs-util: add helper path_is_encrypted() that checks if a file system is encrypted

4 years agoupdate TODO
Lennart Poettering [Thu, 7 May 2020 21:30:06 +0000 (23:30 +0200)] 
update TODO

4 years agocore/cgroup: fix return value of unit_cgorup_freezer_action()
Michal Sekletar [Thu, 7 May 2020 15:23:30 +0000 (17:23 +0200)] 
core/cgroup: fix return value of unit_cgorup_freezer_action()

We should return 0 only if current freezer state, as reported by the
kernel, is already the desired state. Otherwise, we would dispatch
return dbus message prematurely in bus_unit_method_freezer_generic().

Thanks to Frantisek Sumsal for reporting the issue.

4 years agoMerge pull request #15745 from keszybz/one-more-specifier
Lennart Poettering [Thu, 7 May 2020 20:18:59 +0000 (22:18 +0200)] 
Merge pull request #15745 from keszybz/one-more-specifier

Add %l as specifier for short hostname

4 years agoMerge pull request #15713 from poettering/home-discard-when-offline
Lennart Poettering [Thu, 7 May 2020 17:17:48 +0000 (19:17 +0200)] 
Merge pull request #15713 from poettering/home-discard-when-offline

homed: optionally, issue FITRIM ioctl when logging out

4 years agomeson: re-run ninja update-man-rules
Lennart Poettering [Thu, 7 May 2020 13:07:26 +0000 (15:07 +0200)] 
meson: re-run ninja update-man-rules

Split out of #15703, because it has nothing to do with that.

Follow-up for: 4f07ddfa9bc2242eaa6c288a15b8bce4e4383931

4 years agoMerge pull request #15681 from vcaputo/buslocator
Vito Caputo [Thu, 7 May 2020 16:46:01 +0000 (09:46 -0700)] 
Merge pull request #15681 from vcaputo/buslocator

*: switch to BusLocator-oriented helpers

4 years agotimedate: switch to BusLocator-oriented helpers 15681/head
Vito Caputo [Sun, 3 May 2020 07:03:16 +0000 (00:03 -0700)] 
timedate: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agosystemctl: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:55:24 +0000 (23:55 -0700)] 
systemctl: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agorun: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:41:14 +0000 (23:41 -0700)] 
run: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agoresolve: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:39:14 +0000 (23:39 -0700)] 
resolve: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agoportable: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:27:35 +0000 (23:27 -0700)] 
portable: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agonss-resolve: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:23:50 +0000 (23:23 -0700)] 
nss-resolve: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agonss-mymachines: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:21:31 +0000 (23:21 -0700)] 
nss-mymachines: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agonspawn: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:18:27 +0000 (23:18 -0700)] 
nspawn: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agonetwork: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:14:23 +0000 (23:14 -0700)] 
network: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agomount: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:11:33 +0000 (23:11 -0700)] 
mount: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agomachine: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:04:27 +0000 (23:04 -0700)] 
machine: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agologin: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 05:52:38 +0000 (22:52 -0700)] 
login: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agolocale: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 05:45:52 +0000 (22:45 -0700)] 
locale: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agoanalyze: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 05:41:12 +0000 (22:41 -0700)] 
analyze: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

4 years agohome: switch to shared bus_home_mgr
Vito Caputo [Thu, 7 May 2020 07:58:25 +0000 (00:58 -0700)] 
home: switch to shared bus_home_mgr

Largely mechanical change; s/&home_mgr/bus_home_mgr/g

4 years agobus: introduce bus-locator.[ch]
Vito Caputo [Thu, 7 May 2020 08:16:59 +0000 (01:16 -0700)] 
bus: introduce bus-locator.[ch]

Move BusLocator into its own header, introduce collection of
locators for use throughout the code.

4 years agotest-specifier: add a simple test which prints "global" specifiers 15745/head
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 14:25:36 +0000 (16:25 +0200)] 
test-specifier: add a simple test which prints "global" specifiers

...i.e. those which can be resolved without a context parameter.

4 years agoAdd %l as specifier for the hostname without any domain component
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 14:16:19 +0000 (16:16 +0200)] 
Add %l as specifier for the hostname without any domain component

As described in #15603, it is a fairly common setup to use a fqdn as the
configured hostname. But it is often convenient to use just the actual
hostname, i.e. until the first dot. This adds support in tmpfiles, sysusers,
and unit files for %l which expands to that.

Fixes #15603.

4 years agoAdd a basic test that the configured fallback hostname is OK
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 15:30:02 +0000 (17:30 +0200)] 
Add a basic test that the configured fallback hostname is OK

Ideally, assert_cc() would be used for this, so that it is not possible to even
compile systemd with something like '-Dfallback-hostname=.foo'. But to do a
proper check we need to call hostname_is_valid(), and we cannot depend on being
able to run code (e.g. during cross-compilation). So let's do a very superficial
check in meson, and a proper on in test-util.

4 years agotree-wide: port various bits over to locale_is_installed() 15651/head
Lennart Poettering [Thu, 30 Apr 2020 16:32:44 +0000 (18:32 +0200)] 
tree-wide: port various bits over to locale_is_installed()

4 years agotest: add test case for locale_is_installed()
Lennart Poettering [Thu, 30 Apr 2020 16:32:55 +0000 (18:32 +0200)] 
test: add test case for locale_is_installed()

4 years agolocale-util: add new helper locale_is_installed()
Lennart Poettering [Thu, 30 Apr 2020 16:30:56 +0000 (18:30 +0200)] 
locale-util: add new helper locale_is_installed()

This new helper checks whether the specified locale is installed. It's
distinct from locale_is_valid() which just superficially checks if a
string looks like something that could be a valid locale.

Heavily inspired by @jsynacek's #13964.

Replaces: #13964

4 years agoMerge pull request #15635 from keszybz/set-put-strdup
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 15:01:59 +0000 (17:01 +0200)] 
Merge pull request #15635 from keszybz/set-put-strdup

Let set_put_strdup() allocate the set and related changes

4 years agoMerge pull request #15714 from poettering/homed-key-mgmt-doc
Lennart Poettering [Thu, 7 May 2020 14:39:54 +0000 (16:39 +0200)] 
Merge pull request #15714 from poettering/homed-key-mgmt-doc

man: document homed key management

4 years agoman: document the new tmpfiles --root= behaviour regarding users 15718/head
Lennart Poettering [Tue, 5 May 2020 21:23:00 +0000 (23:23 +0200)] 
man: document the new tmpfiles --root= behaviour regarding users

4 years agosysusers/tmpfiles: use --root=/ as way to force offline operation (i.e. without...
Lennart Poettering [Tue, 5 May 2020 20:48:50 +0000 (22:48 +0200)] 
sysusers/tmpfiles: use --root=/ as way to force offline operation (i.e.  without NSS)

4 years agotmpfiles: optionally, read /etc/passwd + /etc/group without NSS
Lennart Poettering [Tue, 5 May 2020 20:45:54 +0000 (22:45 +0200)] 
tmpfiles: optionally, read /etc/passwd + /etc/group without NSS

There are two libc APIs for accessing the user database: NSS/getpwuid(),
and fgetpwent(). if we run in --root= mode (i.e. "offline" mode), let's
use the latter. Otherwise the former. This means tmpfiles can use the
database included in the root environment for chowning, which is a lot
more appropriate.

Fixes: #14806
4 years agoman: put all pages which mention a specifier in the index
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 13:05:29 +0000 (15:05 +0200)] 
man: put all pages which mention a specifier in the index

I wasn't 100% convinced that this is the right thing to do, hence the separate
commit. But e.g. for paths we index all mentions, so I think it's reasonable to
do the same here.

4 years agoman: fix indentation in sysusers.d.xml
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 13:02:02 +0000 (15:02 +0200)] 
man: fix indentation in sysusers.d.xml

4 years agoupdate TODO 15713/head
Lennart Poettering [Tue, 5 May 2020 13:20:10 +0000 (15:20 +0200)] 
update TODO

4 years agodocs: document the new offline discard logic
Lennart Poettering [Tue, 5 May 2020 16:48:47 +0000 (18:48 +0200)] 
docs: document the new offline discard logic

4 years agohomework: run fitrim or fallocate on logout based on the new user record property
Lennart Poettering [Tue, 5 May 2020 13:13:20 +0000 (15:13 +0200)] 
homework: run fitrim or fallocate on logout based on the new user record property

4 years agohomectl: add option for controlling new luksOfflineDiscard user record field
Lennart Poettering [Tue, 5 May 2020 13:12:55 +0000 (15:12 +0200)] 
homectl: add option for controlling new luksOfflineDiscard user record field

4 years agouser-record: add new field for requesting LUKS discard on logout
Lennart Poettering [Tue, 5 May 2020 13:05:59 +0000 (15:05 +0200)] 
user-record: add new field for requesting LUKS discard on logout

We make this entirely independent of the regular discard field, i.e. the
one that controls discard behaviour when the home directory is online.
Not all combinations make a ridiculous amount of sense, but most do.
Specifically:

online-discard = yes, offline-discard = yes
       → Discard when activating explicitly, and during runtime using
       the "discard" mount option, and discard explicitly when logging
       out again.

online-discard = no, offline-discard = yes
       → The new default: when logging in allocate the full backing
       store, and use no discard while active. When loging out discard
       everything. This provides nice behaviour: we take minimal storage
       when offline but provide allocation guarantees while online.

online-discard = no, offline-discard = no
       → Never, ever discard, always operate with fully allocated
       backing store. The extra safe mode.

4 years agohomed: allow overriding homework path via env var
Lennart Poettering [Tue, 5 May 2020 16:27:37 +0000 (18:27 +0200)] 
homed: allow overriding homework path via env var

Let's make debugging a bit easier: when invoking homed from the build
tree it's now possible to make sure homed invokes the build tree's
homework binary by setting an env var.

4 years agoupdate TODO 15714/head
Lennart Poettering [Tue, 5 May 2020 17:36:21 +0000 (19:36 +0200)] 
update TODO

4 years agoman: document homed key management
Lennart Poettering [Tue, 5 May 2020 17:33:27 +0000 (19:33 +0200)] 
man: document homed key management

Fixes: #15235
4 years agoman: add specifiers section to directives index
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 12:59:24 +0000 (14:59 +0200)] 
man: add specifiers section to directives index

The hack with getparent().txt is not very pretty, but the whole
thing seems to work well enough. It is useful to figure out whihc
specifiers are supported where.

4 years agotools: move directive index template to separate file
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 12:31:13 +0000 (14:31 +0200)] 
tools: move directive index template to separate file

In the beginning, it was rather short, and reasonable to include inline.
Now it is long and unwieldy, let's split it out.

While at it, let's reindent and wrap using our current standards.

4 years agotree-wide: make sure our control buffers are properly aligned 15623/head
Lennart Poettering [Fri, 24 Apr 2020 21:54:25 +0000 (23:54 +0200)] 
tree-wide: make sure our control buffers are properly aligned

We always need to make them unions with a "struct cmsghdr" in them, so
that things properly aligned. Otherwise we might end up at an unaligned
address and the counting goes all wrong, possibly making the kernel
refuse our buffers.

Also, let's make sure we initialize the control buffers to zero when
sending, but leave them uninitialized when reading.

Both the alignment and the initialization thing is mentioned in the
cmsg(3) man page.

4 years agotree-wide: remove redundant assignments
Lennart Poettering [Fri, 24 Apr 2020 21:38:47 +0000 (23:38 +0200)] 
tree-wide: remove redundant assignments

We already initialize the fields a few lines up to the very same values,
hence remove this.

4 years agotree-wide: use CMSG_SPACE() (and not CMSG_LEN()) to allocate control buffers
Lennart Poettering [Fri, 24 Apr 2020 21:36:03 +0000 (23:36 +0200)] 
tree-wide: use CMSG_SPACE() (and not CMSG_LEN()) to allocate control buffers

We need to use the CMSG_SPACE() macro to size the control buffers, not
CMSG_LEN(). The former is rounded up to next alignment boundary, the
latter is not. The former should be used for allocations, the latter for
encoding how much of it is actually initialized. See cmsg(3) man page
for details about this.

Given how confusing this is, I guess we don't have to be too ashamed
here, in most cases we actually did get this right.

4 years agoman: update rules
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 12:05:17 +0000 (14:05 +0200)] 
man: update rules

Forgotten in 4f07ddfa9bc2242eaa6c288a15b8bce4e4383931.

4 years agomeson: rename make-man-rules.py to update-man-rules.py
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 12:01:09 +0000 (14:01 +0200)] 
meson: rename make-man-rules.py to update-man-rules.py

The name of the helper didn't match the name of the meson target, which was
always confusing me. With this change, we consistenly use "update" to
re-generate things which we otherwise keep in vc, and "make" for things
which are generated during each build.

4 years agomeson: drop "meson-" prefix from various helper script filenames
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 11:54:10 +0000 (13:54 +0200)] 
meson: drop "meson-" prefix from various helper script filenames

In a few cases, the prefix was originally necessary because a different helper
script was used for automake, and a different one for meson. But now we use
meson exclusively, and the prefix isn't useful. This also synchronizes the
target name, file name, and variable name in meson.build. The targets exposed
by meson didn't have the prefix, so the user interface is unchanged.

(The prefix is retained in the few tools that are used for meson itself,
e.g. meosn-vcs-tag.sh, meson-make-symlink.sh, etc.)

4 years agoman: suffix pam options with "=" where arg is required too
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 11:28:39 +0000 (13:28 +0200)] 
man: suffix pam options with "=" where arg is required too

4 years agoRevert "Add Kensington SlimBlade Trackball"
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 11:10:25 +0000 (13:10 +0200)] 
Revert "Add Kensington SlimBlade Trackball"

This reverts commit 8049c79b654f9c00da883423813ec25b7b54f3d6.

4 years agoresolved: Fix build error due to missing include.
Daan De Meyer [Thu, 7 May 2020 09:51:02 +0000 (11:51 +0200)] 
resolved: Fix build error due to missing include.

4 years agonetlink socket correct check (#15720)
gaurav [Thu, 7 May 2020 07:55:31 +0000 (03:55 -0400)] 
netlink socket correct check (#15720)

4 years agohomectl: show disk free in percent in 'inspect'
Lennart Poettering [Wed, 6 May 2020 20:43:54 +0000 (22:43 +0200)] 
homectl: show disk free in percent in 'inspect'

4 years agoMerge pull request #15733 from benjarobin/fix_warn_ndebug
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 07:47:19 +0000 (09:47 +0200)] 
Merge pull request #15733 from benjarobin/fix_warn_ndebug

Allow to build without any warning with NDEBUG defined + Bugfix

4 years agotree-wide: Workaround -Wnonnull GCC bug
Benjamin Robin [Wed, 6 May 2020 19:24:05 +0000 (21:24 +0200)] 
tree-wide: Workaround -Wnonnull GCC bug

See issue #6119

4 years agohomed: open up home dir Acquire operation to unpriv clients
Lennart Poettering [Wed, 6 May 2020 15:54:35 +0000 (17:54 +0200)] 
homed: open up home dir Acquire operation to unpriv clients

Apparently unpriv clients expect to be able to auth via PAM. Kinda
sucks. But it is what it is. Hence open this up.

This shouldn't be too bad in effect since clients after all need to
provide security creds for unlocking the home dir, in order to misuse
this.

Fixes: #15072
4 years agoresolved: Break include cycles
Daan De Meyer [Wed, 6 May 2020 17:10:59 +0000 (19:10 +0200)] 
resolved: Break include cycles

4 years agomeson: Do not drop warnings (unused variable) when NDEBUG is defined 15733/head
Benjamin Robin [Wed, 6 May 2020 21:02:39 +0000 (23:02 +0200)] 
meson: Do not drop warnings (unused variable) when NDEBUG is defined

This is no longer needed, since there is now no warning with NDEBUG
defined

4 years agoresize-fs: Use xsprintf instead of snprintf
Benjamin Robin [Wed, 6 May 2020 20:58:24 +0000 (22:58 +0200)] 
resize-fs: Use xsprintf instead of snprintf

4 years agotest: Use assert_se() where variables are only checked by assert
Benjamin Robin [Wed, 6 May 2020 18:32:27 +0000 (20:32 +0200)] 
test: Use assert_se() where variables are only checked by assert

Allow to build without any warning with NDEBUG defined

4 years agotree-wide: Fix, replace assert() by assert_se() when there is side effect
Benjamin Robin [Wed, 6 May 2020 18:30:43 +0000 (20:30 +0200)] 
tree-wide: Fix, replace assert() by assert_se() when there is side effect

4 years agotree-wide: Mark as _unused_ variables that are only used in assert()
Benjamin Robin [Wed, 6 May 2020 18:29:31 +0000 (20:29 +0200)] 
tree-wide: Mark as _unused_ variables that are only used in assert()

Allow to build without any warning with NDEBUG defined

4 years agoMerge pull request #15735 from poettering/pam-snippet-update
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2020 20:45:29 +0000 (22:45 +0200)] 
Merge pull request #15735 from poettering/pam-snippet-update

Slightly update our shipped and suggested PAM snippets, so that pam_systemd_home.so is more likely to just work

4 years agoMerge pull request #15727 from poettering/systemctl-list-sockets-tweak
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2020 20:38:25 +0000 (22:38 +0200)] 
Merge pull request #15727 from poettering/systemctl-list-sockets-tweak

systemctl: some table output tweaks

4 years agoman: bring example PAM snippet of pam_systemd and pam_systemd_home back in sync 15735/head
Lennart Poettering [Wed, 6 May 2020 20:28:37 +0000 (22:28 +0200)] 
man: bring example PAM snippet of pam_systemd and pam_systemd_home back in sync

Let's make it the same snippet, just highlight different lines.

4 years agoman: highlight relevant lines in pam_systemd_home.so example PAM snippet
Lennart Poettering [Wed, 6 May 2020 20:26:54 +0000 (22:26 +0200)] 
man: highlight relevant lines in pam_systemd_home.so example PAM snippet

let's do this like we do in the NSS module man pages.

4 years agologin: include pam_systemd_home.so in the default PAM snippet we ship for user@.service
Lennart Poettering [Wed, 6 May 2020 20:25:34 +0000 (22:25 +0200)] 
login: include pam_systemd_home.so in the default PAM snippet we ship for user@.service

Let's make sure systemd-homed works out-of-the box as well as possible.

4 years agotest: Skip test-boot-timestamps on permission denied
Balint Reczey [Tue, 5 May 2020 19:24:53 +0000 (21:24 +0200)] 
test: Skip test-boot-timestamps on permission denied

In containers even root can be denied to access the needed files.

4 years agohwdb: Force "mouse" type on Logitech Ultrathin Touch Mouse
Bastien Nocera [Tue, 5 May 2020 14:38:37 +0000 (16:38 +0200)] 
hwdb: Force "mouse" type on Logitech Ultrathin Touch Mouse

Closes: #15657
4 years agotree-wide: use _cleanup_set_free_ where appropriate 15635/head
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:53:26 +0000 (14:53 +0200)] 
tree-wide: use _cleanup_set_free_ where appropriate

If we already have the helper defined, let's use it instead of open-coding.

4 years agoshared/logs-show: constify Set *fields
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:47:48 +0000 (14:47 +0200)] 
shared/logs-show: constify Set *fields

4 years agosd-device: get rid of device_enumerator_clear_match_parent
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:44:25 +0000 (14:44 +0200)] 
sd-device: get rid of device_enumerator_clear_match_parent

This helper wasn't helping all that much. It seems better to verify args
first, and only then start modifying the state.

4 years agosd-device: optimize addition of already present matches
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:33:51 +0000 (14:33 +0200)] 
sd-device: optimize addition of already present matches

Our hashmap and set helpers return a different code whenever an entry
already exists, so let's use this to avoid unsetting scan_uptodate when
not necessary.

Thus, the return convention for
sd_device_enumerator_add_match_subsystem,
sd_device_enumerator_add_match_sysattr,
sd_device_enumerator_add_match_property,
sd_device_enumerator_add_match_sysname,
sd_device_enumerator_add_match_tag,
device_enumerator_add_match_parent_incremental,
sd_device_enumerator_add_match_parent,
sd_device_enumerator_allow_uninitialized,
device_enumerator_add_match_is_initialized
is that "1" is returned if action was taken, and "0" on noop.

4 years agosd-device: use hashmap_put_strdup()
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:28:56 +0000 (14:28 +0200)] 
sd-device: use hashmap_put_strdup()

4 years agobasic/hashmap: allow NULL values in strdup hashmaps and add test
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 07:55:28 +0000 (09:55 +0200)] 
basic/hashmap: allow NULL values in strdup hashmaps and add test

4 years agosd-device: use string hash ops in device enumerator
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 07:01:18 +0000 (09:01 +0200)] 
sd-device: use string hash ops in device enumerator

There should be no functional change, except that when the same string is
added more than once, we skip the duplicate entries.

4 years agotest-set: make test-set not link to libshared and test test_set_put_strdup*()
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 06:50:37 +0000 (08:50 +0200)] 
test-set: make test-set not link to libshared and test test_set_put_strdup*()

The sets are such basic functionality that it is convenient to be able to
build test-set without all the machinery in shared, and to test it without
the mempool to validate memory accesses easier.

4 years agobasic/set: let set_put_strdup() create the set with string hash ops
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 06:47:51 +0000 (08:47 +0200)] 
basic/set: let set_put_strdup() create the set with string hash ops

If we're using a set with _put_strdup(), most of the time we want to use
string hash ops on the set, and free the strings when done. This defines
the appropriate a new string_hash_ops_free structure to automatically free
the keys when removing the set, and makes set_put_strdup() and set_put_strdupv()
instantiate the set with those hash ops.

hashmap_put_strdup() was already doing something similar.

(It is OK to instantiate the set earlier, possibly with a different hash ops
structure. set_put_strdup() will then use the existing set. It is also OK
to call set_free_free() instead of set_free() on a set with
string_hash_ops_free, the effect is the same, we're just overriding the
override of the cleanup function.)

No functional change intended.

4 years agosystemctl: underline whole rows, gapless 15727/head
Lennart Poettering [Wed, 6 May 2020 13:37:33 +0000 (15:37 +0200)] 
systemctl: underline whole rows, gapless

Just some tweaking of the output.

4 years agoformat-table: support coloring the gap right of each cell individually
Lennart Poettering [Wed, 6 May 2020 13:36:50 +0000 (15:36 +0200)] 
format-table: support coloring the gap right of each cell individually

This is useful for underlining a whole row of cells: previously we
couldn't underline the gap. Now we can.