Commit Graph

42498 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 5ebbb45bde TODO: remove obsolete entries
"introspect" is well established and OK. We shouldn't change it at this point.
2019-12-05 10:35:32 +01:00
Zbigniew Jędrzejewski-Szmek bddeb54cbb Fix use of unitialized variable in error path
CID 1408478.
2019-12-05 10:31:34 +01:00
Zbigniew Jędrzejewski-Szmek 9142bbd19c
Merge pull request #14209 from poettering/sd-bus-sensitive
sd-bus bits from homed PR
2019-12-05 10:22:01 +01:00
Zbigniew Jędrzejewski-Szmek 68296b8b83
Merge pull request #14221 from poettering/homed-preparatory-resizefs
preparatory fs resizing support split out of homed PR
2019-12-05 10:17:10 +01:00
Yu Watanabe ec34e7d1ab
Merge pull request #14229 from yuwata/nspawn-network-interface-14223
nspawn: do not fail if udev is not running
2019-12-05 16:10:29 +09:00
Anita Zhang da4dd97405
Merge pull request #14173 from ssahani/tc-sfq
network: tc: introduce sfq and tbf
2019-12-04 16:14:11 -08:00
Anita Zhang adae5eb977
Merge pull request #14219 from poettering/homed-preparatory-loop
preparatory /dev/loopN support split out of homed PR
2019-12-04 16:07:41 -08:00
Yu Watanabe bf331d8717 network: if /sys is rw, then udev should be around
This switches detect_container() to path_is_read_only_rw("/sys"), as if
systemd-udevd.service is conditionalized with that way.

This also updates the log message.
2019-12-05 08:22:52 +09:00
Yu Watanabe 26208d5b96 nspawn: do not fail if udev is not running
If /sys is read only filesystem, e.g., nspawn is running in container,
then usually udev is not running. In such a case, let's assume that
the interface is already initialized. Also, this makes nspawn refuse
to use the network interface which is under renaming.

Fixes #14223.
2019-12-05 08:22:16 +09:00
Guilhem Lettron 2e22a54f4e Implement SNI when using DNS-over-TLS
Some DNS providers need SNI to identify client.

This can be used by adding #name to a DNS.
Example:
[Resolve]
DNS=192.168.1.1#example.com
2019-12-04 23:24:06 +09:00
Lennart Poettering b7aa08ca15
Merge pull request #14111 from keszybz/unknown-section-warning
Warn about unknown sections
2019-12-04 14:12:24 +01:00
Lennart Poettering 6f0245b342 sd-bus: don't include properties maked as "emit-invalidation" in InterfacesAdded signals
Properties marked this way really shouldn't be sent around willy-nilly,
that's what the flag is about, hence exclude it from InterfacesAdded
signals (and in fact anything that is a signal).
2019-12-04 13:46:23 +01:00
Lennart Poettering 7a77d2a41c sd-bus: add new call sd_bus_message_sensitive() and SD_BUS_VTABLE_SENSITIVE
This allows marking messages that contain "sensitive" data with a flag.
If it's set then the messages are erased from memory when the message is
freed.

Similar, a flag may be set on vtable entries: incoming/outgoing message
matching the entry will then automatically be flagged this way.

This is supposed to be an easy method to mark messages containing
potentially sensitive data (such as passwords) for proper destruction.

