Commit Graph

44143 Commits

Author SHA1 Message Date
Vito Caputo 9f81a592c1 *: convert amenable fdopendir() calls to take_fdopendir()
Some fdopendir() calls remain where safe_close() is manually
performed, those could be simplified as well by converting to
use the _cleanup_close_ machinery, but makes things less trivial
to review so left for a future cleanup.
2020-03-31 06:48:03 -07:00
Vito Caputo f61457b0fe fileio: add take_fdopendir() variant
fdopendir() wrapper analogous to take_fdopen()
2020-03-31 06:48:03 -07:00
Vito Caputo 4fa744a35c *: convert amenable fdopen calls to take_fdopen
Mechanical change to eliminate some cruft by using the
new take_fdopen{_unlocked}() wrappers where trivial.
2020-03-31 06:48:03 -07:00
Vito Caputo 3ebbb6cb39 fileio: introduce take_fdopen{_unlocked}() variant
With the addition of _cleanup_close_ there's a repetitious
pattern of assigning -1 to the fd after a successful fdopen
to prevent its close on cleanup now that the FILE * owns the
fd.

This introduces a wrapper that instead takes a pointer to the
fd being opened, and always overwrites the fd with -1 on success.

A future commit will cleanup all the fdopen call sites to use the
wrapper and elide the manual -1 fd assignment.
2020-03-31 06:48:00 -07:00
Zbigniew Jędrzejewski-Szmek f5d9daaea3 Merge pull request #15268 from poettering/sigusr1-sigusr2
Doing manual merge because github thinks there's a conflict.
2020-03-31 15:33:05 +02:00
Lennart Poettering 286fe8ee21 units: do not pull in home.mount from systemd-homed.service
/home is posibly a remote file system. it makes sense to order homed
after it, so that we can properly enumerate users in it, but we probably
shouldn't pull it in ourselves, and leave that to users to configure
otherwise.

Fixes: #15102
2020-03-31 15:22:48 +02:00
Vito Caputo 80ace4f25e home: fix several typos 2020-03-31 15:16:36 +02:00
Zbigniew Jędrzejewski-Szmek 20f938ff7f test: print path to build directory on misconfiguration
This way it's easier to see when a wrong $BUILD_DIR was passed.
2020-03-31 15:13:13 +02:00
Zbigniew Jędrzejewski-Szmek ead7af3093 units: make systemd-userdbd.{socket,service} installable
It's lightweight and generally useful, so it should be enabled by default. But
users might want to disable it for whatever reason, and things should be fine
without it, so let's make it installable so it can be disabled if wanted.

Fixes #15175.
2020-03-31 14:55:16 +02:00
Zbigniew Jędrzejewski-Szmek 5ef9eda17f units: make systemd-homed.service installable
Fixes #15083. Users might want to disable homed if not used to save resources.
2020-03-31 14:55:14 +02:00
Zbigniew Jędrzejewski-Szmek 7e1ed1f3b2 units: make systemd-repart.service installable
This essentially adds another layer of configurability:
build disable, this, presence of configuration. The default is
set to enabled, because the service does nothing w/o config.
2020-03-31 14:51:04 +02:00
Zbigniew Jędrzejewski-Szmek 73abf7ae06 run-integration-tests: only do the clean operation in the beginning
When doing 'make clean', we remove the cached image. So doing
'make -C TEST-NN-foo clean setup run clean-again' in a loop is very slow.
Let's filter out the 'clean' target (if specified), and do the cleaning
in the beginning, and then run other targets in a loop as before.
2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek 6e5b51d94a test: run loop device cleanup in more cases 2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek 5a89d7b39c run-integration-tests: print times 2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek e00fca8c2e TEST-13-*: remove containers created in test before running the test
The test would fail when run again from the same image. So let's
rename the stuff we create to be more unique, and remove it before
running the test. (Removing it after would be more elegant, but it's
hard to make sure that everything is removed when things fail halfway.
Cleanup *before* tests is much more rebust.)
2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek 68a7705e35 TEST-06-*: also try the installation path for Debian
https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/tests/upstream
used sed to adjust the path. I think it's better to make our script more
flexible.
2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek f1416431b6 test: optionally print the journal after tests
This is hopefully the last bit of functionality from
https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/tests/upstream.
2020-03-31 12:31:10 +02:00
Zbigniew Jędrzejewski-Szmek f9eb2d51da test: use systemd-journal-remote for journal copying, support $ARTIFACT_DIRECTORY
Using s-j-remote fixes the following issue: when coalescing files from multiple
inputs, simply copying all files with into the the same directory might
potentially mess things up, because a newer system.journal might overwrite an
older journal. This happens because we run multiple tests from the same image,
and need to clean out the directory after each run.

