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
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
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 15:26:05 +0000 (16:26 +0100)]
NEWS: add missing word
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 12:23:02 +0000 (13:23 +0100)]
man: clarify that ExecStop= is always called
Fixes #11744.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 12:10:39 +0000 (13:10 +0100)]
man: update description of initrd in bootup(7)
Mention that initramfs is used, not initrd, even though we still call
it that. Also add links and clarify who loads the initramfs.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 14:27:27 +0000 (15:27 +0100)]
NEWS: prepare for v242
Evgeny Vereshchagin [Fri, 22 Mar 2019 10:38:02 +0000 (11:38 +0100)]
network: add missing nulstr terminator
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13821
Lennart Poettering [Fri, 22 Mar 2019 11:25:16 +0000 (12:25 +0100)]
dbus-execute: don't needlessly override error code
Lennart Poettering [Fri, 22 Mar 2019 11:14:09 +0000 (12:14 +0100)]
dbus-execute: lets use exec_directory_type_from_string() to simplify things
Lennart Poettering [Fri, 22 Mar 2019 11:13:01 +0000 (12:13 +0100)]
udev: use string_table_lookup() where we can
Lennart Poettering [Fri, 22 Mar 2019 11:12:29 +0000 (12:12 +0100)]
string-table: use string_table_lookup() in our own macros everywhere
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 11:04:32 +0000 (12:04 +0100)]
nspawn-oci: mount source is optional
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2019 10:51:21 +0000 (11:51 +0100)]
nspawn-oci: use _cleanup_ in one more place
Zbigniew Jędrzejewski-Szmek [Thu, 21 Mar 2019 22:16:56 +0000 (23:16 +0100)]
fuzz-nspawn-oci: add fuzzer for the oci bundle loader
Franck Bui [Fri, 22 Mar 2019 10:09:08 +0000 (11:09 +0100)]
meson: add libseccomp as a nspawn dep (#12067)
Due to this specific change: d0b6a10#diff-0203416587516c224c8fcfe8129e7caeR8,
systemd-nspawn uses libseccomp now if it is available. We we need to pass -I/usr/include
/libseccomp (or wherever seccomp.h is located) when compiling systemd-nspawn because
nspawn-settings.h does #include <seccomp.h>.
Fixes: #12060
Lennart Poettering [Thu, 21 Mar 2019 17:53:46 +0000 (18:53 +0100)]
nspawn: conditionalize libseccomp use
We support compilation without libseccomp, hence don't rely on its
symbols.
Yu Watanabe [Thu, 21 Mar 2019 20:57:38 +0000 (05:57 +0900)]
Merge pull request #12066 from yuwata/fix-network-tunnel-12041
network: fix netdev_tunnel_verify()
Zbigniew Jędrzejewski-Szmek [Thu, 21 Mar 2019 16:11:31 +0000 (17:11 +0100)]
hwdb: make ids_parser.py compatible with pyparsing-2.3.0+
https://github.com/pyparsing/pyparsing/blob/master/CHANGES#L175
says something about fixing erroneously created levels in the hierarchy.
I don't have the faintest idea what this means, but with the change in
this patch we generate output that is unchanged from pre-2.3.0 versions.
Tested with python3-pyparsing-2.3.1-1.fc30.noarch and
python3-pyparsing-2.2.0-3.fc29.noarch.
Fixes #12021.
Yu Watanabe [Thu, 21 Mar 2019 16:54:27 +0000 (01:54 +0900)]
man: mention that Tunnel.Local= and Tunnel.Remote= can take 'any'
Yu Watanabe [Thu, 21 Mar 2019 16:53:46 +0000 (01:53 +0900)]
man: do not wrap line in the table