chiark / gitweb /
elogind.git
5 years agorpm: add macros for common configuration dirs
Zbigniew Jędrzejewski-Szmek [Sat, 19 May 2018 15:02:37 +0000 (17:02 +0200)]
rpm: add macros for common configuration dirs

%_environmnentdir /usr/lib/environment.d
%_modulesloaddir /usr/lib/modules-load.d
%_modprobedir /usr/lib/modprobe.d

This makes installing files there more convenient because people don't need to
construct the path from %_prefix/lib/… .

See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/.

5 years agorpm: add macros for common configuration dirs
Zbigniew Jędrzejewski-Szmek [Sat, 19 May 2018 15:02:37 +0000 (17:02 +0200)]
rpm: add macros for common configuration dirs

%_environmnentdir /usr/lib/environment.d
%_modulesloaddir /usr/lib/modules-load.d
%_modprobedir /usr/lib/modprobe.d

This makes installing files there more convenient because people don't need to
construct the path from %_prefix/lib/… .

See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/.

5 years agofs-util: don't alter errno in unlink_tempfilep()
Lennart Poettering [Fri, 18 May 2018 18:14:54 +0000 (20:14 +0200)]
fs-util: don't alter errno in unlink_tempfilep()

Functions whose only purpose is to be used with _cleanup_() should not
touch errno, so that failing removals do not alter errno at unexpected
places.

This is already done in unlink_and_freep(), rmdir_and_freep(),
rm_rf_physical_and_freep(), hence do so for unlink_tempfilep(), too.

Follow-up for #9013

5 years agomeson: use run_target for generating tags with ctags
Evegeny Vereshchagin [Fri, 18 May 2018 10:52:17 +0000 (10:52 +0000)]
meson: use run_target for generating tags with ctags

In https://github.com/systemd/systemd/pull/6561, `run_target`
was changed to `custom_target`, which inadvertently caused
relative paths to be passed to ctags due to
https://github.com/mesonbuild/meson/issues/3589.
The switch to `run_target` causes absolute paths to be
passed again and makes it easier to jump from file to
file, hopefully delaying the need to exit Vim :-)

5 years agoUse STRLEN in two places
Zbigniew Jędrzejewski-Szmek [Fri, 11 May 2018 09:09:37 +0000 (11:09 +0200)]
Use STRLEN in two places

5 years agotest-copy: remove unnecessary initialization
Zbigniew Jędrzejewski-Szmek [Mon, 14 May 2018 07:20:17 +0000 (09:20 +0200)]
test-copy: remove unnecessary initialization

Initializing just some of the values doesn't make sense. We should handle them
all in the same way. In those tests there are no jumps, all steps are covered
with assert_se(), so we know everything will be set if we get to the end of the
function. And _not_ initializing those variables has the advantage that it
allows valgrind to catch potential initalization errors in the function being
tested.

5 years agotree-wide: do not wrap assert_se in extra parentheses
Zbigniew Jędrzejewski-Szmek [Mon, 14 May 2018 07:12:12 +0000 (09:12 +0200)]
tree-wide: do not wrap assert_se in extra parentheses

We were inconsitently using them in some cases, but in majority not.
Using assignment in assert_se is very common, not an exception like in
'if', so let's drop the extra parens everywhere.

5 years agocore/mount-setup: remove part of check which is always true
Zbigniew Jędrzejewski-Szmek [Mon, 14 May 2018 06:50:00 +0000 (08:50 +0200)]
core/mount-setup: remove part of check which is always true

f1470e424b2b5337e3c383d68dc5a26af1ff4ce6 removed one check, but missed a similar
one a few lines down.

CID #1390949.

5 years agologin: use BUS_DEFINE_PROPERTY_GET* macros
Yu Watanabe [Mon, 14 May 2018 01:02:55 +0000 (10:02 +0900)]
login: use BUS_DEFINE_PROPERTY_GET* macros

5 years agobus-util: add more macros for defining functions of getting dbus properties
Yu Watanabe [Mon, 14 May 2018 01:02:17 +0000 (10:02 +0900)]
bus-util: add more macros for defining functions of getting dbus properties