By using systemd-journal-remote, we nicely coalesce all files. This has the
advantage that if there aren't too many logs, we end up with just one journal
file.

ARTIFACT_DIRECTORY is for ubuntuautopackagetests, where the journal files are
copied to a separate directory to preserve after tests have been run. This
functionality can now be recreated by setting
ARTIFACT_DIRECTORY=$AUTOPKGTEST_ARTIFACTS.
2020-03-31 12:31:10 +02:00
Zbigniew Jędrzejewski-Szmek 8943daf813 test: use a helper function to move the journal files 2020-03-31 12:31:10 +02:00
Zbigniew Jędrzejewski-Szmek 3597bf7550 run-integration-tests: add support for blacklisting
This was done downstream in debian and ubuntu [1]. I want to change the
downstream file to use run-integration-tests so we can change the way tests
work more easily. Let's start moving downstream functionality upstream.

$ sudo BLACKLIST_MARKERS='blacklist-ubuntu-ci-arm64 blacklist-ubuntu-ci' \
   BUILD_DIR=build test/run-integration-tests.sh

[1] https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/tests/upstream
2020-03-31 12:31:10 +02:00
Zbigniew Jędrzejewski-Szmek a455e75a30 test: use systemd.status-unit-format=name in all but one test
We want to test the traditional output, but the non-default one is generally
much nicer for debugging (and takes less space...).
2020-03-31 12:31:10 +02:00
Lennart Poettering a85daa0dfb user-util: switch order of checks in valid_user_group_name_or_id_full()
When we are supposed to accept numeric UIDs formatted as string, then
let's check that first, before passing things on to
valid_user_group_name_full(), since that might log about, and not the
other way round.

See: #15201
Follow-up for: 93c23c9297
2020-03-31 11:25:01 +02:00
Vito Caputo 3aeea37d88 home: narrow scope of 'size_t n'
trivial cosmetic cleanup
2020-03-31 00:29:26 -07:00
Piero La Terza 36e4a8f22a homectl: fix a typo
stroage -> storage
2020-03-31 09:24:38 +02:00
Susant Sahani 7b8d23a9bb network: DHCPv4 - introduce The Manufacturer Usage Description (MUD) 2020-03-30 20:27:48 +02:00
Susant Sahani d11d4a6459 sd-dhcpv4: introduce The Manufacturer Usage Description (MUD) 2020-03-30 19:16:01 +02:00
Lennart Poettering 1f4faf21e8
Merge pull request #15197 from ssahani/smtp-dhcp
DHCP4: Add support to emit and receive SMTP servers.
2020-03-30 18:58:26 +02:00
Lennart Poettering 01262d0d9e
Merge pull request #13084 from ddstreet/log_time
log: add support for prefixing console log messages with current timestamp
2020-03-30 17:57:34 +02:00
Lennart Poettering 6305608f1c
Merge pull request #15194 from keur/import_pull_etag
import: Only keep RO copy if ETag header is set
2020-03-30 17:34:06 +02:00
Lennart Poettering 4c287f9a0b
Merge pull request #14853 from floppym/issue9806
safe_fork: unblock most signals before waiting for child
2020-03-30 17:27:55 +02:00
Lennart Poettering fef7397022
Merge pull request #15251 from keszybz/coverity-fixes
A few small fixups for stuff found by coverity
2020-03-30 17:18:35 +02:00
Frantisek Sumsal 15529f5cea
Merge pull request #14338 from keszybz/functional-test-rework
Functional test rework
2020-03-30 16:25:12 +02:00
Lennart Poettering e3028514ae userwork: fix signal worker sends to manager requesting more workers
That's what you get for changing these signals around, after checking
everything works, not before.

Bad, Lennart, bad!

