Commit Graph
100 Commits
Author SHA1 Message Date
Yu Watanabe 2eaed57bd4 Merge pull request #18932 from poettering/filename-max
Drop use of FILENAME_MAX
2021-03-09 14:15:49 +09:00
Yu Watanabe 0538d2a811 core/execute: sort conditions to make them match documentation 2021-03-08 21:42:06 +09:00
Yu Watanabe 266d0bb9e0 man: update document about NoNewPrivileges=
Fixes #18914.
2021-03-08 21:42:06 +09:00
Yu Watanabe a62f651b32 test: add one more test for system call filter with errno 2021-03-08 21:28:42 +09:00
Yu Watanabe 68acc1afbe seccomp: do not ignore deny-listed syscalls with errno when list is allow-list
Previously, if the hashmap is allow-list and a new deny-listed syscall
is added, seccomp_parse_syscall_filter() simply drop the new syscall
from hashmap even if error number is specified.

This makes 'allow-list' hashmap store two types of entries:
- allow-listed syscalls, which are stored with negative value (-1).
- deny-listed syscalls, which are stored with specified errno.

Fixes #18916.
2021-03-08 21:28:42 +09:00
Yu Watanabe 9e29ee4072 seccomp: use FLAGS_SET() macro 2021-03-08 21:28:42 +09:00
Yu Watanabe 084a46d7c5 core,seccomp: refuse to specify errno for allow-listed syscalls 2021-03-08 21:28:38 +09:00
Yu Watanabe 696a13bab7 core: drop meaningless parse_syscall_and_errno() calls
parse_syscall_and_errno() does not check the validity of syscall name or
syscall group name, but it just split into syscall name and errno.
So, it is not necessary to call it for SystemCallLog=.
2021-03-08 21:26:13 +09:00
Yu Watanabe 1862b310c5 seccomp: fix comment and change variable name 2021-03-08 21:25:54 +09:00
Yu Watanabe 335171ca84 test: parse_syscall_and_errno() accepts zero errno 2021-03-08 21:22:24 +09:00
Yu Watanabe 17884f979a test: move test_parse_syscall_and_errno() to test-seccomp.c 2021-03-08 21:22:24 +09:00
Yu Watanabe f96f5d54b8 socket-util: initialize variable with cleanup attribute
Follow-up for 83e03c4fc2.

Fixes CID#1448460.
2021-03-07 10:32:36 +09:00
Yu Watanabe edf1b5ec92 Merge pull request #18892 from poettering/cname-tweaks
resolved: properly handle stub replies for chains of multiple CNAMEs
2021-03-07 03:03:27 +09:00
Yu Watanabe f91861e49f dissect: fix memleak
Fixes #18903.
2021-03-07 03:02:47 +09:00
Yu Watanabe 2541462f1b Merge pull request #18890 from keszybz/fuzz-bus-match
Add fuzzers for bus match parsing code
2021-03-06 20:35:38 +09:00
Yu Watanabe f6b54e5280 format-table: fix potentail memleak and invalid-free 2021-03-06 09:23:38 +01:00
Yu Watanabe 5a12d1ca1a fstab-generator: fix typo 2021-03-06 08:52:43 +01:00
Yu Watanabe c2cbe05708 Merge pull request #18896 from poettering/no-localhost-ipv6
if ipv6 is turned off, don't synthesize localhost as ::1 ever
2021-03-06 11:28:38 +09:00
Yu Watanabe 3509c7874b test: add test for IMPORT{program}= udev rule 2021-03-05 18:39:38 +09:00
Yu Watanabe 1ebcf47296 test: merge udev tests 2021-03-05 18:36:04 +09:00
Yu Watanabe 275334c562 Merge pull request #18873 from yuwata/use-config-parse-many-and-null-or-empty-path
tree-wide: use config_parse_many() and null_or_empty_path()
2021-03-05 11:34:54 +09:00
Yu Watanabe 986c0edfcb dhcp-server: also append specified additional options and vendor specific option on DHCP_OFFER
Fixes #15780.
2021-03-05 11:34:32 +09:00
Yu Watanabe daceb818cf udev: also not unescape command result on debug log 2021-03-05 11:31:30 +09:00
Yu Watanabe 86c783d93d udev: do not unescape command result
This fixes a bug introduced by 28a5065149.

