1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

55465 Commits

Author SHA1 Message Date
Yu Watanabe
d8d6b2275f hostname-setup: gracefully handle kernel with empty CONFIG_DEFAULT_HOSTNAME
Previously, sethostname_idempotent_full() calls gethostname_full() with
GET_HOSTNAME_ALLOW_NONE and GET_HOSTNAME_ALLOW_LOCALHOST flags. That
intended to get any values set by kernel. But, that does not work, as
the hostname may be empty.

Let's simplify the logic. The function sethostname_idempotent_full()
intends to set the requested hostname only when the current hostname
is different from the requested one. So, no check in getostname_full()
is required. Hence, simply use the result of uname() here.

Fixes #21896.
2021-12-31 03:58:06 +09:00
Yu Watanabe
1e65eb8f9b nss-systemd: fix required buffer size calculation
This also fixes the pointer assigned to the gr_mem element of struct group.

Fixes a bug introduced by 47fd7fa6c650d7a0ac41bc89747e3b866ffb9534.

Fixes #21935.
2021-12-31 03:12:09 +09:00
Yu Watanabe
b78d7f2468 sysusers: use filename if /proc is not mounted
During system install, /proc may not be mounted yet.

Fixes RHBZ#2036217 (https://bugzilla.redhat.com/show_bug.cgi?id=2036217).
2021-12-31 03:11:43 +09:00
Yu Watanabe
14b451f20a test-network: add testcase for invalid AllowedIPs= 2021-12-31 02:31:12 +09:00
Yu Watanabe
af670fc635 network: wireguard: warn about invalid allowed IP addresses
But handle them gracefully. Otherwise, when the route to the address is
being configured, kernel refuse the route.

Note that kernel's wireguard module handle e.g. 192.168.10.3/24 as
192.168.10.0/24.

Fixes #21929.
2021-12-31 02:31:09 +09:00
Noel Kuntze
0d03e672a9 network: complete example for xfrm setup 2021-12-30 23:52:28 +09:00
Luca Boccassi
466f2351bb systemd-run: ensure error logs suggest to use '--user' when appropriate
Before:

$ systemd-run --service-type=notify --user false
Job for run-rc3fe52ee6ddd4a6eaaf1a20e0a949cdf.service failed because the control process exited with error code.
See "systemctl status run-rc3fe52ee6ddd4a6eaaf1a20e0a949cdf.service" and "journalctl -xeu run-rc3fe52ee6ddd4a6eaaf1a20e0a949cdf.service" for details.

After:

$ systemd-run --service-type=notify --user false
Job for run-r7791e380a7b6400ea01d6a0e5a458b23.service failed because the control process exited with error code.
See "systemctl --user status run-r7791e380a7b6400ea01d6a0e5a458b23.service" and "journalctl --user -xeu run-r7791e380a7b6400ea01d6a0e5a458b23.service" for details.

Fixes https://github.com/systemd/systemd/issues/21933
2021-12-30 23:50:45 +09:00
Luca Boccassi
86980de64b dbus-wait-for-jobs: add extra_args to bus_wait_for_jobs_one()
And pass it through to bus_wait_for_jobs()
2021-12-30 23:50:45 +09:00
Luca Boccassi
b3bfe6b9e1
Merge pull request #21922 from medhefgo/boot-fix
boot: More BCD parser fixes
2021-12-29 19:35:42 +00:00
Ludwig Nussel
b13a8b5b37 test: mark partition bootable
Make test suite partition bootable so nspawn can use the image directly.
Useful for local testing.

https://systemd.io/DISCOVERABLE_PARTITIONS/
2021-12-29 19:23:26 +00:00
Jan Janssen
aa1d0f2587 boot: Introduce helper macros for offset checking
This fixes a subtle sizeof overflow on 32bit machines.
2021-12-29 14:39:54 +01:00
Jan Janssen
1cadb35fd6 boot: Reject unaligned data
The data seems to be properly aligned in real BCD stores, so it
should be fine to just reject bad ones.

Fixes: #21917
2021-12-29 14:39:54 +01:00
Jan Janssen
77fcf28cb8 boot: Build BCD parser only on arches supported by Windows 2021-12-29 14:39:54 +01:00
Luca Boccassi
d39d3696c0
Merge pull request #21898 from yuwata/meson-dbus-interfaces-dir
meson: obtain dbus related directories from pkg-config
2021-12-29 12:39:50 +00:00
Yu Watanabe
9c1b17c3dc manager: always close idle pipe when sending ready notification
This fixes a bug introduced by 6d9326595592f98e8126eacb4176acd8c3516d5c.

The commit makes several functions skipped if the manager is already
in finished state, as
> In manager_check_finished(), more steps are skipped if MANAGER_IS_FINISHED().
> Those steps are idempotent, but no need to waste cycles trying to do them
> more than once.

However, the idle pipe may be re-opened after manager is finished:
manager_dispatch_run_queue() -> manager_watch_idle_pipe().
So, the closing the pipe is not idempotent here.

