1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

55471 Commits

Author SHA1 Message Date
Yu Watanabe
60e930fc3e udev: fix ID_NET_NAME_MAC= udev property
This fixes a bug introduced by eaba9bb3e6.

The commit mistakenly drops 'x' in ID_NET_NAME_MAC, and adds colons.
The colons were dropped by the commit dfa4876c41,
but the missing 'x' was not added at that time.

Follow-up for dfa4876c41.
2021-12-31 13:21:12 +00:00
Yu Watanabe
92e9df9ca0 nss-myhostname: do not apply non-zero offset to null pointer
Fixes https://github.com/systemd/systemd/issues/21935#issuecomment-1003216503.
2021-12-31 09:13:03 +09:00
Yu Watanabe
420a35c1fa nss-systemd: fix alignment of gr_mem
Follow-up for 1e65eb8f9b.

Fixes #21935.
2021-12-31 09:05:16 +09:00
Zbigniew Jędrzejewski-Szmek
aac8071730 meson: fix detection of libcryptsetup functions
Meson would generate the following compile test:

  #define crypt_set_metadata_size meson_disable_define_of_crypt_set_metadata_size

  #include <limits.h>
  #undef crypt_set_metadata_size

  #ifdef __cplusplus
  extern "C"
  #endif
  char crypt_set_metadata_size (void);

  #if defined __stub_crypt_set_metadata_size || defined __stub___crypt_set_metadata_size
  fail fail fail this function is not going to work
  #endif

  int main(void) {
    return crypt_set_metadata_size ();
  }

This works fine when the identifier being queried is an actual function. But
crypt_token_max() is an inline function, so getting the address would fail,
leading to a false negative result. Complation would fail because the function
would be defined twice.

With this patch, the check is changed to include the header:

  #include <libcryptsetup.h>
  #include <limits.h>

  #if defined __stub_crypt_set_metadata_size || defined __stub___crypt_set_metadata_size
  fail fail fail this function is not going to work
  #endif

  int main(void) {
    void *a = (void*) &crypt_set_metadata_size;
    long long b = (long long) a;
    return (int) b;
  }

which seems to work correctly.
2021-12-31 07:02:29 +09:00
Luca Boccassi
af73d8bd83
Merge pull request #21940 from yuwata/network-wireguard-mask-allowed-ips
network: wireguard: handle invalid AllowedIPs= gracefully
2021-12-30 21:18:05 +00:00
Yu Watanabe
9383fa08bd hostname-util: drop GET_HOSTNAME_ALLOW_NONE flag and always refuse "(none)"
The flag is now only used in test-sysctl-util.c, and it should be
replaced with uname(), because of the same reason as the previous
commit.
2021-12-31 04:05:38 +09:00
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 47fd7fa6c6.

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 6d93265955.

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 95ef0eaf0d.

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