(Note that this of course is only is as safe as the broker in between is
doing something similar. But let's at least not be the ones at fault
here.)
2019-12-04 13:46:23 +01:00
Zbigniew Jędrzejewski-Szmek 41ab3b7a85
Merge pull request #13953 from SpencerMichaels/systemd-boot-efistub-id-fix
boot: Fix default/oneshot selection for EFISTUB entries
2019-12-04 13:30:52 +01:00
Lennart Poettering f9f8268ac6
Merge pull request #14218 from poettering/homed-preparatory-small-stuff
Assorted smaller stuff split out from homed PR
2019-12-04 13:13:38 +01:00
Lennart Poettering ef560d8b06
Merge pull request #13886 from poettering/sd-event-pidfd
add pidfd support to sd-event (but not yet PID 1)
2019-12-04 13:13:18 +01:00
Yu Watanabe 0ab9279132 test-network: add a test case for SFQ 2019-12-04 20:58:33 +09:00
Yu Watanabe b2340fbb5a network: SFQ cannot be configured with netem or TBF 2019-12-04 20:58:33 +09:00
Susant Sahani 9942b71089 network: tc introduce sfq - Stochastic Fairness Queueing
Stochastic Fairness Queueing is a classless queueing discipline.
SFQ does not shape traffic but only schedules the transmission of packets, based on 'flows'.
The goal is to ensure fairness so that each flow is able to send data in turn,
thus preventing any single flow from drowning out the rest.
2019-12-04 20:58:17 +09:00
Yu Watanabe 1b628c4f64 test-network: add test case for TBF 2019-12-04 20:57:48 +09:00
Yu Watanabe f1dba55565 network: drop unnecessary headers 2019-12-04 20:57:48 +09:00
Yu Watanabe 6483f04381 network: make network_emulator_fill_message() take NetworkEmulator 2019-12-04 20:57:39 +09:00
Yu Watanabe edc54f2f75 network: rename QDiscs to QDisc 2019-12-04 20:57:01 +09:00
Yu Watanabe 8efb93f02d network: ignore sections which have both NetworkEmulator and TokenBufferFilter settings 2019-12-04 20:55:55 +09:00
Susant Sahani ba5841b520 networkd tc: introduce tbf
See https://linux.die.net/man/8/tc-tbf
2019-12-04 20:55:48 +09:00
Lennart Poettering 28937bcc6c shared: add new wrapper for online fs resizing ioctls 2019-12-04 11:02:14 +01:00
Lennart Poettering 24a0b2c0ab missing: add XFS magic 2019-12-04 11:01:31 +01:00
Lennart Poettering 6b636c2d27 main-func: send main exit code to parent via sd_notify() on exit
So far we silently convert negative return values from run() as
EXIT_FAILURE, which is how UNIX expects it. In many cases it would be
very useful for the caller to retrieve the actual error number we exit
with. Let's generically return that via sd_notify()'s ERRNO= attribute.
This means callers can set $NOTIFY_SOCKET and get the actual error
number delivered at their doorstep just like that.
2019-12-04 10:59:59 +01:00
Lennart Poettering 8987afc4d1 process-util: add new safe_fork() flag for connecting stdout to stderr
This adds a new safe_fork() flag. If set the child process' fd 1 becomes
fd 2 of the caller. This is useful for invoking tools (such as various
mkfs/fsck implementations) that output status messages to stdout, but
which we invoke and don't want to pollute stdout with their output.
2019-12-04 10:59:42 +01:00
Lennart Poettering 7a509acc29 tmpfile-util: modernize mkostemp_safe() a bit 2019-12-04 10:59:30 +01:00
Lennart Poettering e5ea9ed030 tmpfile-util: if no path is passed to fopen_temporary() make one up
Let's beef up functionality a bit, and modernize the whole function.
2019-12-04 10:59:17 +01:00
Lennart Poettering a3292ec8d7 user-util: add uid_is_container() for checking whether UID is in container range
We have similar calls for the dynamic user and system range, let's add
this too here.
2019-12-04 10:59:04 +01:00
Lennart Poettering 6093b2bb05 user-util: export is_nologin_shell() so that we can use it elsewhere 2019-12-04 10:58:46 +01:00
Charles (Chas) Williams c0dd326953 man: document journal rate limit burst multiplier
The actual burst limit is modified by the remaining disk space. This
isn't mentioned anywhere in the available documentation and might be a
source of surprise for an end user expecting certain behaviors.
2019-12-04 10:58:15 +01:00
Lennart Poettering 53caaffdf4 string-util: readd string_erase()
This was dropped in 8e27167cc9, but is
actually useful for some usecases still.
2019-12-04 10:58:12 +01:00
Lennart Poettering 282bde1066 memory-util: introduce erase_and_free() helper 2019-12-04 10:57:59 +01:00
Lennart Poettering 9933a47808 errno-util: add new ERRNO_IS_DISK_SPACE() helper 2019-12-04 10:57:44 +01:00
Lennart Poettering b64cea6027 ordered-set: add ordered_set_first() helper 2019-12-04 10:57:37 +01:00
Lennart Poettering 22810041c2 parse-util: sometimes it is useful to check if a string is a valid integer, but not actually parse it 2019-12-04 10:56:50 +01:00
Leonid Bloch 26601a2a17 sd-boot: Add a 0.1 second delay before key-probing for showing menu
If there is no boot menu timeout, pressing a key during boot should get
the boot menu displayed. However, on some systems the keyboard is not
initialized right away, which causes the menu to be inaccessible if no
timeout is specified.