5 years agofs-util,test: add helper to remove tempfiles
Zbigniew Jędrzejewski-Szmek [Wed, 16 May 2018 09:35:41 +0000 (11:35 +0200)]
fs-util,test: add helper to remove tempfiles

This simplifies the use of tempfiles in tests and fixes "leaked"
temporary files in test-fileio, test-catalog, test-conf-parser.

Not the whole tree is converted.

5 years agopath-util: one more empty_or_root() change
Lennart Poettering [Wed, 25 Apr 2018 09:23:01 +0000 (11:23 +0200)]
path-util: one more empty_or_root() change

5 years agoprocess-util: add new helper call for adjusting the OOM score
Lennart Poettering [Mon, 7 May 2018 18:44:41 +0000 (20:44 +0200)]
process-util: add new helper call for adjusting the OOM score

And let's make use of it in execute.c

5 years agobasic: split parsing of the OOM score adjust value into its own function in parse...
Lennart Poettering [Mon, 7 May 2018 18:26:38 +0000 (20:26 +0200)]
basic: split parsing of the OOM score adjust value into its own function in parse-util.c

And port config_parse_exec_oom_score_adjust() over to use it.

While we are at it, let's also fix config_parse_exec_oom_score_adjust()
to accept an empty string for turning off OOM score adjustments set
earlier.

5 years agoconf-parser: shorten config_parse_string() by using free_and_strdup() and empty_to_null()
Lennart Poettering [Mon, 7 May 2018 16:18:11 +0000 (18:18 +0200)]
conf-parser: shorten config_parse_string() by using free_and_strdup() and empty_to_null()

5 years agobasic: be more careful when closing fds based on RLIMIT_NOFILE
Lennart Poettering [Mon, 7 May 2018 15:54:59 +0000 (17:54 +0200)]
basic: be more careful when closing fds based on RLIMIT_NOFILE

Let's make sure we properly handle cases where RLIMIT_NOFILE is set to
infinity, zero or values outside of the "int" range.

5 years agocore: move config_parse_limit() to the generic conf-parser.[ch]
Lennart Poettering [Thu, 3 May 2018 17:01:21 +0000 (19:01 +0200)]
core: move config_parse_limit() to the generic conf-parser.[ch]

That way we can use it in nspawn.

Also, while we are at it, let's rename the call config_parse_rlimit(),
i.e. insert the "r", to clarify what kind of limit this is about.

5 years agorlimit-util: rework rlimit_{from|to}_string() to work without "Limit" prefix
Lennart Poettering [Thu, 3 May 2018 16:45:39 +0000 (18:45 +0200)]
rlimit-util: rework rlimit_{from|to}_string() to work without "Limit" prefix

let's make the call more generic, so that we can also easily use it for
parsing "RLIMIT_xyz" style constants.

5 years agoinhibit: use pager for systemd-inhibit --list
David Tardon [Thu, 17 May 2018 13:45:37 +0000 (15:45 +0200)]
inhibit: use pager for systemd-inhibit --list

5 years agoTurn VALGRIND variable into a meson configuration switch
Zbigniew Jędrzejewski-Szmek [Sun, 13 May 2018 20:28:24 +0000 (22:28 +0200)]
Turn VALGRIND variable into a meson configuration switch