Fixes RHBZ#1935062 (https://bugzilla.redhat.com/show_bug.cgi?id=1935062).
2021-03-05 09:42:56 +09:00
Yu Watanabe f385c44787 strv: introduce strv_split_newlines_full() 2021-03-05 09:29:57 +09:00
Yu Watanabe 0efaa4843e install: use null_or_empty_path() 2021-03-05 08:09:05 +09:00
Yu Watanabe 4e54a17dbb network: use null_or_empty_path()
This also drops unnecessary fseek().
2021-03-05 08:09:05 +09:00
Yu Watanabe e8e2788dab udev/net: use null_or_empty_path() 2021-03-05 08:09:05 +09:00
Yu Watanabe e406e8a29a udev/net: make .link files support drop-in config 2021-03-05 08:09:01 +09:00
Yu Watanabe 4e5cbc4b17 efi: introduce UINT32_MAX and UINT64_MAX 2021-03-05 07:10:13 +09:00
Yu Watanabe f5fbe71d95 tree-wide: use UINT64_MAX or friends 2021-03-05 07:10:13 +09:00
Yu Watanabe ef1e0b9a46 table: drop last SIZE_MAX from table_set_sort() and table_set_display() 2021-03-05 07:10:13 +09:00
Yu Watanabe 496db33004 tree-wide: use usec_add() and usec_sub_unsigned() 2021-03-05 07:10:08 +09:00
Yu Watanabe 005c7b1d88 journal: make namespace invocation also support drop-in config 2021-03-05 06:57:14 +09:00
Yu Watanabe 6ce8eda8a1 Merge pull request #18864 from poettering/fsync-tweaks
make sure fsync_directory_of_file() + fsync_full() work on more inode types reasonably
2021-03-04 14:51:10 +09:00
Yu Watanabe d9e2af0ae8 tree-wide: use ppoll_usec() 2021-03-04 05:06:48 +09:00
Yu Watanabe c4febde9d0 io-util: introduce ppoll_usec() helper function 2021-03-04 05:06:43 +09:00
Yu Watanabe 1d61d70abb libudev: shorten code a bit
fd_wait_for_event() or ppoll() does not return -EAGAIN.
2021-03-04 05:03:44 +09:00
Yu Watanabe 66d2330265 network: do not remove LLDP state file on failure 2021-03-03 16:42:23 +09:00
Yu Watanabe 5288861bf6 network: use conservative_rename() at one more place 2021-03-03 16:34:51 +09:00
Yu Watanabe a34e58d445 network: remove DHCP lease and LLDP state file on link_free() 2021-03-03 16:31:28 +09:00
Yu Watanabe ab7153b3f4 dhcp: use unlink_and_freep() in dhcp_lease_save() 2021-03-03 16:26:32 +09:00
Yu Watanabe 3be9d62ad1 network: move manager_{rtnl,udev}_process_link() to networkd-link.[ch] 2021-03-03 16:12:33 +09:00
Yu Watanabe 24e3ed843f network: drop unnecessary {} 2021-03-03 16:12:33 +09:00
Yu Watanabe 44e1f7e3dc network: minor style fixes 2021-03-03 16:12:33 +09:00
Yu Watanabe d23a66f274 network: use unlink_and_freep() cleanup functions
This also makes state files not removed on failure.
2021-03-03 16:11:45 +09:00
Yu Watanabe 3b5a4fc685 network: move state file related functions to networkd-state-file.[ch] 2021-03-03 16:07:45 +09:00
Yu Watanabe 7a7d2f16c2 tree-wide: fix typo 2021-03-02 09:48:20 +01:00
Yu Watanabe dbc3cf009a Merge pull request #18832 from keszybz/resolved-stop-sources
Always stop sd-event sources in resolved when unreffing them
2021-03-02 14:15:18 +09:00
Yu Watanabe 2be6c4758e timedate: do not ignore fix_system argument in SetLocalRTC method
Fixes #18391.
2021-02-24 23:50:21 +09:00
Yu Watanabe 6cde5b4b1c network: use IPMasquerade=both instead of yes
Follow-up for 4c72d851cd.
2021-02-24 15:01:43 +01:00
Yu Watanabe b34b57a738 clock-util: rename function argument 2021-02-24 19:56:14 +09:00
Yu Watanabe b49bb2866c doc,man: fix-typo (hierachy -> hierarchy) 2021-02-24 09:54:16 +01:00
Yu Watanabe ebc98027fc Merge pull request #18589 from yuwata/network-nexthop-drop-unnecessary-nexthops
network: drop unnecessary nexthops
2021-02-24 09:07:57 +09:00
Yu Watanabe e94a009c10 core: fix stack-use-after-scope
Fixes a bug introduced by f70e6fb471.

