1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00
Commit Graph

55836 Commits

Author SHA1 Message Date
Luca Boccassi
d76f0de746 test: rename service used in TEST-29-PORTABLE to avoid conflict
There's an app0.service in the extension app0.raw, so don't use the same
name for a unit in minimal.raw
2022-01-27 14:21:29 +00:00
Yu Watanabe
2a97a4b374 test: initialize buffer to make Coverity silent
Follow-up for f82f0b9937.

Fixes CID#1469119.
2022-01-27 13:47:58 +00:00
Christian Brauner
7e7a9f9c8b NEWS: mention temporary limitations for running containers in systemd-homed directories 2022-01-27 10:15:56 +00:00
Yu Watanabe
a21440f6d6
Merge pull request #22259 from bluca/exec_cond_restart
core: do not restart a service with Restart=always when ExecCondition fails
2022-01-27 15:09:47 +09:00
Arfrever Frehtes Taifersar Arahesis
a42a93830f logind.conf: Fix name of option: RuntimeDirectoryInodes -> RuntimeDirectoryInodesMax 2022-01-27 14:04:44 +09:00
Evgeny Vereshchagin
b28d06e059 tests: fuzz dhcp_server_relay_message
It's a follow-up to https://github.com/systemd/systemd/pull/19384 where
dhcp_server_relay_message was introduced.

This PR was prompted by https://github.com/systemd/systemd/pull/22236#issuecomment-1020113269
for the most part.
2022-01-27 13:49:36 +09:00
Anita Zhang
1d3b68f6e1 tree-wide: don't use strjoina() on getenv() values
Avoid doing stack allocations on environment variables.
2022-01-27 13:45:00 +09:00
Erik Sjölund
f223fd6add docs: fix typos and improve language
Fix typos and improve the language by
adding a few commas and a missing word.
2022-01-26 22:35:33 +00:00
Rike-Benjamin Schuppner
b6d2f0338e man: Fix paths for user units (transient/generator.early) 2022-01-26 22:35:22 +00:00
Luca Boccassi
3a5cd7dd8d
Merge pull request #22251 from medhefgo/boot-cleanup
boot: Small improvements
2022-01-26 22:34:32 +00:00
Luca Boccassi
429cddbaf1 NEWS: note breaking change w.r.t. Restart=always and ExecCondition= 2022-01-26 19:03:34 +00:00
Luca Boccassi
abb99360d3 core: do not restart a service with Restart=always when ExecCondition fails
When a Condition*= fails, and a service has Restart=always,
the service is not restarted.
Follow the same behaviour for ExecCondition= to avoid inconsistencies.

Fixes #22257
2022-01-26 19:02:11 +00:00
Jan Janssen
1926a11439 boot: Add screen resolution to print status 2022-01-26 18:07:00 +01:00
Jan Janssen
c323c2f63c boot: Also NUL-terminate for CHAR16 in file_reaad 2022-01-26 18:07:00 +01:00
Jan Janssen
20a734726e boot: Use ASSERT_PTR 2022-01-26 18:07:00 +01:00
Jan Janssen
83d905b7b4 boot: Optimize unique title generation 2022-01-26 18:06:52 +01:00
Yu Watanabe
9d3bb25b2d
Merge pull request #22252 from medhefgo/boot-build
meson: Boot build/test changes
2022-01-27 01:32:04 +09:00
Yu Watanabe
58ceeb844d
Merge pull request #22249 from yuwata/wait-online-fix-unmanaged-state
wait-online: fix handling of unmanaged state
2022-01-27 01:17:12 +09:00
Daan De Meyer
f82f0b9937 shared: Ensure COPY_HOLES copies trailing holes
Previously, files with a hole at the end would get silently truncated
which breaks reading journal files. This commit makes sure that holes
are punched in existing space and if no more space is available, that
we grow the file and the hole by using ftruncate().

The corresponding test is extended to put a hole at the end of the file
and we make sure that hole is copied correctly.
2022-01-27 01:15:22 +09:00
Yu Watanabe
cd7fcda543 wait-online: make manager_link_is_online() return 0 when in unmanaged state
Previously, even if a link is in unmanaged state, the function may
returns positive value. So, even if all managed links are in the configured
sate but do not satisfy the online criteria, e.g., IPv4 address state,
then wait-online finishes with positive value.

This makes the function always return 0 for unmanaged state. So, at
least one managed link must satisfies the online criteria.

This also adds more comments and debugging logs.

