Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 10:35:35 +0000 (11:35 +0100)]
Merge pull request #8378 from evverx/get-around-freopen
tests: stop using `freopen` in `test-fileio`
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 09:41:44 +0000 (10:41 +0100)]
Merge pull request #8086 from hdante/sdboot-setmode-v2
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 09:14:41 +0000 (10:14 +0100)]
Merge pull request #7817 from medhefgo/systemd-boot
systemd-boot improvements
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 07:51:09 +0000 (08:51 +0100)]
systemd-boot: fix off-by-one buffer overrun
We'd allocate a buffer of some size and then write zero to the byte one after.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 07:55:04 +0000 (08:55 +0100)]
systemd-boot: reduce indentation in config_entry_add_linux()
No functional change.
Jan Janssen [Sat, 6 Jan 2018 18:21:48 +0000 (19:21 +0100)]
systemd-boot: Try harder not to add ourselves to the list
We don't need to check if we are adding ourselves to the list
if we know that it's the windows or EFI shell loaders.
If we are adding the EFI default loader, additionally try to
see if we can find the systemd-boot magic string and skip
this entry if we do.
Tomasz Torcz [Tue, 6 Mar 2018 08:35:47 +0000 (09:35 +0100)]
NEWS: fix typos in v238 section (#8369)
Yu Watanabe [Tue, 6 Mar 2018 07:02:44 +0000 (16:02 +0900)]
rpm: add missing '-p <lua>' in trigger script (#8367)
Follow-up for
32a00a9c097cf04ec2b0fcbf9b73eba188318424 (#8090).
Evegeny Vereshchagin [Mon, 5 Mar 2018 22:05:46 +0000 (22:05 +0000)]
tests: close a leftover file descriptor in `test-fileio`
This should make it a bit easier to search for real file descriptor leaks.
```
$ valgrind --leak-check=full --track-fds=yes ./build/test-fileio
...
==29457==
==29457== FILE DESCRIPTORS: 4 open at exit.
==29457== Open file descriptor 3: /tmp/test-systemd_writing_tmpfile.lyV5Rc
==29457== at 0x4B9AD9E: open (open.c:43)
==29457== by 0x4B19B24: __gen_tempname (tempname.c:261)
==29457== by 0x4BA5CC3: mkostemp64 (mkostemp64.c:32)
==29457== by 0x48F739B: mkostemp_safe (fileio.c:1206)
==29457== by 0x10D968: test_writing_tmpfile (test-fileio.c:620)
==29457== by 0x10E930: main (test-fileio.c:767)
==29457==
```
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 22:16:37 +0000 (23:16 +0100)]
Merge pull request #8362 from keszybz/release-238
Release 238
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 22:15:56 +0000 (23:15 +0100)]
Merge pull request #8358 from fbuihuu/tmpfiles-dont-resolve-pathnames-when-traversing-recursively
Tmpfiles dont resolve pathnames when traversing recursively
Evegeny Vereshchagin [Mon, 5 Mar 2018 21:23:33 +0000 (21:23 +0000)]
tests: stop using `freopen` in `test-fileio`
This helps get around a bug confusing `glibc` and making the test bail
out with the following error under `asan` on `x86`:
Fatal error: glibc detected an invalid stdio handle
Aborted (core dumped)
The bug has been reported in https://github.com/google/sanitizers/issues/778,
but it is unlikely to be fixed anytime soon.
Franck Bui [Mon, 5 Mar 2018 11:32:18 +0000 (12:32 +0100)]
test: add tests for systemd-tmpfiles
Franck Bui [Mon, 5 Mar 2018 18:02:25 +0000 (19:02 +0100)]
test: fix setup_suse() to make it work with an already populated root
Franck Bui [Fri, 2 Mar 2018 16:19:32 +0000 (17:19 +0100)]
tmpfiles: don't resolve pathnames when traversing recursively through directory trees
Otherwise we can be fooled if one path component is replaced underneath us.
The patch achieves that by always operating at file descriptor level (by using
*at() helpers) and by making sure we do not any path resolution when traversing
direcotry trees.
However this is not always possible, for instance when listing the content of a
directory or some operations don't provide the *at() helpers or others (such as
fchmodat()) don't have the AT_EMPTY_PATH flag. In such cases we operate on
/proc/self/fd/%i pseudo-symlink instead, which works the same for all kinds of
objects and requires no checking of type beforehand.
Also O_PATH flag is used when opening file objects in order to prevent
undesired behaviors: device nodes from reacting, automounts from
triggering, etc...
Fixes: #7986
Fixes: CVE-2018-6954
Franck Bui [Fri, 2 Mar 2018 15:25:56 +0000 (16:25 +0100)]
tmpfiles: fstat() works with fd opened with O_PATH since Linux 3.6
Franck Bui [Fri, 2 Mar 2018 15:13:07 +0000 (16:13 +0100)]
tmpfiles: make hardlink_vulnerable() argument constant
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:45:28 +0000 (17:45 +0100)]
Merge pull request #8341 from yuwata/test-execute-ambient
test-execute: check capabilities before runnig tests
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:13:38 +0000 (17:13 +0100)]
NEWS: bump version and add contributors
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:12:48 +0000 (17:12 +0100)]
meson: bump so revision and systemd version in preparation for v238
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:08:01 +0000 (17:08 +0100)]
mailmap: one more person
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:18:47 +0000 (17:18 +0100)]
Merge pull request #8345 from sourcejedi/logind_restart_is_sorely_lacking_in_testing
login: fix for #8343
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:16:04 +0000 (17:16 +0100)]
Merge pull request #8354 from keszybz/new-NEWS
NEWS for v238
Filipe Brandenburger [Mon, 5 Mar 2018 16:03:52 +0000 (08:03 -0800)]
mkosi: use locale that supports UTF-8, detect one that is available (#8340)
Using C.UTF-8 (as was done before #7244) breaks Arch Linux, but using
en_US.UTF-8 (after #7244) breaks Debian in our .mkosi/mkosi.debian.
So try to detect which one is available and works, first checking
whether we're already running under a valid UTF-8 locale, then trying
C.UTF-8 and finally en_US.UTF-8.
If we fail to find a valid UTF-8 locale, then fail early, instead of
letting the whole build complete only for Mesos to fail midway through
the `ninja test` step.
Tested on all of mkosi.fedora, mkosi.debian and mkosi.arch.
Fixes: #7238
Marco Gulino [Mon, 5 Mar 2018 15:47:28 +0000 (15:47 +0000)]
Add accel matrix for iOTA 360 (#8342)
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 09:25:17 +0000 (10:25 +0100)]
NEWS: update for v238
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 08:31:17 +0000 (09:31 +0100)]
man: just use unicode for an mdash
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 08:04:39 +0000 (09:04 +0100)]
basic/glob-util: do not use names with "_" prefix
Names starting with _ or __ are reserved by the standard, better to
avoid them.
Yu Watanabe [Mon, 5 Mar 2018 07:39:52 +0000 (16:39 +0900)]
coredump: do not leak memory (#8352)
Fixes #8351.
Yu Watanabe [Sun, 4 Mar 2018 15:02:22 +0000 (00:02 +0900)]
test-execute: use CAP_CHOWN instead of CAP_NET_ADMIN
CAP_NET_ADMIN is somtrimes dropped by container runtime.
This changes to use CAP_CHOWN instead of CAP_NET_ADMIN, as it is
less likely to be dropped.
Yu Watanabe [Sun, 4 Mar 2018 15:00:35 +0000 (00:00 +0900)]
test-execute: check capabilities before running tests
Fixes #8193.
Andika Triwidada [Sun, 4 Mar 2018 12:15:21 +0000 (19:15 +0700)]
po: Updated Indonesian translation (#8348)
SjonHortensius [Sun, 4 Mar 2018 12:12:45 +0000 (13:12 +0100)]
fixed 3 occurences of 'Failed top open' (#8349)
Yu Watanabe [Sun, 4 Mar 2018 07:53:50 +0000 (16:53 +0900)]
test-execute: change log level from error to notice
Skipping some tests due to the missing e.g., capsh binary
or kernel support, are not error.
This changes the log level for such messages.
Yu Watanabe [Sat, 3 Mar 2018 13:15:36 +0000 (22:15 +0900)]
test-execute: rename tests for AmbientCapabilities=
The unit files for test-execute are named like
`exec-(setting-name-in-lower-character)-(optional-text).service`.
However, test units for AmbientCapabilities= are not following this.
So, let's rename them for the consistency.
This does not change anything in the functionality of the test.
snorreflorre [Sun, 4 Mar 2018 07:18:46 +0000 (08:18 +0100)]
hwdb: add axis range corrections for the Lenovo ThinkPad Edge 13 (02173BG) (#8253)
Alan Jenkins [Sat, 3 Mar 2018 18:44:39 +0000 (18:44 +0000)]
login: remember that fds received from PID1 need to be removed eventually
Remember to set sd->pushed_fd when we receive an fd from PID1 on startup,
the same as we set it when we send an fd to PID1.
Alan Jenkins [Sat, 3 Mar 2018 18:37:50 +0000 (18:37 +0000)]
login: fix FDNAME in call to sd_pid_notify_with_fds()
$ git grep FDNAME
logind-session-device.c: ... "FDNAME=session-", sd->session->id);
logind-session-device.c: ... "FDNAME=session", sd->session->id);
Oops.
Fixes #8343. Or at least a more minimal reproducer. Xorg still
dies when logind is restarted, but the Xorg message says this
is entirely deliberate.
(This could also be the reason I hit #8035, instead of the race
condition I originally suggested).
Lennart Poettering [Fri, 2 Mar 2018 15:25:27 +0000 (16:25 +0100)]
update TODO
Lennart Poettering [Fri, 2 Mar 2018 14:42:03 +0000 (15:42 +0100)]
Merge pull request #8314 from poettering/rearrange-stdio
refactor how we rearrange fds for stdin/stdout/stderr
Lennart Poettering [Fri, 2 Mar 2018 14:41:36 +0000 (15:41 +0100)]
units: use SuccessAction=reboot where appropriate (#8335)
We should really use our own native concepts for rebooting.
Lennart Poettering [Fri, 2 Mar 2018 14:40:52 +0000 (15:40 +0100)]
Merge pull request #8336 from poettering/coccinelle-reallocarray
reallocarray() coccinellization
Lennart Poettering [Fri, 2 Mar 2018 14:40:21 +0000 (15:40 +0100)]
Merge pull request #8333 from keszybz/hwdb-update
Hwdb update
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 12:33:54 +0000 (13:33 +0100)]
Merge pull request #8337 from poettering/resolve-fixes
various resolve-tool fixes
Lennart Poettering [Fri, 2 Mar 2018 12:33:30 +0000 (13:33 +0100)]
man: there's no point in referenceing systemd.unit(5) from itself (#8338)
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 12:00:07 +0000 (13:00 +0100)]
Merge pull request #8323 from xyproto/ok_color
Make the color of the status OK configurable at build-time
Michael Vogt [Fri, 2 Mar 2018 11:56:44 +0000 (12:56 +0100)]
sysusers: support `u username -:300` style syntax (#8325)
This PR implements the first part of RFE #8046. I.e. this allows to
write:
```
u username -:300
```
Where the uid is chosen automatically but the gid is fixed.
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:56:04 +0000 (12:56 +0100)]
Merge pull request #8332 from poettering/logind-open-if-needed
logind device resume fix
Lennart Poettering [Fri, 2 Mar 2018 11:55:24 +0000 (12:55 +0100)]
mount-setup: change bpf mount mode to 0700 (#8334)
After discussing with the kernel folks, we agreed to default to 0700 for
this. Better safe than sorry.
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:53:11 +0000 (12:53 +0100)]
Merge pull request #8303 from yuwata/fix-8276
test: use synthesize_nobody() in test-execute
Lennart Poettering [Fri, 2 Mar 2018 11:51:57 +0000 (12:51 +0100)]
systemctl: document telinit/init matching a bit (#8339)
See: #8305
Lennart Poettering [Tue, 27 Feb 2018 16:47:00 +0000 (17:47 +0100)]
resolved: debug log about resolv.conf lines we don't grok
Lennart Poettering [Wed, 28 Feb 2018 09:53:27 +0000 (10:53 +0100)]
man: extend synopsys to recently added commands
Lennart Poettering [Tue, 27 Feb 2018 16:46:00 +0000 (17:46 +0100)]
resolve-tool: propagate sensible errors from due to dns_name_is_valid() check failures
Lennart Poettering [Tue, 27 Feb 2018 16:45:04 +0000 (17:45 +0100)]
resolve-tool: trivial coding style improvements
Lennart Poettering [Tue, 27 Feb 2018 18:16:47 +0000 (19:16 +0100)]
coccinelle: similar to reallocarray() let's also systematically use malloc_multiply()
Lennart Poettering [Tue, 27 Feb 2018 18:09:22 +0000 (19:09 +0100)]
coccinelle: add reallocarray() coccinelle script
Let's systematically make use of reallocarray() whereever we invoke
realloc() with a product of two values.
Lennart Poettering [Tue, 27 Feb 2018 16:45:30 +0000 (17:45 +0100)]
resolve-tool: use reallocarray() where appropriate
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:12:04 +0000 (12:12 +0100)]
hwdb: update
usb.ids are not updated, because linux-usb.org is down.
It seems that the updates are corrections and new entries, to major
removal of existing entries.
futpib [Fri, 2 Mar 2018 11:11:28 +0000 (14:11 +0300)]
hwdb: add accelerometer mount matrix for Asus TP300LD (#8327)
Lennart Poettering [Fri, 2 Mar 2018 11:11:06 +0000 (12:11 +0100)]
Merge pull request #8237 from sourcejedi/timer_suspend
core: let OnCalendar= timer units expire during suspend (#8231)
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:09:52 +0000 (12:09 +0100)]
hwdb: ignore whitespace in downloaded files
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:06:32 +0000 (12:06 +0100)]
tools/hwdb-update: allow downloads to fail
sf.net is down, and linux-usb.org which is hosted there also fails.
That's not nice, but there's not we can do about it now.
Lennart Poettering [Fri, 2 Mar 2018 10:56:15 +0000 (11:56 +0100)]
logind: fix typo in comment
Lennart Poettering [Fri, 2 Mar 2018 10:55:51 +0000 (11:55 +0100)]
logind: open device if needed
Fixes: #8291
Lennart Poettering [Fri, 2 Mar 2018 10:55:33 +0000 (11:55 +0100)]
logind: cast away return value we don't care about
Lennart Poettering [Fri, 2 Mar 2018 10:55:16 +0000 (11:55 +0100)]
logind: voidify a function we never check the return value of
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 10:50:43 +0000 (11:50 +0100)]
tools/hwdb-update: print what is being executed
Lennart Poettering [Wed, 28 Feb 2018 22:24:50 +0000 (23:24 +0100)]
fd-util: drop stdio_unset_cloexec(), it's not used anymore
Lennart Poettering [Wed, 28 Feb 2018 22:36:33 +0000 (23:36 +0100)]
sd-bus: let's better not invade stdio territory when duplicating fds
Lennart Poettering [Wed, 28 Feb 2018 22:32:49 +0000 (23:32 +0100)]
tree-wide: port various places over to use new rearrange_stdio()
Lennart Poettering [Wed, 28 Feb 2018 20:21:33 +0000 (21:21 +0100)]
terminal-util: port some generic code over to rearrange_stdio()
Lennart Poettering [Wed, 28 Feb 2018 09:00:26 +0000 (10:00 +0100)]
fd-util: add new call rearrange_stdio()
Quite often we need to set up a number of fds as stdin/stdout/stderr of
a process we are about to start. Add a generic implementation for a
routine doing that that takes care to do so properly:
1. Can handle the case where stdin/stdout/stderr where previously
closed, and the fds to set as stdin/stdout/stderr hence likely in the
0..2 range. handling this properly is nasty, since we need to first
move the fds out of this range in order to later move them back in, to
make things fully robust.
2. Can optionally open /dev/null in case for one or more of the fds, in
a smart way, sharing the open file if possible between multiple of
the fds.
3. Guarantees that O_CLOEXEC is not set on the three fds, even if the fds
already were in the 0..2 range and hence possibly weren't moved.
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 10:32:25 +0000 (11:32 +0100)]
Merge pull request #8316 from yuwata/fix-8315
sysusers: do not create duplicated groups when create users
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 10:24:31 +0000 (11:24 +0100)]
Merge pull request #8330 from filbranden/masked1
Detect masked unit with drop-ins
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 08:09:29 +0000 (09:09 +0100)]
meson: use dashes in colour names
Alexander F Rødseth [Thu, 1 Mar 2018 12:12:02 +0000 (13:12 +0100)]
Add build-time option to change the color of the "OK" status text
Alexander F Rødseth [Thu, 1 Mar 2018 17:23:05 +0000 (18:23 +0100)]
Organize the ANSI codes and add missing colors
For consistency.
Yu Watanabe [Fri, 2 Mar 2018 06:55:02 +0000 (15:55 +0900)]
test-execute: add tests with user/group daemon
The nobody user/group may not synthesized by systemd.
To run tests the functionalities in such situation, this adds tests
by user/group by daemon, as it is expected to exists all environments.
Filipe Brandenburger [Fri, 2 Mar 2018 05:07:27 +0000 (21:07 -0800)]
test: masked unit with drop-ins
Filipe Brandenburger [Fri, 2 Mar 2018 01:48:15 +0000 (17:48 -0800)]
install: detect masked unit with drop-ins
Before this fix, a unit with drop-ins will not be reported as masked by
`systemctl is-enabled` or `systemctl list-unit-files`.
Yu Watanabe [Thu, 1 Mar 2018 22:38:28 +0000 (07:38 +0900)]
sysusers: do not implicitly create group by 'm' if 'u' with the same name exists
The commit
e2c2060f7b3b11fa3cca8899d80963b7a05cc4ab makes 'm' lines
disturb 'u' lines.
This fixes the disturbance.
Yu Watanabe [Thu, 1 Mar 2018 05:52:28 +0000 (14:52 +0900)]
test: add a test for sysusers
The test cases for sysusers did not cover the situation reported in
issue #8315. Let's add one more test case.
Yu Watanabe [Thu, 1 Mar 2018 18:27:34 +0000 (03:27 +0900)]
sysusers: do not create duplicated groups when create users
The commit
e2c2060f7b3b11fa3cca8899d80963b7a05cc4ab introduces
the issue #8315.
Fixes #8315.
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2018 20:48:36 +0000 (21:48 +0100)]
Remove /sbin from paths if split-bin is false (#8324)
Follow-up for
157baa87e4.
Lennart Poettering [Wed, 28 Feb 2018 19:21:57 +0000 (20:21 +0100)]
update TODO
Lennart Poettering [Thu, 1 Mar 2018 14:06:02 +0000 (15:06 +0100)]
Merge pull request #8319 from keszybz/yet-another-symlink-installation-tweak
meson: fix symlink creation when sbin is symlink to bin
Lennart Poettering [Thu, 1 Mar 2018 14:03:19 +0000 (15:03 +0100)]
Merge pull request #8293 from dobyrch/master
tree-wide: fix inconsistencies in option parsing
Lennart Poettering [Thu, 1 Mar 2018 13:58:12 +0000 (14:58 +0100)]
Merge pull request #8322 from keszybz/doc-tweak
man: document that link-ed files must be on /
Douglas Christman [Wed, 28 Feb 2018 01:35:58 +0000 (20:35 -0500)]
udevadm: prevent segfault in blkid builtin when offset not specified
"--offset" takes an optional argument; if none is specified,
stroull() will attempt to parse a NULL pointer. For example:
$ udevadm test-builtin 'blkid --offset' /sys/dev/block/8:1
Update "--offset" to require an argument; also verify that the
offset is not negative.
Douglas Christman [Thu, 1 Mar 2018 00:31:32 +0000 (08:31 +0800)]
analyze: fix typo in error message
Douglas Christman [Wed, 28 Feb 2018 01:28:50 +0000 (20:28 -0500)]
test-libudev: make "-m" equivalent to "--monitor"
"-m" is specified as a short form of "--monitor" in the option struct,
but not included in getopt_long's optstring. Update the optstring
to be consistent with the option struct.
Douglas Christman [Wed, 28 Feb 2018 01:19:55 +0000 (20:19 -0500)]
systemctl: remove redundant option parsing code
"-f" used to be overloaded to mean both "--force" and "--follow";
aae9a96d removed "--follow", leaving behind some duplicate code.
Douglas Christman [Wed, 28 Feb 2018 01:16:26 +0000 (20:16 -0500)]
journalctl: make journalctl -g work as documented
Add "g" to optstring so both "--grep" and "-g" work with journalctl
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2018 12:11:00 +0000 (13:11 +0100)]
man: document that link-ed files must be on /
Fixes #8307.
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2018 09:28:29 +0000 (10:28 +0100)]
meson: support both separate and merged sbin-bin directories
Follow-up for
ba7f4ae6178309dc937e10cf7dce0eca9dafb8de.
By default, we detect if the real root has a separate /usr/sbin directory, but
this can be overrides with -Dsplit-bin=true|false. The check assumes that
/usr/sbin is split if it is not a symlink, so it'll return a false negative
with some more complicated setups. But that's OK, in those cases this should be
configured explicitly.
This will copy the structure of the directories in the root file system to
$DESTDIR. If a directory is a directory in $DESTDIR but a symlink in the root
file system, this script will fail. This means that it's not possible to reuse
a $DESTDIR from between
ba7f4ae61 and this patch.
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2018 10:49:42 +0000 (11:49 +0100)]
meson: autodetect split-usr
Also move the status from "features" to the paths section. This is more of an
anti-feature.
Lennart Poettering [Thu, 1 Mar 2018 10:27:06 +0000 (11:27 +0100)]
procfs-util: drop unnecessary zero initializations (#8321)
Follow-up for #8149.
Lennart Poettering [Thu, 1 Mar 2018 10:10:24 +0000 (11:10 +0100)]
Merge pull request #8149 from poettering/fake-root-cgroup
Properly synthesize CPU+memory accounting data for the root cgroup
Franck Bui [Thu, 1 Mar 2018 09:58:03 +0000 (10:58 +0100)]
units: delegate "memory" instead of "cpu" by default for user instances (#8320)
CPU accounting has a too bad impact on performance to be enabled by
default. Therefore we should not delegate "cpu" for now.
OTOH since commit
e0c46a736412b79b94a21f8512a769b9212b9adf, memory accounting
has been turned on for all units by default so it makes sense to delegate this
controller by default.