Fixes #18753.
2021-02-23 15:39:31 +01:00
Yu Watanabe 9947c7bad1 test-network: add tests for dropping unnecessary nexthops 2021-02-23 22:48:12 +09:00
Yu Watanabe 25b82b6e0e network: nexthop: drop unnecessary nexthops
Similar to addresses or routes, this makes networkd drops unnecessary
nexthops on configuring links or when a link is dropped.
2021-02-23 22:47:11 +09:00
Yu Watanabe 0e9d129c16 network: nexthop: read protocol in received netlink message
Preparation of later commits.
2021-02-23 22:47:11 +09:00
Yu Watanabe e64e052e17 sd-netlink: introduce sd_rtnl_message_nexthop_get_protocol() 2021-02-23 22:47:11 +09:00
Yu Watanabe 774c0e433c Revert "meson: remove one more instance of install_dir:bindir"
This reverts commit 5ffa2eaa54.

It seems that if install_dir is not specified, meson decides install path
based on file type, and non-executable binary files are installed under
/usr/share.

kernel-install is a script. So, we need to set install_dir argument
explicitly.

Fixes #18754.
2021-02-23 13:52:55 +01:00
Yu Watanabe 73b49d433c dhcp6: do not set T1 and T2 by dhcp6_option_append_pd() in client
Fixes #18090.
2021-02-23 19:36:37 +09:00
Yu Watanabe e7613578b4 dhcp6: do not set T1 and T2 by dhcp6_option_append_ia() in client 2021-02-23 19:36:37 +09:00
Yu Watanabe 1e84213a43 dhcp6: make dhcp6_option_parse_{address,pdprefix}() return -EINVAL when received address or prefix is refused
And then the caller ignores the error.
Otherwise, `ret_liftime_valid` is not set even if they succeeds.
2021-02-23 19:36:23 +09:00
Yu Watanabe cf6c33bd6b dhcp6: do not use input value before checking 2021-02-23 18:49:11 +09:00
Yu Watanabe c83e44110c Merge pull request #18718 from yuwata/network-nexthop-blackhole
network: introduce Blackhole= setting in [NextHop] section
2021-02-23 04:44:12 +09:00
Yu Watanabe e82a0ef1cf Merge pull request #18734 from poettering/cryptsetup-description-escape
cryptsetup: unescape ID_PART_ENTRY_NAME udev field
2021-02-23 04:43:22 +09:00
Yu Watanabe 518339d89f Merge pull request #18731 from yuwata/backlight-trivial-cleanups
backlight: trivial cleanups
2021-02-23 04:42:09 +09:00
Yu Watanabe 69a91c704e test-network: add tests for Blackhole= setting in [NextHop] section 2021-02-23 02:21:35 +09:00
Yu Watanabe 484555f3f2 network: route: shorten code a bit 2021-02-23 02:21:31 +09:00
Yu Watanabe 30f1083709 network: nexthop: add Blackhole= setting in [NextHop] section
As similar to unreachable type routes, blackhole nexthops do not have
NHA_OID attribute, so they are managed by Manager.
2021-02-23 02:21:17 +09:00
Yu Watanabe b77c929934 backlight: reindent comments 2021-02-22 23:45:55 +09:00
Yu Watanabe d17d66f0ab backlight: reduce indentation a bit 2021-02-22 23:25:00 +09:00
Yu Watanabe ba6c9b7994 backlight: same_device() may return negative errno 2021-02-22 23:11:28 +09:00
Yu Watanabe 7a9737bc7d backlight: exit earlier when unknown verb is specified 2021-02-22 23:00:46 +09:00
Yu Watanabe 84d32bf59b test-network: test wireguard peer in drop-in config
Closes #18241.
2021-02-22 21:33:36 +09:00
Yu Watanabe 5e63f2915b man: fix typo 2021-02-21 19:20:47 +01:00
Yu Watanabe a9f2f1c13a Merge pull request #18711 from yuwata/network-nexthop-onlink
network: nexthop: add OnLink= setting
2021-02-21 10:33:36 +09:00
Yu Watanabe e2d9bc5cfd test-network: add a test for OnLink= in [NextHop] section 2021-02-21 05:16:27 +09:00
Yu Watanabe 2ddd52d1e2 network: nexthop: add OnLink= setting 2021-02-21 05:16:23 +09:00
Yu Watanabe 1f22fc3828 mount-tool: sd_device_get_sysattr_value() returns 0 on success 2021-02-21 04:40:23 +09:00
Yu Watanabe 9520c2f62b sd-device-enumerator: shorten code a bit 2021-02-21 04:40:23 +09:00
Yu Watanabe 3f15ce66e0 unit: ignore exit code of "udevadm trigger"
Suggested at https://github.com/systemd/systemd/pull/18559#issuecomment-781626226.

