Yu Watanabe [Fri, 19 Oct 2018 17:34:12 +0000 (02:34 +0900)]
modules-load: return first error in the loop
Follow-up for
a889e206a7434afe28039a1698e5ecf6a3fb7a9b.
Fixes CID#1396280.
Yu Watanabe [Fri, 19 Oct 2018 00:37:08 +0000 (09:37 +0900)]
reply-password: initialize 'length' variable
Follow-up for
1fd2786161feba4276a81c3468cfbfb118f56517.
This fixes the following warning when built by clang:
```
../src/reply-password/reply-password.c:76:21 warning: variable 'length' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
```
Fixes CID#1396281 and CID#1396277.
Yu Watanabe [Fri, 19 Oct 2018 00:19:24 +0000 (09:19 +0900)]
core: use ascii_toupper() instead of everytime judging whether it is the first message
Evgeny Vereshchagin [Sun, 21 Oct 2018 03:21:36 +0000 (03:21 +0000)]
journald: use the "driver" transport for logging a refused connection
Otherwise, these messages can end up in `/dev/null` when journald is run
in containers as was shown in https://github.com/systemd/systemd/pull/10444#issuecomment-
430927793.
Evgeny Vereshchagin [Fri, 12 Oct 2018 12:17:04 +0000 (12:17 +0000)]
sd-journal: escape binary data in match_make_string()
Fixes: #10383
Yu Watanabe [Tue, 23 Oct 2018 13:49:16 +0000 (22:49 +0900)]
udevadm: normalize exit status
After
d354690e7d0429338cdd1c2cfe1fdd08fc53da9e, each udevadm command
returns negative errno on error. So, let's normalize the exit status
of udevadm.
Lennart Poettering [Tue, 23 Oct 2018 17:30:49 +0000 (19:30 +0200)]
Merge pull request #10493 from yuwata/parse-time-overflow
util: check overflow in parse_time() and parse_nsec()
Yu Watanabe [Tue, 23 Oct 2018 13:28:21 +0000 (22:28 +0900)]
bash-completion: analyze: add timespan
Follow-up for
3f1c1287a96dfc146ce894bd6bfff388cba0ab55.
Yu Watanabe [Tue, 23 Oct 2018 13:25:01 +0000 (22:25 +0900)]
test: add tests for detecting overflow in parse_time() and parse_nsec()
Yu Watanabe [Tue, 23 Oct 2018 13:24:16 +0000 (22:24 +0900)]
util: check overflow in parse_nsec()
Yu Watanabe [Tue, 23 Oct 2018 13:23:34 +0000 (22:23 +0900)]
util: check overflow in parse_time()
Chris Down [Mon, 15 Oct 2018 11:55:35 +0000 (12:55 +0100)]
analyze: Add "timespan" command to dump time span in usec
This is useful for a couple of cases, I'm mostly interested in case #1:
1. Verifying "reasonable" values in a trivially scriptable way
2. Debugging unexpected time span parsing directly
Test Plan:
```
% build/systemd-analyze timespan 20
Original: 20
μs: 20
Human: 20us
% build/systemd-analyze timespan 20ms
Original: 20ms
μs: 20000
Human: 20ms
% build/systemd-analyze timespan 20z
Failed to parse time span '20z': Invalid argument
```
Zbigniew Jędrzejewski-Szmek [Tue, 23 Oct 2018 11:43:33 +0000 (13:43 +0200)]
Merge pull request #10395 from yuwata/udev-cleanup-9
udev-builtin: replace udev_device by sd_device
Yu Watanabe [Tue, 23 Oct 2018 09:26:06 +0000 (18:26 +0900)]
udev-builtin: propagate negative errno
Yu Watanabe [Mon, 22 Oct 2018 04:47:06 +0000 (13:47 +0900)]
udevadm-test-builtin: use find_device()
This also fixes minor memleak.
Yu Watanabe [Mon, 22 Oct 2018 04:46:35 +0000 (13:46 +0900)]
udevadm: use path friendly functions
Yu Watanabe [Mon, 22 Oct 2018 03:04:52 +0000 (12:04 +0900)]
udev: propagate original error from udev_builtin_add_property()
Yu Watanabe [Mon, 22 Oct 2018 03:04:33 +0000 (12:04 +0900)]
udev: logs error in udev_builtin_add_property()
Yu Watanabe [Mon, 22 Oct 2018 03:04:13 +0000 (12:04 +0900)]
sd-device: introduce log_device_*() macros
Yu Watanabe [Sat, 13 Oct 2018 18:09:13 +0000 (03:09 +0900)]
udev-builtin: modernize code a bit
- introduce _UDEV_BUILTIN_INVALID,
- use _UDEV_BUILTIN_MAX where applicable,
- add several assertions.
Yu Watanabe [Sat, 13 Oct 2018 17:01:58 +0000 (02:01 +0900)]
udevadm-test-builtin: replace udev_device by sd_device
Yu Watanabe [Sat, 13 Oct 2018 16:40:57 +0000 (01:40 +0900)]
udev: drop libudev-private.h from udev-builtin-{hwdb,net_id}.c
Yu Watanabe [Sat, 13 Oct 2018 16:38:54 +0000 (01:38 +0900)]
udev: make udev_builtin_run take sd_device
Yu Watanabe [Sat, 13 Oct 2018 16:32:28 +0000 (01:32 +0900)]
udev-builtin: simplify code a bit
Yu Watanabe [Sat, 13 Oct 2018 16:22:14 +0000 (01:22 +0900)]
udev: replace udev_device by sd_device from prototype of udev builtin commands
Yu Watanabe [Sat, 13 Oct 2018 16:14:10 +0000 (01:14 +0900)]
udev: replace udev_device by sd_device in udev-builtin-usb_id.c
Yu Watanabe [Sat, 13 Oct 2018 16:12:22 +0000 (01:12 +0900)]
udev: replace udev_device by sd_device in udev-builtin-uaccess.c
Yu Watanabe [Sat, 13 Oct 2018 16:10:40 +0000 (01:10 +0900)]
udev: replace udev_device by sd_device in udev-builtin-path_id.c
Yu Watanabe [Sat, 13 Oct 2018 16:06:50 +0000 (01:06 +0900)]
udev: replace udev_device by sd_device in udev-builtin-net_setup_link.c
Yu Watanabe [Sat, 13 Oct 2018 16:04:29 +0000 (01:04 +0900)]
udev: replace udev_device by sd_device in udev-builtin-net_id.c
Yu Watanabe [Sat, 13 Oct 2018 16:01:11 +0000 (01:01 +0900)]
udev: replace udev_device by sd_device in udev-builtin-keyboard.c
Yu Watanabe [Sat, 13 Oct 2018 15:54:05 +0000 (00:54 +0900)]
udev: replace udev_device by sd_device in udev-builtin-input_id.c
Yu Watanabe [Sat, 13 Oct 2018 15:48:04 +0000 (00:48 +0900)]
udev: replace udev_device by sd_device in udev-builtin-blkid.c
Yu Watanabe [Sat, 13 Oct 2018 15:42:43 +0000 (00:42 +0900)]
udev: replace udev_device by sd_device in udev-builtin-hwdb.c
Yu Watanabe [Sat, 13 Oct 2018 15:28:40 +0000 (00:28 +0900)]
udev: make udev_builtin_add_property() take sd_device instead of udev_device
Evgeny Vereshchagin [Tue, 23 Oct 2018 07:09:23 +0000 (10:09 +0300)]
tests: allow passing log_level via an environment variable (#10490)
Michael Biebl [Mon, 22 Oct 2018 22:29:03 +0000 (00:29 +0200)]
tests: update networkd-test.py to use resolvectl instead of systemd-resolve (#10486)
The latter is merely a compat symlink nowadays.
Lennart Poettering [Mon, 22 Oct 2018 19:43:58 +0000 (21:43 +0200)]
Merge pull request #7411 from joergsteffens/tapechanger
udev-rules: extend tape and tape changer rules
Lennart Poettering [Mon, 22 Oct 2018 19:33:23 +0000 (21:33 +0200)]
Merge pull request #10477 from yuwata/fix-10474
network: include linux/fou.h if it exists
Lennart Poettering [Mon, 22 Oct 2018 13:15:45 +0000 (15:15 +0200)]
Merge pull request #10415 from poettering/boot-loader-spec-tweaks
docs: tweaks to the boot loader spec
Zbigniew Jędrzejewski-Szmek [Sun, 21 Oct 2018 17:48:20 +0000 (19:48 +0200)]
systemd-nspawn: do not crash on /var/log/journal creation if not required
When running a read-only file system, we might not be able to create
/var/log/journal. Do not fail on this, unless actually requested by the
--link-journal options.
$ systemd-nspawn --image=image.squashfs ...
Yu Watanabe [Sun, 21 Oct 2018 09:35:46 +0000 (18:35 +0900)]
missing: support old linux/fou.h
linux/fou.h was introduced in 3.18.
FOU_ATTR_REMCSUM_NOPARTIAL was added in 4.0.
FOU_CMD_GET was added in 4.1.
Follow-up for
53cb501a1314740fa777f145067cefccda954487.
Fixes #10474.
Lennart Poettering [Fri, 19 Oct 2018 21:04:22 +0000 (23:04 +0200)]
Merge pull request #9437 from poettering/sd-boot-count
many sd-boot/bootctl fixes, and a new "boot counting" concept, for automatic fallback to older kernels on persistent failures
Tobias Jungel [Fri, 19 Oct 2018 11:12:35 +0000 (13:12 +0200)]
networkd: keep bond slave up if already attached
There is no need to disable an already correct enslaved interface.
relates to #10118
Li Song [Fri, 19 Oct 2018 17:41:51 +0000 (13:41 -0400)]
sd-dhcp: remove unreachable route after rebinding return NAK
Lennart Poettering [Fri, 19 Oct 2018 20:58:53 +0000 (22:58 +0200)]
Merge pull request #10470 from yuwata/log-message-updates
Log message updates
Lennart Poettering [Wed, 17 Oct 2018 09:42:11 +0000 (11:42 +0200)]
boot-loader-spec: drop link to obsolete patch
This is not what distros use, let's not point users to obsolete stuff.
Lennart Poettering [Wed, 17 Oct 2018 09:38:57 +0000 (11:38 +0200)]
update TODO
Lennart Poettering [Wed, 17 Oct 2018 09:38:45 +0000 (11:38 +0200)]
boot-loader-spec: elaborate on 'architecture' stanza a bit and use it in the example
Lennart Poettering [Tue, 16 Oct 2018 10:01:18 +0000 (12:01 +0200)]
docs: tweaks to the boot loader spec
A couple of changes:
1. Clearly name the drop-in entry files "Type #1", and the unified
kernel images "Type #2", and be clearer that the latter is specific
to UEFI.
2. Suffix all directory paths with a trailing "/" to clarify that these
are directories. Also, enclose them all in ``.
3. Add introductory paragraph that explains that there is Type #1 and
Type #2 and what they are about.
4. Explain that Type #2 is about signed UEFI SecureBoot.
5. Don't claim that $BOOT/loader/ contains really all files defined by
the spec, because that's not true, Type #2 images are not located there
after all.
Fixes: #10399
Lennart Poettering [Wed, 27 Jun 2018 18:31:34 +0000 (20:31 +0200)]
man: use proper <keycap> and <keycombo> docbook tags for key bindings
Lennart Poettering [Tue, 26 Jun 2018 21:52:11 +0000 (23:52 +0200)]
doc: add a markdown document introducing the boot assessment logic
Lennart Poettering [Tue, 26 Jun 2018 20:11:35 +0000 (22:11 +0200)]
man: document boot counting logic in systemd-boot
Lennart Poettering [Tue, 26 Jun 2018 13:46:28 +0000 (15:46 +0200)]
man: document systemd-bless-boot-generator
Lennart Poettering [Tue, 26 Jun 2018 13:14:57 +0000 (15:14 +0200)]
man: document systemd-boot-check-no-failures.service
Lennart Poettering [Tue, 26 Jun 2018 13:03:27 +0000 (15:03 +0200)]
man: document systemd-bless-boot
Lennart Poettering [Mon, 25 Jun 2018 19:48:33 +0000 (21:48 +0200)]
man: document the various EFI vars sd-boot sets
Lennart Poettering [Mon, 25 Jun 2018 14:07:33 +0000 (16:07 +0200)]
units: add simple boot check unit
This is might be useful in some cases, but it's primarily an example for
a boot check service that can be plugged before boot-complete.target.
It's disabled by default.
All it does is check whether the failed unit count is zero
Lennart Poettering [Fri, 22 Jun 2018 16:14:22 +0000 (18:14 +0200)]
man: update kernel-install(8) documentation
Many general updates, but most importantly, document the
/etc/kernel/tries logic briefly.
Lennart Poettering [Fri, 22 Jun 2018 15:35:53 +0000 (17:35 +0200)]
kernel-install: teach bot loader spec entry generator to generate entries with "tries"
This makes two changes:
1. When called for "remove" any drop-ins with "+" suffix are removed
too, so that the logic works for entries with boot counting enabled
too and we don't lose track of configuration snippets created that
way.
2. When called for "add" we optionally generate a "+" suffix, based on
the data in /etc/kernel/tries if it exists.
This basically means after "echo 5 > /etc/kernel/tries" any installed
kernels will automatically set up for 5 boot tries before older
kernels will be tried.
Lennart Poettering [Fri, 22 Jun 2018 15:00:47 +0000 (17:00 +0200)]
add "systemd-bless-boot-generator"
This generator automatically pulls in "systemd-bless-boot.service" if
a boot with boot counting is detected.
Lennart Poettering [Mon, 25 Jun 2018 15:24:09 +0000 (17:24 +0200)]
add new systemd-bless-boot.service that marks boots as successful
This is the counterpiece to the boot counting implemented in
systemd-boot: if a boot is detected as successful we mark drop the
counter again from the booted snippet or kernel image.
Lennart Poettering [Mon, 25 Jun 2018 15:21:34 +0000 (17:21 +0200)]
man: document new "boot-complete.target" unit
Lennart Poettering [Fri, 22 Jun 2018 10:52:28 +0000 (12:52 +0200)]
units: add generic boot-complete.target
Lennart Poettering [Fri, 22 Jun 2018 15:16:18 +0000 (17:16 +0200)]
update TODO
Yu Watanabe [Fri, 19 Oct 2018 18:00:46 +0000 (03:00 +0900)]
tree-wide: replace 'unsigned int' with 'unsigned'
Lennart Poettering [Fri, 19 Oct 2018 20:05:50 +0000 (22:05 +0200)]
Merge pull request #10462 from yuwata/test-sd-device-monitor
Add tests for sd_device_monitor and small cleanups
Yu Watanabe [Fri, 19 Oct 2018 16:59:52 +0000 (01:59 +0900)]
nspawn: do not include '%m' in log message if errno is zero
Yu Watanabe [Fri, 19 Oct 2018 16:55:32 +0000 (01:55 +0900)]
import: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 16:55:06 +0000 (01:55 +0900)]
gpt-auto-generator: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 16:54:52 +0000 (01:54 +0900)]
firstboot: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 16:54:29 +0000 (01:54 +0900)]
dissect: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 16:43:13 +0000 (01:43 +0900)]
coredump: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 16:40:42 +0000 (01:40 +0900)]
core: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 16:01:31 +0000 (01:01 +0900)]
cgtop: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 15:57:53 +0000 (00:57 +0900)]
busctl: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 15:52:45 +0000 (00:52 +0900)]
bootctl: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 15:48:21 +0000 (00:48 +0900)]
fs-util: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 15:46:33 +0000 (00:46 +0900)]
analyze: include error cause in the log message
Yu Watanabe [Fri, 19 Oct 2018 15:43:02 +0000 (00:43 +0900)]
analyze: update log message
Lennart Poettering [Fri, 19 Oct 2018 15:07:46 +0000 (17:07 +0200)]
tree-wide: some automatic coccinelle fixes (#10463)
Nothing fancy, just coccinelle doing its work.
Yu Watanabe [Fri, 19 Oct 2018 02:58:25 +0000 (11:58 +0900)]
test: add tests for sd_device_monitor
Lennart Poettering [Fri, 19 Oct 2018 08:48:41 +0000 (10:48 +0200)]
Merge pull request #10457 from yuwata/fuzz-11019
sd-dhcp: fixes oss-fuzz#11019 and several cleanups
Evgeny Vereshchagin [Thu, 18 Oct 2018 05:47:26 +0000 (05:47 +0000)]
core: stop ignoring errors in connect_logger_as
When journald reaches the maximum number of active streams, it,
basically, starts to decline new connections. On the client
side it can be detected by getting EPIPE and, if the writing
process isn't lucky enough, getting SIGPIPE soon afterwards.
systemd has always ignored EPIPE, which makes it very hard
to keep track of services losing logs. This patch should make
it easier to detect such services by just staring at the logs
carefully.
In case anyone is interested, the following one-liner run as any user
can be used to paralyze all the stream logging on a machine:
for i in {1..4096}; do systemd-cat -t HEY-$i & done
Lennart Poettering [Fri, 19 Oct 2018 08:12:00 +0000 (10:12 +0200)]
Merge pull request #10460 from yuwata/setsockopt_int-more
tree-wide: use setsockopt_int() more
Yu Watanabe [Fri, 19 Oct 2018 02:57:54 +0000 (11:57 +0900)]
sd-device-monitor: include error cause in log message
Yu Watanabe [Fri, 19 Oct 2018 02:57:29 +0000 (11:57 +0900)]
sd-device-monitor: drop unnecessary condition
Lennart Poettering [Fri, 19 Oct 2018 00:04:12 +0000 (02:04 +0200)]
core: beautify per-unit consumed resources log message a bit. (#10390)
Shorten message to say "no IP traffic" if there is no IP traffic, rather
than "received 0B IP traffic, sent 0B IP traffic".
Fixes: #9816
Yu Watanabe [Thu, 18 Oct 2018 23:57:51 +0000 (08:57 +0900)]
Merge pull request #10437 from poettering/env-util-love
some env-util.c love
Yu Watanabe [Thu, 18 Oct 2018 23:48:37 +0000 (08:48 +0900)]
Merge pull request #10389 from poettering/nspawn-path-fix
nspawn $PATH execvpe() fix
Yu Watanabe [Thu, 18 Oct 2018 23:44:51 +0000 (08:44 +0900)]
Merge pull request #10450 from poettering/foreach-line-excorcism
FOREACH_LINE excorcism
Yu Watanabe [Thu, 18 Oct 2018 23:36:01 +0000 (08:36 +0900)]
Merge pull request #10447 from poettering/fgets-excorcism
let's get rid of fgets()
Yu Watanabe [Thu, 18 Oct 2018 21:11:49 +0000 (06:11 +0900)]
sd-dhcp6: drop empty 'error' label
Yu Watanabe [Thu, 18 Oct 2018 19:59:18 +0000 (04:59 +0900)]
test-dhcp6-client: normalize logs
Yu Watanabe [Thu, 18 Oct 2018 18:45:46 +0000 (03:45 +0900)]
fuzz: add testcase of oss-fuzz#11019
Yu Watanabe [Thu, 18 Oct 2018 18:42:10 +0000 (03:42 +0900)]
sd-dhcp6: make dhcp6_option_parse_domainname() not store empty domain
This improves performance of fuzzer.
C.f. oss-fuzz#11019.
Yu Watanabe [Thu, 18 Oct 2018 18:40:30 +0000 (03:40 +0900)]
sd-dhcp6: do not update serverid when ENOMEM
Yu Watanabe [Thu, 18 Oct 2018 18:38:59 +0000 (03:38 +0900)]
sd-dhcp6: coding style cleanups
Yu Watanabe [Thu, 18 Oct 2018 18:44:56 +0000 (03:44 +0900)]
sd-dhcp6: fix argument and error handling of dhcp6_option_parse_status()
Yu Watanabe [Thu, 18 Oct 2018 21:03:19 +0000 (06:03 +0900)]
resolved-mdns: use TAKE_FD()