Commit Graph

37462 Commits

Author SHA1 Message Date
Lennart Poettering 03ccc7f077 update TODO 2018-12-10 16:09:41 +01:00
Lennart Poettering d742f4b54b cgroup: correct mangling of return values
Let's nor return the unmangled return value before we actually mangle
it.

Fixes: #11062
2018-12-10 16:09:41 +01:00
Lennart Poettering 92a993041a cgroup: call cg_all_unified() right before using the result
Let's not query it before we actually need it.
2018-12-10 16:09:41 +01:00
Lennart Poettering 8f3fd07ac0
Merge pull request #11105 from keszybz/path-parsing
Some tightening of our path parsing code
2018-12-10 15:50:08 +01:00
Thomas Haller 8217ed5ec3 network: fix handling of uninitialized and zero IAID setting
An earlier commit 0e408b82b (dhcp6-client: handle IAID with value zero)
introduced a flag to sd_dhcp6_client to distinguish between an unset
IAID and a value set to zero.

However, that was not sufficient and broke leaving the setting
uninitialized in networkd configuration. The configuration parsing
also must distinguish between the default, unset value and an
explict zero configuration.

Fixes: 0e408b82b8
2018-12-10 14:25:28 +01:00
Zbigniew Jędrzejewski-Szmek 1d4c6f5bef pid1: set Description even for devices which don't exist yet
We'd only set the description after the device appeared in sysfs, so
we'd always print
"A start job is running for dev-disk-by\x2duuid-aaaa ... aaaa.device (42s / 1min 30s)"
Let's make this
"A start job is running for /dev/disk/by-duuid/aaaa ... aaaa (42s / 1min 30s)"

https://bugzilla.redhat.com/show_bug.cgi?id=1655860
2018-12-10 14:00:42 +01:00
Cedric Viou 83f3e954c8 Add RF kill switch button for Zbook 15 G2 (#11060) 2018-12-10 13:20:46 +01:00
Lennart Poettering 2327f95499
Merge pull request #10984 from fbuihuu/tmpfiles-be-more-explicit-with-unsafe-transition
tmpfiles: be more explicit when an unsafe path transition is met
2018-12-10 12:31:56 +01:00
Lennart Poettering ec68d13789
Merge pull request #10897 from keszybz/etc-fstab-parsing
Forbid dashes in hostnames and /etc/fstab parsing improvements
2018-12-10 12:31:30 +01:00
Zbigniew Jędrzejewski-Szmek a5dfc36ce6 fuzz-unit-file: add one more test case
There seems to be no error per se. RequiresMountsFor=%s%s%s..%s%s%s is expanded to
RequiresMountsFor=/bin/zsh/bin/zsh/bin/zsh/bin/zsh/..., which takes a bit of time,
and then we iterate over this a few times, creating a hashmap with a hashmap
for each prefix of the path, each with one item pointing back to the original unit.
Takes about 0.8 s on my machine.
2018-12-10 11:57:26 +01:00
Zbigniew Jędrzejewski-Szmek 4cb06c5949 Use VLA instead of alloca
The test is the same, but an array is more readable.
2018-12-10 11:57:26 +01:00
Zbigniew Jędrzejewski-Szmek 60473f0c23 pid1: fix (harmless) off-by-one in PATH_MAX comparison
PATH_MAX is supposed to include the terminating NUL byte. But we already
check that there is no NUL byte in the specified path. Hence the maximum
length we can expect is PATH_MAX - 1.

This doesn't change much, but makes this use of PATH_MAX consistent with the
rest of the codebase.
2018-12-10 11:57:26 +01:00
Zbigniew Jędrzejewski-Szmek f8703ed7e5 basic/path-util: line-break PATH_FOREACH_PREFIX macros
Now I can see what they do :]
2018-12-10 11:57:26 +01:00
Zbigniew Jędrzejewski-Szmek 296acffe45 When parsing paths, reject anything above PATH_MAX
The check for length is done after path_simplify(), to be nice to paths which
are constructed using specifiers, and have duplicate slashes and stuff.
2018-12-10 11:57:26 +01:00
Lennart Poettering ec9efbd9bc
Merge pull request #11093 from yuwata/update-python-scripts-for-lgtm
Update python scripts for lgtm
2018-12-10 11:13:21 +01:00
Yu Watanabe 416b88013c systemctl: check triggering units only for stopped units
Fixes #11088.
2018-12-10 11:06:28 +01:00
Lennart Poettering e0069f2eb4
Merge pull request #10999 from wkennington/static-neighbor-master
networkd: Static neighbor support
2018-12-10 11:04:14 +01:00
Zbigniew Jędrzejewski-Szmek 5fe7a0a7de basic/hostname-util: do truncation last when cleaning up
This allows more of the original name to be used if there are invalid
chars in the beginning.
2018-12-10 09:56:56 +01:00
Zbigniew Jędrzejewski-Szmek d65652f1f2 Partially unify hostname_is_valid() and dns_name_is_valid()
This makes hostname_is_valid() apply the ldh checks too, rejecting more
hostnames.
2018-12-10 09:56:56 +01:00
Zbigniew Jędrzejewski-Szmek 7470cc4c73 resolve: reject host names with leading or trailing dashes in /etc/hosts
https://tools.ietf.org/html/rfc1035#section-2.3.1 says (approximately)
that only letters, numbers, and non-leading non-trailing dashes are allowed
(for entries with A/AAAA records). We set no restrictions.