Some drivers may be broken and return unexpected errors on triggering
events. That should be logged but should not boot-up to be affected.
2021-02-21 04:40:23 +09:00
Yu Watanabe 6c99c26500 udevadm-trigger: introduce --quiet option
This may be useful to invoke the command by non-privileged users.
2021-02-21 04:40:23 +09:00
Yu Watanabe 0e789e6d48 udevadm-trigger: do not return immediately on EACCES
Prompted by https://github.com/systemd/systemd/pull/18559.
2021-02-21 04:40:23 +09:00
Yu Watanabe 21012e20a4 udevadm-trigger: use sd_device_trigger() for triggering uevent 2021-02-21 04:40:23 +09:00
Yu Watanabe 25677a055c udev: use sd_device_trigger() to trigger uevent 2021-02-21 04:40:23 +09:00
Yu Watanabe f4d36efa75 sd-device: introduce tiny wrapper sd_device_trigger() 2021-02-21 04:40:23 +09:00
Yu Watanabe 297d1370f8 sd-device: do not cache action string for uevent file written by sd_device_set_sysattr_value()
As sd_device_get_sysattr_value() may be already used to read uevent
file. The read value of uevent file may be usually quite different
from the action string.
2021-02-21 04:40:23 +09:00
Yu Watanabe 1dff135bf9 test: add more tests for path_startswith() 2021-02-21 04:40:23 +09:00
Yu Watanabe 9dcde1034c sd-device: make devpath check stricter
See assertion in sd_device_get_devpath().
2021-02-21 04:40:23 +09:00
Yu Watanabe 45e093a968 sd-device: make sd_device_get_xxx() accept NULL for storing result
Though, setting NULL for some getters, e.g. sd_device_get_syspath()
may be meaningless, but anyway also let's make them accept NULL for
consistency.
2021-02-21 04:40:23 +09:00
Yu Watanabe 163e0a882c sd-device: use appropriate error code 2021-02-21 04:40:23 +09:00
Yu Watanabe 66efcbb149 sd-device: add a brief comment in device_cache_sysattr_value() 2021-02-21 04:40:23 +09:00
Yu Watanabe acfc2a1d15 sd-device: ignore error in device_cache_sysattr_value() and propagate original error code
There are three calls of device_cache_sysattr_value(). Two of them are
just caching the value. Hence, let's ignore its failure, and propagate
original error code.

One exception is the last call in sd_device_get_sysattr_value().
Unfortunately, it returns `const char *` instead of `char *`. So,
sd_device object must have the reference of the returned value.
Hence, error in updating the cache by device_cache_sysattr_value()
is critical, and we need to propagate the error in that case.
2021-02-21 04:40:17 +09:00
Yu Watanabe 32a739afe0 sd-device: the last argument of sd_device_get_sysattr_value() may be NULL 2021-02-21 04:30:42 +09:00
Yu Watanabe 2a394d0bf2 sd-device: use delete_trailing_chars()
Also, this drops trailing '\r' from sysattr value set in
sd_device_set_sysattr_value().
2021-02-21 04:30:42 +09:00
Yu Watanabe 23ff570ba8 sd-device: do not cache an empty string but clear cache on failre
And propagate the original error on write.
Note that some attributes are read-only.
2021-02-21 04:30:42 +09:00
Yu Watanabe 2f7a2e3952 sd-device: move comment about NULL value
It is not intuitive, and I do not know why the function behave so.
But let's keep that behavior for compatibility, as such behavior
may be already used explicitly by callers.
2021-02-21 04:30:42 +09:00
Yu Watanabe 2a0ebc0569 sd-device: rename device_{add,get,remove}_sysattr_value()
They just handle cache of sysattr values. Hence, let's use more
explanatory names.
2021-02-21 04:30:42 +09:00
Yu Watanabe 27edd36eaa network: fix typo 2021-02-20 18:58:07 +09:00