Zbigniew Jędrzejewski-Szmek [Fri, 29 Mar 2019 14:00:25 +0000 (15:00 +0100)]
Merge pull request #12137 from poettering/socket-var-run
warn about sockets in /var/run/ too
Zbigniew Jędrzejewski-Szmek [Fri, 29 Mar 2019 13:59:00 +0000 (14:59 +0100)]
Merge pull request #12133 from poettering/rseq-whitelist
whitelist rseq() system call in `@default` syscall group
Lennart Poettering [Thu, 28 Mar 2019 08:59:24 +0000 (09:59 +0100)]
analyze: check both possible mount points of tracefs
Let's try the new one first, the old one second.
Lennart Poettering [Thu, 28 Mar 2019 18:26:21 +0000 (19:26 +0100)]
fsck: copy out device argument from argv[] before forking
We nowadays rename our child processes, hence argv[] will be clobbered,
let's hence copy the device path to dynamic memory before forking.
This is fall-out from
60ffa37a65a96c3af857a3dfc4a6fd47b20cc90e since we
now a lot more often end up overriding the argv[] buffer than before,
simple because we know what to override.
These kind of bugs kinda suck. THere are only two options here: stop
overriding argv[] for all cases (or just these cases) or explicitly
copying out everything we need in child processes before forking. With
this patch I opt for the latter, though I am not 100% convinced this is
a great solution. Just a better solution than everything else, i.e.
allowing argv[] to remain out of sync with what others see.
Fixes: #12135
Jörg Thalheim [Thu, 28 Mar 2019 16:20:52 +0000 (16:20 +0000)]
wireguard: fix exponential backoff when resolving hosts
It should stop at 25s, not start.
Fixes #12134
Zbigniew Jędrzejewski-Szmek [Thu, 28 Mar 2019 14:55:09 +0000 (15:55 +0100)]
headers: add missing includes
Fixes #12125.
Lennart Poettering [Thu, 28 Mar 2019 08:26:50 +0000 (09:26 +0100)]
sd-bus: change "int" → "signed int" on bitfield
Apparently by the C standard "int" bitfields can have any signedness
(unlike non-bitfield declarations which are "signed" if the signedness
is not specified).
Let's fix the LGTM warning about this hence and be explicit that we mean
"signed" here.
Lennart Poettering [Thu, 28 Mar 2019 16:00:46 +0000 (17:00 +0100)]
update TODO
Lennart Poettering [Thu, 28 Mar 2019 15:59:57 +0000 (16:59 +0100)]
core: complain and correct /var/run/ → /run/ for listening sockets
We already do that for PIDFile= paths, and for tmpfiles.d/ snippets,
let's also do this for .socket paths.
Lennart Poettering [Thu, 28 Mar 2019 15:46:27 +0000 (16:46 +0100)]
load-fragment: use TAKE_PTR() where we can
Michal Sekletar [Wed, 27 Mar 2019 08:27:21 +0000 (09:27 +0100)]
cryptsetup-generator: set high OOM score for systemd-cryptsetup instances
With new LUKS2 header format it is possible to use Argon2 key derivation
function. This function is "memory-hard" hence keyslot unlocking can
potentially use a lot of RAM as this increases resistance to massively
parallel GPU based password cracking.
However, when multiple systemd-cryptsetup binaries run at the same
time it is very likely that system using Argon2 (e.g. Fedora 30)
will encounter memory-pressure during early boot, following OOM killing
spree.
This patch aims to lower the damage done by OOM killer and sets OOMScore
for systemd-cryptsetup units to 500. Hopefully OOM killer will then
shoot us down and leave rest of the system services alone.
Lennart Poettering [Thu, 28 Mar 2019 14:52:27 +0000 (15:52 +0100)]
Merge pull request #12130 from keszybz/fix-ndebug-builds
Fix ndebug builds
Lennart Poettering [Thu, 28 Mar 2019 11:00:28 +0000 (12:00 +0100)]
update TODO
Lennart Poettering [Thu, 28 Mar 2019 09:01:09 +0000 (10:01 +0100)]
seccomp: add rseq() to default list of syscalls to whitelist
Apparently glibc is going to call this implicitly soon, hence let's
whitelist this by default.
Fixes: #12127
Lennart Poettering [Thu, 28 Mar 2019 11:09:23 +0000 (12:09 +0100)]
core: break overly long line
Lennart Poettering [Thu, 28 Mar 2019 11:00:56 +0000 (12:00 +0100)]
core: parse '@default' seccomp group permissively
We are about to add system calls (rseq()) not available on old
libseccomp/old kernels, and hence we need to be permissive when parsing
our definitions.
Zbigniew Jędrzejewski-Szmek [Thu, 28 Mar 2019 10:04:26 +0000 (11:04 +0100)]
Merge pull request #12115 from poettering/verbose-job-enqueue
add "systemctl --show-transaction start" as a more verbose "systemctl start" that shows enqueued jobs
Zbigniew Jędrzejewski-Szmek [Thu, 28 Mar 2019 08:44:02 +0000 (09:44 +0100)]
meson: disable warnings about unused variables for NDEBUG builds
With assertions disabled, we'd get a bunch of warnings that really bring no
value. With this change, a default meson build with -Db_ndebug=true generates
no warnings.
Zbigniew Jędrzejewski-Szmek [Thu, 28 Mar 2019 08:43:56 +0000 (09:43 +0100)]
core: avoid unnecessary cast
Zbigniew Jędrzejewski-Szmek [Thu, 28 Mar 2019 08:35:26 +0000 (09:35 +0100)]
test-terminal-util: fix sigsegv when compiled without asserts
I couldn't figure out what is going on here, because LTO inlines everything and
then the backtrace reported a different spot. But when compiled with NDEBUG but
no LTO, it's fairly obvious ;)
C.f. #12008.
Zbigniew Jędrzejewski-Szmek [Wed, 27 Mar 2019 13:28:24 +0000 (14:28 +0100)]
Remove variable only used for an assert
When compiled with -DNDEBUG, we get warnings about set-but-unused variables.
In general, it's not something we care about, but since removing those
variables arguably makes the code nicer, let's just to it in this case.
Zbigniew Jędrzejewski-Szmek [Wed, 27 Mar 2019 12:25:57 +0000 (13:25 +0100)]
test-terminal-util: add function logging
Lennart Poettering [Tue, 26 Mar 2019 19:11:30 +0000 (20:11 +0100)]
tree-wide: reorder various structures to make them smaller and use fewer cache lines
Some "pahole" spelunking.
Lennart Poettering [Wed, 27 Mar 2019 13:36:36 +0000 (14:36 +0100)]
tree-wide: (void)ify a few unlink() and rmdir()
Let's be helpful to static analyzers which care about whether we
knowingly ignore return values. We do in these cases, since they are
usually part of error paths.
Lennart Poettering [Wed, 27 Mar 2019 14:05:51 +0000 (15:05 +0100)]
Merge pull request #12119 from keszybz/voidify-mkdir-p
Voidify mkdir_p() and normalize util.h includes
Lennart Poettering [Wed, 27 Mar 2019 13:15:59 +0000 (14:15 +0100)]
Merge pull request #12113 from poettering/terminal-util-fixlets
tiny terminal-util.c fixlets
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 06:58:40 +0000 (07:58 +0100)]
man: clarify the role of OnBootSec= in containers
https://github.com/systemd/systemd/pull/12104#pullrequestreview-
218627236
Zbigniew Jędrzejewski-Szmek [Wed, 27 Mar 2019 08:30:35 +0000 (09:30 +0100)]
journalctl: voidify mkdir_p() call and unify two similar code paths
Let's unify the two similar code paths to watch /run/systemd/journal.
The code in manager.c is similar, but it uses mkdir_p_label(), and unifying
that would be too much trouble, so let's just adjust the error messages to
be the same.
CID #1400224.
Lennart Poettering [Tue, 26 Mar 2019 16:22:18 +0000 (17:22 +0100)]
terminal-util: add paranoid overflow check
Lennart Poettering [Tue, 26 Mar 2019 16:19:47 +0000 (17:19 +0100)]
terminal-util: modernize things with TAKE_PTR a bit
Lennart Poettering [Tue, 26 Mar 2019 17:02:49 +0000 (18:02 +0100)]
man: document the new systemctl --show-transaction option
Lennart Poettering [Tue, 26 Mar 2019 16:39:36 +0000 (17:39 +0100)]
test: add some basic testing that "systemctl start -T" does something
Lennart Poettering [Fri, 22 Mar 2019 19:58:13 +0000 (20:58 +0100)]
systemctl: add new --show-transaction switch
This new switch uses the new method call EnqueueUnitJob() for enqueuing
a job and showing the jobs it enqueued.
Fixes: #2297
Lennart Poettering [Tue, 26 Mar 2019 15:19:35 +0000 (16:19 +0100)]
systemctl: split out extra args generation into helper function of its own
Lennart Poettering [Tue, 26 Mar 2019 14:49:52 +0000 (15:49 +0100)]
systemctl: reindent table
Lennart Poettering [Tue, 26 Mar 2019 14:25:48 +0000 (15:25 +0100)]
systemctl: more SYNTHETIC_ERRNO() conversion
Lennart Poettering [Tue, 26 Mar 2019 14:20:26 +0000 (15:20 +0100)]
systemctl: replace switch statement by table of structures
Lennart Poettering [Fri, 22 Mar 2019 19:57:30 +0000 (20:57 +0100)]
core: add new API for enqueing a job with returning the transaction data
Zbigniew Jędrzejewski-Szmek [Wed, 27 Mar 2019 10:33:50 +0000 (11:33 +0100)]
Voidify more mkdir_p calls
Zbigniew Jędrzejewski-Szmek [Wed, 27 Mar 2019 10:32:41 +0000 (11:32 +0100)]
headers: remove unneeded includes from util.h
This means we need to include many more headers in various files that simply
included util.h before, but it seems cleaner to do it this way.
Zbigniew Jędrzejewski-Szmek [Wed, 27 Mar 2019 08:18:50 +0000 (09:18 +0100)]
test-fileio: do not use variable before checking return value
Coverity is unhappy because we use "line" in the assert that checks
the return value. It doesn't matter much, but let's clean this up.
Also, let's not assume that /proc/cmdline contains anything.
CID #1400219.
Lennart Poettering [Wed, 27 Mar 2019 08:29:13 +0000 (09:29 +0100)]
Merge pull request #12110 from keszybz/sysv-compat-fix
Sysv-compat compilation fix
Lennart Poettering [Wed, 27 Mar 2019 08:27:20 +0000 (09:27 +0100)]
Merge pull request #12116 from keszybz/mock-compilation-fixes
Fixes for compilation in Fedora 30 mock
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 11:46:02 +0000 (12:46 +0100)]
shared/install: try even harder to make sure variable is initalized
Apparently the fix in
a05294ff05923563087b53c1db64816130be3b34 was
not sufficient. Let's declare the two arrays as static variables.
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 18:26:11 +0000 (19:26 +0100)]
Merge pull request #12109 from poettering/sleep-minifixes
tiny fixes to sleep.c
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 09:20:57 +0000 (10:20 +0100)]
util-lib: fix sentence in comment
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 09:19:19 +0000 (10:19 +0100)]
systemctl: define less stuff when !HAVE_SYSV_COMPAT
We'd translate our action to sysv runlevel action, only to discard the result
in talk_initctl(). Let's just ifdef the whole thing away.
Fixes #12103.
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 11:01:00 +0000 (12:01 +0100)]
test-execute: skip flaky test when we can't unshare namespaces
When running in Fedora "mock", / is a tmpfs and /home is not mounted. The test
assumes that /home will be a tmpfs only and only if we can unshare. Obviously,
this does not hold in this case, because unsharing is not possible, but /home
is still a tmpfs. Let's just skip the test, since it's fully legitimate to
mount either or both of / and /home as tmpfs.
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 10:38:55 +0000 (11:38 +0100)]
test-execute: provide custom failure message
test_exec_ambientcapabilities: exec-ambientcapabilities-nobody.service: exit status 0, expected 1
Sometimes we get just the last line, for example from the failure summary,
so make it as useful as possible.
Lennart Poettering [Tue, 26 Mar 2019 08:59:32 +0000 (09:59 +0100)]
update TODO
Lennart Poettering [Tue, 26 Mar 2019 08:59:11 +0000 (09:59 +0100)]
sleep: (void)ify some call
Lennart Poettering [Tue, 26 Mar 2019 08:57:53 +0000 (09:57 +0100)]
sleep: use negative_errno() where appropriate
Lennart Poettering [Tue, 26 Mar 2019 09:05:29 +0000 (10:05 +0100)]
Merge pull request #12044 from keszybz/ttyname-malloc-simplification
util-lib: use a fixed buffer size for terminal path
Lennart Poettering [Fri, 22 Mar 2019 12:23:45 +0000 (13:23 +0100)]
tests: add simple testcase for getttyname_malloc()
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 07:58:00 +0000 (08:58 +0100)]
Merge pull request #12106 from poettering/nosuidns
add "nosuid" flag to exec directory mounts of DynamicUser=1 services
Zbigniew Jędrzejewski-Szmek [Mon, 25 Mar 2019 13:28:25 +0000 (14:28 +0100)]
logind: reword the polkit prompt for reboot parameter
Let's opt for the simplest description possible so that users actually
understand what we have in mind.
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2019 07:32:53 +0000 (08:32 +0100)]
Merge pull request #12105 from poettering/api-vfs-mount-flags
some API VFS mount flag tweaks
Lennart Poettering [Mon, 25 Mar 2019 15:21:11 +0000 (16:21 +0100)]
core: drop suid/sgid bit of files/dirs when doing recursive chown
This adds some extra paranoia: when we recursively chown a directory for
use with DynamicUser=1 services we'll now drop suid/sgid from all files
we chown().
Of course, such files should not exist in the first place, and noone
should get access to those dirs who isn't root anyway, but let's better
be safe than sorry, and drop everything we come across.
Lennart Poettering [Fri, 22 Mar 2019 19:21:15 +0000 (20:21 +0100)]
nspawn: minor improvements to --help text
Jörg Sommer [Mon, 25 Mar 2019 23:36:15 +0000 (00:36 +0100)]
completion/zsh/journalctl: Add --no-hostname
Lennart Poettering [Mon, 25 Mar 2019 17:51:14 +0000 (18:51 +0100)]
man: rework timer docs to use a table for monotonic timers
Lennart Poettering [Mon, 25 Mar 2019 18:29:26 +0000 (19:29 +0100)]
namespace: when DynamicUser=1 is set, mount StateDirectory= bind mounts "nosuid"
Add even more suid/sgid protection to DynamicUser= envionments: the
state directories we bind mount from the host will now have the nosuid
flag set, to disable the effect of nosuid on them.
Lennart Poettering [Mon, 25 Mar 2019 18:42:47 +0000 (19:42 +0100)]
nspawn: mount mqueue with nodev,noexec,nosuid, too
The host mounts it like that, nspawn hence should do too.
Moreover, mount the file system after doing CLONEW_NEWIPC so that it
actually reflects the right mqueues. Finally, mount it wthout
considering it fatal, since POSIX mqueue support is little used and it
should be fine not to support it in the kernel.
Lennart Poettering [Mon, 25 Mar 2019 18:39:00 +0000 (19:39 +0100)]
units: set nodev,nosuid,noexec flags for various secondary API VFS
A couple of API VFS we mount via .mount units. Let's set the three flags
for those too, just in case.
This is just paranoia, nothing else, but shouldn't hurt.
Lennart Poettering [Mon, 25 Mar 2019 16:04:38 +0000 (17:04 +0100)]
mount-util: beef up bind_remount_recursive() to be able to toggle more than MS_RDONLY
The function is otherwise generic enough to toggle other bind mount
flags beyond MS_RDONLY (for example: MS_NOSUID or MS_NODEV), hence let's
beef it up slightly to support that too.
Lennart Poettering [Mon, 25 Mar 2019 15:57:55 +0000 (16:57 +0100)]
mount-util: use set_put_strdup() where appropriate
Lennart Poettering [Mon, 25 Mar 2019 15:54:48 +0000 (16:54 +0100)]
mount-util: don't clobber return value in umount_recursive()
We shouldn't override 'r' with the result of cunescape(), since we use
it to return the last error of umount().
Lennart Poettering [Mon, 25 Mar 2019 15:50:21 +0000 (16:50 +0100)]
namespace: get rid of {} around single-line if blocks
Lennart Poettering [Mon, 25 Mar 2019 15:49:57 +0000 (16:49 +0100)]
namespace: get rid of local variable
Lennart Poettering [Mon, 25 Mar 2019 15:38:33 +0000 (16:38 +0100)]
namespace: (void)ify a number of syscalls
Lennart Poettering [Mon, 25 Mar 2019 15:34:48 +0000 (16:34 +0100)]
namespace: replace one case of stack allocation with heap allocation
The list of mounts might grow quite large, let's avoid the stack for
this. Better safe than sorry.
Lennart Poettering [Mon, 25 Mar 2019 16:06:38 +0000 (17:06 +0100)]
Merge pull request #12081 from poettering/systemctl-love
various small systemctl modernizations and refactoring
Lennart Poettering [Fri, 22 Mar 2019 19:22:26 +0000 (20:22 +0100)]
systemctl: move --failed close to --state= in help text
Lennart Poettering [Fri, 22 Mar 2019 19:20:24 +0000 (20:20 +0100)]
systemctl: underline sections in help text
Taking inspiration from the recent commit that added that to nspawn's
help text.
Lennart Poettering [Fri, 22 Mar 2019 19:07:26 +0000 (20:07 +0100)]
systemctl: use structured initialization
Lennart Poettering [Fri, 22 Mar 2019 19:06:40 +0000 (20:06 +0100)]
systemctl: use SYNTHETIC_ERRNO everywhere
Lennart Poettering [Fri, 22 Mar 2019 19:05:08 +0000 (20:05 +0100)]
systemctl: split out some SysV compat stuff into its own C file
systemctl.c is way to large already. Let's split out some stuff out that
is easy to split out.
Zbigniew Jędrzejewski-Szmek [Mon, 25 Mar 2019 12:42:10 +0000 (13:42 +0100)]
hwdb: update for v242
Appears to be usual slew of mundane corrections and additions.
Zbigniew Jędrzejewski-Szmek [Mon, 25 Mar 2019 13:22:15 +0000 (14:22 +0100)]
Merge pull request #12089 from mrc0mmand/journalctl-bash-comp-redirection
bash-completion: use the default completion for shell redirect operators
Lennart Poettering [Fri, 22 Mar 2019 18:19:32 +0000 (19:19 +0100)]
tree-wide: constify a few static string tables
Lennart Poettering [Fri, 22 Mar 2019 18:22:53 +0000 (19:22 +0100)]
dbus-unit: remove redundant check
We checked this with an assert() a few lines up aleady, no need to check
this again.
Lennart Poettering [Fri, 22 Mar 2019 18:21:48 +0000 (19:21 +0100)]
core: remove unnecessary heap allocation
Lennart Poettering [Mon, 25 Mar 2019 12:25:04 +0000 (13:25 +0100)]
NEWS: various tweaks and updates for v242
Zbigniew Jędrzejewski-Szmek [Sun, 24 Mar 2019 12:47:05 +0000 (13:47 +0100)]
Merge pull request #12087 from yuwata/fix-condition-free-list
util: fix condition_free_list_type()
Frantisek Sumsal [Sat, 23 Mar 2019 20:51:04 +0000 (21:51 +0100)]
bash-completion: unify indentation
Frantisek Sumsal [Sat, 23 Mar 2019 20:49:17 +0000 (21:49 +0100)]
bash-completion: use default completion for redirect operators
Yu Watanabe [Sat, 23 Mar 2019 15:34:01 +0000 (00:34 +0900)]
fuzz: add testcases for the bug in condition_free_list_type()
Yu Watanabe [Sat, 23 Mar 2019 15:27:09 +0000 (00:27 +0900)]
network,udev: explicitly declare 'conditions' is a list
Yu Watanabe [Sat, 23 Mar 2019 15:22:38 +0000 (00:22 +0900)]
util: fix condition_free_list_type()
This fixes a bug introduced by
c4f58deab56282cd438922203287cb073b861513.
Closes oss-fuzz#13878, oss-fuzz#13882, oss-fuzz#13884, oss-fuzz#13886, and
oss-fuzz#13888.
Lennart Poettering [Fri, 22 Mar 2019 20:07:47 +0000 (21:07 +0100)]
Merge pull request #11602 from vesajaaskelainen/dbus-reboot-with-parameters
dbus-manager: Add RebootWithParameters d-bus method
Lennart Poettering [Fri, 22 Mar 2019 20:06:17 +0000 (21:06 +0100)]
Merge pull request #12079 from keszybz/fuzz-nspawn-oci
Add fuzzer for nspawn-oci
Vesa Jääskeläinen [Sat, 9 Mar 2019 20:30:58 +0000 (22:30 +0200)]
logind: Add support for RebootParameter
This adds support for user to set & get reboot parameter for reboot.
As callee would be next issuing Reboot call same policy checks are being used.
If unit file issuing the reboot action defines RebootArgument (or similar) that
setting takes precedence.
Lennart Poettering [Fri, 22 Mar 2019 17:11:59 +0000 (18:11 +0100)]
Merge pull request #12075 from keszybz/two-docs
Two small man page enhancements
Lennart Poettering [Fri, 22 Mar 2019 14:22:45 +0000 (15:22 +0100)]
nspawn: don't free "fds" twice
Previously both run() and run_container() would free 'fds'. Let's fix
that, and let run() free it but make run_container() already remove all
fds from it, because that's what we actually want to do.
Fixes: #12073
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 16:23:49 +0000 (17:23 +0100)]
nspawn-oci: fix double free
Also rename function to make it clear that it also frees the array
object itself.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 16:16:17 +0000 (17:16 +0100)]
udev/link-config: rename MACPolicy to MACAddressPolicy
Things are clearer if the same name is used everywhere, and we don't gain
much by saving a few bytes.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 15:58:18 +0000 (16:58 +0100)]
Merge pull request #12055 from poettering/save-argc-argv
main-func.h and systemctl argc/argv improvements
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 15:49:56 +0000 (16:49 +0100)]
Merge pull request #12072 from poettering/string-table-fixes
three small string table fixes
Vesa Jääskeläinen [Mon, 11 Mar 2019 21:18:29 +0000 (23:18 +0200)]
logind: relocate function return_test_polkit()
Relocate function return_test_polkit() upper in file for easier access from other functions.
Vesa Jääskeläinen [Sat, 9 Mar 2019 20:30:45 +0000 (22:30 +0200)]
systemctl: restore "systemctl reboot ARG" functionality
Commit
d85515edcf9700dc068201ab9f7103f04f3b25b2 changed logic how reboot is
executed. That commit changed behavior to use emergency action reboot code path
to perform the reboot.
This inadvertently broke rebooting with argument:
$ systemctl reboot custom-reason
Restore original behavior so that if reboot service unit similar to
systemd-reboot.service is executed it is possible to override reboot reason
with "systemctl reboot ARG".
When "systemctl reboot ARG" is executed ARG is placed in file
/run/systemd/reboot-param and reboot is issued using logind's Reboot
dbus-service.
If RebootArgument is specified in systemd-reboot.service it takes precedence
over what systemctl sets.
Fixes: #11828