Fixes #22246.
2022-01-26 22:41:47 +09:00
Yu Watanabe
5f200833ed wait-online: rename Manager elements 2022-01-26 22:41:47 +09:00
Jan Janssen
7afd0196b6 meson: Use --no-wchar-size-warning
This only disables the one warning that we care to ignore, making
sure that any future issues do not get masked.
2022-01-26 14:40:55 +01:00
Jan Janssen
b6167d9611 meson: Use same name format for efi binary intermediates 2022-01-26 14:40:55 +01:00
Jan Janssen
b2ba8511e6 meson: Remove test-efi-create-disk.sh
The script was probably not used for a very long time. It is currently
passed systemd_boot.so as boot loader, which cannot work. The test
entries it creates are all pointing at non-existant efi/linux binaries,
which means they would not even show up in the menu if the created image
were actually booted. There is also nothing that actually tries to run
the image in the first place.

If we end up creating a proper systemd-boot test suite, it would be
better to start from scratch. In the meantime, mkosi already covers
the bare minimum with a simple bootup test.
2022-01-26 14:40:51 +01:00
Luca Boccassi
e3f7ed944a portable: add flag to return extension-releases in GetImageMetadataWithExtensions
Return the name of each extension and the associated extension-release
file, and pretty-print them in 'portablectl inspect', if a new flag
is passed.

$ portablectl inspect --extension app2 --extension app0  minimal app0 app1
(Matching unit files with prefixes 'app0', 'app1'.)
Image:
        /run/portables/minimal.raw
Portable Service:
        n/a
Operating System:
        Debian GNU/Linux 10 (buster)
Extension:
        /run/portables/app2.raw
        Extension Scope:
                n/a
        Extension Compatibility Level:
                n/a
        Portable Service:
                n/a
        Portable Prefixes:
                n/a
        Operating System:
                n/a (debian 10)
Extension:
        /run/portables/app0.raw
        Extension Scope:
                n/a
        Extension Compatibility Level:
                n/a
        Portable Service:
                n/a
        Portable Prefixes:
                n/a
        Operating System:
                n/a (debian 10)
Unit files:
        app0.service
2022-01-25 22:22:47 +00:00
Luca Boccassi
0017415cc5 portable: add GetImageStateWithExtensions method
Allow to correctly query a layered portable service for
attached/detached state.
2022-01-25 06:44:27 +09:00
Yu Watanabe
9697662915 hostname: expose hardware serial through dbus
Closes #22119.
2022-01-24 21:09:37 +00:00
Yu Watanabe
f338a496e4 NEWS: update 2022-01-25 03:03:09 +09:00
Yu Watanabe
1d2842d1e6 NEWS: mention about the regression in WireGuard 2022-01-25 02:56:20 +09:00
Yu Watanabe
0850fb78af
Merge pull request #22236 from yuwata/fuzz-dhcp-server
fuzz-dhcp-server: three fixes or improvements
2022-01-25 02:19:22 +09:00
Yu Watanabe
bf2a8b7b13 fuzz-dhcp-server: attach sd_event to make dhcp_server_cleanup_expired_leases() works in the fuzzer
Otherwise, most code paths in dhcp_server_handle_message() are not
evaluated by the fuzzer.
2022-01-25 00:05:02 +09:00
march1993
11cc2a5602 Update systemd.netdev.xml
Mind users to avoid use name gre0, gretap0 and erspan0 for GRE tunnels.
2022-01-24 14:58:14 +00:00
Zbigniew Jędrzejewski-Szmek
4a00b45fa6 user-runtime-dir: error out immediately if mkdir fails
We try to create two directories: /run/user and /run/user/<UID>. For the
first we check the return value and error out if creation fails. But for
the second one we continued based on the assumption that the subsequent
mount will immediately fail anyway. But this has the disadvantage that we
get a somewhat confusing error message:

janv. 23 22:04:31 nsfw systemd-user-runtime-dir[1660]: Failed to mount per-user tmpfs directory /run/user/1000: No such file or directory

Let's instead fail immediately with a precise error message.