Configuration through environment variable is inconvenient with meson, because
they cannot be convieniently changed and/or are not preserved during
reconfiguration (https://github.com/mesonbuild/meson/issues/1503).
This adds -Dvalgrind=true/false, which has the advantage that it can be set
at any time with meson configure -Dvalgrind=... and ninja will rebuild targets
as necessary. Additional minor advantages are better consistency with the
options for hashmap debugging, and typo avoidance with '#if' instead of '#ifdef'.

5 years agocore: Break circular dependency between unit.h and cgroup.h
Felipe Sateler [Tue, 15 May 2018 18:12:22 +0000 (14:12 -0400)]
core: Break circular dependency between unit.h and cgroup.h

5 years agomeson: use array type option
Yu Watanabe [Wed, 2 May 2018 04:56:28 +0000 (13:56 +0900)]
meson: use array type option

Array type option is supported since 0.44.0.

5 years agomeson: use warning() method
Yu Watanabe [Thu, 10 May 2018 05:50:52 +0000 (14:50 +0900)]
meson: use warning() method

This bumps the required minimum version of meson to 0.44, as
`warning()` method is supported since 0.44.

5 years agomeson: use get_supported_arguments()
Yu Watanabe [Thu, 10 May 2018 06:30:42 +0000 (15:30 +0900)]
meson: use get_supported_arguments()

This bumps the required minimum version of meson to 0.43, as
`get_supported_arguments()` is supported since meson-0.43.

5 years agotest: use _cleanup_hashmap_free_ instread of _cleanup_(hashmap_freep)
Yu Watanabe [Mon, 14 May 2018 05:14:17 +0000 (14:14 +0900)]
test: use _cleanup_hashmap_free_ instread of _cleanup_(hashmap_freep)

5 years agosd-bus: use free_and_strdup()
Yu Watanabe [Mon, 14 May 2018 05:09:03 +0000 (14:09 +0900)]
sd-bus: use free_and_strdup()

5 years agobus-util: add several macros for defining functions of getting dbus properties
Yu Watanabe [Sun, 13 May 2018 03:20:51 +0000 (12:20 +0900)]
bus-util: add several macros for defining functions of getting dbus properties

5 years agobasic: add log_level argument to timezone_is_valid
Mike Gilbert [Sat, 12 May 2018 19:20:13 +0000 (15:20 -0400)]
basic: add log_level argument to timezone_is_valid

5 years agobasic: timezone_is_valid: check for magic bytes "TZif"
Mike Gilbert [Thu, 10 May 2018 19:10:48 +0000 (15:10 -0400)]
basic: timezone_is_valid: check for magic bytes "TZif"

Fixes: https://github.com/systemd/systemd/issues/8905
5 years agotest: do not call alloca() inside the list of arguments
Yu Watanabe [Fri, 11 May 2018 06:01:35 +0000 (15:01 +0900)]
test: do not call alloca() inside the list of arguments

5 years agohexdecoct: drop an unnecessary check
Yu Watanabe [Fri, 11 May 2018 04:56:28 +0000 (13:56 +0900)]
hexdecoct: drop an unnecessary check

5 years agobasic: fix comment style
Yu Watanabe [Fri, 11 May 2018 04:55:28 +0000 (13:55 +0900)]
basic: fix comment style

5 years agohexdecoct: ignore whitespace within the input hexadecimal text of unhexmem()
Yu Watanabe [Fri, 11 May 2018 05:36:22 +0000 (14:36 +0900)]
hexdecoct: ignore whitespace within the input hexadecimal text of unhexmem()

5 years agoterminal-util: add a function that shows a pretty separator line
Lennart Poettering [Thu, 10 May 2018 18:28:33 +0000 (11:28 -0700)]
terminal-util: add a function that shows a pretty separator line

Follow-up for #8824

5 years agostring-util: rename strdash_if_empty() to empty_to_dash()
Yu Watanabe [Thu, 10 May 2018 16:55:46 +0000 (01:55 +0900)]
string-util: rename strdash_if_empty() to empty_to_dash()

5 years agopath-util: introduce empty_to_root() and use it many places
Yu Watanabe [Thu, 10 May 2018 16:47:33 +0000 (01:47 +0900)]
path-util: introduce empty_to_root() and use it many places

5 years agobasic/terminal-util: fix output of files without a final newline
Zbigniew Jędrzejewski-Szmek [Fri, 27 Apr 2018 07:39:53 +0000 (09:39 +0200)]
basic/terminal-util: fix output of files without a final newline

If the main config file or one of the drop-ins did not have the final newline,
there would be no seperating empty line (or if this was the last file
displayed, our own output would end without the final newline, possibly running
into the subsequent prompt or such). copy_bytes() does not know anything about
lines, so let's just use a normal loop with read_line() and puts().

5 years agoanalyze: add --root option for cat-config
Zbigniew Jędrzejewski-Szmek [Fri, 27 Apr 2018 06:55:16 +0000 (08:55 +0200)]
analyze: add --root option for cat-config

5 years agosysusers: add --cat-config
Zbigniew Jędrzejewski-Szmek [Thu, 26 Apr 2018 18:38:39 +0000 (20:38 +0200)]
sysusers: add --cat-config

5 years agotmpfiles: add --cat-config
Zbigniew Jędrzejewski-Szmek [Thu, 26 Apr 2018 17:07:54 +0000 (19:07 +0200)]
tmpfiles: add --cat-config

This implements similar logic as conf_files_cat(), but with slightly different
file gathering logic. I also want to add support for replacement files later on,
so it seems better to keep those two file-gathering functions separate.

5 years agoanalyze: add 'cat-config' verb
Zbigniew Jędrzejewski-Szmek [Thu, 26 Apr 2018 11:49:50 +0000 (13:49 +0200)]
analyze: add 'cat-config' verb

This is used as 'systemd-analyze show-config systemd/logind.conf', which
will dump
   /etc/systemd/system/user@.service
   /etc/systemd/system/user@.service.d/*.conf
   /run/systemd/system/user@.service.d/*.conf
   /usr/local/lib/systemd/system/user@.service.d/*.conf
   /usr/lib/systemd/system/user@.service.d/*.conf

The idea is to make it easy to dump the configuration using the same locations
and order that systemd programs use themselves (including masking, in the right
order, etc.). This is the generic variant that works with any configuration
scheme that follows the same general rules:

$ systemd-analyze cat-config systemd/system.conf
$ systemd-analyze cat-config systemd/user.conf
$ systemd-analyze cat-config systemd/logind.conf
$ systemd-analyze cat-config systemd/sleep.conf
$ systemd-analyze cat-config systemd/journald.conf
$ systemd-analyze cat-config systemd/journal-remote.conf
$ systemd-analyze cat-config systemd/journal-upload.conf
$ systemd-analyze cat-config systemd/coredump.conf
$ systemd-analyze cat-config systemd/resolved.conf
$ systemd-analyze cat-config systemd/timesyncd.conf
$ systemd-analyze cat-config udev/udev.conf

5 years agoMove function to cat file & dropins into basic/
Zbigniew Jędrzejewski-Szmek [Thu, 26 Apr 2018 11:03:39 +0000 (13:03 +0200)]
Move function to cat file & dropins into basic/

This fixes a buglet where the second and later drop-in would not be seperated
properly by a newline.

5 years agosd-bus: use automatic cleanup more
David Tardon [Thu, 10 May 2018 13:55:56 +0000 (15:55 +0200)]
sd-bus: use automatic cleanup more

5 years agobasic: use automatic cleanup more
David Tardon [Thu, 10 May 2018 12:10:53 +0000 (14:10 +0200)]
basic: use automatic cleanup more

5 years agobasic: use automatic cleanup more
David Tardon [Thu, 10 May 2018 12:08:35 +0000 (14:08 +0200)]
basic: use automatic cleanup more

5 years agocore/mount-setup: remove part of check which is always true
Zbigniew Jędrzejewski-Szmek [Thu, 10 May 2018 00:03:23 +0000 (02:03 +0200)]
core/mount-setup: remove part of check which is always true

k was set to join_controllers at this point and only incremented, so
it cannot be null at this point.

CID #1390949.

5 years agobasic/fs-util: remove logically dead code
Zbigniew Jędrzejewski-Szmek [Wed, 9 May 2018 23:55:05 +0000 (01:55 +0200)]
basic/fs-util: remove logically dead code

We can jump to chase_one from two places. In the first 'todo' is set to
'buffer', which comes from path_make_absolute_cwd() and is nonnull In the
second 'todo' is set to 'joined' which is checked to be nonull a few lines
above the jump. So let's kill the code that deals with null todo there.

CID #1390941.

5 years agologind: fix borked r check
Zbigniew Jędrzejewski-Szmek [Wed, 9 May 2018 23:34:33 +0000 (01:34 +0200)]
logind: fix borked r check

CID #1390947, #1390952.

5 years agobasic/format-table: add missing va_end()
Zbigniew Jędrzejewski-Szmek [Wed, 9 May 2018 23:22:29 +0000 (01:22 +0200)]
basic/format-table: add missing va_end()

CID #1390930, #1390940.

5 years agoshared/sleep-config: fix memleak of strv, add test
Zbigniew Jędrzejewski-Szmek [Wed, 9 May 2018 23:04:53 +0000 (01:04 +0200)]
shared/sleep-config: fix memleak of strv, add test

CID #1390921, #1390951.

5 years agoconf-parser: accept trailing backslash at the end of the file (#8941)
Filipe Brandenburger [Thu, 10 May 2018 01:10:07 +0000 (18:10 -0700)]
conf-parser: accept trailing backslash at the end of the file (#8941)

This makes it behave the same whether there is a blank line or not at
the end of the file.  This is also consistent with the behavior of the
shell on a shell script that ends on a trailing backslash at the last
line.

Added tests to test_config_parse(), which only pass if the corresponding
change to config_parse() is included.

5 years agomeson: recompile all sources for install_libudev_static and install_libsystemd_static
Zbigniew Jędrzejewski-Szmek [Wed, 25 Apr 2018 13:29:48 +0000 (15:29 +0200)]
meson: recompile all sources for install_libudev_static and install_libsystemd_static

This means that when those targets are built, all the sources are built again,
instead of reusing the work done to create libbasic.a and other convenience static
libraries. It would be nice to not do this, but there seems to be no support in
our toolchain for joining multiple static libraries into one. When linking
a static library, any -l arguments are simply ignored by ar/gcc-ar, and .a
libraries given as positional arguments are copied verbatim into the archive
so they objects in them cannot be accessed.

https://stackoverflow.com/questions/2157629/linking-static-libraries-to-other-static-libraries
suggests either unzipping all the archives and putting them back togather,
or using a linker script. Unzipping and zipping back together seems ugly.
The other option is not very nice. The linker script language does not
allow "+" to appear in the filenames, and filenames that meson generates
use that, so files would have to be renamed before a linker script was used.
And we would have to generate the linker script on the fly. Either way, this
doesn't seem attractive. Since those static libraries are a niche use case,
it seems reasonable to just go with the easiest and safest solution and
recompile all the source files. Thanks to ccache, this is probably almost as
cheap as actually reusing the convenience .a libraries.

test-libsystemd-sym.c and test-libudev-sym.c compile fine with the generated
static libs, so it seems that they indeed provide all the symbols they should.

5 years agomeson: only build test-lib{systemd,udev}-static-sym for pic
Davide Cavalca [Tue, 24 Apr 2018 20:34:48 +0000 (13:34 -0700)]
meson: only build test-lib{systemd,udev}-static-sym for pic

5 years agomeson: add test-lib{systemd,udev}-static-sym
Zbigniew Jędrzejewski-Szmek [Mon, 23 Apr 2018 11:49:27 +0000 (13:49 +0200)]
meson: add test-lib{systemd,udev}-static-sym

This is the same as test-lib{systemd,udev}-sym, but linked to the static
variants of those libraries.

5 years agomeson: add support for building static libsystemd and libudev
Davide Cavalca [Mon, 9 Apr 2018 09:43:35 +0000 (02:43 -0700)]
meson: add support for building static libsystemd and libudev

5 years agotree-wide: use strv_free_and_replace() macro
Yu Watanabe [Wed, 9 May 2018 15:34:46 +0000 (00:34 +0900)]
tree-wide: use strv_free_and_replace() macro

5 years agotime-util: fix indentation for comments
Yu Watanabe [Wed, 9 May 2018 13:50:07 +0000 (22:50 +0900)]
time-util: fix indentation for comments

5 years agosd-bus: add bus_freep and use _cleanup_
Zbigniew Jędrzejewski-Szmek [Wed, 9 May 2018 07:44:37 +0000 (09:44 +0200)]
sd-bus: add bus_freep and use _cleanup_

5 years agosd-bus: use automatic cleanup more
Zbigniew Jędrzejewski-Szmek [Wed, 9 May 2018 07:35:01 +0000 (09:35 +0200)]
sd-bus: use automatic cleanup more

5 years agosd-bus: trivial simplification
Zbigniew Jędrzejewski-Szmek [Wed, 9 May 2018 07:25:03 +0000 (09:25 +0200)]
sd-bus: trivial simplification

5 years agouse max. message size allowed by DBus spec (#8936)
David Tardon [Wed, 9 May 2018 08:33:28 +0000 (10:33 +0200)]
use max. message size allowed by DBus spec (#8936)

C.f. https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages.

5 years agobus-util: print a friendly message when PID1 is not systemd
Yu Watanabe [Wed, 9 May 2018 08:06:46 +0000 (17:06 +0900)]
bus-util: print a friendly message when PID1 is not systemd

Follow-up for 861f16d2679eeda79e8185057cef24653913e300.

Fixes #8913.

5 years agologin: do not wall message on cancelling shutdown when Manager.enable_wall_messages...
Yu Watanabe [Mon, 7 May 2018 01:16:04 +0000 (10:16 +0900)]
login: do not wall message on cancelling shutdown when Manager.enable_wall_messages is false

Fixes #8904.

5 years agologin: change variable type of enable_wall_messages as it matches Manager.enable_wall...
Yu Watanabe [Mon, 7 May 2018 01:13:54 +0000 (10:13 +0900)]
login: change variable type of enable_wall_messages as it matches Manager.enable_wall_messages

5 years agoupdate TODO
Lennart Poettering [Mon, 30 Apr 2018 19:20:31 +0000 (21:20 +0200)]
update TODO

5 years agoman: update references to systemd-journal-{remote,upload}
Yu Watanabe [Tue, 8 May 2018 01:14:02 +0000 (10:14 +0900)]
man: update references to systemd-journal-{remote,upload}

Fixes #8920 and #8921.

5 years agomeson: generate m4 preprocessor from config.h (#8914)
Yu Watanabe [Mon, 7 May 2018 09:17:35 +0000 (18:17 +0900)]
meson: generate m4 preprocessor from config.h (#8914)

5 years agoman: add explanations of show-timesync and timesync-status commands
Yu Watanabe [Mon, 30 Apr 2018 13:42:40 +0000 (22:42 +0900)]
man: add explanations of show-timesync and timesync-status commands

5 years agotimedatectl: add timesync-status and show-timesync commands
Yu Watanabe [Thu, 3 May 2018 09:07:43 +0000 (18:07 +0900)]
timedatectl: add timesync-status and show-timesync commands

Closes #1589.

5 years agotest: add tests for signal_from_string()
Yu Watanabe [Thu, 3 May 2018 07:47:12 +0000 (16:47 +0900)]
test: add tests for signal_from_string()

5 years agoutil: rename signal_from_string_try_harder() to signal_from_string()
Yu Watanabe [Thu, 3 May 2018 07:38:57 +0000 (16:38 +0900)]
util: rename signal_from_string_try_harder() to signal_from_string()

Also this makes the new `signal_from_string()` function reject
e.g, `SIG3` or `SIG+5`.

5 years agoutil: make signal_from_string() accept RTMIN, RTMAX, and RTMAX-n
Yu Watanabe [Thu, 3 May 2018 07:40:02 +0000 (16:40 +0900)]
util: make signal_from_string() accept RTMIN, RTMAX, and RTMAX-n

Before this, `signal_from_string()` accepts simple signal name
or RTMIN+n. This makes the function also accept RTMIN, RTMAX,
and RTMAX-n.
Note that RTMIN+0 is equivalent to RTMIN, and RTMAX-0 is to RTMAX.

This also fixes the integer overflow reported by oss-fuzz #8064.
https://oss-fuzz.com/v2/testcase-detail/5648573352902656

5 years agomeson.build: Fix new executable systemd-user-runtime-dir, that we do not need.
Sven Eden [Fri, 10 Aug 2018 15:31:26 +0000 (17:31 +0200)]
meson.build: Fix new executable systemd-user-runtime-dir, that we do not need.

5 years agovirt: simplifications
Lennart Poettering [Mon, 30 Apr 2018 10:24:57 +0000 (12:24 +0200)]
virt: simplifications

Let's simplify the code a bit. Let's reduce the number of redundant if
checks a bit, (i.e. if we want to check for equality with
VIRTUALIZATION_VM_OTHER there's no need to check for non-equality with
VIRTUALIZATION_NONE first). As a very welcome side-effect this means we
lose some lines of code and our level of indentation is reduced.

No changes in behaviour.

5 years agovirt: if we detect Xen by DMI, trust that over CPUID
Lennart Poettering [Mon, 30 Apr 2018 10:23:03 +0000 (12:23 +0200)]
virt: if we detect Xen by DMI, trust that over CPUID

Apparently Xen sometimes lies about its identity when queried via CPUID.
Let's hence prefer DMI tests for CPUID

Fixes: #8844
5 years agopwx: Use latest check_tree.pl revision.
Sven Eden [Fri, 10 Aug 2018 05:57:45 +0000 (07:57 +0200)]
pwx: Use latest check_tree.pl revision.

5 years agotest: add tests for signal_from_string()
Yu Watanabe [Thu, 3 May 2018 07:47:12 +0000 (16:47 +0900)]
test: add tests for signal_from_string()

5 years agoutil: rename signal_from_string_try_harder() to signal_from_string()
Yu Watanabe [Thu, 3 May 2018 07:38:57 +0000 (16:38 +0900)]
util: rename signal_from_string_try_harder() to signal_from_string()

Also this makes the new `signal_from_string()` function reject
e.g, `SIG3` or `SIG+5`.

5 years agoutil: make signal_from_string() accept RTMIN, RTMAX, and RTMAX-n
Yu Watanabe [Thu, 3 May 2018 07:40:02 +0000 (16:40 +0900)]
util: make signal_from_string() accept RTMIN, RTMAX, and RTMAX-n

Before this, `signal_from_string()` accepts simple signal name
or RTMIN+n. This makes the function also accept RTMIN, RTMAX,
and RTMAX-n.
Note that RTMIN+0 is equivalent to RTMIN, and RTMAX-0 is to RTMAX.

This also fixes the integer overflow reported by oss-fuzz #8064.
https://oss-fuzz.com/v2/testcase-detail/5648573352902656

5 years agomeson: drop 'name' argument in cc.has_argument() (#8878)
Yu Watanabe [Wed, 2 May 2018 08:05:51 +0000 (17:05 +0900)]
meson: drop 'name' argument in cc.has_argument() (#8878)

5 years agoBump pwx migration tools and fix doubled line in meson.build.
Sven Eden [Wed, 8 Aug 2018 06:00:08 +0000 (08:00 +0200)]
Bump pwx migration tools and fix doubled line in meson.build.

5 years agovirt: simplifications
Lennart Poettering [Mon, 30 Apr 2018 10:24:57 +0000 (12:24 +0200)]
virt: simplifications

Let's simplify the code a bit. Let's reduce the number of redundant if
checks a bit, (i.e. if we want to check for equality with
VIRTUALIZATION_VM_OTHER there's no need to check for non-equality with
VIRTUALIZATION_NONE first). As a very welcome side-effect this means we
lose some lines of code and our level of indentation is reduced.

No changes in behaviour.

5 years agovirt: if we detect Xen by DMI, trust that over CPUID
Lennart Poettering [Mon, 30 Apr 2018 10:23:03 +0000 (12:23 +0200)]
virt: if we detect Xen by DMI, trust that over CPUID

Apparently Xen sometimes lies about its identity when queried via CPUID.
Let's hence prefer DMI tests for CPUID

Fixes: #8844
5 years agolocale-util: add comment with link to unicode chars supported by eurlatgr (#8894)
Lennart Poettering [Thu, 3 May 2018 14:15:04 +0000 (16:15 +0200)]
locale-util: add comment with link to unicode chars supported by eurlatgr (#8894)

See: #6443

5 years agomount-setup: add a comment that the character/block device nodes are "optional" ...
Lennart Poettering [Thu, 3 May 2018 14:10:35 +0000 (16:10 +0200)]
mount-setup: add a comment that the character/block device nodes are "optional" (#8893)

if we lack privs to create device nodes that's fine, and creating
/run/systemd/inaccessible/chr or /run/systemd/inaccessible/blk won't
work then. Document this in longer comments.

Fixes: #4484
5 years agotest: add tests for signal_from_string()
Yu Watanabe [Thu, 3 May 2018 07:47:12 +0000 (16:47 +0900)]
test: add tests for signal_from_string()

5 years agoutil: rename signal_from_string_try_harder() to signal_from_string()
Yu Watanabe [Thu, 3 May 2018 07:38:57 +0000 (16:38 +0900)]
util: rename signal_from_string_try_harder() to signal_from_string()

Also this makes the new `signal_from_string()` function reject
e.g, `SIG3` or `SIG+5`.

5 years agoutil: make signal_from_string() accept RTMIN, RTMAX, and RTMAX-n
Yu Watanabe [Thu, 3 May 2018 07:40:02 +0000 (16:40 +0900)]
util: make signal_from_string() accept RTMIN, RTMAX, and RTMAX-n

Before this, `signal_from_string()` accepts simple signal name
or RTMIN+n. This makes the function also accept RTMIN, RTMAX,
and RTMAX-n.
Note that RTMIN+0 is equivalent to RTMIN, and RTMAX-0 is to RTMAX.

This also fixes the integer overflow reported by oss-fuzz #8064.
https://oss-fuzz.com/v2/testcase-detail/5648573352902656

5 years agoupdate TODO
Lennart Poettering [Thu, 3 May 2018 13:13:42 +0000 (15:13 +0200)]
update TODO

5 years agoset: drop unused set_make() function (#8879)
Yu Watanabe [Wed, 2 May 2018 08:54:52 +0000 (17:54 +0900)]
set: drop unused set_make() function (#8879)

The function causes compiler error when built with '-Ddebug=hashmap',
and is not used anymore. Let's drop it.

5 years agomeson: drop 'name' argument in cc.has_argument() (#8878)
Yu Watanabe [Wed, 2 May 2018 08:05:51 +0000 (17:05 +0900)]
meson: drop 'name' argument in cc.has_argument() (#8878)

5 years agoadd __nr_statx defines for extra architectures (#8872)
Adam Duskett [Wed, 2 May 2018 08:04:50 +0000 (04:04 -0400)]
add __nr_statx defines for extra architectures (#8872)

This includes:
 - arm
 - arm64
 - alpha
 - powerpc64
 - sparc

Taken from kernel 4.16.6

5 years agoupdate TODO
Lennart Poettering [Fri, 27 Apr 2018 19:31:43 +0000 (21:31 +0200)]
update TODO

5 years agologind: (void)ify all things we knowingly ignore
Lennart Poettering [Tue, 24 Apr 2018 16:16:14 +0000 (18:16 +0200)]
logind: (void)ify all things we knowingly ignore

5 years agologind: terminate cleanly on SIGTERM/SIGINT
Lennart Poettering [Tue, 24 Apr 2018 16:14:25 +0000 (18:14 +0200)]
logind: terminate cleanly on SIGTERM/SIGINT

Let's properly terminate on SIGTERM or SIGINT. Previously we'd just rely
on the implicit process clean-up logic on UNIX. By shutting down
properly on SIGTERM/SIGINT we make it easier to track down memory leaks
by employing valgrind.

5 years agologind: modernize Manager object allocation and freeing
Lennart Poettering [Tue, 24 Apr 2018 16:13:12 +0000 (18:13 +0200)]
logind: modernize Manager object allocation and freeing

Let's propagate errors correctly, and stick to the usual naming and
behaviour of these functions. Or in other words, make this closer to the
matching code in machined.

5 years agobasic/log: always ignore errno from the enviornment (#8841)
Zbigniew Jędrzejewski-Szmek [Fri, 27 Apr 2018 16:00:58 +0000 (18:00 +0200)]
basic/log: always ignore errno from the enviornment (#8841)

This extends the change done in b29f6480ec to other logging functions.

This actually fixes some bugs in callers of log_struct(), for example
config_parse_alias() called 'return log_syntax(..., 0, ...)' which could result
in a bogus non-zero return value.

Calls to log_object() and log_format_iovec() — which is only used by
server_driver_message() — appear correct.

5 years agoupdate TODO
Lennart Poettering [Fri, 27 Apr 2018 12:28:51 +0000 (14:28 +0200)]
update TODO

5 years agotree-wide: use newa() rather than alloca() where we can
Lennart Poettering [Fri, 27 Apr 2018 12:28:35 +0000 (14:28 +0200)]
tree-wide: use newa() rather than alloca() where we can

5 years agoalloca: add an overflow check too
Lennart Poettering [Fri, 27 Apr 2018 12:27:14 +0000 (14:27 +0200)]
alloca: add an overflow check too

Of course, alloca() shouldn't be used with anything that can grow
without bounds anyway, but let's better safe than sorry, and catch this
early.

Since alloca() is not supposed to return an error we trigger an
assert() instead, which is still better than heap trickery.