]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 years agoudev-rules: Permission changes for /dev/dri/renderD*
Tom Stellard [Tue, 31 Oct 2017 15:46:24 +0000 (08:46 -0700)] 
udev-rules: Permission changes for /dev/dri/renderD*

- Remove the uaccess tag from /dev/dri/renderD*.
- Change the owning group from video to render.
- Change default mode to 0666.
- Add an option to allow users to set the access mode for these devices at
compile time.

6 years agoudev-rules: Permission changes for /dev/kvm
Tom Stellard [Tue, 31 Oct 2017 15:41:53 +0000 (08:41 -0700)] 
udev-rules: Permission changes for /dev/kvm

- Remove uaccess tag from /dev/kvm.
- Change the default mode for /dev/kvm to 0666.

6 years agoMerge pull request #7226 from sourcejedi/shutdown-misuse-commment
Alan Jenkins [Tue, 31 Oct 2017 10:05:02 +0000 (10:05 +0000)] 
Merge pull request #7226 from sourcejedi/shutdown-misuse-commment

core: remove "misuse" of getpgid() in systemd-shutdown

6 years agoMerge pull request #7218 from matijaskala/patch-4
Alan Jenkins [Mon, 30 Oct 2017 17:42:33 +0000 (17:42 +0000)] 
Merge pull request #7218 from matijaskala/patch-4

fix compile errors on musl

6 years agocore: remove "misuse" of getpgid() in systemd-shutdown 7226/head
Alan Jenkins [Mon, 30 Oct 2017 16:10:37 +0000 (16:10 +0000)] 
core: remove "misuse" of getpgid() in systemd-shutdown

Using `kill()`  with a signal of 0 is a slightly more documented idiom for
checking whether a process still exists.  It is mentioned explicitly in
man pages.  This avoids the need to comment the call as "misuse".
A comment is still necessary - in fact this idiom is even more confusing if
you don't know how it works.  But it's easy enough to explain.

