summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fileio: extend comment about file sizes in virtual file systemsLennart Poettering2021-02-191-1/+3
|
* manager: taint systemd if cgroupsv1 is usedLennart Poettering2021-02-191-0/+4
| | | | | let's mark cgroupsv1 systems as "tainted" in the taint string logic. It's time.
* Merge pull request #18695 from keszybz/xdg-generator-silence-warningYu Watanabe2021-02-191-50/+44
|\ | | | | xdg-autostart-generator: silence warning
| * xdg-autostart-generator: ignore DBusActivatable=trueZbigniew Jędrzejewski-Szmek2021-02-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://wiki.gnome.org/HowDoI/DBusApplicationLaunching and https://wiki.gnome.org/Initiatives/GnomeGoals/DBusActivatable for a description of this key: > Instead of the typical UNIX-style fork()/exec() approach to process creation, > launching an application is done by sending a D-Bus message to the well-known > name of that application, causing a D-Bus activation. > > Starting processes with D-Bus activation ensures that each application gets > started in its own pristine environment, as a direct descendent of the > session -- not in the environment of whatever its parent happened to be. This > is important for ensuring the app ends up in the correct cgroup, for example. So this motivation is not important for us: we launch stuff ourselves better. This fixes warnings during boot: systemd-xdg-autostart-generator[2274]: /etc/xdg/autostart/org.freedesktop.problems.applet.desktop:92: Unknown key name 'DBusActivatable' in section 'Desktop Entry', ignoring.
| * xdg-autostart-generator: reindentZbigniew Jędrzejewski-Szmek2021-02-191-50/+43
| |
* | Merge pull request #18694 from keszybz/links-and-syntax-highlightingLennart Poettering2021-02-191-1/+1
|\ \ | | | | | | Links and syntax highlighting
| * | tree-wide: fix links to systemd.io pagesZbigniew Jędrzejewski-Szmek2021-02-191-1/+1
| |/ | | | | | | | | Having the extra slash at the end is not a problem, just inconsistent. But the links with .html or .md return 404.
* | basic/alloc-util: also reset the cleaned-up variable in freep()Zbigniew Jędrzejewski-Szmek2021-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | freep() has it's own definition, so I missed it in fd421c4adc7406de02e03e2f7ceede2cc6e1d9d4. Again, there is a small growth, but the compiler should be able to optimize it away: -Dbuildtype=debug: -rwxrwxr-x 1 zbyszek zbyszek 4106816 Feb 19 12:52 build/libsystemd.so.0.30.0 -rwxrwxr-x 1 zbyszek zbyszek 7492952 Feb 19 12:52 build/src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 zbyszek zbyszek 4472624 Feb 19 12:53 build/systemd -rwxrwxr-x 1 zbyszek zbyszek 4107056 Feb 19 13:03 build/libsystemd.so.0.30.0 -rwxrwxr-x 1 zbyszek zbyszek 7493480 Feb 19 13:03 build/src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 zbyszek zbyszek 4472760 Feb 19 13:03 build/systemd Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31055.
* | Merge pull request #18646 from yuwata/network-ip-masquerade-follow-upsZbigniew Jędrzejewski-Szmek2021-02-195-23/+55
|\ \ | | | | | | network: several follow-ups for recent IPMasquerade= change
| * | network: warn when any positive boolean string is specified for IPMasquerade=Yu Watanabe2021-02-193-12/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, any positive boolean string for IPMasquerade= enables only IPv4 masquerade. The commit 48ed276647c754bfb3ed5c6c5af9404e073ffe54 adds IPv6 masquerade support. However, only "yes" is handled as "ipv4", and other positive boolean strings are handled as "both". This makes all positive boolean strings considered as "ipv4", warn that they are deprecated, and suggest to use "ipv4" or "both". Follow-up for 48ed276647c754bfb3ed5c6c5af9404e073ffe54.
| * | network: address: reuse Address:ip_masquerade_done for IPv6 caseYu Watanabe2021-02-192-11/+2
| | | | | | | | | | | | | | | | | | It is not necessary to use different flag for each address family. Follow-up for 48ed276647c754bfb3ed5c6c5af9404e073ffe54.
* | | Fix grammar and a small typo on a commentSven Mueller2021-02-191-1/+1
| |/ |/| | | | | potentically -> potentially (And a small grammar fix)
* | network: nexthop: update ID of nexthop created without specifiying IDYu Watanabe2021-02-191-8/+67
| | | | | | | | | | | | | | Otherwise, nexthop_configure() -> nexthop_add() creates NextHop object without ID in link->nexthop, and then, manager_rtnl_process_nexthop() -> nexthop_add_foreign() also creates another NextHop object with ID in link->nexthop_foreign.
* | network: configure nexthop before routes that requires gatewayYu Watanabe2021-02-194-40/+119
| | | | | | | | | | This is a preparation for later commits. When RTA_NH_ID is set to a route, then the corresponding nexthop must be exist.
* | tree-wide: fix typoYu Watanabe2021-02-195-6/+6
|/
* Merge pull request #18659 from poettering/permyriadificationYu Watanabe2021-02-1930-384/+562
|\ | | | | use scaling relative to UINT32_MAX instead of percentages/permyriads wherever we can
| * oomd: increase accuracy of SwapUsedLimit= to permyriads tooLennart Poettering2021-02-187-42/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | oomd.conf has two parameters with fractionals: SwapUsedLimit= and DefaultMemoryPressureLimit=, but one accepts permyriads, the other only percentages, for no apparent reason. One carries the "Percent" in the name, the other doesn't. Let's clean this up: always accept permyriads, and drop the suffix, given that it is misleading. I figure we should internally try to focus on scaling everything relative to UINT32_MAX, and if that isn't in the cards at least 10000, but never permille nor percent unless there's a really really good reason for it (e.g. interface defined by someone else).
| * core: use our usual UINT32_MAX scaling for OOMD limitsLennart Poettering2021-02-188-21/+24
| | | | | | | | | | | | | | | | | | | | So far OOMD limits used permyriads, as an upgrade from the original percent. The rest of our codebase typically scales stuff relative to UINT32_MAX. Let's clean this up, an make sure this happens here too. This is particularly relevant, as this is exposed in unit files and API, and before we mark this stable we should get the APIs right.
| * parse-util: add format string macro for outputting permyriadLennart Poettering2021-02-183-2/+6
| | | | | | | | | | | | Let's define a set of macros for making output of permyriad values easy. They are printed in pure ASCII, i.e. without the permille/permyriad suffix, using just percent and two places after the dot.
| * tree-wide: port various pieces of code over to UINT32_SCALE_FROM_PERMYRIAD()Lennart Poettering2021-02-184-6/+7
| |
| * util: add some helpers for converting percent/permille/permyriad to parts of ↵Lennart Poettering2021-02-182-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2^32-1 At various places we accept values scaled to the range 0…2^32-1 which are exposed to the user as percentages/permille/permyriad. Let's add some helper macros (actually: typesafe macro-like functions) that help with converting our internal encoding to the external encodings. benefits: some of the previous code rounded up, some down. let's always round to nearest, to ensure that our conversions are reversible. Also, check for overflows correctly. This also adds a test that makes sure that for the full percent/permille/permyriad ranges we can convert forth and back without loss of accuracy.
| * percent-util: when parsing permyriads, permit percents too with 1 place ↵Lennart Poettering2021-02-182-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after the dot Previously, when parsing myriads, we'd support: x% → percent, no places after the dot x.yz% → percent, two places after the dot x‰ → permille, no places after the dot x.y‰ → permille, one place after the dot x‱ → permyriad, no places after the dot What's missing is: x.y% → percent, one place after the dot Let's add it in.
| * util: move percent/permille/permyriad parser into percent-util.[ch]Lennart Poettering2021-02-1816-294/+327
| | | | | | | | | | | | | | A good chunk of parse-util.[ch] has been about parsing parts per hundred/thousand/ten-thousand. Let's split that out into its own file. No code changes, just some shuffling around.
| * main: let's use physical_memory_scale() where appropriateLennart Poettering2021-02-181-2/+2
| | | | | | | | | | This way we can take benefit of the fact that physical_memory_scale() aligns on page sizes.
| * tree-wide: parse permyriads wherever we canLennart Poettering2021-02-186-22/+22
| | | | | | | | | | | | Given that we now have a parser for permyriads, let's use it everywhere for greater accuracy. This means wherever we previously supported % and ‰, we now also support ‱.
| * limits-util: tweak overflow checks for ↵Lennart Poettering2021-02-181-8/+19
| | | | | | | | | | | | | | (physical_memory|system_tasks)_max_scale() Also, shortcut two special cases for passing through values as-is, so that we are not needlessly subjected to overflow issues for them.
* | Recommend drop-ins over modifications to the main config fileZbigniew Jędrzejewski-Szmek2021-02-1914-104/+119
| | | | | | | | As discussed in https://github.com/systemd/systemd/pull/18347.
* | table: drop trailing white spaces of the last cell in rowYu Watanabe2021-02-192-20/+26
|/ | | | Fixes #18415.
* network: rename UseFQDN= -> UseHostname=Yu Watanabe2021-02-184-4/+5
| | | | | Prompted by https://github.com/systemd/systemd/pull/18543#issuecomment-780798451.
* Merge pull request #18685 from poettering/network-type-tweaksLennart Poettering2021-02-1825-71/+71
|\ | | | | sd-network.h type tweaks
| * network: tighten table alignment a bitLennart Poettering2021-02-181-17/+17
| |
| * network: suffix types with _t in public headersLennart Poettering2021-02-1825-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | Apparently, in our current public headers (i.e. those called sd-*.h) we suffixed typedefs that we use as values with _t, but we didn't do this for enum typedefs. Fix that while this stuff is not actually public yet. With this scheme "value typedefs" now end systematically in _t, and "object typedefs" (i.e. structures that are typically passed around via pointers and not values) do not. No code changes, just some renaming.
* | random-util: fix type of random_u64_range()Lennart Poettering2021-02-182-2/+2
| | | | | | | | | | | | As the name of the function suggests this is supposed to return uint64_t, of course. Fix it. Not sure how this mistake happened in the first place...
* | Merge pull request #18546 from poettering/sd-device-actionLennart Poettering2021-02-1827-146/+156
|\ \ | | | | | | export sd_device_get_action() API + more
| * | udevadm: after validating action, use our internal string instead of optargLennart Poettering2021-02-182-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | This doesn't really change anything, but feels nicer, since it abstracts away what device_action_from_string()/device_action_to_string() do internally, and always uses a normalized action string (yes, there's no ambiguity, but it's nice to stay abstract, maybe one day there is ambiguity around this)
| * | sd-device: add sd_device_get_action() + sd_device_get_seqnum() + ↵Lennart Poettering2021-02-1827-139/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sd_device_new_from_stat_rdev() To make sd-device properly usable for all programs we need to provide an API for the "action" field of an event, it's one of the most relevant ones, and it was so far missing. This also adds sd_device_get_seqnum(), which isn't that interesting, except for generating pretty debug output, which we use it ourselves for. This also makes device_new_from_stat_rdev() public, as it is truly useful, as we can see in our own uses of it, and I think is fairly generic to show up in the public APIs.
| * | sd-device: don't compare pointers with numeric zeroLennart Poettering2021-02-181-3/+8
| | | | | | | | | | | | Our coding style says no to this.
* | | resolved: improve debug logging on incoming messages a bitLennart Poettering2021-02-182-3/+7
| | |
* | | Merge pull request #18679 from keszybz/rfkill-size-leniencyZbigniew Jędrzejewski-Szmek2021-02-181-38/+41
|\ \ \ | | | | | | | | struct rfkill_event read/write size leniency
| * | | rfkill: use short writes and accept long readsZbigniew Jędrzejewski-Szmek2021-02-181-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm seeing the following with kernel-core-5.10.16-200.fc33.x86_64: $ sudo SYSTEMD_LOG_LEVEL=debug build/systemd-rfkill Reading struct rfkill_event: got 8 bytes. A new rfkill device has been added with index 0 and type bluetooth. Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy Found container virtualization none. rfkill0: Operating on rfkill device 'tpacpi_bluetooth_sw'. Writing struct rfkill_event successful (8 of 9 bytes). Loaded state '0' from /var/lib/systemd/rfkill/platform-thinkpad_acpi:bluetooth. Reading struct rfkill_event: got 8 bytes. A new rfkill device has been added with index 1 and type wwan. rfkill1: Operating on rfkill device 'tpacpi_wwan_sw'. Writing struct rfkill_event successful (8 of 9 bytes). Loaded state '0' from /var/lib/systemd/rfkill/platform-thinkpad_acpi:wwan. Reading struct rfkill_event: got 8 bytes. A new rfkill device has been added with index 2 and type bluetooth. rfkill2: Operating on rfkill device 'hci0'. Writing struct rfkill_event successful (8 of 9 bytes). Loaded state '0' from /var/lib/systemd/rfkill/pci-0000:00:14.0-usb-0:7:1.0:bluetooth. Reading struct rfkill_event: got 8 bytes. A new rfkill device has been added with index 3 and type wlan. rfkill3: Operating on rfkill device 'phy0'. Writing struct rfkill_event successful (8 of 9 bytes). Loaded state '0' from /var/lib/systemd/rfkill/pci-0000:04:00.0:wlan. All events read and idle, exiting. We were expecting a read of exactly RFKILL_EVENT_SIZE_V1==8 bytes. But the structure has 9 after [1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=14486c82612a177cb910980c70ba900827ca0894 For some reason the kernel does not accept the full structure size, but cuts the write short after 8 bytes: static ssize_t rfkill_fop_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { struct rfkill_event ev; /* we don't need the 'hard' variable but accept it */ if (count < RFKILL_EVENT_SIZE_V1 - 1) return -EINVAL; /* * Copy as much data as we can accept into our 'ev' buffer, * but tell userspace how much we've copied so it can determine * our API version even in a write() call, if it cares. */ count = min(count, sizeof(ev)); if (copy_from_user(&ev, buf, count)) return -EFAULT; ... so it should accept the full size. I'm not sure what is going on here. But we don't care about the extra fields, so let's accept a write as long as it's at least RFKILL_EVENT_SIZE_V1. Fixes #18677.
| * | | rfkill: improve error loggingZbigniew Jędrzejewski-Szmek2021-02-181-36/+30
| | | | | | | | | | | | | | | | If we get something of unexpected size, log the sizes. Also, don't log twice.
* | | | journald: when we fail to add a new entry to a journal, return the seqnoLennart Poettering2021-02-181-14/+46
| | | | | | | | | | | | | | | | Fixes: #18005
* | | | Merge pull request #18664 from poettering/resolved-defragLennart Poettering2021-02-1811-52/+300
|\ \ \ \ | |_|/ / |/| | | resolved: many UDP fragmentation tweaks
| * | | resolved: take fragment size into consideration when determining EDNS0 udp ↵Lennart Poettering2021-02-182-3/+51
| | | | | | | | | | | | | | | | packet size
| * | | resolved: let's track fragment sizes of servers/retry on fragmentingLennart Poettering2021-02-185-14/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fragmenting sucks, let's avoid it. Thus let's start tracking the maximum fragment size we receive. Also, let's redo a transaction via TCP if we see fragmenting on UDP, as effective mitigation against DNS fragment attacks.
| * | | resolved: tweak how we calculate MTU for sending packetsLennart Poettering2021-02-184-29/+59
| | | | | | | | | | | | | | | | | | | | | | | | Let's take all MTU info we possibly have into account, i.e. the one reported via netlink, as before and the one the socket might now (from PMTUD and such), clamped by our own ideas.
| * | | resolved: add udp_header_size() helperLennart Poettering2021-02-182-6/+24
| | | |
| * | | resolved: collect incoming fragment size when receiving UDP datagramsLennart Poettering2021-02-184-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | We can later use this to adapt our announced EDNS buffer size in order to avoid fragmentation to make the best of large datagrams while still avoiding he security weaknesses of it.
| * | | resolved: disable path MTU discovery for UDP trafficLennart Poettering2021-02-184-0/+73
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | This disables path MTU discovery both for our UDP upstream connections and our UDP stub, following the suggestions of: https://blog.apnic.net/2019/07/12/its-time-to-consider-avoiding-ip-fragmentation-in-the-dns/ This more or less follows the model of other DNS servers on this.
* | | resolved: optimize change notification handling away if bus calls set the ↵Lennart Poettering2021-02-185-53/+82
| | | | | | | | | | | | | | | | | | | | | same values as were already set Prompted-by: #17577 (but doesn't fix this, since this commit only handles D-Bus-induced changes, not the ones made via networkd)