Commit graph

28406 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek c083264115
Merge pull request #15278 from vcaputo/more-trivial-cleanups
Expand use of _cleanup_close_ where trivial
2020-04-01 00:16:56 +02:00
Zbigniew Jędrzejewski-Szmek b1b9e829c2
Merge pull request #15229 from ssahani/mud
network: Introduce MUD
2020-04-01 00:10:13 +02:00
Vito Caputo 8e06af804b *: use _cleanup_close_ with fdopendir() where trivial
Also convert these to use take_fdopendir().
2020-03-31 06:48:03 -07:00
Vito Caputo b46c3e4913 *: use _cleanup_close_ with fdopen() where trivial
Also convert these to use take_fdopen().
2020-03-31 06:48:03 -07:00
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
Vito Caputo 80ace4f25e home: fix several typos 2020-03-31 15:16:36 +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
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
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
Zbigniew Jędrzejewski-Szmek e29e4d5742 test: convert TEST-45 to a normal meson test
On my laptop, it now takes 0.23 s. We don't need the overhead of creating
an image and spawning a machine to mangle a file in /tmp.
2020-03-28 11:50:38 +01:00
Zbigniew Jędrzejewski-Szmek 30b84c78ea test-fileio: fix bogus error when /proc/cmdline contains newlines
The kernel does not sanitize /proc/cmdline. E.g. when running under qemu, it is
easy to pass a string with newline by mistake. We use read_one_line_file(), so
we would read only the first list of the file, and
write_string_file(WRITE_STRING_FILE_VERIFY_ON_FAILURE) would fail because the
target file is obviously different. Change to a kernel-generated file to avoid
the issue.

v2:
- use /proc/version instead of /proc/uptime for attempted writes, so the test
  test passes even if test_write_string_file_verify() takes more than 10 ms ;]
2020-03-28 11:46:47 +01:00
Susant Sahani 2c649ca1c9 sd-dhcp: Add support to emit and retrieve SMTP server 2020-03-28 11:21:17 +01:00
Michal Sekletár 8581b9f973 sd-journal: remove the dead code and actually fix #14695
journal_file_fstat() returns an error if we call it on already unlinked
journal file and hence we never reach remove_file_real() which is the
entire point.

I must have made some mistake while testing the fix that got me thinking
the issue is gone while opposite was true.

Fixes #14695
2020-03-28 09:39:33 +01:00
Zbigniew Jędrzejewski-Szmek 2df0df56dd
Merge pull request #15237 from cgzones/improve
SELinux cache updates
2020-03-28 09:38:16 +01:00
Susant Sahani 9f4aafea37 networkctl: Add support to display DHCP pop3 servers 2020-03-28 03:34:27 +01:00
Susant Sahani 8102b9e710 sd-network: Add support to emit and receive pop3 server information 2020-03-28 03:34:27 +01:00
Susant Sahani 284e8fd0d7 DHCP: Add support to emit and retrieve POP3 server 2020-03-28 03:34:27 +01:00
Susant Sahani f678ac7e29 libsystemd-network: DHCP add support to emit and retrive DHCP POP3 server 2020-03-28 03:34:27 +01:00
Christian Göttsche 1b7d1cae0f selinux: print enforcing state in access check debug message 2020-03-27 20:54:58 +01:00
Christian Göttsche 2073bf3f58 selinux: add debug logging to cache functions 2020-03-27 20:54:58 +01:00
Christian Göttsche c8aa389c42 selinux: add unlikely compiler hints for cache functions 2020-03-27 20:54:58 +01:00
Zbigniew Jędrzejewski-Szmek 2e09fa8906 sd-path: handle case of missing runtime dir in test
Also document it in the man page.
2020-03-27 20:12:45 +01:00
Zbigniew Jędrzejewski-Szmek e342055851 path: log at debug level when we can't query a variable 2020-03-27 20:12:45 +01:00