6 years agoAdd sd_bus_message_new and sd_bus_message_seal as public functions (#6609)
aeywalee [Mon, 30 Oct 2017 15:08:46 +0000 (16:08 +0100)] 
Add sd_bus_message_new and sd_bus_message_seal as public functions (#6609)

6 years agoMerge pull request #6996 from poettering/discover-block-device
Zbigniew Jędrzejewski-Szmek [Mon, 30 Oct 2017 15:05:20 +0000 (16:05 +0100)] 
Merge pull request #6996 from poettering/discover-block-device

add nspawn image discovery on block devices

6 years agohwdb: Update GP-electronic T701 accel mount settings (#7220)
Hans de Goede [Mon, 30 Oct 2017 13:33:54 +0000 (14:33 +0100)] 
hwdb: Update GP-electronic T701 accel mount settings (#7220)

The GP-electronic T701 has its LCD panel mounted upside-down, initially
my plan was to fix this by transparently rotating the image in the i915
driver (my "drm/i915: Deal with upside-down mounted LCD" patch), but
that approach has been rejected instead the kernel will now export
a "panel orientation" property on the drm-connector for the panel and
let userspace deal with it.

Since the upside-down-ness of the panel is now no longer transparently
hidden from userspace, the current accel mount quirk for the T701 needs
to be updated to take the upside-down-ness into account.

6 years agoresolved: change newline position in stub-resolv.conf (#7216)
Yu Watanabe [Mon, 30 Oct 2017 09:34:41 +0000 (18:34 +0900)] 
resolved: change newline position in stub-resolv.conf (#7216)

Follow-up for e6b2d948f8f5aabf6cdede8bd39256fe83db205e.

6 years agofix includes 7218/head
Matija Skala [Mon, 30 Oct 2017 09:32:45 +0000 (10:32 +0100)] 
fix includes

sys/wait.h is needed for WEXITED macro

poll.h is more portable than sys/poll.h

6 years agofix compile error on musl
Matija Skala [Mon, 30 Oct 2017 09:15:31 +0000 (10:15 +0100)] 
fix compile error on musl

name '__in6_u.__u6_addr32' is specific to glibc

use 's6_addr32' macro instead

6 years agoMerge pull request #7212 from whot/master
Lennart Poettering [Mon, 30 Oct 2017 09:12:12 +0000 (10:12 +0100)] 
Merge pull request #7212 from whot/master

hwdb: add a hwdb for custom ID_INPUT_* overrides

6 years agorules: add Freescale IMX serial ports name to serial port udev rule (#7203)
Maciej S. Szmigiero [Mon, 30 Oct 2017 08:59:31 +0000 (09:59 +0100)] 
rules: add Freescale IMX serial ports name to serial port udev rule (#7203)

Freescale IMX SoCs serial ports driven by kernel "imx-uart" driver have
names of "ttymxcN", let's add this pattern to an udev rule for serial
ports so they will have proper ownership applied.

6 years agotreewide: unify identical definitions of polkit_agent_open_if_enabled() (#7187)
Zbigniew Jędrzejewski-Szmek [Mon, 30 Oct 2017 08:57:53 +0000 (09:57 +0100)] 
treewide: unify identical definitions of polkit_agent_open_if_enabled() (#7187)

Follows the same pattern as pager_open() now.

6 years agohwdb: add UC-Logic 20160N pad to the ID_INPUT hwdb 7212/head
Peter Hutterer [Mon, 30 Oct 2017 00:58:00 +0000 (10:58 +1000)] 
hwdb: add UC-Logic 20160N pad to the ID_INPUT hwdb

Missing the x/y axes usually exported for pad devices (for historical reaons)
and thus not recognised as tablet (pad).

Fixes #7197
See also https://bugs.freedesktop.org/show_bug.cgi?id=103395

6 years agohwdb: add a hwdb file to override ID_INPUT assignments
Peter Hutterer [Mon, 30 Oct 2017 00:42:29 +0000 (10:42 +1000)] 
hwdb: add a hwdb file to override ID_INPUT assignments

The input_id builtin assigns the various ID_INPUT based on the exported evdev
bits. In some cases, the device may not have the properties required to label
a device as one specific type but the physical form factor is clear.
e.g. in the case of #7197 it's a tablet pad that does not have x/y axes which
the kernel exports for pads for historical reasons.

A custom override is needed, best to be solved with a hwdb entry.

Related #7197

6 years agoman: systemd.offline-updates: remove link to the doc it obsoletes (#7189)
Alan Jenkins [Fri, 27 Oct 2017 08:15:40 +0000 (09:15 +0100)] 
man: systemd.offline-updates: remove link to the doc it obsoletes (#7189)

https://www.freedesktop.org/wiki/Software/systemd/SystemUpdates/

> This document has been replaced by systemd.offline-updates(7) man page.

It's weird to visit the first "see also", and find that it is what the manpage replaces (and looks very similar).  Surely we should remove this link.

6 years agojournalctl: add --output-fields= (#7181)
Lars Karlitski [Fri, 27 Oct 2017 03:10:47 +0000 (05:10 +0200)] 
journalctl: add --output-fields= (#7181)

This option allows restricting the shown fields in the output modes that
would normally show all fields. It allows clients that are only
interested in a subset of the fields to access those more efficiently.
Also, it makes the resulting size of the output more predictable.

It has no effect on the various `short` output modes, because those
already only show a subset of the fields.

6 years agoMerge pull request #7066 from poettering/specifier-update
Yu Watanabe [Fri, 27 Oct 2017 03:09:26 +0000 (12:09 +0900)] 
Merge pull request #7066 from poettering/specifier-update

extend unit file specifier expansion a bit + add a test for it

6 years agoupdate TODO 7066/head
Lennart Poettering [Wed, 11 Oct 2017 12:09:10 +0000 (14:09 +0200)] 
update TODO

6 years agotest: add simple test for validating some of the unit specifiers we support
Lennart Poettering [Wed, 11 Oct 2017 12:07:51 +0000 (14:07 +0200)] 
test: add simple test for validating some of the unit specifiers we support

(Also, sort list of test unit files in meson.build alphabetically, to
make future additions more systematic)

6 years agocore: add support for expanding state/cache/log directory root in unit files
Lennart Poettering [Wed, 11 Oct 2017 12:02:36 +0000 (14:02 +0200)] 
core: add support for expanding state/cache/log directory root in unit files

This augments %t which already resolves to the runtime directory root, and
should be useful for units that want to pass any of these paths in
command line arguments.

Example:

ExecStart=/usr/bin/mydaemon --datadir=%S/mydaemon

Why not expose a specifier resolving directly to the configured
state/runtime/cache/log dir? Three reasons:

1. Specifiers should be independent of configuration of the unit itself,
   and StateDirectory= and friends are unit configuration.  See
   03fc9c723cfc59467a7fccc305f34273f8564b25 and related work.

2. We permit multiple StateDirectory= values per unit, and it hence
   wouldn't be clear which one is passed.

3. We already have %t for the runtime directory root, and we should
   continue with the same scheme.

6 years agoupdate TODO 6996/head
Lennart Poettering [Wed, 4 Oct 2017 15:44:14 +0000 (17:44 +0200)] 
update TODO

6 years agomachine-image: handle nicely if the user asks us to remove a symlinked image
Lennart Poettering [Wed, 4 Oct 2017 15:42:23 +0000 (17:42 +0200)] 
machine-image: handle nicely if the user asks us to remove a symlinked image

Much like for dirs/raw images lets remove the symlink and not the
destination.

6 years agodissect: when we invoke dissection on a loop device with partscan help the user
Lennart Poettering [Wed, 4 Oct 2017 15:40:46 +0000 (17:40 +0200)] 
dissect: when we invoke dissection on a loop device with partscan help the user

This adds some simply detection logic for cases where dissection is
invoked on an externally created loop device, and partitions have been
detected on it, but partition scanning so far was off. If this is
detected we now print a brief message indicating what the issue is,
instead of failing with a useless EINVAL message the kernel passed to
us.

6 years agomachine-image: add partial discovery of block devices as images
Lennart Poettering [Wed, 4 Oct 2017 15:36:58 +0000 (17:36 +0200)] 
machine-image: add partial discovery of block devices as images

This adds some basic discovery of block device images for nspawn and
friends. Note that this doesn't add searching for block devices using
udev, but instead expects users to symlink relevant block devices into
/var/lib/machines. Discovery is hence done exactly like for
dir/subvol/raw file images, except that what is found may be a (symlink
to) a block device.

For now, we do not support cloning these images, but removal, renaming
and read-only flags are supported to the point where that makes sense.

Fixe: #6990

6 years agofs-util: small tweak in chase_symlinks()
Lennart Poettering [Wed, 4 Oct 2017 15:34:03 +0000 (17:34 +0200)] 
fs-util: small tweak in chase_symlinks()

If we follow an absolute symlink there's no need to prefix the path with
a "/", since by definition it already has one.

This helps suppressing double "/" in resolved paths containing absolute
symlinks.

6 years agobtrfs-util: when opening subvolume fds, always set O_NOFOLLOW
Lennart Poettering [Wed, 4 Oct 2017 11:48:51 +0000 (13:48 +0200)] 
btrfs-util: when opening subvolume fds, always set O_NOFOLLOW

Some of the btrfs utility functions already used O_NOFOLLOW others
didn't. Let's streamline this, and refuse operation when we are called
for symlinks on "remove" and "snapshot" too.

In particular in the "remove" case following symlinks is a bad idea, and
is quite different from how unlink() and friends work, which always
remove the symlink, and not the destination, a logic we should follow
here too.

6 years agosystemd-detect-virt: refine hypervisor detection (#7171)
Razvan Cojocaru [Thu, 26 Oct 2017 14:59:04 +0000 (17:59 +0300)] 
systemd-detect-virt: refine hypervisor detection (#7171)

Continue to try to get more details about the actual underlying
hypervisor with successive tests until none are available.
This fixes issue #7165.

6 years agoMerge pull request #7184 from keszybz/resolved-loop
Zbigniew Jędrzejewski-Szmek [Thu, 26 Oct 2017 13:29:03 +0000 (15:29 +0200)] 
Merge pull request #7184 from keszybz/resolved-loop

resolved: fix loop on packets with pseudo dns types

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1725351,
CVE-2017-15908.

6 years agoMerge pull request #7127 from keszybz/sundry-tweaks
Lennart Poettering [Thu, 26 Oct 2017 08:57:00 +0000 (10:57 +0200)] 
Merge pull request #7127 from keszybz/sundry-tweaks

Various unrelated small patches

6 years agoMerge pull request #7142 from sourcejedi/systemd-shutdown
Lennart Poettering [Thu, 26 Oct 2017 08:56:44 +0000 (10:56 +0200)] 
Merge pull request #7142 from sourcejedi/systemd-shutdown

systemd-shutdown: avoid confusingly redundant messages

6 years agoAdding timer_event to wakeup as suggested by MHD_get_timeout (#7152)
martingh [Thu, 26 Oct 2017 08:54:30 +0000 (10:54 +0200)] 
Adding timer_event to wakeup as suggested by MHD_get_timeout (#7152)

6 years agohwdb: Add ACCEL_MOUNT_MATRIX for ThinkPad Yoga 11e (#7174)
Lars Kellogg-Stedman [Wed, 25 Oct 2017 11:23:51 +0000 (07:23 -0400)] 
hwdb: Add ACCEL_MOUNT_MATRIX for ThinkPad Yoga 11e (#7174)

Accelerometer readings from the screen accelerometer on the Yoga 11e
need to be rotated 90 degrees around the Z axis.

6 years agoresolved: fix loop on packets with pseudo dns types 7184/head
Zbigniew Jędrzejewski-Szmek [Wed, 25 Oct 2017 09:19:19 +0000 (11:19 +0200)] 
resolved: fix loop on packets with pseudo dns types

Reported by Karim Hossen & Thomas Imbert from Sogeti ESEC R&D.

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1725351

6 years agohwdb: Document expected MOUNT_MATRIX on devices with non upright display (#7177)
Hans de Goede [Wed, 25 Oct 2017 07:47:27 +0000 (09:47 +0200)] 
hwdb: Document expected MOUNT_MATRIX on devices with non upright display (#7177)

On some devices the display (LCD panel) is mounted non upright
in the device's casing, e.g. mounted upside-down or 90 degree rotated.

Document the expected ACCEL_MOUNT_MATRIX settings for such devices.

6 years agonspawn: EROFS for chowning mount points is not fatal (#7122)
Lauri Tirkkonen [Tue, 24 Oct 2017 17:40:50 +0000 (20:40 +0300)] 
nspawn: EROFS for chowning mount points is not fatal (#7122)

This fixes --read-only with --private-users. mkdir_userns_p may return
-EROFS if either mkdir or lchown fails; lchown failing is fine as the
mount point will just be overmounted, and if mkdir fails then the
following mount() will also fail (with ENOENT).

6 years agocore: systemd-shutdown: avoid confusingly redundant messages 7142/head
Alan Jenkins [Thu, 19 Oct 2017 14:02:12 +0000 (15:02 +0100)] 
core: systemd-shutdown: avoid confusingly redundant messages

After previous output from systemd-shutdown indicated a bug, my attention
was drawn to redundant output lines.  Did they indicate an anomaly?

It turns out to be an expected, harmless result of the current code.  But
we don't have much justification to run such redundant operations.  Let's
remove the confusing redundant message.

We can stop trying to remount a directory read-only once its mount entry
has successfully been changed to "ro".  We can simply let the kernel keep
track of this for us.  I don't bother to try and avoid re-parsing the
mountinfo.  I appreciate snappy shutdowns, but this code is already
intricate and buggy enough (see issue 7131).

(Disclaimer: At least for the moment, you can't _rely_ on always seeing
suspicious output from systemd-shutdown.  By default, you can expect the
kernel to truncate the log output of systemd-shutdown.  Ick ick ick!
Because /dev/kmsg is rate-limited by default.  Normally it prints a message
"X lines supressed", but we tend to shut down before the timer expires
in this case).

Before:

systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel...
EXT4-fs (vda3): re-mounted. Opts: data=ordered
systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel, ...
EXT4-fs (vda3): re-mounted. Opts: data=ordered

After:

systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel, ...
EXT4-fs (vda3): re-mounted. Opts: data=ordered

I also tested with `systemctl reboot --force`, plus a loopback mount to
cause one of the umounts to fail initially.  In this case another 2 lines
of output are removed (out of a larger number of lines).

6 years agoresolved: create private stub resolve file for /etc/resolv.conf integration (#7014)
Dimitri John Ledkov [Tue, 24 Oct 2017 13:28:41 +0000 (09:28 -0400)] 
resolved: create private stub resolve file for /etc/resolv.conf integration (#7014)

This creates a second private resolve.conf file which lists the stub resolver
and the resolved acquired search domains.

This runtime file should be used as a symlink target for /etc/resolv.conf such
that non-nss based applications can resolve search domains.

Fixes: #7009
6 years agoMerge pull request #7141 from yuwata/fix-7129
Lennart Poettering [Tue, 24 Oct 2017 13:25:12 +0000 (15:25 +0200)] 
Merge pull request #7141 from yuwata/fix-7129

core: fix D-Bus API

6 years agocore: in --user mode, report READY=1 as soon as basic.target is reached (#7102)
Zbigniew Jędrzejewski-Szmek [Tue, 24 Oct 2017 12:48:54 +0000 (14:48 +0200)] 
core: in --user mode, report READY=1 as soon as basic.target is reached (#7102)

When a user logs in, systemd-pam will wait for the user manager instance to
report readiness. We don't need to wait for all the jobs to finish, it
is enough if the basic startup is done and the user manager is responsive.

systemd --user will now send out a READY=1 notification when either of two
conditions becomes true:
- basic.target/start job is gone,
- the initial transaction is done.

Also fixes #2863.

6 years agoMerge pull request #7123 from keszybz/date-formatting
Lennart Poettering [Tue, 24 Oct 2017 10:24:09 +0000 (12:24 +0200)] 
Merge pull request #7123 from keszybz/date-formatting

Fix for time stamp formatting in timedatectl

6 years agocore: fix D-Bus API 7141/head
Yu Watanabe [Thu, 19 Oct 2017 13:40:04 +0000 (22:40 +0900)] 
core: fix D-Bus API

This fixes bugs introduced by cffaed83e87bde81378b2be74192193850d0e03a.

Closes #7129.

6 years agonspawn: Fix calculation of capabilities for configuration file (#7087)
myrkr [Tue, 24 Oct 2017 07:56:40 +0000 (09:56 +0200)] 
nspawn: Fix calculation of capabilities for configuration file (#7087)

The current code shifting an integer 1 failed for capabilities like
CAP_MAC_ADMIN (numerical value 33). This caused issues when specifying
them in the nspawn configuration file. Using an uint64_t 1 instead.

The similar code for processing the --capability command line option
was already correctly working.

6 years agoman: update the description of interval limiting (#7128)
Zbigniew Jędrzejewski-Szmek [Tue, 24 Oct 2017 07:41:52 +0000 (09:41 +0200)] 
man: update the description of interval limiting (#7128)

Fixes #7125.

6 years agoMerge pull request #7148 from keszybz/dynamic-user-use-gid
Lennart Poettering [Tue, 24 Oct 2017 07:38:01 +0000 (09:38 +0200)] 
Merge pull request #7148 from keszybz/dynamic-user-use-gid

Use gid for static dynamic users

6 years agoNEWS: start adding 236 (#7159)
Mantas Mikulėnas [Mon, 23 Oct 2017 20:56:01 +0000 (23:56 +0300)] 
NEWS: start adding 236 (#7159)

6 years agoMerge pull request #6948 from pfl/radv_emit_dns
Lennart Poettering [Mon, 23 Oct 2017 16:39:07 +0000 (18:39 +0200)] 
Merge pull request #6948 from pfl/radv_emit_dns

Add EmitDNS= and EmitDomains= network file configuration options

6 years agocore/dynamic-user: use gid from pwnam if a static user was found 7148/head
Zbigniew Jędrzejewski-Szmek [Fri, 20 Oct 2017 11:00:12 +0000 (13:00 +0200)] 
core/dynamic-user: use gid from pwnam if a static user was found

Fixes #7133.

v2:
- update based on review

6 years agohwdb: invert the USB touchpad integration assumption (#7161)
Peter Hutterer [Mon, 23 Oct 2017 08:20:16 +0000 (18:20 +1000)] 
hwdb: invert the USB touchpad integration assumption (#7161)

The vast majority of touchpads are internal, so let's assume that any USB
touchpad is internal by default (exception: bluetooth) and manually mark the
ones that are external. That's a lot more future-proof than having to mark all
internal touchpads that use USB as internal - that number is only going to
increase.

Related to #7068

6 years agomodprobe.d: fix directory of modprobe configuration file (#7149)
Michael Biebl [Sat, 21 Oct 2017 06:32:50 +0000 (08:32 +0200)] 
modprobe.d: fix directory of modprobe configuration file (#7149)

kmod upstream uses /lib/modprobe.d which means we need to use rootprefix
instead of prefix for installing the modprobe configuration file as
otherwise split-usr systems are broken.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879191

6 years agocore/dynamic-user: use _cleanup_ in dynamic user locking
Zbigniew Jędrzejewski-Szmek [Fri, 20 Oct 2017 10:41:04 +0000 (12:41 +0200)] 
core/dynamic-user: use _cleanup_ in dynamic user locking

This makes the code a bit easier to read.

6 years agosd-radv: Allocate space also for DNSSL iov option (#7144)
Patrik Flykt [Fri, 20 Oct 2017 08:59:15 +0000 (11:59 +0300)] 
sd-radv: Allocate space also for DNSSL iov option (#7144)

The iov array needs to hold five entries in addition to the number
of prefixes.

6 years agocore: systemd-shutdown: add missing check for umount_changed
Alan Jenkins [Thu, 19 Oct 2017 14:00:57 +0000 (15:00 +0100)] 
core: systemd-shutdown: add missing check for umount_changed

The assumption was that nothing changes in the final attempt.  This
would be confusing if a filesystem with a process in uninterruptible
sleep suddenly became un-stuck for the final attempt, but we still give
up and don't try to e.g. unmount any parent mounts.

I don't know how possible that is.  But the code will be easier to read
without an assumption that it does not attempt to justify.

6 years agoMerge pull request #7132 from splantefeve/fr-translation
Zbigniew Jędrzejewski-Szmek [Thu, 19 Oct 2017 06:29:37 +0000 (08:29 +0200)] 
Merge pull request #7132 from splantefeve/fr-translation

Update French translation

6 years agopo: update french translation 7132/head
Sylvain Plantefève [Wed, 18 Oct 2017 22:26:52 +0000 (00:26 +0200)] 
po: update french translation

6 years agocatalog: update french translation
Sylvain Plantefève [Wed, 18 Oct 2017 22:26:27 +0000 (00:26 +0200)] 
catalog: update french translation

6 years agoman: describe how machine-id should be initialized (#7051)
Zbigniew Jędrzejewski-Szmek [Wed, 18 Oct 2017 16:47:34 +0000 (18:47 +0200)] 
man: describe how machine-id should be initialized (#7051)

6 years agorfkill: include the device name in error message 7127/head
Zbigniew Jędrzejewski-Szmek [Wed, 18 Oct 2017 15:31:51 +0000 (17:31 +0200)] 
rfkill: include the device name in error message

6 years agoman: recommend using /var/lib/machines in systemd-nspawn(1)
Zbigniew Jędrzejewski-Szmek [Wed, 18 Oct 2017 07:39:30 +0000 (09:39 +0200)] 
man: recommend using /var/lib/machines in systemd-nspawn(1)

Also update the instruction to latest Fedora version.

6 years agoutil-lib: simplify kexec_loaded()
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2017 21:00:54 +0000 (23:00 +0200)] 
util-lib: simplify kexec_loaded()

6 years agologind: drop unnecessary braces
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2017 19:24:32 +0000 (21:24 +0200)] 
logind: drop unnecessary braces

6 years agomeson: drop unneeded check for grep
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2017 17:47:16 +0000 (19:47 +0200)] 
meson: drop unneeded check for grep

6 years agotimedatectl: stop using xstrftime 7123/head
Zbigniew Jędrzejewski-Szmek [Wed, 18 Oct 2017 14:15:09 +0000 (16:15 +0200)] 
timedatectl: stop using xstrftime

When using strftime in arbitrary locales, we cannot really say how big the
buffer should be. Let's make the buffer "large", which will work fine pretty
much always, and just print n/a if the timestamp does not fit. strftime returns
0 if the buffer is too small and a NUL-terminated string otherwise, so we
can drop the size specifications in string formatting.

$ export LANG=fa_IR.UTF-8
$ date
چهارشنبه ۱۸ اكتبر ۱۷، ساعت ۱۰:۵۴:۲۴ (+0330)
$ timedatectl
Assertion 'xstrftime: a[] must be big enough' failed at ../src/timedate/timedatectl.c:105, function print_status_info(). Aborting.

now:

$ timedatectl
        Local time: چهارشنبه 2017-10-18 16:29:40 CEST
    Universal time: چهارشنبه 2017-10-18 14:29:40 UTC
          RTC time: چهارشنبه 2017-10-18 14:29:40


https://bugzilla.redhat.com/show_bug.cgi?id=1503452

6 years agoMerge pull request #7078 from keszybz/cryptsetup-netdev-fixes
Lennart Poettering [Wed, 18 Oct 2017 13:15:29 +0000 (21:15 +0800)] 
Merge pull request #7078 from keszybz/cryptsetup-netdev-fixes

Cryptsetup _netdev fixes

6 years agounits: make remote-cryptsetup.target also after cryptsetup-pre.target 7078/head
Zbigniew Jędrzejewski-Szmek [Wed, 18 Oct 2017 13:14:46 +0000 (15:14 +0200)] 
units: make remote-cryptsetup.target also after cryptsetup-pre.target

This way people can order units before cryptsetup-pre.target and
have them run before any cryptsetup-related stuff.

6 years agonetworkd: don't stop the dhcp server if it's not configured. (#7083)
Susant Sahani [Wed, 18 Oct 2017 10:38:56 +0000 (16:08 +0530)] 
networkd: don't stop the dhcp server if it's not configured. (#7083)

we call sd_dhcp_server_stop even if it's not configured when link is
down resulting unwanted logs.
```
Oct 10 13:41:07 nena systemd-networkd[126]: eth0: Lost carrier
Oct 10 13:41:07 nena systemd-networkd[126]: DHCP CLIENT (0x560f2dc5): STOPPED
Oct 10 13:41:07 nena systemd-networkd[126]: eth0: DHCP lease lost
Oct 10 13:41:07 nena systemd-networkd[126]: NDISC: Stopping IPv6 Router Solicitation client
Oct 10 13:41:07 nena systemd-networkd[126]: Assertion 'server' failed at ../src/libsystemd-network/sd-dhcp-server.c:256, function sd_dhcp_server_stop(). Ignoring.
```

fixes #7047

6 years agotests: rename test-time to test-time-util
Zbigniew Jędrzejewski-Szmek [Wed, 18 Oct 2017 09:27:23 +0000 (11:27 +0200)] 
tests: rename test-time to test-time-util

It's for testing time-util.c so rename it to make things more
obvious.

6 years agonetworkd: Consider linkLocalAddressing state while configuring ndisc. (#7012)
Susant Sahani [Wed, 18 Oct 2017 09:12:59 +0000 (14:42 +0530)] 
networkd: Consider linkLocalAddressing state while configuring ndisc. (#7012)

If linkLocalAddressing is disabled in for the interface still then
we look for ndisc configured or not in link_check_ready.

Link local is used automatic address configuration and neighbor discovery protocol.
If link local is disabled we should not configure ndisc.

Fixes #2713, #6441, #5841.

6 years agocore: fragments of masked units ought not be considered for NeedDaemonReload (#7060)
Lubomir Rintel [Wed, 18 Oct 2017 06:38:50 +0000 (08:38 +0200)] 
core: fragments of masked units ought not be considered for NeedDaemonReload (#7060)

The units that are not loaded don't have dropin_paths set. This
currently results in units that have fragments to always have
NeedDaemonReload=true when masked:

  $ find {/usr/lib,/run/user/8086}/systemd/user/meh.service* |xargs ls -ld
  lrwxrwxrwx. 1 lkundrak lkundrak    9 Oct 11 11:19 /run/user/8086/systemd/user/meh.service -> /dev/null
  -rw-rw-r--. 1 root     root       49 Oct 11 10:16 /usr/lib/systemd/user/meh.service
  drwxrwxr-x. 2 root     root     4096 Oct 11 10:50 /usr/lib/systemd/user/meh.service.d
  -rw-rw-r--. 1 root     root      666 Oct 11 10:50 /usr/lib/systemd/user/meh.service.d/override.conf
  $ systemctl --user daemon-reload
  $ busctl --user get-property org.freedesktop.systemd1 \
        /org/freedesktop/systemd1/unit/meh_2eservice \
        org.freedesktop.systemd1.Unit NeedDaemonReload
  b true

6 years agoMerge pull request #7059 from yuwata/dynamic-user-7013
Zbigniew Jędrzejewski-Szmek [Wed, 18 Oct 2017 06:37:12 +0000 (08:37 +0200)] 
Merge pull request #7059 from yuwata/dynamic-user-7013

dynamic-user: permit the case static uid and gid are different

6 years agoman: add explanation about target's DefaultDependencies= (#7120)
Yu Watanabe [Wed, 18 Oct 2017 06:30:35 +0000 (15:30 +0900)] 
man: add explanation about target's DefaultDependencies= (#7120)

Closes #7113.

6 years agoman: comment a requirement about the static user or group when DynamicUser=yes 7059/head
Yu Watanabe [Wed, 18 Oct 2017 06:30:00 +0000 (15:30 +0900)] 
man: comment a requirement about the static user or group when DynamicUser=yes

6 years agoman: mention /run in systemd.generator document (#7121)
John Lin [Wed, 18 Oct 2017 06:29:19 +0000 (14:29 +0800)] 
man: mention /run in systemd.generator document (#7121)

6 years agonetworkd: Don't stop networkd if CONFIG_FIB_RULES=n in kernel (#7030)
Susant Sahani [Wed, 18 Oct 2017 06:25:57 +0000 (11:55 +0530)] 
networkd: Don't stop networkd if CONFIG_FIB_RULES=n in kernel (#7030)

If FIB Rules are not supported by the kernel then networkd fails to
start as it retuns error=-EOPNOTSUPP.
In this case just ignore and let start networkd.

```
sendto(5, {{len=28, type=RTM_GETRULE, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, seq=8, pid=0}, {family=AF_UNSPEC, dst_len=0, src_len=0, tos=0, table=RT_TABLE_UNSPEC, action=FR_ACT_TO_TBL, flags=0}}, 28, 0, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 16) = 28
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=128->12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_NETLINK, cmsg_type=0x3}], msg_controllen=24, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 48
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=128->12, msg_iov=[{iov_base={{len=48, type=NLMSG_ERROR, flags=0, seq=8, pid=8856}, {error=-EOPNOTSUPP, msg={{len=28, type=RTM_GETRULE, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, seq=8, pid=0}, {family=AF_UNSPEC, dst_len=0, src_len=0, tos=0, table=RT_TABLE_UNSPEC, action=FR_ACT_TO_TBL, flags=0}}}}, iov_len=7416}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_NETLINK, cmsg_type=0x3}], msg_controllen=24, msg_flags=0}, MSG_TRUNC) = 48
```

```
Oct 08 10:22:24 naomi systemd[1]: Starting Network Service...
Oct 08 10:22:24 naomi systemd-networkd[983]: Could not enumerate rules: Operation not supported
Oct 08 10:22:24 naomi systemd[1]: systemd-networkd.service: Main process exited, code=exited, status=1/FAILURE
```

Fixes #7027

6 years agocore: fix invalid error message
Yu Watanabe [Tue, 17 Oct 2017 23:57:54 +0000 (08:57 +0900)] 
core: fix invalid error message

The error message corresponds to EILSEQ is "Invalid or incomplete
multibyte or wide character", and is not suitable in this case.
So, let's show a custom error message when the function
dynamic_creds_realize() returns -EILSEQ.

6 years agoman: add a note about _netdev usage
Zbigniew Jędrzejewski-Szmek [Thu, 12 Oct 2017 20:43:58 +0000 (22:43 +0200)] 
man: add a note about _netdev usage

6 years agounits: replace remote-cryptsetup-pre.target with remote-fs-pre.target
Zbigniew Jędrzejewski-Szmek [Thu, 12 Oct 2017 20:34:54 +0000 (22:34 +0200)] 
units: replace remote-cryptsetup-pre.target with remote-fs-pre.target

remote-cryptsetup-pre.target was designed as an active unit (that pulls in
network-online.target), the opposite of remote-fs-pre.target (a passive unit,
with individual provider services ordering itself before it and pulling it in,
for example iscsi.service and nfs-client.target).

To make remote-cryptsetup-pre.target really work, those services should be
ordered before it too. But this would require updates to all those services,
not just changes from systemd side.

But the requirements for remote-fs-pre.target and remote-cryptset-pre.target
are fairly similar (e.g. iscsi devices can certainly be used for both), so
let's reuse remote-fs-pre.target also for remote cryptsetup units. This loses
a bit of flexibility, but does away with the requirement for various provider
services to know about remote-cryptsetup-pre.target.

6 years agotest-path: fix inverted return value (#7050)
Zbigniew Jędrzejewski-Szmek [Tue, 17 Oct 2017 15:49:48 +0000 (17:49 +0200)] 
test-path: fix inverted return value (#7050)

It must be <0 to indicate failure.

Fixes #7050.

6 years agomodprobe.d: expand drop-in to handle dummy0 as well (#7099)
Mantas Mikulėnas [Mon, 16 Oct 2017 15:17:47 +0000 (18:17 +0300)] 
modprobe.d: expand drop-in to handle dummy0 as well (#7099)

6 years agomount: make sure we unmount tmpfs mounts before we deactivate swaps (#7076)
Michal Sekletar [Mon, 16 Oct 2017 14:15:05 +0000 (16:15 +0200)] 
mount: make sure we unmount tmpfs mounts before we deactivate swaps (#7076)

In the past we introduced this property just for tmp.mount. However on
todays systems usually there are many more tmpfs mounts. Most notably
mounts backing XDG_RUNTIME_DIR for each user.

Let's generalize what we already have for tmp.mount and implement the
ordering After=swap.target for all tmpfs based mounts.

6 years agoMerge pull request #7061 from lkundrak/lr/serialized-environment
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2017 10:47:30 +0000 (12:47 +0200)] 
Merge pull request #7061 from lkundrak/lr/serialized-environment

Environment serialization/deserialization inconsistently validates the variables

6 years agoDisplay the systemctl status in green if state is "running" (#7094)
Boucman [Sun, 15 Oct 2017 10:22:47 +0000 (12:22 +0200)] 
Display the systemctl status in green if state is "running" (#7094)

6 years agoMerge pull request #7062 from yuwata/test-bind-paths
Zbigniew Jędrzejewski-Szmek [Fri, 13 Oct 2017 08:19:55 +0000 (10:19 +0200)] 
Merge pull request #7062 from yuwata/test-bind-paths

test: add test for BindPaths= and BindReadOnlyPaths=

6 years agogitignore: ignore output file of mkid (#7081)
John Lin [Fri, 13 Oct 2017 08:17:43 +0000 (16:17 +0800)] 
gitignore: ignore output file of mkid (#7081)

mkid is from https://www.gnu.org/software/idutils/

6 years agoman: update changes about gateway -> _gateway (#7085)
Christian Hesse [Fri, 13 Oct 2017 07:10:26 +0000 (09:10 +0200)] 
man: update changes about gateway -> _gateway (#7085)

Commit 5248e7e1f11aba6859de0b28f0dd3778b22842f2
(resolved,nss-myhostname: use _gateway for the gateway) changed how the
gateway is resolved. Reflect the change in documentation.

Close #7084.

6 years agounits: add [Install] section to remote-cryptsetup.target
Zbigniew Jędrzejewski-Szmek [Thu, 12 Oct 2017 20:13:03 +0000 (22:13 +0200)] 
units: add [Install] section to remote-cryptsetup.target

This makes this target the same as remote-fs.target in this regard. In practice
it probably doesn't make that much difference, because all encrypted devices
that are part of remote-fs.target (marked with _netdev) will be used for mount
points, so they will be pulled in anyway individually, but with this change any
such device will be configured, even if it is not pulled by any other unit.

6 years agosystemctl: clarify --global, --root and --runtime options (#7071)
Lubomir Rintel [Thu, 12 Oct 2017 06:14:25 +0000 (08:14 +0200)] 
systemctl: clarify --global, --root and --runtime options (#7071)

They're not only for enabling.

6 years agoshared: add vectorized parse_field() (#7056)
Vito Caputo [Thu, 12 Oct 2017 06:14:07 +0000 (23:14 -0700)] 
shared: add vectorized parse_field() (#7056)

By vectorizing parse_field() the chain of parse_field() calls in
output_short() can be replaced with a single call receiving a description
of the desired fields and their targets.

While at it, eliminate the repeated strlen() calls performed on constant
field names by making parse_field() receive the field length, and storing
it in the ParseFieldVec at compile time.

Also sort the output_short() fields so the short ones are tried first, for
a minor efficiency gain.

In addition to making the code less repetitive, gcc in my tests now inlines
the parse_fieldv() call in output_short().

6 years agocore: cleanup for enforce_groups() (#7064)
Yu Watanabe [Thu, 12 Oct 2017 06:10:25 +0000 (15:10 +0900)] 
core: cleanup for enforce_groups() (#7064)

SupplementaryGroups= is preprocessed in get_supplementary_groups().
So, it is not necessary to input ExecContext to enforce_groups().

6 years agotest-execute: always use /bin/sh 7062/head
Yu Watanabe [Thu, 12 Oct 2017 04:26:39 +0000 (13:26 +0900)] 
test-execute: always use /bin/sh

6 years agotest: add test for BindPaths= and BindReadOnlyPaths=
Yu Watanabe [Thu, 12 Oct 2017 04:25:06 +0000 (13:25 +0900)] 
test: add test for BindPaths= and BindReadOnlyPaths=

Follow-up for a8cabc612b16834260831a8163ae4b479b5c33a5.

6 years agosystemctl: supress enable/disable messages when -q is given (#7067)
John Lin [Wed, 11 Oct 2017 18:22:51 +0000 (02:22 +0800)] 
systemctl: supress enable/disable messages when -q is given (#7067)

Fixes: #7036
6 years agobasic: split unit-name.[ch] into two (#7065)
Lennart Poettering [Wed, 11 Oct 2017 18:21:29 +0000 (20:21 +0200)] 
basic: split unit-name.[ch] into two (#7065)

It always bothered me a bit that unit-name.[ch] contains so many
definitions that aren't really have much to do with unit nameing, for
example all the unit state definitions.

With this patch unit-name.[ch] is split into two: the file now contains
only the unit naming related operations, and everything else is split
out into a new set of files unit-def.[ch]. That's mostly unit state
stuff as well as dbus path and interface name operations.

No functional changes. This just moves code around.

(Note as both .c files include each other's headers this doesn't make
the build simpler or anything. All it does is make the C files a bit
shorter, and medicate my pretend OCD)

6 years agobasic/env-util: don't relax unesaping of serialized environment strings 7061/head
Lubomir Rintel [Wed, 11 Oct 2017 13:05:38 +0000 (15:05 +0200)] 
basic/env-util: don't relax unesaping of serialized environment strings

We wrote them ourselves -- they shouldn't contain invalid sequences.

6 years agobasic/env-util: drop the validation when deserializing environment
Lubomir Rintel [Wed, 11 Oct 2017 07:29:30 +0000 (09:29 +0200)] 
basic/env-util: drop the validation when deserializing environment

The environment variables we've serialized can quite possibly contain
characters outside the set allowed by env_assignment_is_valid(). In
fact, my environment seems to contain a couple of these:

  * TERMCAP set by screen contains a '\x7f' character
  * BASH_FUNC_module%% variable has a '%' character in name

Strict check of environment variables name and value certainly makes sense for
unit files, but not so much for deserialization of values we already had
in our environment.

6 years agotest-dhcp-client: fix typos in comment (#7052)
Florian Klink [Wed, 11 Oct 2017 12:45:48 +0000 (14:45 +0200)] 
test-dhcp-client: fix typos in comment (#7052)

6 years agonetworkd: bridge allow AgeingTimeSec to be set 0 (#7021)
Susant Sahani [Wed, 11 Oct 2017 07:08:05 +0000 (12:38 +0530)] 
networkd: bridge allow AgeingTimeSec to be set 0 (#7021)

Closes #7019.

6 years agodynamic-user: permit the case static uid and gid are different
Yu Watanabe [Wed, 11 Oct 2017 05:41:13 +0000 (14:41 +0900)] 
dynamic-user: permit the case static uid and gid are different

This makes systemd supports the case that DynamicUser=yes and
static user and group exist such that uid and gid of them are different.
We only refuse the operation when user does not exist but the group
with the same name exists.

Fixes #7013.

6 years agoMerge pull request #7058 from yuwata/fix-7055
Vito Caputo [Wed, 11 Oct 2017 04:05:00 +0000 (21:05 -0700)] 
Merge pull request #7058 from yuwata/fix-7055

core: fix segfault in compile_bind_mounts() when BindPaths= or BindReadOnlyPaths= is set