summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* ratelimit: fix integer overflowEtienne Doms2020-11-121-1/+1
| | | If StartLimitIntervalSec is huge, or more specifically, set to "infinity", we need to take care about overflows.
* meson: add option to skip installing to $sysconfdirJörg Thalheim2020-11-1213-42/+71
| | | | | | | | | | | | | | | | | | | | | This is useful for development where overwriting files out side the configured prefix will affect the host as well as stateless systems such as NixOS that don't let packages install to /etc but handle configuration on their own. Alternative to https://github.com/systemd/systemd/pull/17501 tested with: $ mkdir inst build && cd build $ meson \ -Dcreate-log-dirs=false \ -Dsysvrcnd-path=$(realpath ../inst)/etc/rc.d \ -Dsysvinit-path=$(realpath ../inst)/etc/init.d \ -Drootprefix=$(realpath ../inst) \ -Dinstall-sysconfdir=false \ --prefix=$(realpath ../inst) .. $ ninja install
* Merge pull request #17567 from keszybz/various-small-cleanupsYu Watanabe2020-11-1217-115/+96
|\ | | | | Various small cleanups
| * basic/fileio: constify struct timespec argumentsZbigniew Jędrzejewski-Szmek2020-11-102-6/+6
| |
| * libsystemd-network: add comment explaining unusual memory accessZbigniew Jędrzejewski-Szmek2020-11-101-1/+1
| | | | | | | | | | Inspired by coverity CID#1435984. I'm confused by the union definion every time I look at it... Let's at least add a comment to help future readers.
| * tree-wide: unsetenv cannot failZbigniew Jędrzejewski-Szmek2020-11-108-32/+22
| | | | | | | | | | | | ... when called with a valid environment variable name. This means that any time we call it with a fixed string, it is guaranteed to return 0. (Also when the variable is not present in the environment block.)
| * basic/env-util: add little helper to call setenv or unsetenvZbigniew Jędrzejewski-Szmek2020-11-105-14/+21
| |
| * sd-event: minor modernizationZbigniew Jędrzejewski-Szmek2020-11-101-9/+4
| | | | | | | | | | With this change the pattern used for epoll_ctl() is the same in all calls in this file. Consistency FTW!
| * sd-event: increase n_enabled_child_sources just onceZbigniew Jędrzejewski-Szmek2020-11-101-28/+12
| | | | | | | | | | Neither source_child_pidfd_register() nor event_make_signal_data() look at n_enabled_child_sources.
| * sd-event: update state at the end in event_source_enableZbigniew Jędrzejewski-Szmek2020-11-101-25/+30
| | | | | | | | | | | | | | | | | | | | | | Coverity in CID#1435966 was complaining that s->enabled is not "restored" in all cases. But the code was actually correct, since it should only be "restored" in the error paths. But let's still make this prettier by not setting the state before all operations that may fail are done. We need to set .enabled for the prioq reshuffling operations, so move those down. No functional change intended.
* | meson: use "_" as separator in test namesZbigniew Jędrzejewski-Szmek2020-11-111-1/+1
| | | | | | | | | | | | | | | | | | ":" is prettier, but meson 0.56+ doesn't like it: src/systemd/meson.build:73: DEPRECATION: ":" is not allowed in test name "cc-sd-bus.h:c", it has been replaced with "_" src/systemd/meson.build:73: DEPRECATION: ":" is not allowed in test name "cc-sd-bus.h:c-ansi", it has been replaced with "_" ... Fixes #17568.
* | Merge pull request #16603 from benzea/benzea/special-app-sliceLennart Poettering2020-11-115-38/+68
|\ \ | | | | | | Use app.slice by default in user manager (and define special user slices)
| * | user: move "extrinsic" units to their root sliceZbigniew Jędrzejewski-Szmek2020-11-101-9/+10
| | | | | | | | | | | | | | | | | | | | | With the grandparent change to move most units to app.slice, those units would be ordered After=app.slice which doesn't make any sense. Actually they appear earlier, before the manager is even started, and conceputally it doesn't seem useful to put them under any slice.
| * | pid1: expose "extrinsic" status of swaps and mountsZbigniew Jędrzejewski-Szmek2020-11-104-32/+52
| | | | | | | | | | | | | | | The only visible change from this is that we show Extrinsic: yes/no in dumps for swap units (this was already done for mount units).
| * | core: Move user units into app.slice by defaultBenjamin Berg2020-10-231-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the default from putting all units into the root slice to placing them into the app slice in the user manager. The advantage is that we get the right behaviour in most cases, and we'll need special case handling in all other cases anyway. Note that we have currently defined that applications *should* start their unit names with app-, so we could also move only these by creating a drop-in for app-.scope and app-.service. However, that would not answer the question on how we should manage session.slice. And we would end up placing anything that does not fit the system (e.g. anything started by dbus-broker currently) into the root slice.
| * | basic: Define macros for special user slicesBenjamin Berg2020-10-231-0/+5
| | |
* | | Merge pull request #17497 from anitazha/randomizeonceLennart Poettering2020-11-105-2/+41
|\ \ \ | | | | | | | | timer: add new feature FixedRandomDelay=
| * | | timer: add new feature FixedRandomDelay=Kristijan Gjoshev2020-11-055-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FixedRandomDelay=yes will use `siphash24(sd_id128_get_machine() || MANAGER_IS_SYSTEM(m) || getuid() || u->id)`, where || is concatenation, instead of a random number to choose a value between 0 and RandomizedDelaySec= as the timer delay. This essentially sets up a fixed, but seemingly random, offset for each timer iteration rather than having a random offset recalculated each time it fires. Closes #10355 Co-author: Anita Zhang <the.anitazha@gmail.com>
* | | | Merge pull request #17555 from yuwata/ethtool-get-driverLennart Poettering2020-11-101-23/+80
|\ \ \ \ | | | | | | | | | | ethtool: make ethtool_get_driver() return -ENODATA if driver is an empty string.
| * | | | ethtool: make ethtool_get_driver() return -ENODATA if ioctl succeeds but ↵Yu Watanabe2020-11-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | driver name is empty Inspired by #17532.
| * | | | ethtool: add several assertionsYu Watanabe2020-11-101-23/+77
| | | | |
* | | | | journal: refuse skip parameter for sd_journal_next_skip() larger than INT_MAXYu Watanabe2020-11-101-0/+1
| |_|_|/ |/| | | | | | | | | | | Fixes #17502.
* | | | Merge pull request #17431 from msekletar/udev-link-update-raceZbigniew Jędrzejewski-Szmek2020-11-103-16/+69
|\ \ \ \ | | | | | | | | | | udev: make algorithm that selects highest priority devlink less susceptible to race conditions
| * | | | udev: make algorithm that selects highest priority devlink less susceptible ↵Michal Sekletár2020-11-062-15/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to race conditions Previously it was very likely, when multiple contenders for the symlink appear in parallel, that algorithm would select wrong symlink (i.e. one with lower-priority). Now the algorithm is much more defensive and when we detect change in set of contenders for the symlink we reevaluate the selection. Same happens when new symlink replaces already existing symlink that points to different device node.
| * | | | basic/stat-util: make mtime check stricter and use entire timestampMichal Sekletár2020-11-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that st_mtime member of struct stat is defined as follows, #define st_mtime st_mtim.tv_sec Hence we omitted checking nanosecond part of the timestamp (struct timespec) and possibly would miss modifications that happened within the same second.
* | | | | sd-bus: drop redundant abs()Yu Watanabe2020-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | strerror_safe() internally applies abs().
* | | | | core: add missing oom checkYu Watanabe2020-11-101-0/+2
| | | | | | | | | | | | | | | | | | | | Fixes #17552.
* | | | | udev: log when we fail to query ID_NET_DRIVERZbigniew Jędrzejewski-Szmek2020-11-101-1/+4
| | | | | | | | | | | | | | | | | | | | Inspired by #17532.
* | | | | Merge pull request #17551 from yuwata/radv-router-lifetimeZbigniew Jędrzejewski-Szmek2020-11-094-14/+23
|\ \ \ \ \ | |_|/ / / |/| | | | network: about router lifetime
| * | | | network: convert router lifetime from usec_t to uint16_tYu Watanabe2020-11-101-7/+12
| | | | |
| * | | | sd-radv: refuse to set preference except medium when router lifetime is zeroYu Watanabe2020-11-101-3/+6
| | | | |
| * | | | sd-radv: router lifetime is uint16_tYu Watanabe2020-11-102-4/+4
| | | | |
| * | | | network: make default router lifetime to 30minYu Watanabe2020-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | Closes #17527.
* | | | | Merge pull request #17549 from yuwata/tiny-fixesLennart Poettering2020-11-093-6/+8
|\ \ \ \ \ | |/ / / / |/| | | | tiny fixes
| * | | | core: reduce scope of variantsYu Watanabe2020-11-091-5/+5
| | | | | | | | | | | | | | | | | | | | Fixes #17543.
| * | | | sd-bus: fix possible division by 0Yu Watanabe2020-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | Fixes #17541.
| * | | | home: fix copy-and-paste mistakeYu Watanabe2020-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | Fixes #17542.
* | | | | license: GPL-2.0+ -> GPL-2.0-or-laterYu Watanabe2020-11-0939-39/+39
| | | | |
* | | | | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091843-1843/+1843
|/ / / /
* | | | resolved: fix non-initialized memory accessLennart Poettering2020-11-061-3/+4
| | | | | | | | | | | | | | | | Fix for bug introduced in 1ed314087fab3988f3221b1b736a7e711f174349.
* | | | resolved: slightly extend debug log output about outgoing messagesLennart Poettering2020-11-061-2/+11
| | | |
* | | | resolved: don't resolve "local." via LLMNRLennart Poettering2020-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | It's the mDNS top-level domain, hence don't consider it for LLMNR, ever. Fixes: #16233
* | | | resolved: add comments for various query flagsLennart Poettering2020-11-061-15/+25
| | | |
* | | | resolved: show all answer flags when dumping answerLennart Poettering2020-11-061-1/+5
| | | |
* | | | resolved: add minor optimization path to dns_answer_merge()Lennart Poettering2020-11-061-0/+5
| | | |
* | | | resolved: suppress misleading debug message about ignored resolv.conf lineLennart Poettering2020-11-061-0/+2
| | | |
* | | | errno: ETIMEDOUT is also a connection errorLennart Poettering2020-11-061-2/+6
| | | |
* | | | journalctl: show boot id in the reboot context separatorRonan Pigott2020-11-061-2/+2
| | | |
* | | | seccomp: allow turning off of seccomp filtering via env varLennart Poettering2020-11-052-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #17504 (While we are it, also move $SYSTEMD_SECCOMP_LOG= env var description into the right document section) Also suggested in: https://github.com/systemd/systemd/issues/17245#issuecomment-704773603
* | | | selinux: also try the netlink-based fallback and continue on permission errorZbigniew Jędrzejewski-Szmek2020-11-041-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fedora Rawhide still has the old policy, so selinux prevents our selinux code from checking if selinux is enabled. But it seems smart to fall back to the old API anyway. Follow-up for fd5e402fa9377f2860e02bdb5b84d5f5942e73f4. Both the reference policy [1] and Fedora selinux policy [2] needed to be updated, so it's likely that this will impact other distros too. [1] https://github.com/SELinuxProject/refpolicy/pull/308 [2] https://github.com/fedora-selinux/selinux-policy/pull/464