summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* shared/exec-util: use our own execveat() wrapper instead of fexecve()Zbigniew Jędrzejewski-Szmek2020-11-063-3/+24
| | | | | | | | | | | | | | For scripts, when we call fexecve(), on new kernels glibc calls execveat(), which fails with ENOENT, and then we fall back to execve() which succeeds: [pid 63039] execveat(3, "", ["/home/zbyszek/src/systemd/test/test-path-util/script.sh", "--version"], 0x7ffefa3633f0 /* 0 vars */, AT_EMPTY_PATH) = -1 ENOENT (No such file or directory) [pid 63039] execve("/home/zbyszek/src/systemd/test/test-path-util/script.sh", ["/home/zbyszek/src/systemd/test/test-path-util/script.sh", "--version"], 0x7ffefa3633f0 /* 0 vars */) = 0 But on older kernels glibc (some versions?) implement a fallback which falls into the same trap with bash $0: [pid 13534] execve("/proc/self/fd/3", ["/home/test/systemd/test/test-path-util/script.sh", "--version"], 0x7fff84995870 /* 0 vars */) = 0 We don't want that, so let's call execveat() ourselves. Then we can do the execve() fallback as we want.
* core/execute: fall back to execve() for scriptsZbigniew Jędrzejewski-Szmek2020-11-066-4/+38
| | | | fexecve() fails with ENOENT and we need a fallback. Add appropriate test.
* core: use fexecve() to spawn childrenZbigniew Jędrzejewski-Szmek2020-11-062-8/+14
| | | | | We base the smack/selinux setup on the executable. Let's open the file once and use the same fd for that setup and the subsequent execve.
* basic/path-util: let find_executable_full() optionally return an fdZbigniew Jędrzejewski-Szmek2020-11-064-16/+87
|
* core/execute: refactor creation of array with fds to keep during executionZbigniew Jędrzejewski-Szmek2020-10-141-44/+47
| | | | | | | | | | | | | | | | | | We close fds in two phases, first some and then the some more. When passing a list of fds to exclude from closing to the closing function, we would pass some in an array and the rest as separate arguments. For the fds which should be excluded in both closing phases, let's always create the array and put the relevant fds there. This has the advantage that if more fds to exclude in both phases are added later, we don't need to add more positional arguments. The list passed to setup_pam() is not changed. I think we could pass more fds to close there, but I'm leaving that unchanged. The setting of FD_CLOEXEC on an already open fds is dropped. The fd is opened in service_allocate_exec_fd() and there is no reason to suspect that it might have been opened incorrectly. If some rogue code is unsetting our FD_CLOEXEC bits, then it might flip any fd, no reason to single this one out.
* Merge pull request #16968 from yuwata/remove-old-device-on-move-eventLennart Poettering2020-10-1410-127/+259
|\ | | | | core, udev: remove old device on move event
| * test: add test for device renaming issue #16967Yu Watanabe2020-09-152-0/+31
| |
| * udev: merge rules for bluetooth deviceYu Watanabe2020-09-151-2/+2
| |
| * udev: do not update return value on failureYu Watanabe2020-09-151-1/+0
| |
| * udev: allow to match OriginalName= with renamed interface nameYu Watanabe2020-09-151-19/+8
| |
| * udev: re-assign ID_NET_DRIVER=, ID_NET_LINK_FILE=, ID_NET_NAME= properties ↵Yu Watanabe2020-09-152-4/+28
| | | | | | | | | | | | | | | | | | | | | | on non-'add' uevent Previous commit makes drop ID_NET_DRIVER=, ID_NET_LINK_FILE=, and ID_NET_NAME= properties for network interfaces on 'move' uevent. ID_NET_DRIVER= and ID_NET_LINK_FILE= properties are used by networkctl. ID_NET_NAME= may be used by end-user rules or programs. So, let's re-assign them on 'move' uevent. (Note that strictly speaking, this makes them re-assigned on all but 'remove' uevent.)
| * Revert "udev: import the full db on MOVE events for devices without dev_t"Yu Watanabe2020-09-151-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b081b27e1433cdc7ac72b25ae8b4db887d79187f. If a network interface get a 'move' event, then previously SYSTEMD_ALIAS= property still contains an old alias, and the old alias .device unit will not be removed. This makes all properties cleared on 'move' event, and then old alias .device unit will be removed by pid1. Fixes #16967.
| * udev: split link_config_apply() into small piecesYu Watanabe2020-09-152-88/+158
| |
| * ethtool: constify arguments for ethtool_set_xxx()Yu Watanabe2020-09-152-8/+8
| |
| * core/device: remove .device unit corresponding to DEVPATH_OLDYu Watanabe2020-09-151-0/+26
| | | | | | | | Partially fixes #16967.
* | Merge pull request #17338 from poettering/close-rangeLennart Poettering2020-10-147-8/+240
|\ \ | | | | | | make use of new kernel 5.9 close_range() syscall in close_all_fds()
| * | update TODOLennart Poettering2020-10-141-2/+0
| | |
| * | test-fd-util: add test case for close_all_fd()Lennart Poettering2020-10-141-0/+96
| | |
| * | fd-util: port close_all_fds() to close_range()Lennart Poettering2020-10-141-0/+90
| | |
| * | missing: add close_range() wrapperLennart Poettering2020-10-142-0/+47
| | | | | | | | | | | | | | | The syscall was added in 5.9 and is not yet exposed in glibc, hence define our own wrapper.
| * | seccomp: allowlist close_range() by default in @basic-ioLennart Poettering2020-10-141-0/+1
| | |
| * | alloc-util: avoid allocating zero size memory blocksLennart Poettering2020-10-141-6/+6
| | | | | | | | | | | | | | | It's not clear what libc's make of this. We clamp to 1 byte allocations in most cases already, let's add this for a few where this was missing.
* | | Merge pull request #17342 from yuwata/network-dhcp-ipv4-acd-fixesYu Watanabe2020-10-145-21/+65
|\ \ \ | | | | | | | | network: fixes several issues in IPv4 DAD for DHCP4
| * | | network: update MAC address in IPv4ACD client for DHCP4Yu Watanabe2020-10-141-0/+32
| | | |
| * | | network: also stop IPv4ACD client in link_stop_clients()Yu Watanabe2020-10-141-0/+6
| | | |
| * | | network: stop IPv4ACD client for DHCPv4 when lease is expriredYu Watanabe2020-10-141-0/+3
| | | |
| * | | network: move IPv4ACD client for DHCPv4 from Network to Link objectYu Watanabe2020-10-145-24/+27
| | | | | | | | | | | | | | | | A .network file may matches multiple interfaces.
| * | | network: voidify link_stop_clients() in link_enter_failed()Yu Watanabe2020-10-141-1/+1
| | | |
* | | | Merge pull request #17267 from yuwata/hashmap_put_strdupZbigniew Jędrzejewski-Szmek2020-10-146-14/+32
|\ \ \ \ | | | | | | | | | | hashmap: make hashmap_put_strdup() take hash_ops
| * | | | sd-device: use trivial_hash_ops_free_free for managing match sysattrs or ↵Yu Watanabe2020-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | properties This fixes an issue caused by eb1c1dc029c91750e6255c3fd844b4f4bf238fab. Before the commit, multiple values can be specified for the same sysattr or property. Fixes #17259.
| * | | | util: introduce two trivial hash_opsYu Watanabe2020-10-132-0/+15
| | | | | | | | | | | | | | | | | | | | Will be used in a later commit.
| * | | | hashmap: introduce {hashmap,set}_put_strdup_full()Yu Watanabe2020-10-133-12/+15
| | | | | | | | | | | | | | | | | | | | They can take hash_ops.
* | | | | Merge pull request #17316 from yuwata/network-address-ipv4-peer-issue-17304Zbigniew Jędrzejewski-Szmek2020-10-146-149/+197
|\ \ \ \ \ | | | | | | | | | | | | network: directly compare with in_addr element for IPv4 case
| * | | | | test-network: add test for issue #17304Yu Watanabe2020-10-132-0/+25
| | | | | |
| * | | | | network: constify argumentsYu Watanabe2020-10-132-11/+11
| | | | | |
| * | | | | network: read peer address, label, broadcast from rtnl messageYu Watanabe2020-10-134-147/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Then, Address objects in Network and Link can be easily compared by address_equal().
| * | | | | network: directly compare with in_addr element for IPv4 caseYu Watanabe2020-10-131-0/+9
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When peer address is set, address_compare_func() (or address_equal()) does not work in link_is_static_address_configured(), as an Address object stored in a Link does not contain peer addresses. So, we need to also compare with in_addr element for IPv4 case. Fixes #17304.
* | | | | Merge pull request #17341 from yuwata/sd-dhcp-client-fix-eexist-issue-16964Yu Watanabe2020-10-144-62/+62
|\ \ \ \ \ | | | | | | | | | | | | sd-dhcp: make sd_dhcp_client_set_request_option() not return -EEXIST
| * | | | | network: drop unused conditionYu Watanabe2020-10-141-4/+0
| | | | | |
| * | | | | sd-dhcp-client: make sd_dhcp_client_set_request_option() not return -EEXISTYu Watanabe2020-10-143-58/+62
| |/ / / / | | | | | | | | | | | | | | | Fixes #16964.
* | | | | network: start dynamic addressing clients like DHCP after setting netdevsYu Watanabe2020-10-141-6/+5
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function link_acquire_conf() may make the link state 'configuring' when DHCP6 PD is enabled. Previously link_acquire_conf() was called before link_enter_join_netdev(), and thus the assertion in the function might be triggered. Fixes #17329.
* | | | analyze: show ungrouped syscalls separately (#17343)Lennart Poettering2020-10-142-7/+28
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | This updates the "systemd-analyze syscall-filter" command to show a special section of syscalls that are included in @known but in no other group. Typically this should show syscalls we either should add to any of the existing groups or where we unsure were they best fit in. Right now, it mostly shows arch-specific compat syscalls, we probably should move "@obsolete". This patch doesn't add thta however.
* | | typo in systemd.network(5): IPv6PrefixDelegation=dhcpv6Dmitry Borodaenko2020-10-141-1/+1
| | |
* | | units: update serial-getty@.service to support 57600 baud rateBjørn Mork2020-10-131-1/+1
| | | | | | | | | | | | Fixes: #17306
* | | hwdb: update for v247Zbigniew Jędrzejewski-Szmek2020-10-1313-990/+7993
|/ / | | | | | | | | As usual, it seems that there are mostly additions with a smaller amount of corrections, no big removals.
* | po: revert some recent translation changes (#17237)Daniele Medri2020-10-131-129/+118
| | | | | | | | | | | | This partially reverts 7b8c70ed209: - È richiesto autenticarsi → Autenticazione richiesta - «${unit}» → '${unit}'
* | sysctl: set kernel.core_pipe_limit=16Lennart Poettering2020-10-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to make sure that our coredump pattern handler manages to read process metadata from /proc/$PID/ before the kernel reaps the crashed process. By default the kernel will reap the process as soon as it can. By setting kernel.core_pipe_limit to a non-zero the kernel will wait for userspace to finish before reaping. We'll set the value to 16, which allows 16 crashes to be processed in parallel. This matches the MaxConnections= setting in systemd-coredump.socket. See: #17301 (This doesn't close 17301, since we probably should also gracefully handle if /proc/$PID/ vanished already while our coredump handler runs, just in case people loclly set the sysctl back to zero. i.e. we should collect what we can and rather issue an incomplete log record than none.)
* | basic/selinux: work around mallinfo deprecationZbigniew Jędrzejewski-Szmek2020-10-123-8/+27
| | | | | | | | | | | | | | Latest glibc has deprecated mallinfo(), so it might become unavailable at some point in the future. There is malloc_info(), but it returns XML, ffs. I think the information that we get from mallinfo() is quite useful, so let's use mallinfo() if available, and not otherwise.
* | update TODOLennart Poettering2020-10-121-3/+5
| |
* | xdg-autostart: Lower most info messages to debug levelBenjamin Berg2020-10-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is expected for numerous autostart files to not be convertible to corresponding units. The information is only useful for someone debugging why a file might not be started, but it is not generally useful for users in most situations. As such, lower the warnings. Anyone wondering why an application is not started will easily notice that the unit is not generated. From there it will be somewhat harder to figure out why, but the overall trade-off is still improved. Fixes: #17305