Fixes #21889.
2021-12-29 12:35:48 +00:00
Evgeny Vereshchagin
c84059f16e oss-fuzz: turn on the alignment check 2021-12-29 10:39:06 +00:00
Evgeny Vereshchagin
4b65fc8725 tests: add fuzz-bcd 2021-12-29 10:39:06 +00:00
ksa678491784
5204355861 stub: Do not assume having DeviceHandle 2021-12-29 11:59:57 +09:00
Yu Watanabe
80bfc3b901 network: ndisc: ignore route prefix to ::/0
Fixes #21912.
2021-12-28 21:00:49 +00:00
Luca Boccassi
69b5c7cf2a
Merge pull request #21925 from yuwata/unit-file-symlinked-drop-in-directory
unit-file: fix symlinked drop-in directory handling
2021-12-28 20:38:24 +00:00
Yu Watanabe
cf6562e456 test: add testcases of symlinked drop-in directories 2021-12-29 01:29:21 +09:00
Yu Watanabe
7f304b8561 unti-file: fix symlinked drop-in directory handling
This fixes a bug introduced by 95ef0eaf0d5cd43fcc8e9eb541f2c342f25f8f2f.

Fixes #21920.
2021-12-29 01:29:17 +09:00
Yu Watanabe
1bd0cc452c meson: obtain dbus directories from pkg-config 2021-12-28 23:00:58 +09:00
Yu Watanabe
7e560e79eb meson: show dbus interfaces directory in summary 2021-12-28 22:52:24 +09:00
Yu Watanabe
320848a6ba meson: move dbus-interfaces-dir 2021-12-28 22:52:24 +09:00
Luca Boccassi
4b3ad81bfa core: do not touch /run/systemd/systemd-units-load from user session instances
Follow-up for: 15b9243c0d
Fixes: https://github.com/systemd/systemd/issues/21911
2021-12-28 22:07:02 +09:00
Luca Boccassi
e99f8605e2
Merge pull request #21916 from medhefgo/boot-fix
boot: Fixes
2021-12-28 11:48:19 +00:00
Jan Janssen
2198a77391 boot: Fix name length comparison 2021-12-27 22:49:02 +01:00
Jan Janssen
c3c5b93a0c boot: Fix off-by-one offset sanity checks 2021-12-27 22:46:40 +01:00
Jan Janssen
fab8275646 boot: Fix off-by-one NUL-termination 2021-12-27 22:41:50 +01:00
dependabot[bot]
987202b2c1 build(deps): bump github/super-linter from 4.8.4 to 4.8.5
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.8.4 to 4.8.5.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](563be7dc55...b8641364ca)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-27 12:33:34 +03:00
Luca Boccassi
7c3b51c469 chrattr-util: return EOPNOTSUPP from chrattr_full if no other failure was observed
When chattr_full tries to apply flags one-by-one, and one fails,
record which errno was returned. But record EOPNOTSUPP(&friends)
only if no other error is observed, and return it only in that case
(otherwise keep returning ENOANO), so that callers can respond
appropriately to EOPNOTSUPP vs more relevant errors.
For example, this lets tmpfiles.d log at debug level when a filesystem
flag cannot be applied because the filesystem does not support it,
but at warning level if something else went wrong when applying it.
Restores logging behaviour of tmpfiles.d to pre-250.

Follow-up for: c1631ee124

Fixes: https://github.com/systemd/systemd/issues/21901
2021-12-27 08:28:26 +09:00
Luca Boccassi
a2ccfc9ccb
Merge pull request #21881 from yuwata/update-linux-headers
Update linux headers
2021-12-26 17:30:47 +00:00
Luca Boccassi
4ac8526215
Merge pull request #21892 from yuwata/network-vxlan-automatic-local-address-selection
network: vxlan: automatic local address selection
2021-12-26 17:27:41 +00:00
Evgeny Vereshchagin
bfa6bd1be0 ci: replace apt-key with signed-by
to limit the scope of the key to apt.llvm.org only.

This is mostly inspired by https://blog.cloudflare.com/dont-use-apt-key/
2021-12-26 15:38:42 +00:00
Hans de Goede
04b457d8ef hwdb: 60-keyboard: Fix volume-button mapping on Asus TF103C
The Asus TF103C misses the home button in its PNP0C40 GPIO resources
causing the button mappings for the volume buttons to be off by one,
leading to the volume-up button sending home button presses and the
volume-down button sending volume-up button presses.

Add a 60-keyboard hwdb entry to correct the mappings. Note this is
split over 2 input devices because the soc_button_array driver
creates separate input devices for power + home and vol up/down.
This is done because power/home act as wakeup buttons where as
the volume buttons do not.

This means that after this fixup the home -> volume-up button
still acts as a wakeup button, there is nothing which can be done
about this without adding a kludge to the kernel which is not
worth the trouble (IMHO).
2021-12-26 10:15:25 +09:00
Mike Gilbert
289b41aae7 random-util: use ssize_t for getrandom return value
This matches the prototype provided by glibc.
2021-12-26 10:13:56 +09:00
James Hilliard
4b7b73c714 meson: don't try to guess versioned clang/llvm-strip bins for cross compile
This should simplify overriding the program locations as the binary
names should now not change if cross compiling.