To resolve this, if the error is "not ready" after the initial attempt of
detection, wait for 0.1 second and retry. This solves the problem
described above on all the tested systems.

The reason for just a single retry, and not retrying while "not ready",
is that some firmwares continue to return the "not ready" error on
every probe attempt if no key is pressed.

Signed-off-by: Leonid Bloch <lb.workbox@gmail.com>
2019-12-04 10:52:28 +01:00
Lennart Poettering e544601536 sd-event: refuse running default event loops in any other thread than the one they are default for 2019-12-04 10:36:28 +01:00
Lennart Poettering 8089643328 man: document the new sd-event pidfd magic 2019-12-04 10:36:10 +01:00
Lennart Poettering b350807200 man: mention that SIGCHLD has to be blocked before using sd_event_add_child() 2019-12-04 10:35:56 +01:00
Lennart Poettering 68765d94fe man: don't claim we'd unblock the specified signal in sd_event_add_signal()
We don't, the signal remains blocked. We use signalfd() to be able to
read the signal events without unblocking the signal.

While we are at it, mention that pthread_sigmask() is fine too.
2019-12-04 10:35:42 +01:00
Lennart Poettering 3ecb3bdc93 test: add test for pidfd support in sd-event 2019-12-04 10:35:39 +01:00
Lennart Poettering ee880b37c1 sd-event: refuse sd_event_add_child() if SIGCHLD is not blocked
We already refuse sd_event_add_signal() if the specified signal is not
blocked, let's do this also for sd_event_add_child(), since we might
need signalfd() to implement this, and this means the signal needs to be
blocked.
2019-12-04 10:35:27 +01:00
Lennart Poettering d1b75241ba sd-event: make use of new signal_is_blocked() helper 2019-12-04 10:35:16 +01:00
Lennart Poettering 90b15e18ee signal-util: add new helper signal_is_blocked() 2019-12-04 10:35:01 +01:00
Lennart Poettering f8f3f9263e sd-event: add pidfd support
This adds support for watching for process exits via Linux new pidfd
concept. This makes watching processes and killing them race-free if
properly used, fixing a long-standing UNIX misdesign.

This patch adds implicit and explicit pidfd support to sd-event: if a
process shall be watched and is specified by PID we will now internally
create a pidfd for it and use that, if available. Alternatively a new
constructor for child process event sources is added that takes pidfds
as input.

Besides mere watching of child processes via pidfd two additional
features are added:

→ sd_event_source_send_child_signal() allows sending a signal to the
  process being watched in the safest way possible (wrapping
  the new pidfd_send_signal() syscall).

→ sd_event_source_set_child_process_own() allows marking a process
  watched for destruction as soon as the event source is freed. This is
  currently implemented in userspace, but hopefully will become a kernel
  feature eventually.

Altogether this means an sd_event_source object is now a safe and stable
concept for referencing processes in race-free way, with automatic
fallback to pre-pidfd kernels.

Note that this patch adds support for this only to sd-event, not to PID
1. That's because PID 1 needs to use waitid(P_ALL) for reaping any
process that might get reparented to it. This currently semantically
conflicts with pidfd use for watching processes since we P_ALL is
undirected and thus might reap process earlier than the pidfd notifies
process end, which is hard to handle. The kernel will likely gain a
concept for excluding specific pidfds from P_ALL watching, as soon as
that is around we can start making use of this in PID 1 too.
2019-12-04 10:34:41 +01:00
Lennart Poettering 298f466f15 process-util: add helper pidfd_get_pid()
It returns the pid_t a pidfd refers to.
2019-12-04 10:34:26 +01:00