platform/upstream/systemd.git
6 years agoMerge pull request #8534 from poettering/safe-atoi-full
Zbigniew Jędrzejewski-Szmek [Fri, 23 Mar 2018 11:30:12 +0000 (12:30 +0100)]
Merge pull request #8534 from poettering/safe-atoi-full

some improvements to safe_atou() to allow specification of arbitrary bases

6 years agoMerge pull request #8553 from poettering/take-take
Alan Jenkins [Thu, 22 Mar 2018 22:33:38 +0000 (22:33 +0000)]
Merge pull request #8553 from poettering/take-take

introduce TAKE_FD() and TAKE_PTR() macros

6 years agounits: document why systemd-time-wait-sync.service conditions on CAP_SYS_TIME (#8555)
Lennart Poettering [Thu, 22 Mar 2018 20:41:54 +0000 (21:41 +0100)]
units: document why systemd-time-wait-sync.service conditions on CAP_SYS_TIME (#8555)

As requested by @evverx in https://github.com/systemd/systemd/pull/8537#issuecomment-375122615

6 years agovconsole: minor modernizations
Lennart Poettering [Thu, 22 Mar 2018 16:12:23 +0000 (17:12 +0100)]
vconsole: minor modernizations

6 years agovconsole-setup: don't concat strv if we don't need to (i.e. not in debug log mode)
Lennart Poettering [Thu, 22 Mar 2018 16:07:18 +0000 (17:07 +0100)]
vconsole-setup: don't concat strv if we don't need to (i.e. not in debug log mode)

6 years agomacro: introduce new TAKE_FD() macro
Lennart Poettering [Thu, 22 Mar 2018 16:04:29 +0000 (17:04 +0100)]
macro: introduce new TAKE_FD() macro

This is similar to TAKE_PTR() but operates on file descriptors, and thus
assigns -1 to the fd parameter after returning it.

Removes 60 lines from our codebase. Pretty good too I think.

6 years agosleep-config: replace USE() macro with TAKE_PTR() usage
Lennart Poettering [Thu, 22 Mar 2018 15:59:46 +0000 (16:59 +0100)]
sleep-config: replace USE() macro with TAKE_PTR() usage

let's use the new generic macor instead of the locally defined, specific
one.

6 years agomacro: introduce TAKE_PTR() macro
Lennart Poettering [Thu, 22 Mar 2018 15:53:26 +0000 (16:53 +0100)]
macro: introduce TAKE_PTR() macro

This macro will read a pointer of any type, return it, and set the
pointer to NULL. This is useful as an explicit concept of passing
ownership of a memory area between pointers.

This takes inspiration from Rust:

https://doc.rust-lang.org/std/option/enum.Option.html#method.take

and was suggested by Alan Jenkins (@sourcejedi).

It drops ~160 lines of code from our codebase, which makes me like it.
Also, I think it clarifies passing of ownership, and thus helps
readability a bit (at least for the initiated who know the new macro)

6 years agoman/udevadm: remove superfluous --version from subcommands (#8549)
Jan Synacek [Thu, 22 Mar 2018 18:24:37 +0000 (19:24 +0100)]
man/udevadm: remove superfluous --version from subcommands (#8549)

There's need to show the program specific --version for each subcommand.

6 years agoseccomp: add mmap and address family restrictions for MIPS (#8547)
James Cowgill [Thu, 22 Mar 2018 14:40:44 +0000 (14:40 +0000)]
seccomp: add mmap and address family restrictions for MIPS (#8547)

6 years agoMerge pull request #8531 from poettering/dhcp-server-mini-fixes
Lennart Poettering [Thu, 22 Mar 2018 14:36:48 +0000 (15:36 +0100)]
Merge pull request #8531 from poettering/dhcp-server-mini-fixes

some minor tweaks to sd-dhcp-server

6 years agoHACKING: small umask tweak for the rootpw (#8541)
Lennart Poettering [Thu, 22 Mar 2018 14:36:01 +0000 (15:36 +0100)]
HACKING: small umask tweak for the rootpw (#8541)

6 years agounits: disable systemd-time-sync-wait inside containers (#8537)
Peter A. Bigot [Thu, 22 Mar 2018 02:27:27 +0000 (21:27 -0500)]
units: disable systemd-time-sync-wait inside containers (#8537)

Fixes #8535

6 years agodoc/HACKING: show command to set root password in image (#8540)
Peter A. Bigot [Wed, 21 Mar 2018 22:56:33 +0000 (17:56 -0500)]
doc/HACKING: show command to set root password in image (#8540)

Fixes #8538

6 years agomain: add NoNewPrivileges config option (#8475)
juergbi [Wed, 21 Mar 2018 22:41:19 +0000 (23:41 +0100)]
main: add NoNewPrivileges config option (#8475)

This makes it possible to disable new privileges for the whole system.

6 years agoparse-util: similar to safe_atou16_full() add safe_atou_full()
Lennart Poettering [Wed, 21 Mar 2018 21:31:40 +0000 (22:31 +0100)]
parse-util: similar to safe_atou16_full() add safe_atou_full()

What's good for uint16_t is also good for unsigned.

This is preparation for: #8140

6 years agoparse-util: introduce safe_atou16_full()
Lennart Poettering [Wed, 21 Mar 2018 21:27:19 +0000 (22:27 +0100)]
parse-util: introduce safe_atou16_full()

safe_atou16_full() is like safe_atou16() but also takes a base
parameter. safe_atou16() is then implemented as inline function on top
of it, passing 0 as base. Similar safe_atoux16() is reworked as inline
function too, with 16 as base.

6 years agodhcp-server: don't propagate erros up the event loop
Lennart Poettering [Wed, 21 Mar 2018 19:30:56 +0000 (20:30 +0100)]
dhcp-server: don't propagate erros up the event loop

If we can't send a message this is no reason to completely abort the
event handler.

Issue identified by Nandor Han <nandor.han@ge.com>, Sebastian Reichel
<sebastian.reichel@collabora.co.uk>.

Replaces: #8525

6 years agodhcp-sever: check properly for invalid fds
Lennart Poettering [Wed, 21 Mar 2018 19:30:29 +0000 (20:30 +0100)]
dhcp-sever: check properly for invalid fds

We generally just compare for negativity, not for equlity to -1, let's
do so here too.

6 years agodhcp_server_handle_message: don't pretend there was a difference between return code...
Lennart Poettering [Wed, 21 Mar 2018 19:29:43 +0000 (20:29 +0100)]
dhcp_server_handle_message: don't pretend there was a difference between return code 0 or 1

We ignore the difference anyway, hence let's systematically return 0.

6 years agodhcp-server: reduce level of indentation a bit
Lennart Poettering [Wed, 21 Mar 2018 19:29:07 +0000 (20:29 +0100)]
dhcp-server: reduce level of indentation a bit

Less indentation is good, let's do that where it's easy.

6 years agodhcp-server: introduce log_dhcp_server_errno()
Lennart Poettering [Wed, 21 Mar 2018 19:28:01 +0000 (20:28 +0100)]
dhcp-server: introduce log_dhcp_server_errno()

Sometimes we want to print the error number, hence do so properly, and
avoid to use strerror() which is not reentrant.

6 years agodhcp-server: don't assign sendmsg() return value to "int"
Lennart Poettering [Wed, 21 Mar 2018 19:25:46 +0000 (20:25 +0100)]
dhcp-server: don't assign sendmsg() return value to "int"

The type is "ssize_t", not "int", let's be accurate about that, as these
types are different on some archs.

Given that we don't actually care about the return value reall, drop
the whole assignment, just check if negative.

6 years agoWhen mangling names, optionally emit a warning (#8400)
Zbigniew Jędrzejewski-Szmek [Wed, 21 Mar 2018 14:26:47 +0000 (15:26 +0100)]
When mangling names, optionally emit a warning (#8400)

The warning is not emitted for absolute paths like /dev/sda or /home, which are
converted to .device and .mount unit names without any fuss.

Most of the time it's unlikely that users use invalid unit names on purpose,
so let's warn them. Warnings are silenced when --quiet is used.

$ build/systemctl show -p Id hello@foo-bar/baz
Invalid unit name "hello@foo-bar/baz" was escaped as "hello@foo-bar-baz" (maybe you should use systemd-escape?)
Id=hello@foo-bar-baz.service

$ build/systemd-run --user --slice foo-bar/baz --unit foo-bar/foo true
Invalid unit name "foo-bar/foo" was escaped as "foo-bar-foo" (maybe you should use systemd-escape?)
Invalid unit name "foo-bar/baz" was escaped as "foo-bar-baz" (maybe you should use systemd-escape?)
Running as unit: foo-bar-foo.service

Fixes #8302.

6 years agoMerge pull request #8523 from keszybz/oss-fuzz-fixes
Lennart Poettering [Wed, 21 Mar 2018 14:26:25 +0000 (15:26 +0100)]
Merge pull request #8523 from keszybz/oss-fuzz-fixes

A fix for oss-fuzz msan ListenNetlink workaround

6 years agouser-util: add new wrappers for reading/writing {passwd,shadow,gshadow} database...
Franck Bui [Wed, 21 Mar 2018 14:26:02 +0000 (15:26 +0100)]
user-util: add new wrappers for reading/writing {passwd,shadow,gshadow} database files (#8521)

The API povided by the glibc is too error-prone as one has to deal directly
with errno in order to detect if errors occured.

Suggested by Zbigniew.

6 years agofuzz-unit-file: fix check if ListenNetlink is used
Zbigniew Jędrzejewski-Szmek [Wed, 21 Mar 2018 12:16:25 +0000 (13:16 +0100)]
fuzz-unit-file: fix check if ListenNetlink is used

A line may contain leading spaces which we should skip.
Fixes https://oss-fuzz.com/v2/issue/5546208027213824/7049.

6 years agoshared/conf-parser: fix outdated comment
Zbigniew Jędrzejewski-Szmek [Wed, 21 Mar 2018 12:15:01 +0000 (13:15 +0100)]
shared/conf-parser: fix outdated comment

6 years agoac-power: add simple getopt() argument parsing to systemd-ac-power (#8516)
Lennart Poettering [Wed, 21 Mar 2018 11:52:18 +0000 (12:52 +0100)]
ac-power: add simple getopt() argument parsing to systemd-ac-power (#8516)

We should probably do that for all our tools, hence fill in this gap
here.

6 years agoMerge pull request #8508 from poettering/more-cocci
Zbigniew Jędrzejewski-Szmek [Wed, 21 Mar 2018 11:50:49 +0000 (12:50 +0100)]
Merge pull request #8508 from poettering/more-cocci

two new coccinelle rules files and their results

6 years agotime-sync-wait: add service (#8494)
Peter A. Bigot [Wed, 21 Mar 2018 11:42:04 +0000 (06:42 -0500)]
time-sync-wait: add service (#8494)

This one-shot service waits until the kernel time has been set to
synchronized.

6 years agoMerge pull request #8313 from alexgartrell/compression-threshold
Lennart Poettering [Wed, 21 Mar 2018 11:37:54 +0000 (12:37 +0100)]
Merge pull request #8313 from alexgartrell/compression-threshold

Compression threshold

6 years agoMerge pull request #8368 from yuwata/nss-systemd-getpwent
Lennart Poettering [Wed, 21 Mar 2018 11:36:47 +0000 (12:36 +0100)]
Merge pull request #8368 from yuwata/nss-systemd-getpwent

nss-systemd: make dynamic users enumerable by `getent`

6 years agodissect: add dissect_image_and_warn() that unifies error message generation for disse...
Lennart Poettering [Wed, 21 Mar 2018 11:10:01 +0000 (12:10 +0100)]
dissect: add dissect_image_and_warn() that unifies error message generation for dissect_image() (#8517)

6 years agomove MANAGER_IS_RELOADING() check into manager_recheck_{dbus|journal}() (#8510)
Lennart Poettering [Wed, 21 Mar 2018 11:03:45 +0000 (12:03 +0100)]
move MANAGER_IS_RELOADING() check into manager_recheck_{dbus|journal}() (#8510)

Let's better check this inside of the call than before it, so that we
never issue this while reloading, even should these calls be called due
to other reasons than just the unit notify.

This makes sure the reload state is unset a bit earlier in
manager_reload() so that we can safely call this function from there and
they do the right thing.

Follow-up for e63ebf71edd7947f29389c72e851d8df5c7bedda.

6 years agofileio: port parse_env_file_internal() to use _cleanup_free_ (#8511)
Lennart Poettering [Wed, 21 Mar 2018 10:59:56 +0000 (11:59 +0100)]
fileio: port parse_env_file_internal() to use _cleanup_free_ (#8511)

6 years agov3: Properly parsing SCSI Hyperv devices (#8509)
Long Li [Wed, 21 Mar 2018 10:51:28 +0000 (03:51 -0700)]
v3: Properly parsing SCSI Hyperv devices (#8509)

Since 2016, Hyperv devices moved to using standard way to expose UUID to sysfs. Fix the parsing function to work with the newer format.

Change log:
v2: changed code to work with both old and new path format
v3: changed guid_str_len type to size_t, fixed length in char guid[] in handle_scsi_hyperv()

6 years agoMerge pull request #8487 from keszybz/oss-fuzz-fixes
Lennart Poettering [Wed, 21 Mar 2018 10:50:57 +0000 (11:50 +0100)]
Merge pull request #8487 from keszybz/oss-fuzz-fixes

Oss fuzz fixes, another batch

6 years agoselinux: let's fully (and statically) initialize log callback union (#8512)
Lennart Poettering [Wed, 21 Mar 2018 10:48:40 +0000 (11:48 +0100)]
selinux: let's fully (and statically) initialize log callback union (#8512)

We can make this const and static, and initialize this ahead of time and
fully, hence let's do that.

6 years agoMerge pull request #8513 from poettering/journal-minifixes
Zbigniew Jędrzejewski-Szmek [Wed, 21 Mar 2018 10:48:06 +0000 (11:48 +0100)]
Merge pull request #8513 from poettering/journal-minifixes

two minor journal fixes

6 years agosd-bus: drop fd_nonblock() calls that are implied by rearrange_stdio() (#8514)
Lennart Poettering [Wed, 21 Mar 2018 10:46:49 +0000 (11:46 +0100)]
sd-bus: drop fd_nonblock() calls that are implied by rearrange_stdio() (#8514)

6 years agocoredumpctl: drop unnecessary NULL initialization, and use const where possible ...
Lennart Poettering [Wed, 21 Mar 2018 10:46:08 +0000 (11:46 +0100)]
coredumpctl: drop unnecessary NULL initialization, and use const where possible (#8515)

6 years agodoc: update TODO
Yu Watanabe [Thu, 8 Mar 2018 03:53:43 +0000 (12:53 +0900)]
doc: update TODO

6 years agonss-systemd: make dynamic users enumerable by `getent`
Yu Watanabe [Wed, 21 Mar 2018 04:39:03 +0000 (13:39 +0900)]
nss-systemd: make dynamic users enumerable by `getent`

This adds `setpwent()`, `getpwent_r()`, `endpwent()`, `setgrent()`,
`getgrent_r()`, and `endgrent()` interfaces to nss-systemd library.
Thus, dynamic users can be enumerated by e.g. `getent passwd` command.

6 years agonss-systemd: define dynamic user properties
Yu Watanabe [Tue, 6 Mar 2018 06:39:26 +0000 (15:39 +0900)]
nss-systemd: define dynamic user properties

6 years agonss-systemd: cleanup bypassing dbus logic
Yu Watanabe [Tue, 6 Mar 2018 12:31:16 +0000 (21:31 +0900)]
nss-systemd: cleanup bypassing dbus logic

6 years agocore: add new dbus method GetDynamicUsers
Yu Watanabe [Wed, 21 Mar 2018 04:11:01 +0000 (13:11 +0900)]
core: add new dbus method GetDynamicUsers

This intruduces a new dbus method GetDynamicUsers for systemd1.Manager,
which enumerates all dynamic users realized in the system.

6 years agoRestore naming of IOPRIO_PRIO defines from linux/ioprio.h
Zbigniew Jędrzejewski-Szmek [Tue, 20 Mar 2018 23:36:35 +0000 (00:36 +0100)]
Restore naming of IOPRIO_PRIO defines from linux/ioprio.h

This undoes part of 10062bbc35a28e95897f66fa5f4991b9b1f9df5d.

6 years agocore/load-fragment: reject overly long paths early
Zbigniew Jędrzejewski-Szmek [Mon, 19 Mar 2018 14:43:35 +0000 (15:43 +0100)]
core/load-fragment: reject overly long paths early

No need to go through the specifier_printf() if the path is already too long in
the unexpanded form (since specifiers increase the length of the string in all
practical cases).

In the oss-fuzz test case, valgrind reports:
  total heap usage: 179,044 allocs, 179,044 frees, 72,687,755,703 bytes allocated
and the original config file is ~500kb. This isn't really a security issue,
since the config file has to be trusted any way, but just a matter of
preventing accidental resource exhaustion.

https://oss-fuzz.com/v2/issue/4651449704251392/6977

While at it, fix order of arguments in the neighbouring log_syntax() call.

6 years agobasic/calendarspec: add check for repeat values that would overflow
Zbigniew Jędrzejewski-Szmek [Mon, 19 Mar 2018 08:21:02 +0000 (09:21 +0100)]
basic/calendarspec: add check for repeat values that would overflow

https://oss-fuzz.com/v2/issue/4651449704251392/7004

6 years agojournal: don't insist that the journal file header's boot ID matches the last entry
Lennart Poettering [Tue, 20 Mar 2018 19:41:30 +0000 (20:41 +0100)]
journal: don't insist that the journal file header's boot ID matches the last entry

We update the boot ID whenever the file is opened for writing (i.e. set
to ONLINE stat), even if we never write a single entry to it. Hence,
don't insist that the last entry's boot ID matches the file header.

As pointed out by Matthijs van Duin:

https://lists.freedesktop.org/archives/systemd-devel/2018-March/040499.html

6 years agojournal-file: drop unused tail_entry_monotonic_valid field.
Lennart Poettering [Tue, 20 Mar 2018 19:37:59 +0000 (20:37 +0100)]
journal-file: drop unused tail_entry_monotonic_valid field.

As pointed out by Matthijs van Duin:

https://lists.freedesktop.org/archives/systemd-devel/2018-March/040499.html

6 years agojournal: make the compression threshold tunable
Alex Gartrell [Tue, 27 Feb 2018 17:37:23 +0000 (09:37 -0800)]
journal: make the compression threshold tunable

Allow a user to set a number of bytes as Compress to use as the compression
threshold.

6 years agococcinelle: always use fcntl(fd, FD_DUPFD, 3) instead of dup(fd)
Lennart Poettering [Tue, 20 Mar 2018 19:57:37 +0000 (20:57 +0100)]
coccinelle: always use fcntl(fd, FD_DUPFD, 3) instead of dup(fd)

Let's avoid fds 0…2 for safety reasons.

6 years agococcinelle: make use of DIV_ROUND_UP() wherever appropriate
Lennart Poettering [Tue, 20 Mar 2018 19:36:09 +0000 (20:36 +0100)]
coccinelle: make use of DIV_ROUND_UP() wherever appropriate

Let's use our macros where we can

6 years agojournal: provide compress_threshold_bytes parameter
Alex Gartrell [Tue, 27 Feb 2018 05:56:35 +0000 (21:56 -0800)]
journal: provide compress_threshold_bytes parameter

Previously the compression threshold was hardcoded to 512, which meant that
smaller values wouldn't be compressed. This left some storage savings on the
table, so instead, we make that number tunable.

6 years agobasic/fs-util: skip fsync_directory_of_file() if /proc/self/fd/ is not available...
Zbigniew Jędrzejewski-Szmek [Tue, 20 Mar 2018 17:20:01 +0000 (18:20 +0100)]
basic/fs-util: skip fsync_directory_of_file() if /proc/self/fd/ is not available (#8386)

When systemd is running under lorax (in Fedora compose process), it'd think that
it failed to write /etc/machine-id, even though the write succeeded, because
fsync_directory_of_file() would fail, because /proc/self/fd/ is not available.
fsync_directory_of_file() is mostly an additional safety net, so I think it's best
to just silently ignore the error.

Strace of pid1:
35791 stat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
35791 openat(AT_FDCWD, "/etc/machine-id", O_RDWR|O_CREAT|O_NOCTTY|O_CLOEXEC, 0444) = 3
35791 umask(022)                        = 000
35791 read(3, "", 38)                   = 0
35791 openat(AT_FDCWD, "/var/lib/dbus/machine-id", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file o
r directory)
35791 openat(AT_FDCWD, "/sys/class/dmi/id/product_name", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
35791 openat(AT_FDCWD, "/sys/class/dmi/id/sys_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
35791 openat(AT_FDCWD, "/sys/class/dmi/id/board_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
35791 openat(AT_FDCWD, "/sys/class/dmi/id/bios_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
35791 access("/proc/xen", F_OK)         = -1 ENOENT (No such file or directory)
35791 openat(AT_FDCWD, "/sys/hypervisor/type", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
35791 openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
35791 getrandom("\xb8\x82\xed\xd4\x35\x11\xd0\xeb\xa6\x79\xd7\x31\x6e\x7b\x99\xce", 16, GRND_NONBLOCK) = 16
35791 writev(2, [{iov_base="Initializing machine ID from random generator.", iov_len=46}, {iov_base="\n", iov_len=1}],
 2) = 47
35791 lseek(3, 0, SEEK_SET)             = 0
35791 ftruncate(3, 0)                   = 0
35791 write(3, "b882edd4351140eba679d7316e7b99ce\n", 33) = 33
35791 fsync(3)                          = 0
35791 fstat(3, {st_mode=S_IFREG|0444, st_size=33, ...}) = 0
35791 readlinkat(AT_FDCWD, "/proc/self/fd/3", 0x564df8c694c0, 99) = -1 ENOENT (No such file or directory)
35791 close(3)                          = 0
35791 umask(022)                        = 022
35791 openat(AT_FDCWD, "/run/machine-id", O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC|O_CLOEXEC, 0444) = 3
35791 write(3, "b882edd4351140eba679d7316e7b99ce\n", 33) = 33
35791 close(3)                          = 0
35791 umask(022)                        = 022
35791 mount("/run/machine-id", "/etc/machine-id", NULL, MS_BIND, NULL) = 0
35791 writev(2, [{iov_base="Installed transient /etc/machine-id file.", iov_len=41}, {iov_base="\n", iov_len=1}], 2) = 42
35791 mount(NULL, "/etc/machine-id", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0

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

6 years agoMerge pull request #8440 from keszybz/use-cleanup-in-efi
Lennart Poettering [Tue, 20 Mar 2018 17:17:57 +0000 (18:17 +0100)]
Merge pull request #8440 from keszybz/use-cleanup-in-efi

Use cleanup in sd-boot

6 years agonspawn: move network namespace creation to a separate step (#8430)
Zbigniew Jędrzejewski-Szmek [Tue, 20 Mar 2018 17:07:17 +0000 (18:07 +0100)]
nspawn: move network namespace creation to a separate step (#8430)

Fixes #8427.

Unsharing the namespace in a separate step changes the ownership of
/proc/net/ip_tables_names (and related files) from nobody:nobody to
root:root. See [1] and [2] for all the details.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f13f2aeed154da8e48f90b85e720f8ba39b1e881
[2] https://bugzilla.netfilter.org/show_bug.cgi?id=1064#c9

6 years agoMerge pull request #8106 from dqminh/route-expires-kernel
Lennart Poettering [Tue, 20 Mar 2018 16:38:30 +0000 (17:38 +0100)]
Merge pull request #8106 from dqminh/route-expires-kernel

move route expiration to kernel

6 years agomkosi: set file permissions in copy of source tree (#8370)
Filipe Brandenburger [Tue, 20 Mar 2018 16:21:36 +0000 (09:21 -0700)]
mkosi: set file permissions in copy of source tree (#8370)

Meson keeps permissions around during the build, so details of how umask
was set when cloning the original git tree will leak all the way to the
installed files in the mkosi image.

So reset the permissions of the files in the copy of the tree before
starting the build.

Also set the umask explicitly.

Tested by creating a mkosi image and booting it on a tree that was
cloned with a umask of 027, confirmed that the *.target files were not
created as world-unreadable anymore.

6 years agoseccomp: enable RestrictAddressFamilies on ppc (#8505)
Mathieu Malaterre [Tue, 20 Mar 2018 15:08:20 +0000 (16:08 +0100)]
seccomp: enable RestrictAddressFamilies on ppc (#8505)

In commit da1921a5c3 ppc64/ppc64el were added as supported architectures for
socketcall() for the POWER family. Extend the support for the 32bits
architectures.

6 years agoMerge pull request #8499 from fbuihuu/shadow-support-nis
Lennart Poettering [Tue, 20 Mar 2018 11:16:43 +0000 (12:16 +0100)]
Merge pull request #8499 from fbuihuu/shadow-support-nis

sysusers: also add support for NIS entries in /etc/shadow

6 years agosysusers: make sure to reset errno before calling fget*ent()
Franck Bui [Tue, 20 Mar 2018 10:38:00 +0000 (11:38 +0100)]
sysusers: make sure to reset errno before calling fget*ent()

Due to the glibc interface we have to test errno in various places to detect if
an error occured after calling fget*ent() helpers.

6 years agosysusers: also add support for NIS entries in /etc/shadow
Franck Bui [Tue, 20 Mar 2018 08:32:05 +0000 (09:32 +0100)]
sysusers: also add support for NIS entries in /etc/shadow

Commit 563dc6f8e2cda4114dd20f32655890ed378c3740 added support for
/etc/{passwd,group} only but since nsswitch.conf(5) appears to document the NIS
entries also for shadow, let's support this case too.

6 years agov4l_id: check mplane video capture and output capailities (#8464)
Jui-Chi Ricky Liang [Tue, 20 Mar 2018 08:54:18 +0000 (16:54 +0800)]
v4l_id: check mplane video capture and output capailities (#8464)

Video devices using mplane buffer API declare capture and output
capabilities with V4L2_CAP_VIDEO_CAPTURE_MPLANE and
V4L2_CAP_VIDEO_OUTPUT_MPLANE.

6 years agoman: use unicode ellipsis in one more place (#8496)
Zbigniew Jędrzejewski-Szmek [Tue, 20 Mar 2018 08:54:01 +0000 (09:54 +0100)]
man: use unicode ellipsis in one more place (#8496)

Also add note where it should *not* be used.

https://github.com/systemd/systemd/pull/8408#discussion_r175606771

6 years agoMerge pull request #8452 from keszybz/use-libmount-more
Lennart Poettering [Tue, 20 Mar 2018 08:53:34 +0000 (09:53 +0100)]
Merge pull request #8452 from keszybz/use-libmount-more

Use libmount in systemd-shutdown, add tests

6 years agohwdb: ThinkPad 4x0s and X1 Carbon 3rd gen LEDs (#8492)
Matteo F. Vescovi [Tue, 20 Mar 2018 06:41:19 +0000 (07:41 +0100)]
hwdb: ThinkPad 4x0s and X1 Carbon 3rd gen LEDs (#8492)

6 years agohwdb: ThinkPad T560 doesn't have a caps lock led (#8490)
Salvo 'LtWorf' Tomaselli [Mon, 19 Mar 2018 18:19:53 +0000 (19:19 +0100)]
hwdb: ThinkPad T560  doesn't have a caps lock led (#8490)

Similar to 16bed3afa1b916ace5e927392a1baab9dd9ff963, this model also doesn't have the
LED.
```
cat /sys/class/dmi/id/modalias
dmi:bvnLENOVO:bvrN1KET16W(1.03):bd01/20/2016:svnLENOVO:pn20FH001AMX:pvrThinkPadT560:rvnLENOVO:rn20FH001AMX:rvrSDK0J40705WIN:cvnLENOVO:ct10:cvrNone:
```

6 years agomacros: fix sysusers_create_inline (#8489)
Filipe Brandenburger [Mon, 19 Mar 2018 17:05:49 +0000 (10:05 -0700)]
macros: fix sysusers_create_inline (#8489)

This typo was introduced in commit dd2490ae12ad1e when using
here-documents for the macro values.

6 years agoMerge pull request #8488 from yuwata/client-update
Zbigniew Jędrzejewski-Szmek [Mon, 19 Mar 2018 16:58:14 +0000 (17:58 +0100)]
Merge pull request #8488 from yuwata/client-update

Many client updates

6 years agoresolve: show more global settings in `systemd-resolve --status`
Yu Watanabe [Mon, 19 Mar 2018 15:40:05 +0000 (00:40 +0900)]
resolve: show more global settings in `systemd-resolve --status`

Closes #8455.

6 years agoresolve: expose global LLMNR, MulticastDNS, and DNSSEC settings as bus property
Yu Watanabe [Mon, 19 Mar 2018 05:29:22 +0000 (14:29 +0900)]
resolve: expose global LLMNR, MulticastDNS, and DNSSEC settings as bus property

6 years agodoc: update TODO
Yu Watanabe [Mon, 19 Mar 2018 15:38:36 +0000 (00:38 +0900)]
doc: update TODO

6 years agobus-util: introduce bus_message_print_all_properties()
Yu Watanabe [Mon, 19 Mar 2018 15:37:00 +0000 (00:37 +0900)]
bus-util: introduce bus_message_print_all_properties()

Then, use it where applicable.

6 years agosystemctl: use bus_map_all_properties() in status command
Yu Watanabe [Mon, 19 Mar 2018 15:20:39 +0000 (00:20 +0900)]
systemctl: use bus_map_all_properties() in status command

6 years agosystemctl: use string table for show()
Yu Watanabe [Mon, 19 Mar 2018 15:09:04 +0000 (00:09 +0900)]
systemctl: use string table for show()

6 years agobus-util: make bus_map_all_properties() not copy string
Yu Watanabe [Mon, 19 Mar 2018 14:46:29 +0000 (23:46 +0900)]
bus-util: make bus_map_all_properties() not copy string

6 years agohwdb: ThinkPad T450s doesn't have a caps lock led (#8433)
Paride Legovini [Mon, 19 Mar 2018 14:56:11 +0000 (15:56 +0100)]
hwdb: ThinkPad T450s doesn't have a caps lock led (#8433)

6 years agobus-util: store boolean message to bool
Yu Watanabe [Thu, 15 Mar 2018 17:35:29 +0000 (02:35 +0900)]
bus-util: store boolean message to bool

6 years agosystemctl: use bus_map_all_properties() in list-dependencies command
Yu Watanabe [Thu, 15 Mar 2018 09:44:34 +0000 (18:44 +0900)]
systemctl: use bus_map_all_properties() in list-dependencies command

6 years agotree-wide: voidify pager_open()
Yu Watanabe [Wed, 14 Mar 2018 08:48:29 +0000 (17:48 +0900)]
tree-wide: voidify pager_open()

Even if pager_open() fails, in general, we should continue the operations.
All erroneous cases in pager_open() show log message in the function.
So, it is not necessary to check the returned value.

6 years agoman: mention 'status' is the default command for timedatectl
Yu Watanabe [Wed, 14 Mar 2018 06:10:46 +0000 (15:10 +0900)]
man: mention 'status' is the default command for timedatectl

6 years agotimedatectl: use dispatch_verb()
Yu Watanabe [Wed, 14 Mar 2018 06:09:28 +0000 (15:09 +0900)]
timedatectl: use dispatch_verb()

6 years agoman: mention 'status' is the default command for localectl
Yu Watanabe [Wed, 14 Mar 2018 05:52:45 +0000 (14:52 +0900)]
man: mention 'status' is the default command for localectl

6 years agolocalectl: use dispatch_verb()
Yu Watanabe [Wed, 14 Mar 2018 05:50:40 +0000 (14:50 +0900)]
localectl: use dispatch_verb()

6 years agohostnamectl: use dispatch_verb()
Yu Watanabe [Wed, 14 Mar 2018 05:29:55 +0000 (14:29 +0900)]
hostnamectl: use dispatch_verb()

6 years agoman: mention that 'status' is the default command for `hostnamectl`
Yu Watanabe [Wed, 14 Mar 2018 05:06:50 +0000 (14:06 +0900)]
man: mention that 'status' is the default command for `hostnamectl`

6 years agocoredumpctl: use dispatch_verb()
Yu Watanabe [Wed, 14 Mar 2018 08:46:34 +0000 (17:46 +0900)]
coredumpctl: use dispatch_verb()

6 years agobusctl: drop redundant pager_open()
Yu Watanabe [Mon, 12 Mar 2018 08:47:16 +0000 (17:47 +0900)]
busctl: drop redundant pager_open()

6 years agobusctl: add missing oom check
Yu Watanabe [Mon, 12 Mar 2018 08:45:42 +0000 (17:45 +0900)]
busctl: add missing oom check

6 years agobusctl: use dispatch_verb()
Yu Watanabe [Tue, 13 Mar 2018 20:09:16 +0000 (05:09 +0900)]
busctl: use dispatch_verb()

6 years agonetworkctl,hwdb: make verbs static
Yu Watanabe [Mon, 12 Mar 2018 05:05:08 +0000 (14:05 +0900)]
networkctl,hwdb: make verbs static

6 years agoMerge pull request #8399 from keszybz/systemctl-kexec
Yu Watanabe [Mon, 19 Mar 2018 09:35:41 +0000 (18:35 +0900)]
Merge pull request #8399 from keszybz/systemctl-kexec

Systemctl kexec buglet fixes

6 years agoMerge pull request #8408 from keszybz/ln-relative
Yu Watanabe [Mon, 19 Mar 2018 09:32:30 +0000 (18:32 +0900)]
Merge pull request #8408 from keszybz/ln-relative

bugs.fd.o bug archelogy

6 years agoshutdown: Don't limit unmount attempts prematurely (#8469)
Jan Janssen [Mon, 19 Mar 2018 09:27:49 +0000 (10:27 +0100)]
shutdown: Don't limit unmount attempts prematurely (#8469)

Once upon a time shutdown.c didn't have the logic to check whether any
unmount attempts succeeded or not. So instead it kept looping for
a fixed amount and hoped all was right. Nowadays, we do know if we
changed anything during a iteration and also stop looping then, but
we still limit ourselves to FINALIZE_ATTEMPTS.

But, theoretically, we could have such a complicated and nested
setup that would survive that limit, leaving stuff around we
might actually be able to unmount. And we could also end up in a
situation where the extra loop with raised unmount error level could
be skipped too.

So let's just drop the retries logic and rely fully on the changed
flag.

6 years agohwdb: fix accelerometer mount matrix for Asus TP300LD (#8327) (#8463)
futpib [Mon, 19 Mar 2018 09:25:07 +0000 (12:25 +0300)]
hwdb: fix accelerometer mount matrix for Asus TP300LD (#8327) (#8463)

6 years agomacros: use here-docs instead of echo (#8480)
Zbigniew Jędrzejewski-Szmek [Mon, 19 Mar 2018 08:07:44 +0000 (09:07 +0100)]
macros: use here-docs instead of echo (#8480)

It's common for sysusers files to contain quotes (in particular around the
comment/GECOS field), and using echo "..." is very likely to not work properly
in that case. Let's use <<EOF redirection. It's not bulletproof, but should
work in general.

6 years agoMerge pull request #8476 from EliaGeretto/n550jv-touchpad-fix
Yu Watanabe [Mon, 19 Mar 2018 08:06:42 +0000 (17:06 +0900)]
Merge pull request #8476 from EliaGeretto/n550jv-touchpad-fix

hwdb: correct touchpad resolution for Asus N550JV