It's likely any attempts at autodetecting these in cross environments will
be brittle at best so lets just disable it.
2021-12-25 22:37:04 +09:00
Yu Watanabe
3e7bf8535f tree-wide: fix typo 2021-12-25 18:32:22 +09:00
Yu Watanabe
61d99ab9fb
Merge pull request #21774 from keszybz/make-libcore-shared-and-add-lib-tag-option
Make libcore shared and add private shared lib tag option
2021-12-25 18:02:54 +09:00
Yu Watanabe
1de6d117ef
Merge pull request #21765 from yuwata/udev-warn-truncation
udev: warn string truncation
2021-12-25 18:02:32 +09:00
Yu Watanabe
254a7d66c6 shared/linux: update linux headers from v5.16-rc6 2021-12-25 15:34:02 +09:00
Yu Watanabe
d25cc8321c basic/linux: update linux headers from v5.16-rc6 2021-12-25 15:34:02 +09:00
Yu Watanabe
49ad8da779 test-network: add testcase for vxlan local address auto selection 2021-12-25 15:32:06 +09:00
Yu Watanabe
b886649c95 network: vxlan: support to select an address assigned on underlying interface as local address 2021-12-25 15:32:06 +09:00
Yu Watanabe
8585b7ca65
Merge pull request #20833 from pdmorrow/onfailure_env
service: pass exiting service state to triggered On{Failure,Success}= dependencies
2021-12-25 15:29:42 +09:00
Zbigniew Jędrzejewski-Szmek
ff254eea8f test: ignore the error about our own libraries missing during image creation
19:50:59 F: Missing a shared library required by /var/tmp/systemd-test.NIPT2q/root/lib/systemd/libsystemd-core-250.so.
19:50:59 F: Run "ldd /var/tmp/systemd-test.NIPT2q/root/lib/systemd/libsystemd-core-250.so" to find out what it is.
19:50:59 F: libsystemd-shared-250.so => not found
19:50:59 F: Cannot create a test image.
2021-12-25 15:18:50 +09:00
Zbigniew Jędrzejewski-Szmek
a2b0cd3f5a meson: allow specifying a custom "tag" for the private shared libaries
We have /usr/lib/systemd/libsystemd-{shared,core}-nnn.so. With this
path the 'nnn' part can be changed to something different. The idea
is that during a package build this will be set to the package version.

This way during in-place upgrades with the same major version both
the new and old libraries can cooexit. This should fix the issue
when systemd programs are called during package upgrades and fail
to exec because the expect different symbols in the library they
are linked to.

This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1906010.
2021-12-25 15:18:50 +09:00
Zbigniew Jędrzejewski-Szmek
4287c85589 meson: create new libsystemd-core.so private shared library
The scheme is very similar to libsystemd-shared.so: instead of building a
static library, we build a shared library from the same objects and link the
two users to it. Both systemd and systemd-analyze consist mostly of the fairly
big code in libcore, so we save a bit on the installation:

(-0g, no strip)
-rwxr-xr-x 5238864 Dec 14 12:52 /var/tmp/inst1/usr/lib/systemd/systemd
-rwxr-xr-x 5399600 Dec 14 12:52 /var/tmp/inst1/usr/bin/systemd-analyze
-rwxr-xr-x  244912 Dec 14 13:17 /var/tmp/inst2/usr/lib/systemd/systemd
-rwxr-xr-x  461224 Dec 14 13:17 /var/tmp/inst2/usr/bin/systemd-analyze
-rwxr-xr-x 5271568 Dec 14 13:17 /var/tmp/inst2/usr/lib/systemd/libsystemd-core-250.so

(-0g, strip)
-rwxr-xr-x 2522080 Dec 14 13:19 /var/tmp/inst1/usr/lib/systemd/systemd
-rwxr-xr-x 2604160 Dec 14 13:19 /var/tmp/inst1/usr/bin/systemd-analyze
-rwxr-xr-x  113304 Dec 14 13:19 /var/tmp/inst2/usr/lib/systemd/systemd
-rwxr-xr-x  207656 Dec 14 13:19 /var/tmp/inst2/usr/bin/systemd-analyze
-rwxr-xr-x 2648520 Dec 14 13:19 /var/tmp/inst2/usr/lib/systemd/libsystemd-core-250.so

So for systemd itself we grow a bit (2522080 → 2648520+113304=2761824), but
overall we save. The most is saved on all the test files that link to libcore,
if they are installed, because there's 15 of them:

$ du -s /var/tmp/inst?
220096	/var/tmp/inst1
122960	/var/tmp/inst2

I also considered making systemd-analyze a symlink to /usr/lib/systemd/systemd
and turning systemd into a multicall binary. We did something like this with
udevd and udevadm. But that solution doesn't fit well in this case.
systemd-analyze has a bunch of functionality that is not used in systemd,
so the systemd binary would need to grow quite a bit. And we're likely to
add new types of verification or introspection features in analyze, and this
baggage would only grow. In addition, there are the test binaries which also
benefit from this.
2021-12-25 15:18:47 +09:00
Yu Watanabe
b0c01c9846 test: add test for truncation of program result invoked by udev 2021-12-25 15:13:19 +09:00