hosts(5) says:
> Host names may contain only alphanumeric characters, minus signs ("-"), and
> periods (".").  They must begin with an alphabetic character and end with an
> alphanumeric character.

nss-files follows those rules, and will ignore names in /etc/hosts that do not
follow this rule.

Let's follow the documented rules for /etc/hosts. In particular, this makes us
consitent with nss-files, reducing surprises for the user.

I'm pretty sure we should apply stricter filtering to names received over DNS
and LLMNR and MDNS, but it's a bigger project, because the rules differ
depepending on which level the label appears (rules for top-level names are
stricter), and this patch takes the minimalistic approach and only changes
behaviour for /etc/hosts.

Escape syntax is also disallowed in /etc/hosts, even if the resulting character
would be allowed. Other tools that parse /etc/hosts do not support this, and
there is no need to use it because no allowed characters benefit from escaping.
2018-12-10 09:56:56 +01:00
Zbigniew Jędrzejewski-Szmek bd00527779 resolved: rework parsing of /etc/hosts
Do not treat various errors (missing hostname, invalid address) as fatal,
just warn and continue. /etc/hosts is written by humans and we should not
reject the whole file just because a singly entry is not to our liking.

Handle comments as described in hosts(5):
everything from the comment character until the end of the line should be
ignored.

Fixes #10779.

Add tests.
2018-12-10 09:56:56 +01:00
Franck Bui 145b8d0f68 fs-util: make CHASE_WARN effective with CHASE_NO_AUTOFS
This has the side effect to upgrade the log level at which the log is emitted
from debug to warning.

This might be better since after all we didn't apply a tmpfiles.d/ rule and
that actually might end up being problematic eventually.
2018-12-10 09:22:28 +01:00
Franck Bui b85ee2ec95 fs-util: rename safe_transition() into unsafe_transition()
We're always interested into finding unsafe transitions so let's make the
helper return true when it finds such transitions so we don't need to negate
its results.

No functional changes.
2018-12-10 09:19:14 +01:00
Franck Bui 7f0704da94 tmpfiles: use CHASE_WARN in addition to CHASE_SAFE
and let's emit a more comprehensive warning when an unsafe transition is
encountered.

Before this patch:

 Unsafe symlinks encountered in /run/nrpe, refusing.

After:

 Detected unsafe path transition / → /run during canonicalization of /run/nrpe.
2018-12-10 09:19:14 +01:00
Franck Bui 36c97decbe fs-util: make chase_symlink() returns -ENOLINK when unsafe transitions are met
We previously returned -EPERM but it can be returned for various other reasons
too.

Let's use -ENOLINK instead as this value shouldn't be used currently. This
allows users of CHASE_SAFE to detect without any ambiguities when unsafe
transitions are encountered by chase_symlinks().

