]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoMove tests for *serialize_environment into test-serialize.c 10536/head
Zbigniew Jędrzejewski-Szmek [Fri, 26 Oct 2018 10:30:04 +0000 (12:30 +0200)] 
Move tests for *serialize_environment into test-serialize.c

The implementation is in serialize.c.

5 years agotest-serialize: allocate long_string dynamically
Zbigniew Jędrzejewski-Szmek [Fri, 26 Oct 2018 11:17:44 +0000 (13:17 +0200)] 
test-serialize: allocate long_string dynamically

5 years agotest-serialize: a smoke test for the serialization functions
Zbigniew Jędrzejewski-Szmek [Tue, 23 Oct 2018 10:00:31 +0000 (12:00 +0200)] 
test-serialize: a smoke test for the serialization functions

5 years agotest: _cleanup_(unlink_tempfilep) in two more places
Zbigniew Jędrzejewski-Szmek [Tue, 23 Oct 2018 08:50:38 +0000 (10:50 +0200)] 
test: _cleanup_(unlink_tempfilep) in two more places

5 years agoIntroduce fmkostemp_safe and use it in tests
Zbigniew Jędrzejewski-Szmek [Tue, 23 Oct 2018 08:50:09 +0000 (10:50 +0200)] 
Introduce fmkostemp_safe and use it in tests

No functional change.

5 years agoMerge pull request #10519 from poettering/serialize-fixes
Zbigniew Jędrzejewski-Szmek [Fri, 26 Oct 2018 10:17:13 +0000 (12:17 +0200)] 
Merge pull request #10519 from poettering/serialize-fixes

pid1 serialization/deserialization fixes

5 years agoCODING_STYLE: briefly mention that fgets() should not be used anymore 10519/head
Lennart Poettering [Fri, 19 Oct 2018 19:56:10 +0000 (21:56 +0200)] 
CODING_STYLE: briefly mention that fgets() should not be used anymore

5 years agofileio: drop FOREACH_LINE(), it's not used anymore
Lennart Poettering [Fri, 19 Oct 2018 19:56:29 +0000 (21:56 +0200)] 
fileio: drop FOREACH_LINE(), it's not used anymore

5 years agocore: rework serialization
Lennart Poettering [Wed, 17 Oct 2018 18:40:09 +0000 (20:40 +0200)] 
core: rework serialization

Let's be more careful with what we serialize: let's ensure we never
serialize strings that are longer than LONG_LINE_MAX, so that we know we
can read them back with read_line(…, LONG_LINE_MAX, …) safely.

In order to implement this all serialization functions are move to
serialize.[ch], and internally will do line size checks. We'd rather
skip a serialization line (with a loud warning) than write an overly
long line out. Of course, this is just a second level protection, after
all the data we serialize shouldn't be this long in the first place.

