Commit Graph

28218 Commits

Author SHA1 Message Date
Lennart Poettering b8076e3d06 update TODO 2017-02-08 22:21:27 +01:00
Lennart Poettering ae9d60ce4e seccomp: on s390 the clone() parameters are reversed
Add a bit of code that tries to get the right parameter order in place
for some of the better known architectures, and skips
restrict_namespaces for other archs.

This also bypasses the test on archs where we don't know the right
order.

In this case I didn't bother with testing the case where no filter is
applied, since that is hopefully just an issue for now, as there's
nothing stopping us from supporting more archs, we just need to know
which order is right.

Fixes: #5241
2017-02-08 22:21:27 +01:00
Philip Withnall b53ede699c nspawn: Add support for sysroot pivoting (#5258)
Add a new --pivot-root argument to systemd-nspawn, which specifies a
directory to pivot to / inside the container; while the original / is
pivoted to another specified directory (if provided). This adds
support for booting container images which may contain several bootable
sysroots, as is common with OSTree disk images. When these disk images
are booted on real hardware, ostree-prepare-root is run in conjunction
with sysroot.mount in the initramfs to achieve the same results.
2017-02-08 16:54:31 +01:00
Philip Withnall 6a909d41e1 test: Fix a maybe-uninitialised compiler warning (#5269)
The compiler warning is a false positive, since n_addresses is always
initialised on the success path from parse_argv(), but the compiler
obviously can’t work that out.

Fixes:
   src/test/test-nss.c:426:9: warning: 'n_addresses' may be used uninitialized in this function [-Wmaybe-uninitialized]
2017-02-08 16:53:01 +01:00
Lennart Poettering 8a50cf6957 seccomp: MemoryDenyWriteExecute= should affect both mmap() and mmap2() (#5254)
On i386 we block the old mmap() call entirely, since we cannot properly
filter it. Thankfully it hasn't been used by glibc since quite some
time.

Fixes: #5240
2017-02-08 15:14:02 +01:00
Lennart Poettering b6f08ecda9 Merge pull request #5231 from keszybz/mask-wants
Mask individual .wants/.requires symlinks
2017-02-08 14:50:56 +01:00
Lennart Poettering a48dd3475b dissect: don't honour NOAUTO flags when looking for ESP (#5224)
The flag is originally defined for "basic data partitions", but not for the
ESP. We reuse it for the various partitions defined by the Discoverable
Partitions Spec, but it isn't defined for the ESP, hence don't check for
it. Instead, do check for GPT_FLAG_NO_BLOCK_IO_PROTOCOL, as that flag
actually is defined for all partition types, and recommended to use by
the UEFI spec.

Fixes: #5218
2017-02-07 22:10:48 -05:00
Franck Bui fbc42f1332 tests: add dropin dependency tests
[zj: tests assertions adjusted to the different logic in which masking
     of a dependency through one name, does not forbid the dependency
     being added through another name.]
2017-02-07 21:32:10 -05:00
Zbigniew Jędrzejewski-Szmek 317cd27afb core/load-dropin: add more sanity checks on .wants/.requires symlinks
Feb 04 22:35:42 systemd[1462]: foo.service: Wants dependency dropin /home/zbyszek/.config/systemd/user/foo.service.wants/diffname.service target ../barbar.service has different name
Feb 04 22:35:42 systemd[1462]: foo.service: Wants dependency dropin /home/zbyszek/.config/systemd/user/foo.service.wants/wrongname is not a valid unit name, ignoring
2017-02-07 21:32:00 -05:00
Zbigniew Jędrzejewski-Szmek dcc4f30ecc core: drop code that is now unused 2017-02-07 21:31:59 -05:00
Zbigniew Jędrzejewski-Szmek 5be5d39bf0 core: implement masking of .wants/.requires symlinks
Fixes #1169.
Fixes #4830.

Example log errors:
Feb 04 22:13:28 systemd[1462]: foo.service: Wants dependency on empty_file.service is masked by /home/zbyszek/.config/systemd/user/foo.service.wants/empty_file.service, ignoring
Feb 04 22:13:28 systemd[1462]: foo.service: Wants dependency on masked.service is masked by /home/zbyszek/.config/systemd/user/foo.service.wants/masked.service, ignoring
2017-02-07 21:31:59 -05:00
Zbigniew Jędrzejewski-Szmek 9577878210 core: when loading .wants and .requires, follow the same logic as .d conf dropins
Essentially, instead of sequentially adding deps based on all symlinks
encountered in .wants and .requires dirs for each name and each unit file load
path, iteratate over the load paths and unit names gathering symlinks, then
order them based on priority, and then iterate over the final list, adding
dependencies.

This patch doesn't change the logic too much, except that the order in which
dependencies are applied might be different. It wasn't defined before, so that
not really a change. Adding filtering on the symlinks is left for later
patches.
2017-02-07 21:31:22 -05:00
Zbigniew Jędrzejewski-Szmek 5dd11ab5f3 basic/dirent-util: allow suffix to be omitted for dirent_is_file_with_suffix 2017-02-07 21:06:38 -05:00
Lennart Poettering cec2a20dab man: s/--unmount/--umount/g (#5243)
The --help text currently uses the "--umount" spelling, hence to the
same in the man page too.

And let's settle on "umount" instead of "unmount" here, since most folks
probably expect that when typing in a command, as util-linux' tool is
called "umount" after all, and so is the symlink "systemd-umount" we
install.
2017-02-07 19:54:37 -05:00
Zbigniew Jędrzejewski-Szmek a4bee98152 Merge pull request #5263 from poettering/install-alias 2017-02-07 19:50:20 -05:00
Zbigniew Jędrzejewski-Szmek 2cb2eba61b Revert "fix handling of templates instantiated in /usr/lib (#5263)"
This reverts commit 0698b67492.

It was supposed to be merged, not squashed.
2017-02-07 19:49:55 -05:00
Lennart Poettering 0698b67492 fix handling of templates instantiated in /usr/lib (#5263)
Fix handling of templates instantiated in /usr/lib.
All work to fix #5136.
2017-02-07 19:48:56 -05:00
Lucas Werkmeister 8331eaabc7 man: document *.d/ drop-in file order (#5262) 2017-02-07 18:58:02 -05:00
lewo 15fcdc98cf tmpfiles.d: set primary group rights to r-w (#5265)
If the /var/log/journal directory is created with rigths 700, the application
of an ACL rules without any primary group right sets it to 0. A chmod 755 on
this file will then only set the ACL mask and let the ACL primary group right
to 0. The directory is then unreadable for the primary group.

This patch explicitly sets the primary group to avoid this problem.

Fixes #5264.
2017-02-07 18:56:55 -05:00
Zbigniew Jędrzejewski-Szmek 55295fd84d Merge pull request #5219 from poettering/run-size-check
before reloading, check that /run/systemd has enough space
2017-02-07 18:37:04 -05:00
Lennart Poettering 27413cde03 Merge pull request #5259 from lucaswerkmeister/man
Manpage improvements
2017-02-07 20:24:43 +01:00
Lennart Poettering ee152d2f6b Merge pull request #5261 from AsciiWolf/master
l10n: various fixes
2017-02-07 20:24:05 +01:00
Lennart Poettering 80cb9da358 install: remove some unused parameters from various functions in install.c
No need to pass what we don't use.
2017-02-07 20:22:09 +01:00
Lennart Poettering dfead90d93 install: when a template unit is instantiated via a /usr symlink, consider it enabled
If a unit foobar@.service stored below /usr is instantiated via a
symlink foobar@quux.service also below /usr, then we should consider the
instance statically enabled, while the template itself should continue
to be considered enabled/disabled/static depending on its [Install]
section.

In order to implement this we'll now look for enablement symlinks in all
unit search paths, not just in the config and runtime dirs.

Fixes: #5136
2017-02-07 20:16:12 +01:00
AsciiWolf 3f33236b6b l10n: fix file permissions of Indonesian translation 2017-02-07 19:02:01 +01:00
AsciiWolf fabb53c2c9 l10n: fix strings formatting in Czech translation 2017-02-07 19:00:24 +01:00
Lucas Werkmeister c04becfa72 man: document that systemd-run --on-* cannot be used with --pty 2017-02-07 16:26:02 +01:00
Lennart Poettering 9f6cbcf53c install: don't enter loop when traversing a template symlinks
Before this patch, if we'd encounter an instance or template symlink
while traversing a chain of symlinks we'd fill in the instance name and
retry the iteration. This makes no sense if the resulting name is
actually the same as we are coming from, as we'd just spin a couple of
times in the loop, until the UNIT_FILE_FOLLOW_SYMLINK_MAX iteration
limit is hit.

Fix this, by accepted the symlink as it is, if it identical to what we
filled in.
2017-02-07 16:22:49 +01:00
Lucas Werkmeister ee3c52ebbe man: use systemctl enable --now 2017-02-07 16:20:25 +01:00
Lucas Werkmeister aa9f9e587d man: add cross-reference
The third paragraph of the Description already linked to
systemd.resource-control(5), but it was missing from the list of
additional options for the [Service] section.
2017-02-07 16:20:25 +01:00
Evgeny Vereshchagin d52fbaa58c Merge pull request #5225 from poettering/seccomp-socket
make RestrictAddressFamilies= officially a NOP on i386
2017-02-07 05:06:54 +03:00
Evgeny Vereshchagin 1fb8579749 Merge pull request #5239 from poettering/notify-access-all
man: document that sd_notify() is racy in some cases
2017-02-06 23:59:33 +03:00
Lennart Poettering 6a1da642b3 update TODO 2017-02-06 21:14:31 +01:00
Lennart Poettering 0ca48bb0e8 README: suffix unit file options with "=" 2017-02-06 21:13:29 +01:00
Lennart Poettering 33bac67b48 update TODO 2017-02-06 20:26:33 +01:00
Lennart Poettering aa20394579 notify: document that we fake the PID when sending sd_notify() 2017-02-06 20:01:24 +01:00
Lennart Poettering d543b9f586 update TODO 2017-02-06 18:37:28 +01:00
Lennart Poettering b3bb64767a man: document that sd_notify() is racy in some cases 2017-02-06 18:21:27 +01:00
Lennart Poettering d53333d4b1 core: use a memfd for serialization
If we can, use a memfd for serializing state during a daemon reload or
reexec. Fall back to a file in /run/systemd or /tmp only if memfds are
not available.

See: #5016
2017-02-06 16:58:35 +01:00
Lennart Poettering ae57dad3f9 manager: refuse reloading/reexecing when /run is overly full
Let's add an extra safety check: before entering a reload/reexec, let's
verify that there's enough room in /run for it.

Fixes: #5016
2017-02-06 16:58:06 +01:00
Lukas Rusak 0f92383243 systemd-mount: add missing fsck argument (#5238) 2017-02-06 14:25:15 +01:00
Lennart Poettering 142bd808a1 man: Document that RestrictAddressFamilies= doesn't work on s390/s390x/...
We already say that it doesn't work on i386, but there are more archs
like that apparently.
2017-02-06 14:17:12 +01:00
Lennart Poettering ad8f1479b4 seccomp: RestrictAddressFamilies= is not supported on i386/s390/s390x, make it a NOP
See: #5215
2017-02-06 14:17:12 +01:00
Lennart Poettering 3576dddf27 update TODO 2017-02-06 13:49:40 +01:00
Lennart Poettering 9194199c98 Merge pull request #5237 from keszybz/explicit-bzero
Use `explicit_bzero`
2017-02-06 13:35:56 +01:00
Zbigniew Jędrzejewski-Szmek 65c8834942 cgls: look at the right variable in error path (#5234)
CID #1370779.
2017-02-06 13:34:01 +01:00
Zbigniew Jędrzejewski-Szmek 1075122f42 journalctl: replace string_erase with memset('x')
The compiler should not be able to optimize out the memset, because optarg is global
memory. In this case, not making the argument an empty string is nicer, so just use
an open-coded version of string_erase from before the explicit_bzero change.
2017-02-05 21:07:55 -05:00
Zbigniew Jędrzejewski-Szmek 2d26d8e07e treewide: replace homegrown memory_erase with explicit_bzero
explicit_bzero was added in glibc 2.25. Make use of it.

explicit_bzero is hardcoded to zero the memory, so string erase now
truncates the string, instead of overwriting it with 'x'. This causes
a visible difference only in the journalctl case.
2017-02-05 21:07:55 -05:00
Felipe Sateler 52e634271f resolved: downgrade "processing query..." message to debug (#5233)
It doesn't really add much value in normal operation and just spams the log.
2017-02-05 17:17:50 -05:00
Martin Pitt d2697a95fe Merge pull request #5223 from keszybz/root-workdir
Fix WorkDir=~ with empty User=
2017-02-05 22:31:02 +01:00