Lennart Poettering [Sun, 18 Jun 2017 09:16:53 +0000 (11:16 +0200)]
Merge pull request #6064 from keszybz/lock-session
Improvements to loginctl operating on current session
Lennart Poettering [Sun, 18 Jun 2017 09:15:13 +0000 (11:15 +0200)]
Merge pull request #6140 from keszybz/rm-rf-symlink
Allow symlinks to root to be removed
Djalal Harouni [Sun, 18 Jun 2017 07:36:50 +0000 (09:36 +0200)]
Merge pull request #6142 from keszybz/man-runtimedirectorymode
man: describe RuntimeDirectoryMode=
Yu Watanabe [Sat, 17 Jun 2017 20:22:32 +0000 (05:22 +0900)]
resolved: ignore DNSSEC= option when resolved is built without gcrypt (#6084)
Fixes #5583.
Zbigniew Jędrzejewski-Szmek [Sat, 17 Jun 2017 19:23:02 +0000 (15:23 -0400)]
man: describe RuntimeDirectoryMode=
Fixes #5509.
Zbigniew Jędrzejewski-Szmek [Sat, 17 Jun 2017 16:41:08 +0000 (12:41 -0400)]
basic/rm-rf: allow a symlink to / to be removed
We open the target path with O_DIRECTORY|O_NOFOLLOW, and if that doesn't work,
we call unlink() on the path. In neither case we will follow the symlink, so
we can relax our check to also not follow symlinks.
Fixes #5864.
Zbigniew Jędrzejewski-Szmek [Sat, 17 Jun 2017 16:37:16 +0000 (12:37 -0400)]
basic/path-util: allow flags for path_equal_or_files_same
No functional change, just a new parameters and the tests that
AT_SYMLINK_NOFOLLOW works as expected.
Nate Clark [Fri, 16 Jun 2017 20:44:57 +0000 (16:44 -0400)]
udev-builtin-blkid: Use _cleanup_blkid_free_probe_ to free probe (#6108)
Use the _cleanup_blkid_free_probe_ to guarantee that the
blkid_probe will be freed when builtin_blkid exits.
Lennart Poettering [Fri, 16 Jun 2017 20:43:36 +0000 (22:43 +0200)]
Merge pull request #6134 from pfl/radv_fixes
Router Advertisement fixes
Lennart Poettering [Fri, 16 Jun 2017 20:06:48 +0000 (22:06 +0200)]
Merge pull request #6133 from wbx-github/idn_config
make IDN support conditional
Zbigniew Jędrzejewski-Szmek [Fri, 16 Jun 2017 13:16:28 +0000 (09:16 -0400)]
meson: add -Didn=yes|no option
Waldemar Brodkorb [Thu, 15 Jun 2017 15:44:59 +0000 (17:44 +0200)]
Make IDN support conditional
[zj: rename HAVE_IDN to ENABLE_IDN]
Patrik Flykt [Fri, 16 Jun 2017 06:09:35 +0000 (09:09 +0300)]
networkd-address: Use DIV_ROUND_UP for consistency
Use DIV_ROUND_UP for consistency instead of the previous construct.
Patrik Flykt [Fri, 16 Jun 2017 06:35:12 +0000 (09:35 +0300)]
networkd-radv: Fix router lifetime assignment
Router lifetime is stored as usec_t, use value accordingly.
Patrik Flykt [Fri, 16 Jun 2017 06:07:13 +0000 (09:07 +0300)]
networkd: Fix comment
Comment about not being a router is in the wrong place. Router lifetime
is assigned with config_parse_sec().
Davide Cavalca [Thu, 15 Jun 2017 08:55:13 +0000 (09:55 +0100)]
meson: only run c++ tests when c++ compiler is available (#6123)
Pat Riehecky [Fri, 9 Jun 2017 22:48:25 +0000 (17:48 -0500)]
man: systemd-timesyncd.service(8) (#6109)
Updates the documentation to note use of SNTP (resolves #5735)
NeilBrown [Wed, 7 Jun 2017 12:28:23 +0000 (22:28 +1000)]
core/mount: pass "-c" flag to /bin/umount (#6093)
"-c", which is short for "--no-canonicalize", tells /bin/umount
that the path name is canonical (no .. or symlinks etc).
systemd always uses a canonical name, so this flag is appropriate
for systemd to use.
Knowing that the path is canonical allows umount to avoid
some calls to lstat() on the path.
From v2.30 "-c" goes further and causes umount to avoid all
attempts to 'lstat()' (or similar) the path. This is important
when automatically unmounting a filesystem, as lstat() can
hang indefinitely in some cases such as when an NFS server
is not accessible.
"-c" has been supported since util-linux 2.17 which is before the
earliest version supported by systemd.
So "-c" is safe to use now, and once util-linux v2.30 is in use,
it will allow mounts from non-responsive NFS servers to be
unmounted.
Evgeny Vereshchagin [Wed, 7 Jun 2017 01:47:47 +0000 (04:47 +0300)]
udev: stop freeing value after using it for setting sysattr (#6094)
This prevents udev from double-freeing and crashing.
See https://github.com/systemd/systemd/issues/6040#issuecomment-
306589836
==351== Invalid free() / delete / delete[] / realloc()
==351== at 0x4C2C14B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==351== by 0x13CBE8: hashmap_clear_free_free (hashmap.c:900)
==351== by 0x13CBE8: hashmap_free_free_free (hashmap.c:852)
==351== by 0x147F4F: sd_device_unref (sd-device.c:88)
==351== by 0x130CCC: udev_device_unref (libudev-device.c:552)
==351== by 0x130CD5: udev_device_unref (libudev-device.c:553)
==351== by 0x11FBBB: worker_spawn (udevd.c:488)
==351== by 0x1216E5: event_run (udevd.c:584)
==351== by 0x1216E5: event_queue_start (udevd.c:823)
==351== by 0x122213: on_uevent (udevd.c:927)
==351== by 0x141F2F: source_dispatch (sd-event.c:2272)
==351== by 0x142D52: sd_event_dispatch (sd-event.c:2631)
==351== by 0x142D52: sd_event_run (sd-event.c:2690)
==351== by 0x142D52: sd_event_loop (sd-event.c:2710)
==351== by 0x1159CB: run (udevd.c:1643)
==351== by 0x1159CB: main (udevd.c:1772)
==351== Address 0x81745b0 is 0 bytes inside a block of size 1 free'd
==351== at 0x4C2C14B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==351== by 0x1447F0: freep (alloc-util.h:57)
==351== by 0x1447F0: sd_device_set_sysattr_value (sd-device.c:1859)
==351== by 0x132081: udev_device_set_sysattr_value (libudev-device.c:849)
==351== by 0x12E777: set_trackpoint_sensitivity (udev-builtin-keyboard.c:180)
==351== by 0x12E777: builtin_keyboard.lto_priv.170 (udev-builtin-keyboard.c:263)
==351== by 0x14D03F: udev_builtin_run.constprop.75 (udev-builtin.c:133)
==351== by 0x11FAEB: udev_event_execute_run (udev-event.c:957)
==351== by 0x11FAEB: worker_spawn (udevd.c:461)
==351== by 0x1216E5: event_run (udevd.c:584)
==351== by 0x1216E5: event_queue_start (udevd.c:823)
==351== by 0x122213: on_uevent (udevd.c:927)
==351== by 0x141F2F: source_dispatch (sd-event.c:2272)
==351== by 0x142D52: sd_event_dispatch (sd-event.c:2631)
==351== by 0x142D52: sd_event_run (sd-event.c:2690)
==351== by 0x142D52: sd_event_loop (sd-event.c:2710)
==351== by 0x1159CB: run (udevd.c:1643)
==351== by 0x1159CB: main (udevd.c:1772)
==351== Block was alloc'd at
==351== at 0x4C2CF35: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==351== by 0x144853: sd_device_set_sysattr_value (sd-device.c:1888)
==351== by 0x132081: udev_device_set_sysattr_value (libudev-device.c:849)
==351== by 0x12E777: set_trackpoint_sensitivity (udev-builtin-keyboard.c:180)
==351== by 0x12E777: builtin_keyboard.lto_priv.170 (udev-builtin-keyboard.c:263)
==351== by 0x14D03F: udev_builtin_run.constprop.75 (udev-builtin.c:133)
==351== by 0x11FAEB: udev_event_execute_run (udev-event.c:957)
==351== by 0x11FAEB: worker_spawn (udevd.c:461)
==351== by 0x1216E5: event_run (udevd.c:584)
==351== by 0x1216E5: event_queue_start (udevd.c:823)
==351== by 0x122213: on_uevent (udevd.c:927)
==351== by 0x141F2F: source_dispatch (sd-event.c:2272)
==351== by 0x142D52: sd_event_dispatch (sd-event.c:2631)
==351== by 0x142D52: sd_event_run (sd-event.c:2690)
==351== by 0x142D52: sd_event_loop (sd-event.c:2710)
==351== by 0x1159CB: run (udevd.c:1643)
==351== by 0x1159CB: main (udevd.c:1772)
Felipe Sateler [Wed, 7 Jun 2017 01:32:15 +0000 (21:32 -0400)]
zsh: add completion for add-wants and add-requires (#6082)
Susant Sahani [Tue, 6 Jun 2017 16:02:31 +0000 (16:02 +0000)]
networkd: fix route table from unsigned char to uint32_t (#6083)
[zj: struct Route is defined with uint32_t route, so this makes the type of the function
parameter match the field it is assigned to.]
AsciiWolf [Tue, 6 Jun 2017 15:52:25 +0000 (17:52 +0200)]
l10n: update Czech Translation (#6090)
add missing Report-Msgid-Bugs-To
Paul Kocialkowski [Tue, 6 Jun 2017 15:27:30 +0000 (18:27 +0300)]
sd-device: Try /sys/firmware for sysname to allow device-tree (#5837)
This adds /sys/firmware lookup for sysname when creating a new device,
which allows device-tree properties lookup. This look-up can then be
used in udev rules, allowing device-tree-based model detection.
Josef Gajdusek [Tue, 6 Jun 2017 15:18:22 +0000 (17:18 +0200)]
systemd-nspawn@.service: start after /var/lib/machines is mounted (#6079)
This fixes a race condition during boot, where an nspawn container would start
before /var/lib/machines got mounted resulting in a failure.
AsciiWolf [Tue, 6 Jun 2017 14:52:52 +0000 (16:52 +0200)]
mkosi: update Debian config for mkosi (#6089)
Drop g++ package — it's only used for a test and we want to keep the mkosi installation footprint small-ish.
Zbigniew Jędrzejewski-Szmek [Sat, 3 Jun 2017 09:41:17 +0000 (05:41 -0400)]
sd-bus: silence format warnings in kdbus code (#6072)
The code is mostly correct, but gcc is trying to outsmart us, and emits a
warning for a "llu vs lu" mismatch, even though they are the same size (on alpha):
src/libsystemd/sd-bus/bus-control.c: In function ‘kernel_get_list’:
src/libsystemd/sd-bus/bus-control.c:267:42: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
if (asprintf(&n, ":1.%llu", name->id) < 0) {
^
src/libsystemd/sd-bus/bus-control.c: In function ‘bus_get_name_creds_kdbus’:
src/libsystemd/sd-bus/bus-control.c:714:47: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
if (asprintf(&c->unique_name, ":1.%llu", conn_info->id) < 0) {
^
This is hard to work around properly, because kdbus.h uses __u64 which is
defined-differently-despite-being-the-same-size then uint64_t. Thus the simple
solution of using %PRIu64 fails on amd64:
src/libsystemd/sd-bus/bus-control.c:714:47: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64 {aka long long unsigned int}’ [-Werror=format=]
if (asprintf(&c->unique_name, ":1.%"PRIu64, conn_info->id) < 0) {
^~~~~~
Let's just avoid the whole issue for now by silencing the warning.
After the next release, we should just get rid of the kdbus code.
Fixes #5561.
Evgeny Vereshchagin [Thu, 1 Jun 2017 17:58:37 +0000 (20:58 +0300)]
tests: skip test_exec_inaccessiblepaths_proc when inaccessible dir is unavailable (#6068)
test_exec_inaccessiblepaths_proc depends on
/run/systemd/inaccessible/dir, which may be unavailable.
See https://github.com/systemd/systemd/issues/5987#issuecomment-
305448958.
Lluís Gili [Thu, 1 Jun 2017 10:16:32 +0000 (12:16 +0200)]
hwdb: add multimedia keys for Medion Akoya S3409 (#6062)
Martin Pitt [Thu, 1 Jun 2017 07:37:13 +0000 (09:37 +0200)]
Merge pull request #6058 from keszybz/chrooted-test-fixes
Chrooted test fixes
Zbigniew Jędrzejewski-Szmek [Thu, 1 Jun 2017 02:42:14 +0000 (22:42 -0400)]
loginctl: also use $XDG_SESSION_ID for session-status
Zbigniew Jędrzejewski-Szmek [Thu, 1 Jun 2017 02:23:30 +0000 (22:23 -0400)]
loginctl: use $XDG_SESSION_ID for "our" session
Instead of always letting logind guess what the caller's session is, let's
give it the value from $XDG_SESSION_ID when it is present in the caller's
environment.
Nowadays terminal emulators are often running as services under systemd --user,
and not as part of an actual session, so all loginctl calls which depend on
logind guessing the session will fail. I don't see a reason not to honour
$XDG_SESSION_ID.
This applies to LockSession, UnlockSession, TerminateSession, ActivateSession,
SetUserLinger.
Fixes #6032.
Zbigniew Jędrzejewski-Szmek [Thu, 1 Jun 2017 02:10:15 +0000 (22:10 -0400)]
logind: nicer error message when we cannot guess the caller's session
Partial fix for #6032.
Michael Biebl [Thu, 1 Jun 2017 01:21:11 +0000 (03:21 +0200)]
hwdb: use path_join() to generate the hwdb_bin path (#6063)
This avoids having double slashes which can confuse selinux.
Yu Watanabe [Wed, 31 May 2017 15:27:47 +0000 (00:27 +0900)]
man: update sd_get_seats(3)
Yu Watanabe [Wed, 31 May 2017 15:12:32 +0000 (00:12 +0900)]
sd-login: sd_get_machine_names(): do not return -EINVAL when output parameter is NULL
Other functions in sd-login generally allow the output parameter to be NULL, in
which case only the number of items that would be stored in the array is returned.
Be nice and do the same here.
Yu Watanabe [Wed, 31 May 2017 14:48:47 +0000 (23:48 +0900)]
sd-login: treat missing /run/systemd/{seats,sessions,users} the same as empty
C.f.
0543105b0fb13e4243b71a78f62f81fb9dde5d51.
This makes if /run/systemd/{seats,sessions,users} are missing, then
sd_get_seats(), sd_get_sessions() and sd_get_uids() return 0, that is,
an empty list, instead of -ENOENT.
Martin Pitt [Wed, 31 May 2017 21:24:57 +0000 (23:24 +0200)]
Merge pull request #6053 from keszybz/doc-tweaks
Man page and unit file and mailmap and meson tweaks
Djalal Harouni [Wed, 31 May 2017 14:57:55 +0000 (16:57 +0200)]
Merge pull request #6060 from keszybz/reboot-f-warning
systemctl: avoid spurious warning about missing reboot-param file
Franck Bui [Wed, 31 May 2017 13:44:08 +0000 (15:44 +0200)]
build: *really* install tmpfiles.d/systemd-remote.conf when necessary (#6061)
This fixes commit
5e354b22520bbb02e which was an attempt to avoid installation
of tmpfiles.d/systemd-remote.conf when it was not needed (ie HAVE_REMOTE=false).
Before this fix and with the autotool build, systemd-remote.conf was
distributed and also installed (although it was empty) even though
HAVE_REMOTE=false.
That's what happens when doing last second changes without retesting...
While at it, update tmpfiles.d/.gitignore (var.conf was missing as well
since commit
a083537e5d11b).
Zbigniew Jędrzejewski-Szmek [Wed, 31 May 2017 03:14:31 +0000 (23:14 -0400)]
systemctl: avoid spurious warning about missing reboot-param file
$ reboot -f
Failed to read reboot parameter file: No such file or directory
It seems that the warning on ENOENT was inadvertently introduced in
27c06cb516c3b87c34f2a1c2c227152997d05c8c.
The warning reported in #5646 comes from systemctl, but let's fix the other
call site in the same way too.
Fixes #5646.
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2017 23:56:12 +0000 (19:56 -0400)]
meson: output TAGS file in source not build directory
The TAGS file was generated in build/ following what autotools did.
Nevertheless, it's more convenient to put in the source dir.
(It doesn't get deleted by mistake, and it's easier to find for the
editor.)
Zbigniew Jędrzejewski-Szmek [Tue, 23 May 2017 23:46:10 +0000 (19:46 -0400)]
mailmap: add entries for recent commits from github
Zbigniew Jędrzejewski-Szmek [Wed, 31 May 2017 00:36:18 +0000 (20:36 -0400)]
test-bus-vtable: it's OK if dbus is not running
Fixes #5989.
Zbigniew Jędrzejewski-Szmek [Wed, 31 May 2017 00:21:45 +0000 (20:21 -0400)]
sd-login: translate -ENOMEDIUM to -ENODATA
The -ENOMEDIUM return value was introduced in v232-1001-g2977724b09,
('core: make hybrid cgroup unified mode keep compat /sys/fs/cgroup/systemd hierarchy'),
and would be returned by cg_pid_get_path_shifted(), but the documented and
expected return value is -ENODATA. Let's just catch ENXIO/ENOMEDIUM and translate
it to ENODATA in all cases.
Complements
171f8f591ff27ebb5ff475b7a9d1f13a846c9331, fixes #6012.
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2017 21:03:25 +0000 (17:03 -0400)]
sulogin-shell: avoid heredocs
They require a writable /tmp dir (in the bash implementation).
Let's use echo, and not 'echo -e' since that doesn't seem to be completely
portable.
Fixes #6052.
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2017 20:43:48 +0000 (16:43 -0400)]
man: update MemoryDenyWriteExecute description for executable stacks
Without going into details, mention that libraries are also covered by the
filters, and that executable stacks are a no no.
Closes #5970.
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2017 20:31:51 +0000 (16:31 -0400)]
man: don't say that ExecStart syntax is "very shell"
Fixes #6035.
Franck Bui [Tue, 30 May 2017 15:03:25 +0000 (17:03 +0200)]
build: only install tmpfiles.d/systemd-remote.conf when necessary (#6051)
Also only include the relevant parts for systemd-journal-remote and
systemd-journal-upload when needed.
Yu Watanabe [Tue, 30 May 2017 13:45:10 +0000 (22:45 +0900)]
kernel-install: support the case /etc/machine-id is missing or empty (#5975)
Some .install plugins does not require that machine ID is set such as
20-grubby.install for Fedora and 50-depmod.install.
To support such plugins to run without valid machine-id, this commit
makes the following change:
* if /etc/machine-id is missing or empty, create temporary directory
and set its path to BOOT_DIR_ABS,
* run the .install helpers with KERNEL_INSTALL_MACHINE_ID environment
variable that'd be empty if /etc/machine-id is missing or empty.
This may be useful for installing kernel for e.g. stateless systems
which initialize machine-id while booting the systems.
kjackiewicz [Tue, 30 May 2017 13:19:03 +0000 (15:19 +0200)]
rules: watch metadata changes in mmcblk devices (#6050)
Formatting sd-cards does not trigger "change" uevents. As a result clients
using udev API don't get any updates afterwards and get outdated information
about the device.
Include mmcblk* in a match for watch option assignment.
Lennart Poettering [Tue, 30 May 2017 12:49:35 +0000 (14:49 +0200)]
timesyncd: properly handle OOM errors when parsing fallback servers (#6047)
Lennart Poettering [Tue, 30 May 2017 12:49:07 +0000 (14:49 +0200)]
Merge pull request #4512 from pfl/ndisc_exponential_backoff
Ndisc exponential backoff
Patrik Flykt [Fri, 19 May 2017 13:22:47 +0000 (16:22 +0300)]
test-ndisc-rs.c: Test Router Solicitation timer computation
Test ICMPv6 Router Solicitation exponential backoff timer by
computing the minimum and maximum values according to RFC 7559,
Section 2 and the algorithm itself described in RFC 3315, Section
14. Reset the sd_ndisc timer to trigger after a zero second delay,
which causes the ndisc timeout to be triggered immediately once
the caller of the "sending" function returns to the main loop.
Patrik Flykt [Fri, 19 May 2017 13:22:46 +0000 (16:22 +0300)]
sd-ndisc.c: Move Router Solicitation sending after timer computaion
Move ICMPv6 Router Solicitation sending after timer computation so
that timers are already set up when the packet is being sent. This
makes it possible to create a test that inspects Router
Solicitation timer values when the Router Solicitation is sent out
on the network.
Patrik Flykt [Fri, 19 May 2017 13:22:45 +0000 (16:22 +0300)]
sd-ndisc: Implement Router Solicitation backoff method
Instead of sending a fixed amount of Router Solicitiations, implement
the backoff algorithm proposed in RFC 7559. The backoff algorithm is
the same as used by DHCPv6.
Time out after 12s as specified in RFC 4861 in order not to delay
setting up a link for too long while sending Router Solicitations
in the background. Notice that after this change the callback will
receive a SD_NDISC_EVENT_TIMEOUT timeout event, and at a later point
when a router appears, a received Router Advertisment will cause the
callback to be called again with the SD_NDISC_EVENT_ROUTER event.
Tobias Jungel [Mon, 29 May 2017 15:20:01 +0000 (17:20 +0200)]
network: bridge vlan without PVID (#5899)
this patch makes it possible to configure a vlan aware bridge without the
PVID. To configure no PVID set DefaultPVID=none in the [BridgeVLAN] section.
fixes #5716
Lennart Poettering [Mon, 29 May 2017 13:18:38 +0000 (15:18 +0200)]
Merge pull request #5926 from fsateler/condition-uid
core: add ConditionUID and ConditionGID
Lennart Poettering [Mon, 29 May 2017 13:08:20 +0000 (15:08 +0200)]
Merge pull request #6031 from teg/monitor
busctl: fix up the monitor
Lucas Werkmeister [Mon, 29 May 2017 13:01:01 +0000 (15:01 +0200)]
shell-completion: add systemctl revert (#6042)
The `systemctl revert` command was added in v230 (commit
344ca7556b),
but was missing from the shell completion specifications.
Fixes #5978.
Lennart Poettering [Fri, 26 May 2017 16:09:57 +0000 (18:09 +0200)]
Merge pull request #6029 from keszybz/vconsole-no-vga
Avoid systemd-vconsole-setup failure on machines w/o VGA
Felipe Sateler [Fri, 19 May 2017 02:12:14 +0000 (22:12 -0400)]
core: add @system special value to ConditionUser=
It allows checking if the user is a system user or a normal user
Felipe Sateler [Sat, 8 Apr 2017 23:32:13 +0000 (20:32 -0300)]
core: add ConditionUser and ConditionGroup
This adds two options that are useful for user units. In particular, it
is useful to check ConditionUser=!0 to not start for the root user.
Closes: #5187
George McCollister [Fri, 26 May 2017 02:13:50 +0000 (21:13 -0500)]
rules: Handle MMC boot partitions by-path correctly (#6026)
Many eMMC devices have separate boot partitions that aren't part of the
normal partition table that show up as /dev/mmcblk[0-9]boot[0-9]. These
partitions are generally small (128KB to 16MB) and typically hold a boot
loader, boot loader data or a recovery image. Match these and create
-boot%n by-path symlinks.
Prior to this change by-path symlinks for the main device would be
incorrectly linked to one of the boot partitions.
For instance before:
/dev/disk/by-path/platform-219c000.usdhc linked to /dev/mmcblk1boot1
Now:
/dev/disk/by-path/platform-219c000.usdhc links to /dev/mmcblk1
/dev/disk/by-path/platform-219c000.usdhc-boot0 links to /dev/mmcblk1boot0
/dev/disk/by-path/platform-219c000.usdhc-boot1 links to /dev/mmcblk1boot1
On systems that support multiple SD/MMC devices it can be essential to
have by-path links to these devices since device names vary depending on
which other devices are connected.
Zbigniew Jędrzejewski-Szmek [Thu, 25 May 2017 22:51:08 +0000 (18:51 -0400)]
Merge pull request #5999 from mbiebl/timesyncd-fallback-server
timesyncd: don't use compiled-in list if FallbackNTP has been configured
Tom Gundersen [Thu, 25 May 2017 14:10:37 +0000 (16:10 +0200)]
busctl: monitor - ignore the final NameLost message
Commit
f5938e8ff3cf5b6fadd6b440b3b10fc0e5a64733 started dropping all
messages before we become a monitor, but the last one was getting
through.
This drops also the last NameLost message, which indicatse the switch
from a regular peer to a monitor.
Tom Gundersen [Thu, 25 May 2017 14:11:04 +0000 (16:11 +0200)]
logn: tests - don't compare signed with unsigned
Zbigniew Jędrzejewski-Szmek [Thu, 25 May 2017 14:26:29 +0000 (10:26 -0400)]
test-timesync: add first test for timesyncd conf parsing
We parse the string supplied in NTP_SERVERS during configuration under an
assert_se(). Right now we will accept pretty much anything there, but in case
we are more picky in the future, add a simple test which checks that we can
actually parse whatever is in NTP_SERVERS so that we don't fail the assertion
at runtime.
Timothée Ravier [Thu, 25 May 2017 04:47:08 +0000 (06:47 +0200)]
test: ensure 'InaccessiblePaths=/proc' option works (#6017)
Test case for PR #5985.
Zbigniew Jędrzejewski-Szmek [Thu, 25 May 2017 03:25:44 +0000 (23:25 -0400)]
vconsole-setup: skip setting fonts when setfont returns EX_OSERR
On a machine without a VGA console, /dev/tty{0,1,…} exist, so
systemd-vconsole-setup is started, but all setfont operations fail.
setfont has a bunch of return codes for different failure modes. It uses
EX_OSERR when the communication with the kernel using ioctls fails. This isn't
too specific, but at least it's only used this general class of errors. Let's
swallow the error in this case to avoid systemd-vconsole-setup.service failing
on cloud vms.
On a machine from https://bugzilla.redhat.com/show_bug.cgi?id=1272686#c4:
$ build/systemd-vconsole-setup
setfont: putfont: 512,8x16: failed: -1
putfont: PIO_FONT: Invalid argument
/usr/bin/setfont failed with error code 71.
Setting fonts failed with a "system error", ignoring.
$ SYSTEMD_LOG_LEVEL=debug build/systemd-vconsole-setup
Found container virtualization none.
Sysfs UTF-8 flag enabled
UTF-8 kbdmode enabled on /dev/tty0
Executing "/usr/bin/setfont -C /dev/tty0 eurlatgr"...
setfont: putfont: 512,8x16: failed: -1
putfont: PIO_FONT: Invalid argument
/usr/bin/setfont failed with error code 71.
Executing "/usr/bin/loadkeys -q -C /dev/tty0 -u us"...
/usr/bin/loadkeys succeeded.
Setting fonts failed with a "system error", ignoring.
$ lspci | grep -i vga
$ ls /dev/tty?
/dev/tty0 /dev/tty2 /dev/tty4 /dev/tty6 /dev/tty8
/dev/tty1 /dev/tty3 /dev/tty5 /dev/tty7 /dev/tty9
If we have a better test for /dev/tty? being connected to something that has a
font, we could avoid running setfont at all… ATM, I'm not aware of a simple
test like that.
Zbigniew Jędrzejewski-Szmek [Thu, 25 May 2017 03:25:10 +0000 (23:25 -0400)]
vconsole-setup: add more log messages
This makes it quite a bit easier to see what failed.
strv_join is called inline in log_debug so that it is under the conditional
that kills the whole thing if debugging is disabled.
Michael Biebl [Sun, 21 May 2017 01:22:43 +0000 (03:22 +0200)]
timesyncd: don't use compiled-in list if FallbackNTP has been configured explicitly
Parse the config files first and only apply the compiled-in list of
fallback servers if no NTP server was configured via FallbackNTP.
Closes: #5091
Daniel Wang [Wed, 24 May 2017 12:05:49 +0000 (05:05 -0700)]
DHCP: Fail link_dhcp_set_routes promotely if no address is assigned from lease (#6009)
Currently the local variable `address` is unintialized if the DHCP lease
doesn't provide a router address (when r == -ENODATA). Thus the
subsequent call to route_scope_from_address will result in accessing an
unintialized variable.
As a matter of fact, sd-dhcp-client ignores DHCP leases without an
address so link_dhcp_set_routes probably will never be called without a
valid address.
codekipper [Wed, 24 May 2017 09:10:59 +0000 (11:10 +0200)]
tmpfiles: Remove unnecessary utmp file creation (#6006)
If utmp is disabled (--disable-utmp) then there is no need to create
the wtmp and btmp files.
Evgeny Vereshchagin [Wed, 24 May 2017 05:56:48 +0000 (08:56 +0300)]
resolved: bugfix of null pointer p->question dereferencing (#6020)
See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1621396
John Paul Adrian Glaubitz [Tue, 23 May 2017 13:22:44 +0000 (15:22 +0200)]
mailmap: add entry for John Paul Adrian Glaubitz (#6015)
NeilBrown [Tue, 23 May 2017 07:42:26 +0000 (17:42 +1000)]
Allow TimeoutSec=0 to work as documented in mount units and elsewhere (#6013)
Since commit
36c16a7cdd6c ("core: rework unit timeout handling, and add
new setting RuntimeMaxSec=") TimeoutSec=0 in mount units has
cause the mount to timeout immediately instead of never as documented.
There is a similar problem with Socket.TimeoutSec and Swap.TimeoutSec.
These are easily fixed using config_parse_sec_fix_0().
Automount.TimeoutIdleSec looks like it could have the same problem,
but doesn't because the kernel treats '0' as 'no timeout'.
It handle USEC_INFINITY correctly only because that constant has
the value '-1', and when round up, it becomes zero.
To avoid possible confusion, use config_parse_sec_fix_0() as well, and
explicitly handle USEC_INFINITY.
tomty89 [Tue, 23 May 2017 07:41:36 +0000 (15:41 +0800)]
nspawn: add nosuid and nodev to /tmp mount (#6004)
When automatic /tmp mount was introduced to nspawn in v219, it was done without having the nosuid and nodev mount options, which was the same case as systemd's default tmp.mount unit back then.
nosuid and nodev was added to tmp.mount(.m4) in v231 for security reasons. matching the nspawn /tmp mount entry against that.
Ref.:
https://github.com/systemd/systemd/commit/
2f9df7c96a25adb42093ee3ee201577f3e01da42
https://github.com/systemd/systemd/commit/
bbb99c30d01a8bcdc27fb151cc6376a7877a6b07
sjoerd-ccu [Tue, 23 May 2017 07:10:59 +0000 (09:10 +0200)]
networkd-link: Receive LLDP on Bridge slaves not master (#5995)
LLDP should be received on bridge slaves as they're the entities
directly connected to a peer. Receiving LLDP on the bridge device makes
little sense, Linux by default even filters out LLDP going onto the
bridge device.
Flip the current logic, receive LLDP on bridge slaves don't listen for
them on the bridge itself.
Lennart Poettering [Mon, 22 May 2017 13:47:50 +0000 (15:47 +0200)]
Merge pull request #6005 from grawity/github
doc: update GitHub ISSUE_TEMPLATE
Lennart Poettering [Mon, 22 May 2017 13:18:00 +0000 (15:18 +0200)]
load-dropin: propagate errors properly from unit_name_compatible() (#6002)
Let's log about this in the caller.
Doesn't really matter, but let's do something about my OCD, and
propagate errors properly, so that the caller can log about them.
Mantas Mikulėnas [Mon, 22 May 2017 13:07:28 +0000 (16:07 +0300)]
github: comment out submitter note in ISSUE_TEMPLATE
It's for the person filling in the form, not for people reading it later.
Mantas Mikulėnas [Mon, 22 May 2017 13:06:50 +0000 (16:06 +0300)]
github: remove checkboxes from ISSUE_TEMPLATE
The issue list page thinks those are in fact todo items.
Lennart Poettering [Mon, 22 May 2017 12:38:01 +0000 (14:38 +0200)]
sd-dhcp: library code shouldn't log above LOG_DEBUG (#6001)
Let's downgrade the warning introduced by
955d99edc7991386a36e3d33924cc584931fde91 to debug, as we really
shouldn't log at more than debug level from library code.
(And while we are at it, print the MTU as the right (unsigned) type in
the format string.)
Lennart Poettering [Mon, 22 May 2017 08:12:18 +0000 (10:12 +0200)]
Merge pull request #5958 from keszybz/explicit-log-errno
Use explicit errno in log calls
AsciiWolf [Mon, 22 May 2017 02:24:30 +0000 (04:24 +0200)]
mkosi: update Debian config for mkosi (#5997)
* mkosi.debian: fix libidn2 package name
* mkosi.debian: drop duplicate diffutils package
* mkosi.debian: add missing g++ package
Matthias Greiner [Mon, 22 May 2017 01:11:25 +0000 (03:11 +0200)]
Allow bad MTU values with warning to be able to connect to the machine. (#5954)
Ensure the MTU value is valid. Emit a warning and ignore otherwise.
Djalal Harouni [Sun, 21 May 2017 05:14:21 +0000 (07:14 +0200)]
Merge pull request #5990 from keszybz/logind
A bunch of sd-login improvements
Djalal Harouni [Sun, 21 May 2017 05:11:33 +0000 (07:11 +0200)]
Merge pull request #6000 from keszybz/fix-oom-warning
core/load-droping: avoid oom warning when the unit symlink is not a template
Zbigniew Jędrzejewski-Szmek [Sat, 20 May 2017 23:34:50 +0000 (19:34 -0400)]
core/load-droping: avoid oom warning when the unit symlink is not a template
unit_name_template returns -EINVAL if the unit name is not a template, but
the code assumed that OOM is the only failure mode. Fix that to emit the warning
if a non-template unit is encountered (because in this case we expect the name
to match exactly), and just skip the warning on other errors (presumably oom).
Fixes #5543.
Evgeny Vereshchagin [Sat, 20 May 2017 22:41:48 +0000 (01:41 +0300)]
Merge pull request #5960 from keszybz/journald-memleak
Journald and journal-remote memleak fixes
Daniel Wang [Sat, 20 May 2017 11:05:18 +0000 (04:05 -0700)]
DHCP: when adding static routes set scopes properly (#5982)
DHCP responses could include static routes, but unfortunately not an
option to tell what scope to use. So it's important that the client sets
it properly.
This mimics what the `ip route add` command does when adding a static
route without an explicit scope:
* If the destination IP is on the local host, use scope `host`
* Otherwise if the gateway IP is null (direct route), use scope `link`
* If anything else, use the current default `global`.
Fixes #5979.
Zbigniew Jędrzejewski-Szmek [Fri, 19 May 2017 16:52:05 +0000 (12:52 -0400)]
journald: fix trivial memleak
Fixes #5516.
Zbigniew Jędrzejewski-Szmek [Sat, 13 May 2017 20:23:30 +0000 (16:23 -0400)]
udev-rules: add helper function for logging
Avoid repeating the same conditional four times. Error messages are
capitalized.
Zbigniew Jędrzejewski-Szmek [Fri, 19 May 2017 18:49:06 +0000 (14:49 -0400)]
basic/time-util: make parsing of dual_timestamp more strict
*scanf functions set errno on i/o error. For sscanf, this doesn't really apply,
so (based on the man page), it seems that errno is unlikely to be ever set to a
useful value. So just ignore errno. The error message includes the string that
was parsed, so it should be always pretty clear why parsing failed.
On the other hand, detect trailing characters and minus prefix that weren't
converted properly. This matches what our safe_ato* functions do. Add tests to
elucidate various edge cases.
Zbigniew Jędrzejewski-Szmek [Fri, 19 May 2017 18:37:48 +0000 (14:37 -0400)]
test-parse-util: verify that ato[ui] actually rejects trailing garbage
Zbigniew Jędrzejewski-Szmek [Sat, 13 May 2017 15:26:55 +0000 (11:26 -0400)]
tree-wide: when %m is used in log_*, always specify errno explicitly
All those uses were correct, but I think it's better to be explicit.
Using implicit errno is too error prone, and with this change we can require
(in the sense of a style guideline) that the code is always specified.
Helpful query: git grep -n -P 'log_[^s][a-z]+\(.*%m'
Lennart Poettering [Fri, 19 May 2017 17:17:57 +0000 (19:17 +0200)]
Merge pull request #5624 from glaubitz/x32
Fix multiple issues with incorrect usage of format specifiers
Zbigniew Jędrzejewski-Szmek [Fri, 19 May 2017 15:59:47 +0000 (11:59 -0400)]
journald: process "binary" fields the same as text fields
MESSAGE=data\n and MESSAGE\n40000000data\n are both valid serializations, so
they should be stored in the journal. Before, MESSAGE, SYSLOG_FACILITY,
SYSLOG_IDENTIFIER, PRIORITY, and OBJECT_PID would be only honoured if they were
given in the first form.
Fixed #5973.
Zbigniew Jędrzejewski-Szmek [Sun, 14 May 2017 02:34:40 +0000 (22:34 -0400)]
journald: properly process multiple entries in the same native packet
For all except the last entry in a single packet, we would dispatch the
message to the journal, but not forward it, nor perform proper cleanup.
Rewrite the code to process each entry in a helper function, and make
server_process_native_message() just call this function in a loop.
Fixes #5643.
v2:
- properly decrement *remaining when processing entry separator
Zbigniew Jędrzejewski-Szmek [Sat, 13 May 2017 20:40:09 +0000 (16:40 -0400)]
shared/logs-show: avoid printing "(null)" when timestamp is not specified
$ perl -e 'print("MESSAGE\n", pack("q<", 1), "A\n\nMESSAGE=test2\n")' > message.bin
$ systemd-journal-remote -o /tmp/out.journal message.bin
$ journalctl -o export --file /tmp/out.journal
__CURSOR=s=
b16c464c2db44384b29e75a564d8388e;i=1;b=
6b0be47627bd4932913dc126012c21c0;m=0;t=0;x=
b04263a253e357a
__REALTIME_TIMESTAMP=0
__MONOTONIC_TIMESTAMP=0
_BOOT_ID=
6b0be47627bd4932913dc126012c21c0
MESSAGE=A
$ journalctl -o verbose --file /tmp/out.journal
(null) [s=
b16c464c2db44384b29e75a564d8388e;i=1;b=
6b0be47627bd4932913dc126012c21c0;m=0;t=0;x=
b04263a253e357a]
MESSAGE=A
This is changed to
$ build/journalctl -o verbose --file /tmp/out.journal
(no timestamp) [s=
b16c464c2db44384b29e75a564d8388e;i=1;b=
6b0be47627bd4932913dc126012c21c0;m=0;t=0;x=
b04263a253e357a]
MESSAGE=A
We should deal gracefully with unexpected input.