While we are at it also clean up logging: while serializing make sure to
always log about errors immediately. Also, (void)ify all calls we don't
expect errors in (or catch errors as part of the general
fflush_and_check() at the end.

5 years agocore: make manager_serialize() a bit easier to read by adding predicate function
Lennart Poettering [Wed, 17 Oct 2018 18:35:28 +0000 (20:35 +0200)] 
core: make manager_serialize() a bit easier to read by adding predicate function

The predicate function manager_timestamp_shall_serialize() simply says
whether to serialize or not serialize a timestamp, and should make
things a bit easier to read.

5 years agocore: strjoina() in a loop is never OK
Lennart Poettering [Wed, 17 Oct 2018 18:32:20 +0000 (20:32 +0200)] 
core: strjoina() in a loop is never OK

Let's use plain strjoin() instead.

5 years agoautomount: fix deserialization of dev_t
Lennart Poettering [Wed, 17 Oct 2018 18:15:26 +0000 (20:15 +0200)] 
automount: fix deserialization of dev_t

let's prefer "unsigned long" rather than "unsigned", in case there are
archs that have 32bit int, but 64bit dev_t.

(Also one cast was wrong anyway.)

5 years agocore: enforce a limit on STATUS= texts recvd from services
Lennart Poettering [Wed, 17 Oct 2018 16:37:48 +0000 (18:37 +0200)] 
core: enforce a limit on STATUS= texts recvd from services

Let's better be safe than sorry, and put a limit on what we receive.

5 years agocore: when deserializing state always use read_line(…, LONG_LINE_MAX, …)
Lennart Poettering [Wed, 17 Oct 2018 16:36:24 +0000 (18:36 +0200)] 
core: when deserializing state always use read_line(…, LONG_LINE_MAX, …)

This should be much better than fgets(), as we can read substantially
longer lines and overly long lines result in proper errors.

Fixes a vulnerability discovered by Jann Horn at Google.

CVE-2018-15686
LP: #1796402
https://bugzilla.redhat.com/show_bug.cgi?id=1639071

5 years agoMerge pull request #10525 from poettering/journal-vaccum-all
Zbigniew Jędrzejewski-Szmek [Fri, 26 Oct 2018 08:36:25 +0000 (10:36 +0200)] 
Merge pull request #10525 from poettering/journal-vaccum-all

journald: add ability to vacuum active files too

5 years agoMerge pull request #10522 from lnykryn/initrd_debug
Zbigniew Jędrzejewski-Szmek [Fri, 26 Oct 2018 08:08:39 +0000 (10:08 +0200)] 
Merge pull request #10522 from lnykryn/initrd_debug

Let's make systemd-debug-generator usable also in initrd

5 years agoman: journalctl: expand description of --all
Lucas Werkmeister [Thu, 25 Oct 2018 21:34:05 +0000 (23:34 +0200)] 
man: journalctl: expand description of --all

In the default journalctl output, unprintable entries are abbreviated as
“[<amount> blob data]”; using the same term in the documentation helps
users to quickly discover the option they need to add in order to see
those entries.

5 years agosd-device: fix wrong assertion (#10530)
Yu Watanabe [Fri, 26 Oct 2018 01:16:00 +0000 (10:16 +0900)] 
sd-device: fix wrong assertion (#10530)

5 years agoMerge pull request #10523 from poettering/fd-get-path-optimize
Yu Watanabe [Fri, 26 Oct 2018 00:34:07 +0000 (09:34 +0900)] 
Merge pull request #10523 from poettering/fd-get-path-optimize

fd_get_path() optimization

5 years agocore: reword polkit request a bit (#10524)
Lennart Poettering [Thu, 25 Oct 2018 21:01:41 +0000 (23:01 +0200)] 
core: reword polkit request a bit (#10524)

"killing" is very UNIX terminology, and not really what this is about.
Let's be more correct and say "send a UNIX signal" for the operation.

Otherwise things are really weird if users call "journalctl --rotate"
from the command line, which internally asks systemd to send SIGUSR2 to
to journald: when german locale is selected this asks the user — roughly
transliterated — whether they want to "eliminate" journald, which is
definitely not the intended meaning.

5 years agojournal-file: structured initialization is your friend 10525/head
Lennart Poettering [Thu, 25 Oct 2018 19:35:32 +0000 (21:35 +0200)] 
journal-file: structured initialization is your friend

5 years agojournald: when we are asked to rotate all files, let's also look at closed files
Lennart Poettering [Thu, 25 Oct 2018 16:39:27 +0000 (18:39 +0200)] 
journald: when we are asked to rotate all files, let's also look at closed files

Before this when asked for rotation we'd only rotate files we have open
anyway. However there might be a number of other files on disk that are
active (i.e. not archived yet) but not open. Let's take care of those
too, so that rotation is always comprehensive, and the user gets the
guarantee that afterthe rotation all stored data is in archived files.

Fixes: #1017
5 years agoman: document the new combined --vacuum*= and --rotate invocation
Lennart Poettering [Thu, 25 Oct 2018 19:16:38 +0000 (21:16 +0200)] 
man: document the new combined --vacuum*= and --rotate invocation

5 years agojournalctl: fix error number in error message
Lennart Poettering [Thu, 25 Oct 2018 16:38:50 +0000 (18:38 +0200)] 
journalctl: fix error number in error message

5 years agojournalctl: add ability to vacuum and rotate in one step
Lennart Poettering [Thu, 25 Oct 2018 16:36:56 +0000 (18:36 +0200)] 
journalctl: add ability to vacuum and rotate in one step

journalctl --vacuum-*= only vacuums archived files. To archive all
active files the rotate operation is used. Let's add a new switch that
combines both, so that the user a single command to first move all
running journal files into archival and then vacuum them.

See: #1017

5 years agojournald: log about an OOM condition
Lennart Poettering [Thu, 25 Oct 2018 16:35:55 +0000 (18:35 +0200)] 
journald: log about an OOM condition

5 years agojournald: debug log when we cannot read the machine ID
Lennart Poettering [Thu, 25 Oct 2018 16:35:39 +0000 (18:35 +0200)] 
journald: debug log when we cannot read the machine ID

5 years agojournal-file: refactor journal_file_open_reliably()
Lennart Poettering [Thu, 25 Oct 2018 17:23:23 +0000 (19:23 +0200)] 
journal-file: refactor journal_file_open_reliably()

Let's split out the part that actually renames the file in case we can't
open it into a new function journal_file_dispose().

This way we can reuse the function in other cases where we want to open
a file but can't.

5 years agojournal-file: refactor journal_file_rotate()
Lennart Poettering [Thu, 25 Oct 2018 16:33:11 +0000 (18:33 +0200)] 
journal-file: refactor journal_file_rotate()

Let's split the function in three: the part where we archive the old
file into journal_file_archive(), and the part where we initiate the
deferred closing into journal_file_initiate_close().
journal_file_rotate() then simply becomes a wrapper around these two
calls, and the opening of the new journal file.

This useful so that we can archive journal files without having to open
new ones, i.e. to do only the archival part of the rotation, without the
rotation part.

5 years agojournal: refactor out loop that processes deferred closes into its own function
Lennart Poettering [Thu, 25 Oct 2018 15:42:30 +0000 (17:42 +0200)] 
journal: refactor out loop that processes deferred closes into its own function

5 years agojournal: fix some type confusion in journal_directory_vacuum()
Lennart Poettering [Thu, 25 Oct 2018 15:40:41 +0000 (17:40 +0200)] 
journal: fix some type confusion in journal_directory_vacuum()

Let's store array sizes and indexes in size_t. And let's count numbers
of files in uint64_t (simply because that is the type of the input
parameter for this of the function)

5 years agojournald: use structured initialization
Lennart Poettering [Thu, 25 Oct 2018 10:30:48 +0000 (12:30 +0200)] 
journald: use structured initialization

5 years agojournald: use usec_sub_unsigned() where we can
Lennart Poettering [Thu, 25 Oct 2018 10:30:36 +0000 (12:30 +0200)] 
journald: use usec_sub_unsigned() where we can

5 years agofd-util: optimize fd_get_path() a bit 10523/head
Lennart Poettering [Thu, 25 Oct 2018 19:27:00 +0000 (21:27 +0200)] 
fd-util: optimize fd_get_path() a bit

journald calls fd_get_path() a lot (it probably shouldn't, there's some
room for improvement there, but I'll leave that for another time), hence
it's worth optimizing the call a bit, in particular as it's easy.

Previously we'd open the dir /proc/self/fd/ first, before reading the
symlink inside it. This means the whole function requires three system
calls: open(), readlinkat(), close(). The reason for doing it this way
is to distinguish the case when we see ENOENT because /proc is not
mounted and the case when the fd doesn't exist.

With this change we'll directly go for the readlink(), and only if that
fails do an access() to see if /proc is mounted at all.

This optimizes the common case (where the fd is valid and /proc
mounted), in favour of the uncommon case (where the fd doesn#t exist or
/proc is not mounted).

5 years agofs-util: increase start buffer size in readlinkat_malloc()
Lennart Poettering [Thu, 25 Oct 2018 19:16:47 +0000 (21:16 +0200)] 
fs-util: increase start buffer size in readlinkat_malloc()

I noticed while profiling journald that we invoke readlinkat() a ton on
open /proc/self/fd/<fd>, and that the returned paths are more often than
not longer than the 99 chars used before, when we look at archived
journal files. This means for these cases we generally need to execute
two rather than one syscalls.

Let's increase the buffer size a tiny bit, so that we reduce the number
of syscalls executed. This is really a low-hanging fruit of
optimization.

5 years agodebug-generator: introduce rd.* version of all options 10522/head
Lukas Nykryn [Thu, 25 Oct 2018 14:34:00 +0000 (16:34 +0200)] 
debug-generator: introduce rd.* version of all options

5 years agoMerge pull request #10378 from poettering/json-fuzz-fix
Zbigniew Jędrzejewski-Szmek [Thu, 25 Oct 2018 14:25:39 +0000 (16:25 +0200)] 
Merge pull request #10378 from poettering/json-fuzz-fix

json: a comprehensive fix for oss-fuzz#10908

5 years agoproc-cmdline: introduce PROC_CMDLINE_RD_STRICT
Lukas Nykryn [Thu, 25 Oct 2018 14:21:26 +0000 (16:21 +0200)] 
proc-cmdline: introduce PROC_CMDLINE_RD_STRICT

Our current set of flags allows an option to be either
use just in initrd or both in initrd and normal system.
This new flag is intended to be used in the case where
you want apply some settings just in initrd or just
in normal system.

5 years agoMerge pull request #10518 from poettering/dhcp6-size-fixes
Lennart Poettering [Thu, 25 Oct 2018 11:29:42 +0000 (13:29 +0200)] 
Merge pull request #10518 from poettering/dhcp6-size-fixes

dhcp6 packet size calculation fixes

5 years agoMerge pull request #10504 from poettering/hibernate-fallback
Zbigniew Jędrzejewski-Szmek [Thu, 25 Oct 2018 10:54:47 +0000 (12:54 +0200)] 
Merge pull request #10504 from poettering/hibernate-fallback

s2h: when hibernate fails after coming back from suspend, go back to suspend

5 years agocore: don't create Requires for workdir if "missing ok"
Martin Wilck [Wed, 24 Oct 2018 11:22:01 +0000 (13:22 +0200)] 
core: don't create Requires for workdir if "missing ok"

Don't add an implicit RequiresMountsFor depenency for the
WorkingDirectory of a unit if the "-" character was used to
indicate that "a missing working directory is not considered fatal"
(see systemd.exec(5)). Otherwise systemd might fail the unit
because of missing dependencies.

5 years agodhcp6: prefer offsetof() over sizeof() for structs with undefined sizes 10518/head
Lennart Poettering [Fri, 19 Oct 2018 10:14:22 +0000 (12:14 +0200)] 
dhcp6: prefer offsetof() over sizeof() for structs with undefined sizes

This doesn't change anything in the generated source, but I think makes
semantically more sense, as these structures have undefined size, and we
only want to know the size up to the data field in these cases.

5 years agodhcp6: make sure we have enough space for the DHCP6 option header
Lennart Poettering [Fri, 19 Oct 2018 10:12:33 +0000 (12:12 +0200)] 
dhcp6: make sure we have enough space for the DHCP6 option header

Fixes a vulnerability originally discovered by Felix Wilhelm from
Google.

CVE-2018-15688
LP: #1795921
https://bugzilla.redhat.com/show_bug.cgi?id=1639067

5 years agodhcp6: reduce whitespace a bit
Lennart Poettering [Fri, 19 Oct 2018 10:11:59 +0000 (12:11 +0200)] 
dhcp6: reduce whitespace a bit

5 years agodhcp6: split assert_return() to be more debuggable when hit
Lennart Poettering [Fri, 19 Oct 2018 10:11:48 +0000 (12:11 +0200)] 
dhcp6: split assert_return() to be more debuggable when hit

5 years agodhcp6: constify things where we can
Lennart Poettering [Fri, 19 Oct 2018 10:11:29 +0000 (12:11 +0200)] 
dhcp6: constify things where we can

5 years agostring-util: fix prototype of explicit_bzero_safe() (#10513)
Yu Watanabe [Thu, 25 Oct 2018 02:41:55 +0000 (11:41 +0900)] 
string-util: fix prototype of explicit_bzero_safe() (#10513)

Follow-up for 87f54463117654af48d6027986c2b21831d41616.

5 years agotime-util: change parse_sec_fix_0() to accept "0s" for infinity too (#10501)
Lennart Poettering [Wed, 24 Oct 2018 20:21:28 +0000 (22:21 +0200)] 
time-util: change parse_sec_fix_0() to accept "0s" for infinity too (#10501)

This function is about compatibility, nothing else, hence we should make
it properly compatible.

Fixes: #9556
5 years agoMerge pull request #10510 from poettering/uacess-brackets
Lennart Poettering [Wed, 24 Oct 2018 20:18:33 +0000 (22:18 +0200)] 
Merge pull request #10510 from poettering/uacess-brackets

coverity fixes

5 years agoman: fix wording a bit on the cgroup accountings options (#10509)
Lennart Poettering [Wed, 24 Oct 2018 20:08:07 +0000 (22:08 +0200)] 
man: fix wording a bit on the cgroup accountings options (#10509)

The &MEMORY_ACCOUNTING_DEFAULT; resolves to "yes" or "no" while the rest
of the paragraph talked about "on" and "off". Let's adjust this and
stick to "yes" and "no"...

Quite frankly I think it's not a particularly good idea to change the
docs based configuration changes... THis can only be incomplete, and the
wording is still very awkward since we repeat the same sentence twice.

5 years agoMerge pull request #10505 from poettering/have-namespace
Lennart Poettering [Wed, 24 Oct 2018 20:00:42 +0000 (22:00 +0200)] 
Merge pull request #10505 from poettering/have-namespace

skip various test-execute tests when we have no namespacing

5 years agounits: drop systemd-user-sessions.service ordering dep on systemd-journal-flush.servi...
Lennart Poettering [Wed, 24 Oct 2018 19:41:02 +0000 (21:41 +0200)] 
units: drop systemd-user-sessions.service ordering dep on systemd-journal-flush.service (#10502)

THis dep existed since the unit was introduced, but I cannot see what
good it would do. Hence in the interest of simplifying things, let's
drop it. If breakages appear later we can certainly revert this again.

Fixes: #10469
5 years agostring-util: introduce explicit_zero_safe() 10510/head
Lennart Poettering [Wed, 24 Oct 2018 19:00:15 +0000 (21:00 +0200)] 
string-util: introduce explicit_zero_safe()

The only real difference is that this wrapper can deal with NULL
pointer arguments, but only if the length is also zero.

CID 1396277

5 years agoudev: use right error variable to make level decision
Lennart Poettering [Wed, 24 Oct 2018 18:47:52 +0000 (20:47 +0200)] 
udev: use right error variable to make level decision

5 years agoudev: fix bad if {}
Lennart Poettering [Wed, 24 Oct 2018 18:46:41 +0000 (20:46 +0200)] 
udev: fix bad if {}

CID 1396318
CID 1396319

5 years agotest: skip various tests if namespacing is not available 10505/head
Lennart Poettering [Wed, 24 Oct 2018 14:53:14 +0000 (16:53 +0200)] 
test: skip various tests if namespacing is not available

Apparently on Debian LXC/AppArmor doesn't allow namespacing to container
payloads. Deal with it.

Fixes: #9700
5 years agotests: add helper call have_namespaces() to test whether Linux namespaces are available
Lennart Poettering [Wed, 24 Oct 2018 15:07:04 +0000 (17:07 +0200)] 
tests: add helper call have_namespaces() to test whether Linux namespaces are available

A slighly sloppy test call for conditionalizing several tests.

5 years agotests: as per CODING_STYLE undefine basename() right after including libgen.h
Lennart Poettering [Wed, 24 Oct 2018 15:06:28 +0000 (17:06 +0200)] 
tests: as per CODING_STYLE undefine basename() right after including libgen.h

5 years agotests: alloc-util.h and fs-util.h are our own headers
Lennart Poettering [Wed, 24 Oct 2018 15:05:16 +0000 (17:05 +0200)] 
tests: alloc-util.h and fs-util.h are our own headers

Hence include them with "" rather than <>. Also including them twices is
a pretty bad idea too.

5 years agoexecute: if we fail to do namespacing, explain why we refuse to continue in a debug...
Lennart Poettering [Wed, 24 Oct 2018 14:55:17 +0000 (16:55 +0200)] 
execute: if we fail to do namespacing, explain why we refuse to continue in a debug message

5 years agosleep: when we can't hibernate on suspend-then-hibernate, fall back to suspend again 10504/head
Lennart Poettering [Wed, 24 Oct 2018 11:15:24 +0000 (13:15 +0200)] 
sleep: when we can't hibernate on suspend-then-hibernate, fall back to suspend again

Let's make this a bit safer, and try hard to return to sleep, if we can
at all.

Fixes: #10212
5 years agosleep: rework what we do if a suspend fails.
Lennart Poettering [Wed, 24 Oct 2018 11:04:30 +0000 (13:04 +0200)] 
sleep: rework what we do if a suspend fails.

First of all, let's fix logging: let's simply log the same message as we
do on success, so that there's always the same pair of these messages
around, regardless if the suspend was successful or not. To distuingish
a successful suspend from a failed one, check the ERRNO= field of the
structured message.

In most ways a failed suspend cycle is not distuingishable from a
successful one that took no time, hence let's treat it this way, and
always pair the success message with a failure message.

This also changes a more important concept: the post-suspend callouts
are now called also called on failure, following the same logic: let's
always run them in pairs: for every pre callout a post callout has to
follow.

5 years agosleep: no need to check for resume_offset twice
Lennart Poettering [Wed, 24 Oct 2018 10:57:37 +0000 (12:57 +0200)] 
sleep: no need to check for resume_offset twice

The W_OK check already checks for existance hence let's remove the F_OK
check.

5 years agosleep: let's turn off the RTC alarm time ASAP
Lennart Poettering [Wed, 24 Oct 2018 10:52:11 +0000 (12:52 +0200)] 
sleep: let's turn off the RTC alarm time ASAP

Let's be a tiny bit more careful here.

Also, let's rearrange things to simplify them a bit, and to not use "r"
outside of its immediate scope of validity.

5 years agosleep: round up when calculating RTC sleep time
Lennart Poettering [Wed, 24 Oct 2018 10:48:56 +0000 (12:48 +0200)] 
sleep: round up when calculating RTC sleep time

Paranoia: this way we know that when we wake up all timers are
definitely equal or ahead of what we expect them to be.

5 years agosleep: move log message generation for rtc_read_time() into the function itself
Lennart Poettering [Wed, 24 Oct 2018 10:47:46 +0000 (12:47 +0200)] 
sleep: move log message generation for rtc_read_time() into the function itself

The log messages were petty borked anyway, and generated at two separate
locations. Let's fix that.

5 years agosleep: rework write_wakealarm() to take a numeric parameter
Lennart Poettering [Wed, 24 Oct 2018 10:45:06 +0000 (12:45 +0200)] 
sleep: rework write_wakealarm() to take a numeric parameter

Also, let's rename it to rtc_write_wake_alarm(). Both changes together
make sure rtc_write_wake_alarm() and rtc_read_time() are more alike in
their naming and semantics.

5 years agosleep: rename read_wakealarm() → rtc_read_time()
Lennart Poettering [Wed, 24 Oct 2018 10:40:07 +0000 (12:40 +0200)] 
sleep: rename read_wakealarm() → rtc_read_time()

It doesn't read wakealarm, but the current time of the RTC. Hence, let's
rename this to make it less misleading.

5 years agosleep: log about the correct errors
Lennart Poettering [Wed, 24 Oct 2018 10:38:13 +0000 (12:38 +0200)] 
sleep: log about the correct errors

5 years agosleep: don't make up errors, propagate the right ones
Lennart Poettering [Wed, 24 Oct 2018 10:38:04 +0000 (12:38 +0200)] 
sleep: don't make up errors, propagate the right ones

5 years agosleep: let's use write_string_file() instead of write_string_stream() if we can
Lennart Poettering [Wed, 24 Oct 2018 10:35:49 +0000 (12:35 +0200)] 
sleep: let's use write_string_file() instead of write_string_stream() if we can

Let's shorten things.

5 years agoMerge pull request #10484 from yuwata/udev-spawn-simplify
Lennart Poettering [Wed, 24 Oct 2018 08:57:45 +0000 (10:57 +0200)] 
Merge pull request #10484 from yuwata/udev-spawn-simplify

udev-event: cleanups about udev_event_spawn()

5 years agoMerge pull request #10498 from yuwata/udev-builtin-log
Lennart Poettering [Wed, 24 Oct 2018 08:53:35 +0000 (10:53 +0200)] 
Merge pull request #10498 from yuwata/udev-builtin-log

udev-builtin: use log_device_*() macros

5 years agoMerge pull request #10483 from yuwata/udev-cleanup-10
Lennart Poettering [Wed, 24 Oct 2018 08:51:53 +0000 (10:51 +0200)] 
Merge pull request #10483 from yuwata/udev-cleanup-10

tree-wide: use log_device_*()

5 years agoMerge pull request #10461 from yuwata/small-cleanups
Lennart Poettering [Wed, 24 Oct 2018 08:36:20 +0000 (10:36 +0200)] 
Merge pull request #10461 from yuwata/small-cleanups

Fixes recent defects reported by coverity

5 years agoadd ephemeral to nspawn-settings.
Jiuyang liu [Mon, 22 Oct 2018 17:26:05 +0000 (01:26 +0800)] 
add ephemeral to nspawn-settings.

5 years agoudevadm-info: fix memleak 10461/head
Yu Watanabe [Fri, 19 Oct 2018 17:39:02 +0000 (02:39 +0900)] 
udevadm-info: fix memleak

Fixes CID#1396276.

5 years agoudevadm-monitor: initialize variable
Yu Watanabe [Fri, 19 Oct 2018 17:36:12 +0000 (02:36 +0900)] 
udevadm-monitor: initialize variable

Fixes CID#1396278.

5 years agomodules-load: return first error in the loop
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.

5 years agoreply-password: initialize 'length' variable
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.

5 years agocore: use ascii_toupper() instead of everytime judging whether it is the first message
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

5 years agoudev-event: use sd_event_add_io() for reading stdout or stderr of spawned process 10484/head
Yu Watanabe [Tue, 23 Oct 2018 04:52:57 +0000 (13:52 +0900)] 
udev-event: use sd_event_add_io() for reading stdout or stderr of spawned process

5 years agoudev-event: unify two log_*() by log_full()
Yu Watanabe [Tue, 23 Oct 2018 03:25:17 +0000 (12:25 +0900)] 
udev-event: unify two log_*() by log_full()

5 years agoudev-event: Capitalize log messages
Yu Watanabe [Tue, 23 Oct 2018 03:23:44 +0000 (12:23 +0900)] 
udev-event: Capitalize log messages

5 years agoudev-event: fix condition to create pipe fds
Yu Watanabe [Tue, 23 Oct 2018 03:18:33 +0000 (12:18 +0900)] 
udev-event: fix condition to create pipe fds

The bug was introduced by feaa6db7ac287b34887f75c27a7efc2107a7b691.

5 years agoudev-event: set O_CLOEXEC to pipe fds
Yu Watanabe [Tue, 23 Oct 2018 01:18:36 +0000 (10:18 +0900)] 
udev-event: set O_CLOEXEC to pipe fds

5 years agoudev-event: make failure in getting device properties fatal
Yu Watanabe [Mon, 22 Oct 2018 20:47:21 +0000 (05:47 +0900)] 
udev-event: make failure in getting device properties fatal

5 years agotest: create /dev/null in test-udev.pl
Yu Watanabe [Mon, 22 Oct 2018 22:23:01 +0000 (07:23 +0900)] 
test: create /dev/null in test-udev.pl

5 years agoudev-event: use rearrange_stdio() and close_all_fds()
Yu Watanabe [Mon, 22 Oct 2018 09:29:05 +0000 (18:29 +0900)] 
udev-event: use rearrange_stdio() and close_all_fds()

5 years agoudev-event: set FORK_DEATHSIG flag
Yu Watanabe [Mon, 22 Oct 2018 09:27:57 +0000 (18:27 +0900)] 
udev-event: set FORK_DEATHSIG flag

5 years agoudev-event: drop redundant code
Yu Watanabe [Mon, 22 Oct 2018 09:25:18 +0000 (18:25 +0900)] 
udev-event: drop redundant code

We have set FORK_RESET_SIGNALS in safe_fork(). So, calling
reset_signal_mask() after safe_fork() is redundant.

5 years agoudev-event: move debug logging before safe_fork()
Yu Watanabe [Mon, 22 Oct 2018 09:21:42 +0000 (18:21 +0900)] 
udev-event: move debug logging before safe_fork()

This fixes the following journal layout issue:
```
Oct 22 15:26:02 systemd-udevd[348]: RUN '/usr/sbin/setregdomain' /usr/lib/udev/rules.d/85-regulatory.rules:5
Oct 22 15:26:02 [439]: Starting '/usr/sbin/setregdomain'
Oct 22 15:26:02 systemd-udevd[348]: Process '/usr/sbin/setregdomain' succeeded.
```

5 years agoudev-builtin-input_id: update log messages 10498/head
Yu Watanabe [Tue, 23 Oct 2018 19:27:36 +0000 (04:27 +0900)] 
udev-builtin-input_id: update log messages

5 years agoudev-builtin-usb_id: update log messages
Yu Watanabe [Tue, 23 Oct 2018 19:19:16 +0000 (04:19 +0900)] 
udev-builtin-usb_id: update log messages

5 years agoudev-builtin-uaccess: update log messages
Yu Watanabe [Tue, 23 Oct 2018 19:08:13 +0000 (04:08 +0900)] 
udev-builtin-uaccess: update log messages

5 years agoudev-builtin-net_setup_link: update log messages
Yu Watanabe [Tue, 23 Oct 2018 19:02:29 +0000 (04:02 +0900)] 
udev-builtin-net_setup_link: update log messages

5 years agoudev-builtin-keyboard: update log messages
Yu Watanabe [Tue, 23 Oct 2018 18:56:17 +0000 (03:56 +0900)] 
udev-builtin-keyboard: update log messages

5 years agosd_hwdb: update log messages
Yu Watanabe [Tue, 23 Oct 2018 18:26:31 +0000 (03:26 +0900)] 
sd_hwdb: update log messages

5 years agoudev-builtin-btrfs: add debug log messages
Yu Watanabe [Tue, 23 Oct 2018 18:13:54 +0000 (03:13 +0900)] 
udev-builtin-btrfs: add debug log messages

5 years agoudev-builtin-blkid: add more debug log messages
Yu Watanabe [Tue, 23 Oct 2018 18:01:19 +0000 (03:01 +0900)] 
udev-builtin-blkid: add more debug log messages