]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 years agoNEWS: typo fixes (#6276)
Thomas H. P. Andersen [Mon, 3 Jul 2017 21:35:05 +0000 (23:35 +0200)] 
NEWS: typo fixes (#6276)

6 years agobuild-sys: fix automake build
Lennart Poettering [Mon, 3 Jul 2017 18:13:18 +0000 (20:13 +0200)] 
build-sys: fix automake build

Lennart broke the automake build in
d4cbada2a95667c4d5d4310298bfcb446b1357b5. Let's fix that again, to
unfuck the CIs.

6 years agoMerge pull request #6271 from poettering/resolved-switching
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jul 2017 16:52:25 +0000 (12:52 -0400)] 
Merge pull request #6271 from poettering/resolved-switching

downgrade DNS server switching log messages + NEWS fixes

6 years agovconsole: search for usable source console (#6180)
Michal Soltys [Mon, 3 Jul 2017 16:38:13 +0000 (18:38 +0200)] 
vconsole: search for usable source console (#6180)

When vconsole-setup is called without arguments, search for a usable
console instead of using /dev/tty0.

/dev/tty0 — pointing to the current active console — it not necessarily
usable and in such case vconsole-setup would exit with failure. In particular
when systemd-vconsole-setup.service was restarted from within an X
session, it always failed.

If the function searching for a usable source terminal fails, the first
encountered error is returned to the caller.

Closes #5367.

Additional changes:

- true/false functions with 'is_ prefix are renamed to functions with
  'verify_vc_' prefix and return 0 on success and negative error on
  failure
- O_NOCTTY flag is used when opening terminals

6 years agosd-boot: stub: Obtain PE section offsets from RAM, not disk (#6250)
Matthew Garrett [Fri, 30 Jun 2017 18:27:47 +0000 (11:27 -0700)] 
sd-boot: stub: Obtain PE section offsets from RAM, not disk (#6250)

In a Secure Boot scenario the stub loader will have been validated
before execution. A malicious drive could then change the data returned
in future reads, resulting in the loader obtaining incorrect section
offsets and (for instance) allowing the command line to be modified.
Pull that information out of the in-RAM representation of the loader
instead in order to avoid this.

Fixes: #6230
(Lennart did some minor coding style fixes, and renamed pefile.c → pe.c,
as suggested by Kay, given that the file now contains a function whose
name doesn't match the filename as prefix anymore.)

6 years agounits: use Requires in systemd-networkd-wait-online.service (#6065)
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jul 2017 15:05:20 +0000 (11:05 -0400)] 
units: use Requires in systemd-networkd-wait-online.service (#6065)

In the initial design, foobar-wait-online.service would have
Requisite=foobar.service, so that foobar-wait-online.service could be enabled
unconditionally, irrespective of whether foobar.service itself is enabled.
Unfortunately this doesn't work too well:

1. the message about foobar-wait-online.service being skipped because of a
   "missing dependency" *looks* like an is problem. This is mostly cosmetic,
   but it also quite confusing. We generally don't want any messages of this
   type during default boot.

2. it is impossible to start and wait for the network in an
   implementation-agnostic way: systemctl start network-online.target, or
   Wants/After=network-online.target in a unit don't work because pulling in
   network-online.target pulls in foobar-wait-online.service, but it in turn
   does not pull in foobar.service. During startup, foobar.service is pulled in
   by multi-user.target, but not in a smaller transaction which does not
   include multi-user.target.

This change means that *-wait-online.service should be installed through
presets, so that it can be enabled/disabled at will by the administrator.
Our own systemd-networkd-wait-online.service does this already, and
similar change has been requested for NetworkManager-wait-online.service
(https://bugzilla.redhat.com/show_bug.cgi?id=1455704).

This change should by mostly backwards-compatible, unless somebody has some
wait-online.service enabled, without having the corresponding network
implementation enabled, and they are relying on it not being started.  I think
that's relatively unlikely because of issue 1. above, and I'm not aware of this
being the default in any distro. And being able to start the network in an
implementation-agnostic way is pretty important, see
https://bugzilla.redhat.com/show_bug.cgi?id=1452866.

6 years agoMerge pull request #6231 from keszybz/man-nss-resolved
Lennart Poettering [Mon, 3 Jul 2017 14:11:16 +0000 (16:11 +0200)] 
Merge pull request #6231 from keszybz/man-nss-resolved

man: describe the relationship between nss-myhostname and nss-resolved

6 years agoautomount: don't lstat(2) upon umount request (#6086)
Franck Bui [Mon, 3 Jul 2017 12:48:21 +0000 (14:48 +0200)] 
automount: don't lstat(2) upon umount request (#6086)

When umounting an NFS filesystem, it is not safe to lstat(2) the mountpoint at
all as that can block indefinitely if the NFS server is down.

umount() will not block, but lstat() will.

This patch therefore removes the call to lstat(2) and defers the handling of
any error to the child process which will issue the umount call.

6 years agoParse "timeout=0" as infinity in various generators (#6264)
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jul 2017 12:29:32 +0000 (08:29 -0400)] 
Parse "timeout=0" as infinity in various generators (#6264)

This extends 2d79a0bbb9f651656384a0a86ed814e6306fb5dd to the kernel
command line parsing.

The parsing is changed a bit to only understand "0" as infinity. If units are
specified, parse normally, e.g. "0s" is just 0. This makes it possible to
provide a zero timeout if necessary.

Simple test is added.

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

6 years agoMerge pull request #6235 from mbiebl/var-log-lastlog
Lennart Poettering [Mon, 3 Jul 2017 09:47:30 +0000 (11:47 +0200)] 
Merge pull request #6235 from mbiebl/var-log-lastlog

tmpfiles: create /var/log/lastlog if it does not exist

6 years agoMerge pull request #6233 from keszybz/man-locale-vconsole
Lennart Poettering [Mon, 3 Jul 2017 09:40:42 +0000 (11:40 +0200)] 
Merge pull request #6233 from keszybz/man-locale-vconsole

Small doc updates for 00-keyboard.conf, vconsole.conf, locale.conf

6 years agogit-contrib: drop weird non-breaking spaces 6271/head
Lennart Poettering [Mon, 3 Jul 2017 09:22:38 +0000 (11:22 +0200)] 
git-contrib: drop weird non-breaking spaces

For some reason git shortlog spits out non-breaking spaces, let's remove
that, as for our purposes (inclusion in NEWS) we really want breaking
(i.e. normal) spaces.

6 years agoresolved: downgrade log messages about switching DNS servers
Lennart Poettering [Mon, 3 Jul 2017 09:20:04 +0000 (11:20 +0200)] 
resolved: downgrade log messages about switching DNS servers

As suggested in:

https://github.com/systemd/systemd/commit/496ae8c84b2d3622bc767a727e3582e2b6bcffcd#commitcomment-22819483

Let's drop some noise from the logs, as switching between DNS servers is
definitely useful for debugging, but shouldn't get more attention that
that.

6 years agoNEWS: tweak contributors list a bit
Lennart Poettering [Mon, 3 Jul 2017 09:19:20 +0000 (11:19 +0200)] 
NEWS: tweak contributors list a bit

Let's add more .mailmap entries to clean up GitHub's mess.

6 years agoMerge pull request #6257 from keszybz/unnecessary-job-log
Lennart Poettering [Mon, 3 Jul 2017 08:48:28 +0000 (10:48 +0200)] 
Merge pull request #6257 from keszybz/unnecessary-job-log

core: do not print color console message about gc-ed jobs

6 years agoMerge pull request #6218 from poettering/v234-pre
Lennart Poettering [Mon, 3 Jul 2017 08:43:00 +0000 (10:43 +0200)] 
Merge pull request #6218 from poettering/v234-pre

preparation for v234

6 years agoudev: define BTN_DPAD_RIGHT if not present (#6267)
Peter Hutterer [Mon, 3 Jul 2017 08:03:22 +0000 (18:03 +1000)] 
udev: define BTN_DPAD_RIGHT if not present (#6267)

Regression introduced in commit b876bc0 when building on systemds with a pre
3.11 headers (RHEL7 and derivatives).

All the DPAD defines were introduced in the same kernel commit
d09bbfd2a8408a9954, we don't need a separate ifdef check for right.

Fixes #6240

6 years agonspawn: wait for the scope to be created (#6261)
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jul 2017 05:59:49 +0000 (01:59 -0400)] 
nspawn: wait for the scope to be created (#6261)

Fixes #6253.

6 years agoman: add zypper instructions for systemd-nspawn 6231/head
Zbigniew Jędrzejewski-Szmek [Sun, 2 Jul 2017 17:37:27 +0000 (13:37 -0400)] 
man: add zypper instructions for systemd-nspawn

v2:
- add -c and update the list of packages
v3:
- link to a man page on mankier.com

6 years agohwdb: Add SNES Mouse plugged through Retrode 2 (#6263)
hadess [Sun, 2 Jul 2017 20:59:44 +0000 (22:59 +0200)] 
hwdb: Add SNES Mouse plugged through Retrode 2 (#6263)

Note that this will only work with the new "hid-retrode" driver in the
upcoming 4.12 kernel as otherwise the mouse events and the 4 joypad
ports are bundled into a single event node.

6 years agoBe slightly more verbose in error message 6257/head
Zbigniew Jędrzejewski-Szmek [Sun, 2 Jul 2017 16:03:25 +0000 (12:03 -0400)] 
Be slightly more verbose in error message

Including the full path is always useful.

Also use PID_FMT in one more place.

6 years agocore/loopback-setup: make log messages nicer
Zbigniew Jędrzejewski-Szmek [Sun, 2 Jul 2017 14:23:07 +0000 (10:23 -0400)] 
core/loopback-setup: make log messages nicer

Under nspawn, systemd would print:

Got address error code: Operation not permitted
Got address error code: Operation not permitted
Got start error code: Operation not permitted

which is quite unclear out of context. Change that to:

Failed to add address 127.0.0.1 to loopback interface: Operation not permitted
Failed to add address ::1 to loopback interface: Operation not permitted
Failed to bring loopback interface up: Operation not permitted

6 years agocore: do not print color console message about gc-ed jobs
Zbigniew Jędrzejewski-Szmek [Sat, 1 Jul 2017 23:05:36 +0000 (19:05 -0400)] 
core: do not print color console message about gc-ed jobs

This is just a cosmetic issue.

Garbage collection of jobs (especially the ones that we create automatically)
is something of an internal implementation detail and should not be made
visible to the users. But it's probably still useful to log this in the
journal, so the code is rearranged to skip one of the messages if we log to the
console and the journal separately, and to keep the message if we log
everything to the console.

Fixes #6254.

6 years agoNEWS: mention that logind is restartable 6218/head
Zbigniew Jędrzejewski-Szmek [Fri, 30 Jun 2017 17:36:42 +0000 (13:36 -0400)] 
NEWS: mention that logind is restartable

6 years agomailmap: some additions for recent commits
Zbigniew Jędrzejewski-Szmek [Fri, 30 Jun 2017 17:20:23 +0000 (13:20 -0400)] 
mailmap: some additions for recent commits

6 years agoMerge pull request #6194 from keszybz/urandom-magic
Zbigniew Jędrzejewski-Szmek [Fri, 30 Jun 2017 17:05:56 +0000 (13:05 -0400)] 
Merge pull request #6194 from keszybz/urandom-magic

Fall back to /dev/urandom less and other random number improvements.

6 years agoethtool: fix half-duplex / full-duplex confusion (#6209)
Susant Sahani [Fri, 30 Jun 2017 16:55:21 +0000 (16:55 +0000)] 
ethtool: fix half-duplex / full-duplex confusion (#6209)

The values that we used for half-duplex and full-duplex in ethtool_set_glinksettings were
reversed wrt. what the kernel uses.

6 years agocore/automount: revise the "fun fact" comments. (#6245)
NeilBrown [Fri, 30 Jun 2017 16:51:33 +0000 (02:51 +1000)] 
core/automount: revise the "fun fact" comments. (#6245)

Fun fact 1 suggests that a "close()" is needed, but that close() has long since been
removed.  So the comment in now meaningless and possibly confusing.

Fun fact 2 refers to a bug that has been fixed in Linux prior to v4.12

Commit: 9fa4eb8e490a ("autofs: sanity check status reported with AUTOFS_DEV_IOCTL_FAIL")

so revise the comment so that no-one goes pointlessly looking for the bug.

6 years agoman: add more detail about quoting in ExecStart lines
Zbigniew Jędrzejewski-Szmek [Thu, 29 Jun 2017 02:29:41 +0000 (22:29 -0400)] 
man: add more detail about quoting in ExecStart lines

Fixes #624.

6 years agoman: fix spelling error of sd_bus_error_set_const (#6246)
Lars Karlitski [Fri, 30 Jun 2017 09:57:13 +0000 (11:57 +0200)] 
man: fix spelling error of sd_bus_error_set_const (#6246)

6 years agoInclude dpad buttons in joystick detection (#6240)
hramrach [Fri, 30 Jun 2017 00:23:58 +0000 (02:23 +0200)] 
Include dpad buttons in joystick detection (#6240)

Since f472d466ec26 ("Remove BTN_DPAD_* keys from ID_INPUT_KEY test
    (#5701)") dpad buttons are excluded from keyboard keys for keyboard
detection.

Include them in joystick buttons for joystick detection.

6 years agotmpfiles: create /var/log/lastlog if it does not exist 6235/head
Michael Biebl [Thu, 29 Jun 2017 05:57:35 +0000 (07:57 +0200)] 
tmpfiles: create /var/log/lastlog if it does not exist

Create /var/log/lastlog the same way we create utmp and wtmp.
This is useful for stateless systems where /var is volatile and a
missing /var/log/lastlog otherwise creates error messages like

Jun 27 20:00:00 huron sshd[1234]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory

Fixes #6234

6 years agounits: use https for the freedesktop url (#6227)
AsciiWolf [Thu, 29 Jun 2017 02:54:12 +0000 (04:54 +0200)] 
units: use https for the freedesktop url (#6227)

6 years agoman: mention localed and localectl in locale.conf(5) and vconsole.conf(5) 6233/head
Zbigniew Jędrzejewski-Szmek [Thu, 29 Jun 2017 02:47:55 +0000 (22:47 -0400)] 
man: mention localed and localectl in locale.conf(5) and vconsole.conf(5)

Fixes #295.

(We cannot add a comment to either of those files because they are documented
to "only support variable assignments", so it's better to add an explanation
in the man page instead.)

6 years agolocaled: improve the comment in 00-keyboard.conf
Zbigniew Jędrzejewski-Szmek [Thu, 29 Jun 2017 02:34:36 +0000 (22:34 -0400)] 
localed: improve the comment in 00-keyboard.conf

6 years agoman: describe the relationship between nss-myhostname and nss-resolved
Zbigniew Jędrzejewski-Szmek [Thu, 29 Jun 2017 00:43:37 +0000 (20:43 -0400)] 
man: describe the relationship between nss-myhostname and nss-resolved

Fixes #1605.

6 years agoRevert "resolved: drop unnecessary comparison (#6220)"
Zbigniew Jędrzejewski-Szmek [Wed, 28 Jun 2017 20:01:18 +0000 (16:01 -0400)] 
Revert "resolved: drop unnecessary comparison (#6220)"

This reverts commit d718d20225bd631360ca5502b873278416616a03.

6 years agosystemd-mount: support unmounting loop devices by backing files (#6211)
Yu Watanabe [Wed, 28 Jun 2017 18:19:38 +0000 (03:19 +0900)] 
systemd-mount: support unmounting loop devices by backing files (#6211)

This makes `systemd-umount` or `systemd-mount -u` support unmounting
loop devices by the corresponding backing files, like
`systemd-mount --umount /tmp/foo.img /tmp/bar.img`

Fixes #6206.

6 years agoOnly drop the capabilities from the bounding set if we are running as PID1 (#6204)
Lennart Poettering [Wed, 28 Jun 2017 17:29:45 +0000 (19:29 +0200)] 
Only drop the capabilities from the bounding set if we are running as PID1 (#6204)

The CapabilityBoundingSet option only makes sense if we are running as
PID1.

The system.conf.d(5) manpage, already states that the CapabilityBoundingSet
option:
  Controls which capabilities to include in the capability bounding set
  for PID 1 and its children.

https://github.com/systemd/systemd/issues/6080

6 years agoudev: never ask libblkid for detecting superblocks with bad checksums (#6215)
Lennart Poettering [Wed, 28 Jun 2017 17:27:40 +0000 (19:27 +0200)] 
udev: never ask libblkid for detecting superblocks with bad checksums (#6215)

Previously, we'd ask liblkid to also tell us about recognized
superblocks with bad checksums. We'd then log about them and ignore
them. This however created ambuigity problems, see #6110: the
BLKID_SUBLKS_BADCSUM is not as innocent as it appears.

This patch drops bad checksum handling and we ignore all such superblocks
entirely again, as it was the status quo ante
d47f6ca5f9b7a0b400d8bdb050151a0284fb4bdb (where this was snuck in).

Ideally, libblkid would be changed to avoid this ambiguity problems for
bad checksums, but that's not going to happen any time soon, according
to @karelzak.

Fixes: #6110
6 years agonspawn: register a scope for the unit if --register=no is specified (#6166)
Lennart Poettering [Wed, 28 Jun 2017 17:22:46 +0000 (19:22 +0200)] 
nspawn: register a scope for the unit if --register=no is specified (#6166)

Previously, only when --register=yes was set (the default) the invoked
container would get its own scope, created by machined on behalf of
nspawn. With this change if --register=no is set nspawn will still get
its own scope (which is a good thing, so that --slice= and --property=
take effect), but this is not done through machined but by registering a
scope unit directly in PID 1.

Summary:

--register=yes             → allocate a new scope through machined (the default)
--register=yes --keep-unit → use the unit we are already running in an register with machined
--register=no              → allocate a new scope directly, but no machined
--register=no --keep-unit  → do not allocate nor register anything

Fixes: #5823
6 years agosd-bus: never augment creds when we are operating on remote connections (#6217)
Lennart Poettering [Wed, 28 Jun 2017 17:20:16 +0000 (19:20 +0200)] 
sd-bus: never augment creds when we are operating on remote connections (#6217)

It's not always clear when something is a remote connection, hence only
flag the obvious cases as local.

Fixes: #6207
6 years agoman: update reference for binfmt documentation (#6223)
Stefan Schweter [Wed, 28 Jun 2017 17:18:37 +0000 (19:18 +0200)] 
man: update reference for binfmt documentation (#6223)

6 years agoresolved: drop unnecessary comparison (#6220)
Zbigniew Jędrzejewski-Szmek [Wed, 28 Jun 2017 16:24:37 +0000 (12:24 -0400)] 
resolved: drop unnecessary comparison (#6220)

mtu is always greater than UDP_PACKET_HEADER_SIZE at this point.
Pointed out by Benjamin Robin.

6 years agoMerge pull request #6222 from keszybz/input-id-rules-installation
Michael Biebl [Wed, 28 Jun 2017 15:40:12 +0000 (17:40 +0200)] 
Merge pull request #6222 from keszybz/input-id-rules-installation

build-sys: fix installation of new 60-input-id.rules

6 years agobuild-sys: fix installation of new 60-input-id.rules 6222/head
Zbigniew Jędrzejewski-Szmek [Wed, 28 Jun 2017 15:19:33 +0000 (11:19 -0400)] 
build-sys: fix installation of new 60-input-id.rules

Fixup for 38887d1bd5eb037a532279b2b75d6a87ce381419.

6 years agotests: add test-random-util 6194/head
Zbigniew Jędrzejewski-Szmek [Sun, 25 Jun 2017 22:01:02 +0000 (18:01 -0400)] 
tests: add test-random-util

In case you're wondering: 16 aligns in a nice pyramid.

6 years agobasic/random-util: do not fall back to /dev/urandom if getrandom() returns short
Zbigniew Jędrzejewski-Szmek [Sun, 25 Jun 2017 21:09:05 +0000 (17:09 -0400)] 
basic/random-util: do not fall back to /dev/urandom if getrandom() returns short

During early boot, we'd call getrandom(), and immediately fall back to
reading from /dev/urandom unless we got the full requested number of bytes.
Those two sources are the same, so the most likely result is /dev/urandom
producing some pseudorandom numbers for us, complaining widely on the way.

Let's change our behaviour to be more conservative:
- if the numbers are only used to initialize a hash table, a short read is OK,
  we don't really care if we get the first part of the seed truly random and
  then some pseudorandom bytes. So just do that and return "success".

- if getrandom() returns -EAGAIN, fall back to rand() instead of querying
  /dev/urandom again.

  The idea with those two changes is to avoid generating a warning about
  reading from an /dev/urandom when the kernel doesn't have enough entropy.

- only in the cases where we really need to make the best effort possible
  (sd_id128_randomize and firstboot password hashing), fall back to
  /dev/urandom.

When calling getrandom(), drop the checks whether the argument fits in an int —
getrandom() should do that for us already, and we call it with small arguments
only anyway.

Note that this does not really change the (relatively high) number of random
bytes we request from the kernel. On my laptop, during boot, PID 1 and all
other processes using this code through libsystemd request:
  74780 bytes with high_quality_required == false
    464 bytes with high_quality_required == true
and it does not eliminate reads from /dev/urandom completely. If the kernel was
short on entropy and getrandom() would fail, we would fall back to /dev/urandom
for those 464 bytes.

When falling back to /dev/urandom, don't lose the short read we already got,
and just read the remaining bytes.

If getrandom() syscall is not available, we fall back to /dev/urandom same
as before.

Fixes #4167 (possibly partially, let's see).

6 years agobasic/random-util: use most of the pseudorandom bytes from rand()
Zbigniew Jędrzejewski-Szmek [Sun, 25 Jun 2017 21:32:53 +0000 (17:32 -0400)] 
basic/random-util: use most of the pseudorandom bytes from rand()

The only implementation that we care about — glibc — provides us
with 31 bits of entropy. Let's use 24 bits of that, instead of throwing
all but 8 away.

6 years agoMerge pull request #6214 from keszybz/resolved-packet-size
Lennart Poettering [Wed, 28 Jun 2017 07:10:56 +0000 (09:10 +0200)] 
Merge pull request #6214 from keszybz/resolved-packet-size

Resolved packet size

6 years agoMerge pull request #6099 from hramrach/master
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 23:07:23 +0000 (19:07 -0400)] 
Merge pull request #6099 from hramrach/master

Enable mapping button events on keyboard.

6 years agoMerge pull request #6202 from poettering/condition-first-boot-doc
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 22:34:18 +0000 (18:34 -0400)] 
Merge pull request #6202 from poettering/condition-first-boot-doc

some documentation updates

6 years agoMerge pull request #6210 from poettering/input-mask
Lennart Poettering [Tue, 27 Jun 2017 21:24:21 +0000 (23:24 +0200)] 
Merge pull request #6210 from poettering/input-mask

logind: make use of EVIOCSMASK input ioctl to mask out events we aren…

6 years agoupdate hwdb in preparation for v234
Lennart Poettering [Tue, 27 Jun 2017 21:14:53 +0000 (23:14 +0200)] 
update hwdb in preparation for v234

6 years agobuild-sys: bump versions in prepare for v234
Lennart Poettering [Tue, 27 Jun 2017 21:11:26 +0000 (23:11 +0200)] 
build-sys: bump versions in prepare for v234

6 years agostart preparing NEWS file for 234
Lennart Poettering [Tue, 27 Jun 2017 21:06:55 +0000 (23:06 +0200)] 
start preparing NEWS file for 234

6 years agoresolved: define various packet sizes as unsigned 6214/head
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 20:59:06 +0000 (16:59 -0400)] 
resolved: define various packet sizes as unsigned

This seems like the right thing to do, and apparently at least some compilers
warn about signed/unsigned comparisons with DNS_PACKET_SIZE_MAX.

6 years agoresolved: do not allocate packets with minimum size
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 18:20:00 +0000 (14:20 -0400)] 
resolved: do not allocate packets with minimum size

dns_packet_new() is sometimes called with mtu == 0, and in that case we should
allocate more than the absolute minimum (which is the dns packet header size),
otherwise we have to resize immediately again after appending the first data to
the packet.

This partially reverts the previous commit.

6 years agoMerge pull request #5930 from larskarlitski/journal-skip
Lennart Poettering [Tue, 27 Jun 2017 20:10:38 +0000 (22:10 +0200)] 
Merge pull request #5930 from larskarlitski/journal-skip

journal: return 0 from _skip() when skip is 0

6 years agoresolved: Recover from slow DNS responses
Kai Krakow [Sat, 13 May 2017 10:30:56 +0000 (12:30 +0200)] 
resolved: Recover from slow DNS responses

When DNS is unreliable temporarily, the current implementation will
never improve resend behavior again and switch DNS servers only late
(current maximum timeout is 5 seconds).

We can improve this by biasing the resend_timeout back to the current
RTT when a successful response was received. Next time, a timeout is hit
on this server, it will switch to the next server faster.

Fixes: #5953
6 years agoman: extend Before=/After= documentation a bit 6202/head
Lennart Poettering [Mon, 26 Jun 2017 17:23:54 +0000 (19:23 +0200)] 
man: extend Before=/After= documentation a bit

let's clarify what the order actually means for service units.

Fixes: #6097
6 years agoman: improve documentation of ExecStartPost= a bit
Lennart Poettering [Mon, 26 Jun 2017 17:23:21 +0000 (19:23 +0200)] 
man: improve documentation of ExecStartPost= a bit

Let's make clear what start-up really means in this case.

See: #6097

6 years agoman: be more precise on the ConditionFirstBoot= documentation
Lennart Poettering [Mon, 26 Jun 2017 17:11:09 +0000 (19:11 +0200)] 
man: be more precise on the ConditionFirstBoot= documentation

Fixes: #5696
6 years agoMerge pull request #5976 from fbuihuu/swap-fix
Lennart Poettering [Tue, 27 Jun 2017 18:28:56 +0000 (20:28 +0200)] 
Merge pull request #5976 from fbuihuu/swap-fix

Swap fix

6 years agologind: relax udev rules matching devices logind watches for 6210/head
Lennart Poettering [Tue, 27 Jun 2017 14:14:30 +0000 (16:14 +0200)] 
logind: relax udev rules matching devices logind watches for

Now that we have support for key/switch masking in logind, we can relax
the rules by which logind picks the devices to watch a bit, after all we
won't wake up anymore for every single event, but instead only the
events we actually care about.

This should make power/suspend keys on normal usb/atkbd keyboards just
work.

6 years agologind: filter out input devices that have none of the keys/switche we care about
Lennart Poettering [Tue, 27 Jun 2017 15:46:28 +0000 (17:46 +0200)] 
logind: filter out input devices that have none of the keys/switche we care about

Let's check what keys are there, before we actually hang on to the
opened devices.

6 years agologind: make use of EVIOCSMASK input ioctl to mask out events we aren't interested in
Lennart Poettering [Mon, 26 Jun 2017 19:35:12 +0000 (21:35 +0200)] 
logind: make use of EVIOCSMASK input ioctl to mask out events we aren't interested in

This way logind will get woken up only when an actual event took place,
and not for every key press on the system.

The ioctl EVIOCSMASK was added by @dvdhrm already in October 2015, for
the use in logind, among others, hence let's actually make use of it
now.

While we are at it, also fix usage of the EVIOCGSW ioctl, where we
assumed a byte array, even though a unsigned long native endian array is
returned.

6 years agoresolved: simplify alloc size calculation
Zbigniew Jędrzejewski-Szmek [Sun, 18 Jun 2017 20:07:57 +0000 (16:07 -0400)] 
resolved: simplify alloc size calculation

The allocation size was calculated in a complicated way, and for values
close to the page size we would actually allocate less than requested.

Reported by Chris Coulson <chris.coulson@canonical.com>.

CVE-2017-9445

6 years agotest-resolved-packet: add a simple test for our allocation functions
Zbigniew Jędrzejewski-Szmek [Sun, 18 Jun 2017 19:53:15 +0000 (15:53 -0400)] 
test-resolved-packet: add a simple test for our allocation functions

6 years agoMerge pull request #6067 from ssahani/networkctl
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 15:41:09 +0000 (11:41 -0400)] 
Merge pull request #6067 from ssahani/networkctl

networkctl: display address labels

6 years agoAdd networkctl label to man and shell completion 6067/head
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 14:30:41 +0000 (10:30 -0400)] 
Add networkctl label to man and shell completion

6 years agonetworkctl: display address labels
Susant Sahani [Mon, 26 Jun 2017 17:58:10 +0000 (23:28 +0530)] 
networkctl: display address labels

```
 ./networkctl label

    Prefix/Prefixlen                          Label
        ::/0                                  1
    fc00::/7                                  5
    fec0::/10                                11
    2002::/16                                 2
    3ffe::/16                                12
 2001:10::/28                                 7
    2001::/32                                 6
::ffff:0.0.0.0/96                                 4
        ::/96                                 3
       ::1/128                                0

```

6 years agoMerge pull request #6201 from poettering/bus-driver-creds
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 14:11:21 +0000 (10:11 -0400)] 
Merge pull request #6201 from poettering/bus-driver-creds

shortcut credential querying of the "org.freedesktop.DBus" bus driver pseudo-service

6 years agohwdb: weed out key defines which do not designate events 6099/head
Michal Suchanek [Thu, 15 Jun 2017 10:50:05 +0000 (12:50 +0200)] 
hwdb: weed out key defines which do not designate events

The defines

KEY_MAX
KEY_CNT
KEY_MIN_INTERESTING
BTN_MISC
BTN_MOUSE
BTN_JOYSTICK
BTN_GAMEPAD
BTN_DIGI
BTN_WHEEL
BTN_TRIGGER_HAPPY

mark start/end of key blocks and do not designate events.

Exclude them from the list of recognized key events.

6 years agoinput_id: fix button detection
Michal Suchanek [Wed, 14 Jun 2017 15:15:36 +0000 (17:15 +0200)] 
input_id: fix button detection

Due to remapping some devices might not have the first button.

Check whole button range.

6 years agoinput_id: fix detection of devices with mouse buttons
Michal Suchanek [Mon, 12 Jun 2017 12:09:55 +0000 (14:09 +0200)] 
input_id: fix detection of devices with mouse buttons

Assign ID_INPUT_MOUSE property to devices with mouse buttons and no axis.

Libinput tries to use libwacom on devices with tablet-pad capability
which are detected by ID_INPUT_TABLET_PAD=1 property so assign pointer
class by setting ID_INPUT_MOUSE=1 to devices with mouse buttons and let
libwacom override the class for Wacom pads.

6 years agorules: move input_id rule to a separate file
Michal Suchanek [Mon, 12 Jun 2017 11:43:05 +0000 (13:43 +0200)] 
rules: move input_id rule to a separate file

This places the input_id call after the evdev hwdb calls. With this the
hwdb fixups in evdev can affect the device capabilities assigned in
input_id.

Remove the ID_INPUT_KEY dependency in atkbd rule because it is now not
assigned at this point.

6 years agohwdb: fix help text in 60-keyboard.hwdb
Michal Suchanek [Wed, 7 Jun 2017 17:26:25 +0000 (19:26 +0200)] 
hwdb: fix help text in 60-keyboard.hwdb

udevadm trigger /dev/input/event* does not work
use udevadm trigger --verbose --sysname-match="event*"

6 years agohwdb: support pressing buttons on a keyboard
Michal Suchanek [Wed, 7 Jun 2017 13:28:18 +0000 (15:28 +0200)] 
hwdb: support pressing buttons on a keyboard

Support BTN_* codes with btn_ prefix and keys with KEY_ prefix
optionally removed.

6 years agoUse same script to build key list in Makefile and meson
Michal Suchanek [Tue, 27 Jun 2017 09:48:45 +0000 (11:48 +0200)] 
Use same script to build key list in Makefile and meson

6 years agogpt-auto-generator: disable gpt auto logic for swaps if at least one is defined in... 5976/head
Franck Bui [Mon, 26 Jun 2017 13:23:35 +0000 (15:23 +0200)] 
gpt-auto-generator: disable gpt auto logic for swaps if at least one is defined in fstab

If a swap partition is created on a disk using GPT then the unit generated by
the gpt-generator can shadow the one generated by the fstab-generator.

This can be an issue if the fstab entry for the swap has options since they are
simply ignored if PID1 decides to use the unit created by the gpt-generator
since this unit carries no information about the swap options.

This patch simply disables the GPT auto logic for swaps if at least one entry
for swap is defined in /etc/fstab.

Fixes: #6192
6 years agofstab-util: introduce fstab_has_fstype() helper
Franck Bui [Mon, 26 Jun 2017 13:22:10 +0000 (15:22 +0200)] 
fstab-util: introduce fstab_has_fstype() helper

6 years agofstab-util: don't eat up errors in fstab_is_mount_point()
Franck Bui [Tue, 27 Jun 2017 07:52:12 +0000 (09:52 +0200)] 
fstab-util: don't eat up errors in fstab_is_mount_point()

That way the caller can decide what to do with failures, whether to consider
them or ignore them.

6 years agodoc: Add an example for target units (#5951)
Janne Heß [Tue, 27 Jun 2017 07:50:28 +0000 (09:50 +0200)] 
doc: Add an example for target units (#5951)

This adds an example target unit to the man page of systemd targets.

Closes #67.

6 years agoMerge pull request #6200 from poettering/ioprio-transient
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 01:19:33 +0000 (21:19 -0400)] 
Merge pull request #6200 from poettering/ioprio-transient

6 years agoMerge pull request #6197 from ssahani/ethtool-port
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 00:19:53 +0000 (20:19 -0400)] 
Merge pull request #6197 from ssahani/ethtool-port

ethtool: Fix speed in 593022fa377d40d9a645919759b04c53cf4eace8

6 years agoudev: fix some incorrect usages of CLOCK_BOOTTIME (#6198)
Lennart Poettering [Tue, 27 Jun 2017 00:17:39 +0000 (02:17 +0200)] 
udev: fix some incorrect usages of CLOCK_BOOTTIME (#6198)

CLOCK_BOOTTIME should only be used if we actually want the clock to
count on while we are suspended, and it is hence not useful for normal
code execution time limits, fix that.

Moreover, a couple of uses were even more broken, as
clock_bottime_or_monotonic() was called where actually
now(clock_boottime_or_monotic()) was supposed to be called. Ouch!

Fixes: #5903
6 years agoMerge pull request #6199 from poettering/systemctl-quiet
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 00:16:39 +0000 (20:16 -0400)] 
Merge pull request #6199 from poettering/systemctl-quiet

systemctl: be truly quiet in systemctl when -q is used

6 years agoMerge pull request #6203 from poettering/import-assert
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 00:03:14 +0000 (20:03 -0400)] 
Merge pull request #6203 from poettering/import-assert

remove misplaced importd assert

6 years agoMerge pull request #6160 from poettering/non-pollable-fdstore
Evgeny Vereshchagin [Mon, 26 Jun 2017 21:22:58 +0000 (00:22 +0300)] 
Merge pull request #6160 from poettering/non-pollable-fdstore

support for non-pollable fds in the service fdstore

6 years agosystemd-mount: support device names and multiple arguments for umount (#6096)
Yu Watanabe [Mon, 26 Jun 2017 20:07:07 +0000 (05:07 +0900)] 
systemd-mount: support device names and multiple arguments for umount (#6096)

This makes systemd-umount (or systemd-mount -u) supports multiple arguments
which can be path, device, or fstab style node name, like
`systemd-umount /path/to/umount /dev/sda1 UUID=xxxxxx-xxxx LABEL=xxxxx`.

C.f. https://github.com/systemd/systemd/pull/5235#issuecomment-277731314.

6 years agosmack: handling smack onlycap list (#5542)
WaLyong Cho [Mon, 26 Jun 2017 19:00:03 +0000 (04:00 +0900)] 
smack: handling smack onlycap list (#5542)

To support smack onlycap, read onlycap list from /etc/smack/onlycap and write
to /sys/fs/smackfs/onlycap.

https://lwn.net/Articles/292128/
http://lkml.iu.edu/hypermail/linux/kernel/1505.2/04718.html
http://schaufler-ca.com/description_from_the_linux_source_tree

6 years agoMerge pull request #6116 from richardmaw-codethink/networkd-carrier-fixes
Lennart Poettering [Mon, 26 Jun 2017 18:55:36 +0000 (20:55 +0200)] 
Merge pull request #6116 from richardmaw-codethink/networkd-carrier-fixes

Networkd fixes related to carrier status

6 years agosystemctl: quieten a few more messages if -q is specified 6199/head
Lennart Poettering [Mon, 26 Jun 2017 18:42:08 +0000 (20:42 +0200)] 
systemctl: quieten a few more messages if -q is specified

As suggested by @mbiebl in https://github.com/systemd/systemd/pull/6199

6 years agoimportd: log more information when renaming files 6203/head
Lennart Poettering [Mon, 26 Jun 2017 18:32:40 +0000 (20:32 +0200)] 
importd: log more information when renaming files

6 years agoimport: remove misplaced assert()
Lennart Poettering [Mon, 26 Jun 2017 18:25:07 +0000 (20:25 +0200)] 
import: remove misplaced assert()

We shouldn't assume the final path for the settings file is already
known, it unlikely is unless we already downloaded the image once. Also
add some commenting to explain the code surrounding the assert a bit.

Fixes: #6188
6 years agosd-bus: use GetConnectionCredentials() when querying credentials, if available 6201/head
Lennart Poettering [Mon, 26 Jun 2017 16:52:47 +0000 (18:52 +0200)] 
sd-bus: use GetConnectionCredentials() when querying credentials, if available

Newer D-Bus versions implement the GetConnectionCredentials() driver
call to get all connection creds in one go. Make use of that to reduce
the number of bus calls we do.

When only a single credential field is queried we will still use the old
calls, which we'll also use if the new call isn't implemented.

6 years agosd-bus: when credentials of the "org.freedesktop.DBus" service are queried return...
Lennart Poettering [Mon, 26 Jun 2017 16:24:58 +0000 (18:24 +0200)] 
sd-bus: when credentials of the "org.freedesktop.DBus" service are queried return the bus owner's credentials

The bus driver service is always implemented by the owner of the bus,
hence let's shortcut the credential operation and use our cached data.
This makes sure things simply work, given that dbus itself doesn't
support GetConnectionSELinuxSecurityContext() on the bus driver name
itself.

Fixes: #6120
6 years agocore: when parsing integers passed over the bus use int32_t, not int 6200/head
Lennart Poettering [Mon, 26 Jun 2017 15:41:54 +0000 (17:41 +0200)] 
core: when parsing integers passed over the bus use int32_t, not int

sd-bus will return "i" integers as "int32_t", not "int". Now on all
archs we care about that's the same, but we still should do this
properly.

6 years agocore: make IOSchedulingClass= and IOSchedulingPriority= settable for transient units
Lennart Poettering [Mon, 26 Jun 2017 15:40:08 +0000 (17:40 +0200)] 
core: make IOSchedulingClass= and IOSchedulingPriority= settable for transient units

This patch is a bit more complex thant I hoped. In particular the single
IOScheduling= property exposed on the bus is split up into
IOSchedulingClass= and IOSchedulingPriority= (though compat is
retained). Otherwise the asymmetry between setting props and getting
them is a bit too nasty.

Fixes #5613