Fixes: #15085
2020-03-30 16:05:27 +02:00
Evgeny Vereshchagin 6b8d32ea7b ci: turn off FuzzBuzz
I don't think anyone uses it.
2020-03-30 14:57:22 +02:00
Evgeny Vereshchagin c4ae2704b7 travis: install ninja with pip
https://mesonbuild.com/Release-notes-for-0-54-0.html#ninja-version-requirement-bumped-to-17
https://github.com/mesonbuild/meson/issues/6867
2020-03-30 02:57:56 +03:00
Susant Sahani ad1e288013 networkctl: Add support to display DHCP SMTP servers 2020-03-29 22:59:21 +02:00
Susant Sahani c1c6ff10a1 sd-network: Add support to emit and receive SMTP server information 2020-03-29 22:59:18 +02:00
Susant Sahani f6269fe7bb network: DHCP - add support to emit and receive SMTP server information 2020-03-29 22:59:11 +02:00
Zbigniew Jędrzejewski-Szmek 4a874560c5
Merge pull request #15217 from keszybz/beef-up-sd-path
Export sd-path functions and beef up systemd-path to show more items
2020-03-29 22:57:53 +02:00
Daan De Meyer 35bae98dce sd-bus: Fix pointer alignment 2020-03-29 21:48:21 +02:00
Daan De Meyer 45069c67ce sd-bus: Add sd_bus_slot_get_current_* docs 2020-03-29 21:36:55 +02:00
Topi Miettinen a6c9f8fa6d README.md: add repology badge
Show downstream usage for various versions of systemd.
2020-03-29 21:26:28 +02:00
Kevin Kuehler 7ea4392f1e basic: Fix capability_ambient_set_apply for kernels < 4.3
https://github.com/systemd/systemd/pull/14133 made
capability_ambient_set_apply() acquire capabilities that were explicitly
asked for and drop all others. This change means the function is called
even with an empty capability set, opening up a code path for users
without ambient capabilities to call this function. This function will
error with EINVAL out on kernels < 4.3 because PR_CAP_AMBIENT is not
understood. This turns capability_ambient_set_apply() into a noop for
kernels < 4.3

Fixes https://github.com/systemd/systemd/issues/15225
2020-03-29 21:11:25 +02:00
Zbigniew Jędrzejewski-Szmek 3e118d135b
Merge pull request #15233 from msekletar/device-dbus
device: make sure we don't generate bogus PropertiesChanged signals
2020-03-29 20:52:31 +02:00
Michal Sekletár 2e129d5d6b device: don't emit PropetiesChanged needlessly
Functions called from device_setup_unit() already make sure that unit is
enqueued in case it is a new unit or properties exported on the bus have
changed.

This should prevent unnecessary DBus wakeups and associated DBus traffic
when device_setup_unit() was called while reparsing /proc/self/mountinfo
due to the mountinfo notifications. Note that we parse
/proc/self/mountinfo quite often on the busy systems (e.g. k8s container
hosts) but majority of the time mounts didn't change, only some mount
got added. Thus we don't need to generate PropertiesChanged for devices
associated with the mounts that didn't change.

Thanks to Renaud Métrich <rmetrich@redhat.com> for debugging the
problem and providing draft version of the patch.
2020-03-28 21:26:40 +01:00
Michal Sekletár 7c4d139485 device: make sure we emit PropertiesChanged signal once we set sysfs 2020-03-28 21:26:40 +01:00
Zbigniew Jędrzejewski-Szmek 37bc9dcc09 nss-systemd: use _cleanup_ for pthread_mutex_{lock,unlock}
v2: separate the declaration from the assignment to appease clang.
2020-03-28 17:03:21 +01:00
Zbigniew Jędrzejewski-Szmek 29d4392ca0 basic: add _cleanup_ wrappers for pthread_mutex_{lock,unlock}
I put the helper functions in a separate header file, because they don't fit
anywhere else. pthread_mutex_{lock,unlock} is used in two places: nss-systemd
and hashmap. I don't indent to convert hashmap to use the helpers, because
there it'd make the code more complicated. Is it worth to create a new header
file even if the only use is in nss-systemd.c? I think yes, because it feels
clean and also I think it's likely that pthread_mutex_{lock,unlock} will be
used in other places later.
2020-03-28 13:29:39 +01:00
Zbigniew Jędrzejewski-Szmek e7e9a9d0dc nss-systemd: add missing jump to unlock mutex
CID#1412415.
2020-03-28 13:03:06 +01:00
Zbigniew Jędrzejewski-Szmek 42b977810d test-strv: add missing oom check
CID#1420259.
2020-03-28 12:46:52 +01:00