1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00
Commit Graph

34663 Commits

Author SHA1 Message Date
Franck Bui
9f36a8fb38 tmpfiles: add more tests 2018-07-30 16:04:23 +02:00
Franck Bui
addc3e302d tmpfiles: don't follow unsafe transitions in path_set_*()
Since all path_set_*() helpers don't follow symlinks, it's possible to use
chase_symlinks(CHASE_NOFOLLOW) flag to both open the files specified by the
passed paths and check their validity (unlike their counterpart fd_set_*()
helpers).
2018-07-30 16:04:20 +02:00
Franck Bui
1f56e4ce77 fs-util: add new CHASE_NOFOLLOW flag to chase_symlinks()
This flag mimics what "O_NOFOLLOW|O_PATH" does for open(2) that is
chase_symlinks() will not resolve the final pathname component if it's a
symlink and instead will return a file descriptor referring to the symlink
itself.

Note: if CHASE_SAFE is also passed, no safety checking is performed on the
transition done if the symlink would have been followed.
2018-07-30 15:54:03 +02:00
Franck Bui
7ea5a87f92 tmpfiles: make create_fifo() safe 2018-07-30 15:54:03 +02:00
Franck Bui
4fe3828c58 fs-util: introduce mkfifoat_atomic() helper 2018-07-30 15:54:03 +02:00
Franck Bui
43231f00c2 fileio: make tempfn_random_child() accept empty string as path
In this case it simply returns the random generated filename with anything
prefixed.
2018-07-30 15:54:03 +02:00
Franck Bui
a2fc2f8dd3 tmpfiles: introduce create_fifo() 2018-07-30 15:54:03 +02:00
Franck Bui
5494602195 tmpfiles: introduce empty_directory() 2018-07-30 15:54:03 +02:00
Franck Bui
4c39d899ff tmpfiles: introduce create_directory() and create_subvolume() and make them safe 2018-07-30 15:54:03 +02:00
Franck Bui
a12e4ade1b basic/stat-util: introduce is_dir_fd() 2018-07-30 15:54:03 +02:00
Franck Bui
62f9666ae0 btrfs-util: introduce btrfs_subvol_make_fd() 2018-07-30 15:54:03 +02:00
Franck Bui
1e9126316f basic/label: introduce mkdirat_label()/mkdirat_errno_wrapper() helpers 2018-07-30 15:54:03 +02:00
Franck Bui
7e531a5265 selinux: introduce mac_selinux_create_file_prepare_at() 2018-07-30 15:54:03 +02:00
Franck Bui
2c3d5adde0 smack: introduce mac_smack_fix_at() 2018-07-30 15:54:03 +02:00
Franck Bui
4ad3684410 tmpfiles: introduce create_directory_or_subvolume()
No functional changes.
2018-07-30 15:54:03 +02:00
Franck Bui
c7700a7748 tmpfiles: make create_device() safe 2018-07-30 15:54:03 +02:00
Franck Bui
074bd73fd3 tmpfiles: introduce create_device() 2018-07-30 15:54:03 +02:00
Franck Bui
16ba55adb1 tmpfiles: make copy_files() safe 2018-07-30 15:54:02 +02:00
Franck Bui
b1f7b17f9a tmpfiles: introduce copy_files() routine
No functional changes.
2018-07-30 15:54:02 +02:00
Franck Bui
551470ecf2 tmpfiles: make write_one_file() safe 2018-07-30 15:54:02 +02:00
Franck Bui
14ab804e14 tmpfiles: make truncate_file() safe 2018-07-30 15:54:02 +02:00
Franck Bui
5ec9d06512 tmpfiles: introduce truncate_file() which deals with 'F' exclusively
TRUNCATE_FILE is now handled by a new dedicated function
truncate_file(). Indeed we have to take special care when truncating existing
file since the behavior is only specified for regular files.

Well that's not entirely true for fifo and terminal devices since O_TRUNC is
ignored in this case but even in for these types of file, truncating is
probably not the right thing to do.

It is worth noting that both truncate_file() and create_file() have been
modified so they use fstat(2) instead of stat(2) since both functions are not
supposed to follow symlinks.
2018-07-30 15:53:53 +02:00
Franck Bui
31c84ff11e tmpfiles: introduce create_file() which deals with 'f'/'F' exclusively
write_one_file() only deals with the 'w' command and 'f'/'F' are now handled by
a new function create_file().

This is primarly done because 'w' is allowed to operate on any kind of files,
not just regular ones.
2018-07-30 14:44:58 +02:00
Franck Bui
b206ac8e54 tmpfiles: make the stat struct parameter in fd_set_*() optional
So every callers are not forced to stat() the passed file descriptor before
calling those functions.
2018-07-30 14:44:58 +02:00
Franck Bui
14f3480af1 tmpfiles: stat file in item_do() rather than in its callers
This a slight simplification since all callers of item_do()
(glob_item_recursively() and item_do() itself) stat the file descriptor only
for passing it to item_do().
2018-07-30 14:44:58 +02:00
Yu Watanabe
1c57fa90be man: move explanations about boolean and time-span value from systemd.unit to systemd.syntax
Fixes #9735.
2018-07-30 14:13:42 +02:00
Lennart Poettering
f6f8a1aee0
Merge pull request #9734 from irtimmer/feature/dns-over-tls-openssl
resolved: Add OpenSSL as alternative SSL library
2018-07-30 14:13:05 +02:00
Lennart Poettering
faf739a73d
Merge pull request #9747 from yuwata/workaround-structured-initialization
sd-resolve: use structured initialization and a workaround for nested structs
2018-07-30 13:25:37 +02:00
Mike Palmer
4da3d1d10b Expanding evdev device match for Razer Blade Stealth (2017) 2018-07-30 13:24:18 +02:00
Lennart Poettering
150a509c9f
Merge pull request #9742 from yuwata/workaround-9718
resolve: add option to toggle reading /etc/hosts
2018-07-30 12:40:20 +02:00
Yu Watanabe
b127bc99d1 sd-resolve: workaround for structured initialization to nested structs
When a nested struct is initialized by structured initializer, then
padding space is not cleared by zero. So, before setting values,
this makes explicitly set zero including padding.

