Lennart Poettering
43dc7aa2ba
coccinelle: always use fcntl(fd, FD_DUPFD, 3) instead of dup(fd)
...
Let's avoid fds 0…2 for safety reasons.
2018-03-20 22:31:14 +01:00
Lennart Poettering
be6b0c2165
coccinelle: make use of DIV_ROUND_UP() wherever appropriate
...
Let's use our macros where we can
2018-03-20 20:59:02 +01:00
Zbigniew Jędrzejewski-Szmek
3ceae1bc14
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
2018-03-20 18:20:01 +01:00
Lennart Poettering
4279c82075
Merge pull request #8440 from keszybz/use-cleanup-in-efi
...
Use cleanup in sd-boot
2018-03-20 18:17:57 +01:00
Zbigniew Jędrzejewski-Szmek
0441378080
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
2018-03-20 18:07:17 +01:00
Lennart Poettering
5c24d63675
Merge pull request #8106 from dqminh/route-expires-kernel
...
move route expiration to kernel
2018-03-20 17:38:30 +01:00
Filipe Brandenburger
b454cfb05c
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.
2018-03-20 17:21:36 +01:00
Mathieu Malaterre
0d9fca76bb
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.
2018-03-20 16:08:20 +01:00
Lennart Poettering
ed358dbd0e
Merge pull request #8499 from fbuihuu/shadow-support-nis
...
sysusers: also add support for NIS entries in /etc/shadow
2018-03-20 12:16:43 +01:00
Franck Bui
8c1b45aa9c
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.
2018-03-20 11:38:39 +01:00
Franck Bui
19ec7de2d6
sysusers: also add support for NIS entries in /etc/shadow
...
Commit 563dc6f8e2
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.
2018-03-20 11:28:19 +01:00
Jui-Chi Ricky Liang
27b6cb1f59
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.
2018-03-20 09:54:18 +01:00
Zbigniew Jędrzejewski-Szmek
24c44fdf56
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
2018-03-20 09:54:01 +01:00
Lennart Poettering
8c637fe242
Merge pull request #8452 from keszybz/use-libmount-more
...
Use libmount in systemd-shutdown, add tests
2018-03-20 09:53:34 +01:00
Matteo F. Vescovi
c72102edd5
hwdb: ThinkPad 4x0s and X1 Carbon 3rd gen LEDs ( #8492 )
2018-03-20 07:41:19 +01:00
Salvo 'LtWorf' Tomaselli
bc33509ea0
hwdb: ThinkPad T560 doesn't have a caps lock led ( #8490 )
...
Similar to 16bed3afa1
, 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:
```
2018-03-20 03:19:53 +09:00
Filipe Brandenburger
c2887d565f
macros: fix sysusers_create_inline ( #8489 )
...
This typo was introduced in commit dd2490ae12
when using
here-documents for the macro values.
2018-03-19 18:05:49 +01:00
Zbigniew Jędrzejewski-Szmek
912f7a9877
Merge pull request #8488 from yuwata/client-update
...
Many client updates
2018-03-19 17:58:14 +01:00
Yu Watanabe
11d6e9e9dc
resolve: show more global settings in systemd-resolve --status
...
Closes #8455 .
2018-03-20 00:44:47 +09:00
Yu Watanabe
bf4e5c4cc6
resolve: expose global LLMNR, MulticastDNS, and DNSSEC settings as bus property
2018-03-20 00:44:44 +09:00
Yu Watanabe
3b85dace6d
doc: update TODO
2018-03-20 00:44:41 +09:00
Yu Watanabe
07636114b1
bus-util: introduce bus_message_print_all_properties()
...
Then, use it where applicable.
2018-03-20 00:44:37 +09:00
Yu Watanabe
4679a8c301
systemctl: use bus_map_all_properties() in status command
2018-03-20 00:44:34 +09:00
Yu Watanabe
8559e61d64
systemctl: use string table for show()
2018-03-20 00:44:30 +09:00
Yu Watanabe
f37f8a61c0
bus-util: make bus_map_all_properties() not copy string
2018-03-20 00:42:48 +09:00
Paride Legovini
16bed3afa1
hwdb: ThinkPad T450s doesn't have a caps lock led ( #8433 )
2018-03-19 15:56:11 +01:00
Yu Watanabe
4f00a11c73
bus-util: store boolean message to bool
2018-03-19 22:53:45 +09:00
Yu Watanabe
32b4727965
systemctl: use bus_map_all_properties() in list-dependencies command
2018-03-19 22:53:39 +09:00
Yu Watanabe
ee5324aa04
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.
2018-03-19 21:04:02 +09:00
Yu Watanabe
24fcd009c3
man: mention 'status' is the default command for timedatectl
2018-03-19 21:04:02 +09:00
Yu Watanabe
be90a88654
timedatectl: use dispatch_verb()
2018-03-19 21:04:02 +09:00
Yu Watanabe
d4e0773b4d
man: mention 'status' is the default command for localectl
2018-03-19 21:03:36 +09:00
Yu Watanabe
1d4ecb98be
localectl: use dispatch_verb()
2018-03-19 21:03:36 +09:00
Yu Watanabe
f46bc484f7
hostnamectl: use dispatch_verb()
2018-03-19 21:03:36 +09:00
Yu Watanabe
a456324fef
man: mention that 'status' is the default command for hostnamectl
2018-03-19 21:03:36 +09:00
Yu Watanabe
5ce97d33d0
coredumpctl: use dispatch_verb()
2018-03-19 21:03:36 +09:00
Yu Watanabe
5488660154
busctl: drop redundant pager_open()
2018-03-19 21:03:36 +09:00
Yu Watanabe
cb05d2a514
busctl: add missing oom check
2018-03-19 21:03:36 +09:00
Yu Watanabe
9bb31a0c9f
busctl: use dispatch_verb()
2018-03-19 21:03:36 +09:00
Yu Watanabe
15c3626e06
networkctl,hwdb: make verbs static
2018-03-19 21:03:35 +09:00
Yu Watanabe
cc6861006e
Merge pull request #8399 from keszybz/systemctl-kexec
...
Systemctl kexec buglet fixes
2018-03-19 18:35:41 +09:00
Yu Watanabe
bcabcde5d2
Merge pull request #8408 from keszybz/ln-relative
...
bugs.fd.o bug archelogy
2018-03-19 18:32:30 +09:00
Jan Janssen
ac9cea5ba3
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.
2018-03-19 18:27:49 +09:00
futpib
e9ee721abd
hwdb: fix accelerometer mount matrix for Asus TP300LD ( #8327 ) ( #8463 )
2018-03-19 18:25:07 +09:00
Zbigniew Jędrzejewski-Szmek
dd2490ae12
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.
2018-03-19 17:07:44 +09:00
Yu Watanabe
be1bc01d11
Merge pull request #8476 from EliaGeretto/n550jv-touchpad-fix
...
hwdb: correct touchpad resolution for Asus N550JV
2018-03-19 17:06:42 +09:00
Elia Geretto
26d0c809a5
hwdb: Correct touchpad resolution for Asus N550JV
2018-03-19 08:02:40 +01:00
Elia Geretto
80188d5bf6
hwdb: Split touchpad rules for X550CC and S550C
2018-03-19 08:00:28 +01:00
Evgeny Vereshchagin
e4711004d6
Merge pull request #8461 from keszybz/oss-fuzz-fixes
...
Oss fuzz fixes
2018-03-19 00:06:44 +03:00
Zbigniew Jędrzejewski-Szmek
ca8700e922
core/unit: delay creating a stack variable until after length has been checked
...
path_is_normalized() will reject paths longer than 4095 bytes, so it's better
to not create a stack variable of unbounded size, but instead do the check first
and only then do that allocation.
Also use _cleanup_ to make things a bit shorter.
https://oss-fuzz.com/v2/issue/5424177403133952/7000
2018-03-18 21:07:01 +01:00