For https://bugzilla.redhat.com/show_bug.cgi?id=2044100.
2022-01-24 13:06:45 +00:00
Luca Boccassi
cb94b8acc5
Merge pull request #22203 from brauner/2022-01-21.procsubset.pid
core/namespace: allow using ProtectSubset=pid and ProtectHostname=tru…
2022-01-24 13:04:23 +00:00
Luca Boccassi
aa3160b967
Merge pull request #22231 from yuwata/resolve-synthesize
resolve: synthesize several filtered name
2022-01-24 12:11:29 +00:00
Yu Watanabe
0590f1b58c fuzz-dhcp-server: duplicate input data
As `dhcp_server_handle_message()` -> `ensure_sane_request()` may modify
the input data, and that causes error in some fuzzing engine.
2022-01-24 19:37:37 +09:00
Yu Watanabe
c3da2e4732 fuzz-dhcp-server: also set new lease elements correctly
The fuzzer does not send anything to the address, so it should be not
necessary, but just for safety.
2022-01-24 19:28:21 +09:00
Christian Brauner
fbf90c0d5c
core/namespace: s/normalize_mounts()/drop_unused_mounts()
Rename the normalize_mounts() helper to drop_unused_mounts. All the
helpers called in there get rid of mounts that are unused for a variety
of reasons. And whereas the helpers are aptly prefixed with "drop" the
overall helper isn't and instead uses "normalize".

Make it more obvious what the helper actually does by renaming it from
normalize_mounts() to drop_unused_mounts(). Readers of code calling this
helper will immediately see that it will get rid of unused mounts.

Link: https://github.com/systemd/systemd/issues/22206
2022-01-24 10:22:47 +01:00
Christian Brauner
1361f01577
core/namespace: allow using ProtectSubset=pid and ProtectHostname=true together
If a service requests both ProtectSubset=pid and ProtectHostname=true
then it will currently fail to start. The ProcSubset=pid option
instructs systemd to mount procfs for the service with subset=pid which
hides all entries other than /proc/<pid>. Consequently trying to
interact with the two files /proc/sys/kernel/{hostname,domainname}
covered by ProtectHostname=true will fail.

Fix this by only performing this check when ProtectSubset=pid is not
requested. Essentially ProtectSubset=pid implies/provides
ProtectHostname=true.
2022-01-24 09:41:28 +01:00
dependabot[bot]
da9be066cb build(deps): bump github/codeql-action from 1.0.27 to 1.0.29
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.27 to 1.0.29.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cd783c8a29...384cfc42b2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 11:18:48 +03:00
Yu Watanabe
766527e8ae
Merge pull request #22226 from yuwata/hostname-allow-to-override-hardware-vendor-and-model
hostname: allow to override hardware vendor and model
2022-01-24 06:55:29 +09:00
Yu Watanabe
a6ba7d58f2
Merge pull request #22227 from yuwata/dhcp-server-fix-heap-buffer-overflow
sd-dhcp-server: fix heap buffer overflow
2022-01-24 06:55:02 +09:00
Frantisek Sumsal
ab9760b846 github: point to "tags" instead of "releases" in systemd-stable
since we don't do releases there.

Mentioned in https://github.com/systemd/systemd/issues/22230#issue-1111991271.
2022-01-24 06:53:43 +09:00
Yu Watanabe
46b53e8035 resolve: synthesize null address, IPv4 broadcast address, or invalid domain
These are filtered in `dns_scope_good_domain()`, but not synthesized.

Fixes #22229.
2022-01-24 06:46:50 +09:00
Yu Watanabe
3b2ac14ac4 resolve: synthesize empty name
Do not return any error for empty name. Just returns empty answer.

Before:
---
$ dig .

; <<>> DiG 9.16.24-RH <<>> .
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 13617
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;.				IN	A

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Mon Jan 24 05:49:30 JST 2022
;; MSG SIZE  rcvd: 28
---

After:
---
$ dig .

; <<>> DiG 9.16.24-RH <<>> .
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7957
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;.				IN	A

;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Mon Jan 24 06:05:02 JST 2022
;; MSG SIZE  rcvd: 28
---

Replaces #22197.

Fixes RHBZ#2039854 (https://bugzilla.redhat.com/show_bug.cgi?id=2039854).
2022-01-24 06:45:37 +09:00
Yu Watanabe
7bdf419830 dns-domain: re-introduce dns_name_is_empty() 2022-01-24 06:06:59 +09:00
Yu Watanabe
7c0601102a Revert "resolve: refuse to resolve empty hostname"
This reverts commit 6e8ecb8974.
2022-01-24 05:51:47 +09:00
Yu Watanabe
a596631808 fuzz: add testcases of heap-buffer-overflow for sd-dhcp-server 2022-01-24 04:52:33 +09:00
Yu Watanabe
ab4f9eeb7b sd-dhcp-server: fix heap buffer overflow
This checks client hardware length earlier.
2022-01-24 04:49:33 +09:00
Yu Watanabe
b87209f933
Merge pull request #22222 from yuwata/dhcp-server-support-non-ethernet-packet
dhcp-server: support packets from non-Ethernet interfaces
2022-01-24 04:19:26 +09:00