All current users of CHASE_SAFE that explicitly reacted on -EPERM have been
converted to react on -ENOLINK.
2018-12-10 09:18:27 +01:00
William A. Kennington III e4a71bf36f networkd: Static neighbor support
When using networkd we currently have no way of ensuring that static
neighbor entries are set when our link comes up. This change adds a new
section to the network definition that allows multiple static neighbors
to be set on a link.
2018-12-09 16:56:37 -08:00
William A. Kennington III 289e6774d0 networkd: Use only a generic CONFIGURING state
This allows us to convey that we are performing multiple link
configuration changes in parallel. This is needed to support configuring
neighbors while simultaneously configuring addresses and routes.
2018-12-09 16:56:00 -08:00
William A. Kennington III c42ff3a1a7 networkd: Track address configuration
This will be useful to assert that our static route configuration always
happens after address configuration once our individual configure state
goes away.
2018-12-09 16:54:37 -08:00
Yu Watanabe d8a0bcfd77 tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00
Yu Watanabe 87421ff560 tools: add one more SPDX license header 2018-12-10 03:08:52 +09:00
Yu Watanabe fc1c09e1df lgtm: use python3 2018-12-10 03:07:17 +09:00
Yu Watanabe 2f6c9b6f3f tools: drop unused variable 2018-12-10 03:07:08 +09:00
Yu Watanabe af182e786c hwdb: drop unused imported object 2018-12-10 03:06:58 +09:00
Yu Watanabe a9f2655dbe hwdb: drop comment 2018-12-10 03:06:44 +09:00
Evgeny Vereshchagin a01eb97b6c
Merge pull request #11095 from evverx/use-systemd-as-pid1-yolo
travis: use systemd as PID1 in debian containers
2018-12-09 16:53:03 +03:00
Zbigniew Jędrzejewski-Szmek 6e076600d0
Merge pull request #10931 from yuwata/daemon-util
sd-daemon: add notify_on_cleanup() helper function and use it where applicable
2018-12-09 12:10:57 +01:00
Zbigniew Jędrzejewski-Szmek 503a1bd37f
Merge pull request #11097 from jwrdegoede/hwdb-sensors5
Hwdb sensors5
2018-12-09 11:50:39 +01:00
Evgeny Vereshchagin f413cd0a6a travis: mount tmpfs on /tmp before running the tests
To judge from https://api.travis-ci.org/v3/job/465547774/log.txt,
overlayfs on Travis CI is having trouble delivering inotify events,
which is why `test-path` and `test-event` are failing there.
2018-12-09 11:46:23 +01:00
Evgeny Vereshchagin ee6776b41a travis: use systemd as PID1 in debian containers
Turns out some tests like `test-execute` are tightly coupled with
systemd as PID1 (which should be fixed of course). In the meantime,
let's see how it goes.
2018-12-09 11:31:01 +01:00
Lennart Poettering be24321f3d mount-point: honour AT_SYMLINK_FOLLOW correctly
Fixes: #11092
2018-12-08 22:43:55 +01:00
Hans de Goede 84e8548313 hwdb: Add accelerometer orientation quirk for the PoV P1005W-232 tablet
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2018-12-08 22:11:39 +01:00
Hans de Goede 76efe240b8 hwdb: Add accelerometer orientation quirk for the Prowise PT301 tablet 2018-12-08 22:11:39 +01:00
Zbigniew Jędrzejewski-Szmek c90ee83400 coding style: reduce text width to 109 characters
Patches are shown on github with a fixed width (no matter how wide the window
is). When line numbers are high (we have some files with 5 digit line numbers),
the diff does not fit, and horizontal scrolling must be used when viewing the
patch. This is super annoying. Let's reduce the width a bit. I think 109 is
still very wide, but at least the github issue should be alleviated.
2018-12-08 10:14:28 +01:00
Yu Watanabe d8dd35fd31 journal-remote: define main through macro
Also, this fixes memleaks on failure.
2018-12-08 18:09:40 +09:00
Yu Watanabe 94952201e1 journal-remote: destroy RemoteServer object by using _cleanup_ attribute 2018-12-08 18:09:40 +09:00
Yu Watanabe f36bb1e182 journal-upload: define main through macro 2018-12-08 18:09:40 +09:00
Yu Watanabe c9ed608679 journal-upload: use _cleanup_ attribute to clear uploader 2018-12-08 18:09:40 +09:00
Yu Watanabe 29cd4c8ffb journal-gateway: define main through macro 2018-12-08 18:09:40 +09:00
Yu Watanabe 0d2a1a2085 journal-gateway: use _cleanup_ attribute to stop microhttpd daemon 2018-12-08 18:09:40 +09:00
Yu Watanabe c03a80c419 wait-online: define main through macro 2018-12-08 18:09:40 +09:00