This fixes the following false positive warning by valgrind:
```
==492== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
==492==    at 0x56D0CF7: sendmsg (in /usr/lib64/libpthread-2.27.so)
==492==    by 0x4FDD3C5: sd_resolve_getaddrinfo (sd-resolve.c:975)
==492==    by 0x110B9E: manager_connect (timesyncd-manager.c:879)
==492==    by 0x10B729: main (timesyncd.c:165)
==492==  Address 0x1fff0008f1 is on thread 1's stack
==492==  in frame #1, created by sd_resolve_getaddrinfo (sd-resolve.c:928)
==492==
```
2018-07-29 16:05:23 +09:00
Yu Watanabe
2a12960bcd sd-resolve: use structured initialization at more places 2018-07-29 16:01:37 +09:00
Yu Watanabe
494c5676b3 man: use literal tag 2018-07-28 21:46:22 +09:00
Yu Watanabe
8631708741 resolve: add option to toggle reading /etc/hosts
Workaround for #9718.
2018-07-28 21:46:00 +09:00
Yu Watanabe
452ca09152 resolve: make manager_etc_hosts_read() static 2018-07-28 20:36:13 +09:00
Iwan Timmer
04c4d9199e resolved: TCP Fast Open and TLS Session Tickets for OpenSSL
To decreae latency this add support for TFO and TLS Session Tickets. As OpenSSL wouldn't let you easily set a different function all written data is temporarily cached and therefore needs to be flushed after each SSL function which can write data.
2018-07-27 21:23:17 +01:00
Iwan Timmer
096cbdce13 resolved: basic OpenSSL support for DNS-over-TLS
This provides basic OpenSSL support without optimizations like TCP Fast Open and TLS Session Tickets.
Notice only a single SSL library can be enabled at a time and therefore journald functions provided by GnuTLS will be disabled when using OpenSSL.
Fixes #9531
2018-07-27 21:23:17 +01:00
Iwan Timmer
ba6aaf5727 resolved: set io events after receiving EAGAIN for TLS
During handshake and TLS session closing, messages needs to be exchanged. Therefore this patch overrides the requested IO events for the TCP stream when the TLS is waiting for sending or receiving of messages during theses periods. This fixes issues with correctly closing the TLS stream and prevents the handshake from hanging in rare cases (not seen yet).
2018-07-27 21:23:17 +01:00
Iwan Timmer
6016fcb0ea resolved: refactor GnuTLS specific code in separate source file
This is a first step towards supporting alternative TLS implementations for DNS-over-TLS.

Co-authored-by: Filipe Brandenburger <filbranden@google.com>
2018-07-27 21:23:17 +01:00
Michael Biebl
48c20af38e test: Increase qemu timeout from 90s to 180s
The usage of an initrd made TEST-09-ISSUE-2691 more likely to fail with
a timeout, so increase the timeout by 90s and adjust TimeoutStopSec=
accordingly.
2018-07-27 14:35:26 +03:00
Lennart Poettering
4d7293f07c
Merge pull request #9726 from dkozovsk/master
signal safety fixes exit ->_exit, call of page_size to prevent call of sysconf from signal handler
2018-07-27 09:56:24 +02:00
Lennart Poettering
126708fa02 update TODO 2018-07-26 16:55:27 +02:00
Erik Kooistra
d3051e7866 hwdb: Added correct ACCEL_MOUNT_MATRIX for the Asus TP412UA 2018-07-26 16:01:19 +02:00
Daniel
1595b257df void call of page_size guarantees that sysconf is not called from signal handler 2018-07-26 15:39:12 +02:00
Daniel
14a6aee050 changed exit(4) to asynchronous-safe _exit(4) in signal handler sig_alrm 2018-07-26 14:47:38 +02:00
Zbigniew Jędrzejewski-Szmek
4ee35e4e53
Merge pull request #9721 from yuwata/fix-resolve-memleak
Fix resolve memleak
2018-07-26 14:22:15 +02:00
Lennart Poettering
c9177eb8ec
Merge pull request #9719 from poettering/sleep-fixes
require the kernel image to still exist before allowing hibernation
2018-07-26 14:03:18 +02:00
Zbigniew Jędrzejewski-Szmek
7426028b7a
Merge pull request #9720 from yuwata/fix-9702
Fix DynamicUser=yes with static User= whose UID and GID are different
2018-07-26 11:42:00 +02:00
Lennart Poettering
007d5b1f40 hwbd: whitespace fix-up
A correction for 505707490a.
2018-07-26 11:01:29 +02:00
Lennart Poettering
904865b8c2 sleep-config: library code should not log beyond LOG_DEBUG 2018-07-26 11:01:29 +02:00