1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 16:21:26 +03:00
Commit Graph

49685 Commits

Author SHA1 Message Date
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
Evgeny Vereshchagin
8e32f20d13 Revert "ci: switch back to meson-0.56.2"
This reverts commit c39e36203f.

Now that meson-0.57.1 (where https://github.com/mesonbuild/meson/issues/8347
is fixed) is out it should be safe to keep rolling forward.
2021-02-20 20:20:04 +01:00
Lennart Poettering
cd6d2111c4 man: split out sd_bus_set_fd() man page from sd_bus_get_fd()
sd_bus_get_fd() and related calls are useful for integrating a bus
connection into arbitrary event loops. But sd_bus_set_fd() is quite a
different beast, it's for using D-Bus over pre-initialized sockets or
pairs of fifos or stuff, i.e. very advanced stuff.

Let's split this man page in two, in order not to confuse things
needlessly.

And while we are at it, let's slightly extend the documentation.
2021-02-20 16:13:06 +01:00
Lennart Poettering
2306d1778f systemctl: don't search in the full argv[0] for the invocation name
argv[0] might be prefixed by a path, and we shouldn't get confused by
that. Hence provide a simple helper call that abstracts the checking
away, which we can use everywhere, and expose the same behaviour, even
if argv[0] is not set.

(While we are at it, port all other multi-call binaries over to the new
helper, too)

Follow-up for: d41a9e4fc1
2021-02-20 14:45:27 +01:00
Yu Watanabe
27edd36eaa network: fix typo 2021-02-20 18:58:07 +09:00
Yu Watanabe
aa3069977e
Merge pull request #18689 from yuwata/network-address-broadcast-no
network: make Broadcast= accept "no"
2021-02-20 16:55:28 +09:00
Yu Watanabe
045db4fa0d test-network: add tests for Broadcast= with boolean settings 2021-02-20 14:23:07 +09:00
Yu Watanabe
832583ada8 network: make Broadcast= accept boolean value
And disable it for wireguard interfaces by default.

Closes #18492.
2021-02-20 14:23:00 +09:00
Yu Watanabe
7f37ecf7e5
Merge pull request #18699 from yuwata/network-route-add-nexthop-setting
network: add NextHop= setting in [Route] section
2021-02-20 14:17:17 +09:00
Lennart Poettering
6c41cf4459 sd-bus: simplify sd_bus_reply()
there's no point in having two arguments, if one does as well.
2021-02-20 13:44:02 +09:00
Zbigniew Jędrzejewski-Szmek
fa98c99ea7 sysctl.d: silence warning if net.core.default_qdisc cannot be set
Kernels can be compiled without the attribute. It's fine if this is not
set, so silence the warning.
2021-02-19 21:24:26 +01:00
Lennart Poettering
1cf36084a7 fileio: extend comment about file sizes in virtual file systems 2021-02-19 18:29:13 +01:00
Zbigniew Jędrzejewski-Szmek
27a54998f4
Merge pull request #18703 from poettering/cgroupsv1-bad
consider cgroupsv1 usage grounds for "tainting"
2021-02-19 18:25:17 +01:00
Lennart Poettering
5cfbe7452f man: emphasize a bit more that PID files suck 2021-02-19 17:51:31 +01:00
Lennart Poettering
82f3063218 manager: taint systemd if cgroupsv1 is used
let's mark cgroupsv1 systems as "tainted" in the taint string logic.
It's time.
2021-02-19 17:50:16 +01:00
Yu Watanabe
ace0bd14ba
Merge pull request #18695 from keszybz/xdg-generator-silence-warning
xdg-autostart-generator: silence warning
2021-02-20 01:00:18 +09:00
Zbigniew Jędrzejewski-Szmek
01785c9778
Merge pull request #18702 from poettering/news-v248-more
more v248 NEWS stuff
2021-02-19 16:00:48 +01:00
Lennart Poettering
04955f7c61
Merge pull request #18694 from keszybz/links-and-syntax-highlighting
Links and syntax highlighting
2021-02-19 15:27:41 +01:00
Zbigniew Jędrzejewski-Szmek
5800f0fc68 basic/alloc-util: also reset the cleaned-up variable in freep()
freep() has it's own definition, so I missed it in fd421c4adc.

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.
2021-02-19 15:25:16 +01:00
Lennart Poettering
1267036578 hwdb: whitespace fixes 2021-02-19 15:21:13 +01:00
Lennart Poettering
2b6a8a4b9b update NEWS 2021-02-19 15:21:11 +01:00
Yu Watanabe
cee0f719d8 test-network: add tests for NextHop= setting in [Route] 2021-02-19 22:42:39 +09:00
Yu Watanabe
e918b3c12a network: add nexthop ID in debugging logs 2021-02-19 22:42:39 +09:00
Yu Watanabe
324e342219 network: add NextHop= setting in [Route] section 2021-02-19 22:42:39 +09:00
Yu Watanabe
69e244e321 network: also manage nexthops by ID
It will be used in later commits.
2021-02-19 22:42:39 +09:00
Zbigniew Jędrzejewski-Szmek
3d81e41190
Merge pull request #18646 from yuwata/network-ip-masquerade-follow-ups
network: several follow-ups for recent IPMasquerade= change
2021-02-19 12:43:37 +01:00
Sven Mueller
b87fbe5fd7 Fix grammar and a small typo on a comment
potentically -> potentially
(And a small grammar fix)
2021-02-19 12:43:10 +01:00
Zbigniew Jędrzejewski-Szmek
36290e0b97 xdg-autostart-generator: ignore DBusActivatable=true
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.
2021-02-19 09:54:46 +01:00
Zbigniew Jędrzejewski-Szmek
9f11f56555 xdg-autostart-generator: reindent 2021-02-19 09:54:46 +01:00
Zbigniew Jędrzejewski-Szmek
d80961720c man: fix links to various pages
nss-dns doesn't have any man page that I could find.
2021-02-19 09:28:13 +01:00
Zbigniew Jędrzejewski-Szmek
1d10005b39 tree-wide: fix links to systemd.io pages
Having the extra slash at the end is not a problem, just inconsistent. But the links with
.html or .md return 404.
2021-02-19 09:28:08 +01:00
Zbigniew Jędrzejewski-Szmek
e7b86e4813 docs/ENVIRONMENT: syntax highlighting and some rewordings
Use backticks for commands and functions and variables, suffix directories with
a slash. Some sentences were reworded.
2021-02-19 09:28:00 +01:00
Yu Watanabe
bfe6043454 network: nexthop: update ID of nexthop created without specifiying ID
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.
2021-02-19 08:41:52 +01:00
Yu Watanabe
f345918d8d network: configure nexthop before routes that requires gateway
This is a preparation for later commits. When RTA_NH_ID is set to a
route, then the corresponding nexthop must be exist.
2021-02-19 08:34:12 +01:00
Yu Watanabe
b480543cf0 tree-wide: fix typo 2021-02-19 07:56:22 +01:00
Jameer Pathan
63f48ab3fa GH Actions: Fix labeler bot 2021-02-19 14:51:59 +09:00
Yu Watanabe
4c72d851cd network: warn when any positive boolean string is specified for IPMasquerade=
Previously, any positive boolean string for IPMasquerade= enables only IPv4
masquerade. The commit 48ed276647 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 48ed276647.
2021-02-19 14:24:10 +09:00
Yu Watanabe
da0e2baea3 network: address: reuse Address:ip_masquerade_done for IPv6 case
It is not necessary to use different flag for each address family.

Follow-up for 48ed276647.
2021-02-19 14:22:32 +09:00