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

61963 Commits

Author SHA1 Message Date
Ulrich Ölmann
fe0bdcacd1 man: exec,nspawn: fix typo 2023-01-10 16:45:22 +09:00
Yu Watanabe
2d0d75b279 test: add tests for failure in renaming network interface 2023-01-10 14:25:20 +09:00
Yu Watanabe
e9336d6ac3 core/device: ignore failed uevents
When udevd failed to process the device, SYSTEMD_ALIAS or any other
properties may contain invalid values. Let's refuse to handle the uevent.
2023-01-10 14:25:20 +09:00
Yu Watanabe
58b0a3e511 core/device: downgrade log level for ignored errors 2023-01-10 14:25:20 +09:00
Yu Watanabe
eedfef0f0d sd-device: introduce device_get_property_int() 2023-01-10 14:25:20 +09:00
Yu Watanabe
210033847c udev: restore syspath and properties on failure
Otherwise, invalid sysname or properties may be broadcast to udev
listeners.
2023-01-10 14:25:16 +09:00
Lennart Poettering
b293bb2316 shutdown: propagate mount() failures from child to parent
Let's propagate the actual error code up, as we usual do.

Inspired by: #25168
2023-01-09 22:17:04 +01:00
Lennart Poettering
e29684a1ba
Merge pull request #25982 from mrc0mmand/curl-scheme
Fix build with the latest libcurl
2023-01-09 18:59:20 +01:00
Jan Janssen
3f92dc2fd4 boot: Simplify object erasure
This erase_obj() machinery looks like voodoo and creates an awful lot of
noise as soon as we get back to building with -O0. We can do this in a
more simple way by introducing a struct that holds the information we
need on cleanup. When building with optimization enabled, all this gets
inlined and the eraser vanishes.
2023-01-09 18:58:54 +01:00
msizanoen1
e18722375b journal: handle clock rollback error in managed_journal_file_open_reliably
-EREMCHG was introduced to denote a clock rollback detection error.
Handle this in managed_journal_file_open_reliably.
2023-01-09 23:05:19 +07:00
msizanoen1
9cd80d8a58 test-journal-flush: don't fail on -EREMCHG
-EREMCHG on write is now used to denote clock rollback conditions
detected during journal write.
2023-01-09 22:57:50 +07:00
msizanoen1
1d8d483f59 journal: enforce strict consistency for realtime timestamps on write
Ensure all realtime timestamps in a journal file are strictly
ordered on write as a defense-in-depth measure. All known callers of
journal_file_append_entry and journal_file_copy_entry, which call this
function, should be able to handle the error by rotating the journal.

This is especially helpful for systems with RTC local time enabled,
where all log entries from initramfs might be recorded as several hours
later than it actually is, which won't get caught by journald during log
flushing. In those cases, the resulting inconsistency can cause libsystemd
to loop infinitely through journal files as observed in
`abrt-dump-journal-oops`.
2023-01-09 22:57:30 +07:00
Frantisek Sumsal
e61a4c0b7c import: use CURLOPT_PROTOCOLS_STR with libcurl >= 7.85.0
CURLOPT_PROTOCOLS [0] was deprecated in libcurl 7.85.0 with
CURLOPT_PROTOCOLS_STR [1] as a replacement, causing build warnings/errors:

../build/src/import/curl-util.c: In function ‘curl_glue_make’:
../build/src/import/curl-util.c:255:9: error: ‘CURLOPT_PROTOCOLS’ is deprecated: since 7.85.0. Use CURLOPT_PROTOCOLS_STR [-Werror=deprecated-declarations]
  255 |         if (curl_easy_setopt(c, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_FILE) != CURLE_OK)
      |         ^~
In file included from ../build/src/import/curl-util.h:4,
                 from ../build/src/import/curl-util.c:6:
/usr/include/curl/curl.h:1749:3: note: declared here
 1749 |   CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
      |   ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Since there's no grace period between the two symbols, let's resort
to a light if-def-ery to resolve this.

[0] https://curl.se/libcurl/c/CURLOPT_PROTOCOLS.html
[1] https://curl.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html
2023-01-09 13:36:42 +01:00
Lennart Poettering
f977356a82 man: make clearer that sd_bus_get_timeout() returns an absolute time-out
Prompted by:

https://lists.freedesktop.org/archives/systemd-devel/2023-January/048714.html
2023-01-09 13:23:11 +01:00
Frantisek Sumsal
2285c462eb import: use CURLINFO_SCHEME instead of CURLINFO_PROTOCOL
CURLINFO_PROTOCOL has been deprecated in curl 7.85.0 causing compilation
warnings/errors:

../build/src/import/pull-job.c: In function ‘pull_job_curl_on_finished’:
../build/src/import/pull-job.c:142:9: error: ‘CURLINFO_PROTOCOL’ is deprecated: since 7.85.0. Use CURLINFO_SCHEME [-Werror=deprecated-declarations]
  142 |         code = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
      |         ^~~~
In file included from ../build/src/import/curl-util.h:4,
                 from ../build/src/import/pull-job.h:6,
                 from ../build/src/import/pull-common.h:7,
                 from ../build/src/import/pull-job.c:16:
/usr/include/curl/curl.h:2896:3: note: declared here
 2896 |   CURLINFO_PROTOCOL    CURL_DEPRECATED(7.85.0, "Use CURLINFO_SCHEME")
      |   ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Since both CURLINFO_SCHEME and CURLINFO_PROTOCOL were introduced in
the same curl version (7.52.0 [0][1]) we don't have to worry about
backwards compatibility.

[0] https://curl.se/libcurl/c/CURLINFO_SCHEME.html
[1] https://curl.se/libcurl/c/CURLINFO_PROTOCOL.html
2023-01-09 12:43:37 +01:00
Yu Watanabe
eafff21da2 test: modernize test-netlink.c 2023-01-09 20:33:35 +09:00
Lennart Poettering
a3310012e8
Merge pull request #25979 from yuwata/coverity-fixes
Coverity fixes
2023-01-09 09:56:04 +01:00
Jan Janssen
d84bdadb43 boot: Remove option TPM PCR compat option
It says remove in 2023; happy to oblige.
2023-01-09 09:52:55 +01:00
Yu Watanabe
ff88b94953 udev: move device_rename() from device-private.c
The function is used only by udevd.
2023-01-09 15:02:55 +09:00
Yu Watanabe
1de6a49721 sd-device: do not directly access entry in sd-device object
No functional change, just refactoring.
2023-01-09 15:00:56 +09:00
Yu Watanabe
9a26098e90 sd-device: make device_set_syspath() clear sysname and sysnum
Otherwise, when a new syspath is assigned to the sd-device object,
sd_device_get_sysname() or _sysnum() will provide an outdated device
name or number.
2023-01-09 14:00:20 +09:00
Yu Watanabe
bb1234d1d6 udev: align table 2023-01-09 11:20:35 +09:00
Yu Watanabe
3d5af17045 bootctl: 'tmp' is always non-NULL
Fixes CID#1502330.
2023-01-09 11:00:56 +09:00
Yu Watanabe
a42909e60c bootctl: fix indentation 2023-01-09 10:58:10 +09:00
Yu Watanabe
da8f9c4661 tmpfile: make failure in path_extract_filename() non-critical 2023-01-09 10:57:50 +09:00
Yu Watanabe
8a555dcbf7 tmpfile: fix resource leak
Fixes CID#1501687.
2023-01-09 10:52:33 +09:00
Siddhesh Poyarekar
4f79f545b3 alloc-util: Disallow inlining of expand_to_usable
Explicitly set __attribute__ ((noinline)) so that the compiler does not
attempt to inline expand_to_usable, even with LTO.
2023-01-08 16:26:39 +01:00
Luca Boccassi
9907a7e00b
Merge pull request #25915 from poettering/arm-timer-rel
pid1: rework service_arm_timer() to optionally take a relative time v…
2023-01-07 17:56:14 +01:00
Luca Boccassi
768405f2c8
Merge pull request #25936 from poettering/emergaction-fix
EmergencyAction parsing fix
2023-01-07 17:52:49 +01:00
Frantisek Sumsal
bef8d18b3f oss-fuzz: include generated corpora in the final zip file
Since the files with generated directives are now automatically
generated during build, they're now under the respective build directory
which the current oss-fuzz CI script didn't account for.

Follow-up to: #24958
Resolves: #25859
2023-01-07 17:44:23 +01:00
Lennart Poettering
b7d963e50a man: improve docs about systemd-notify invocations and NotifyAccess= settings
Fixes: #24516
2023-01-06 23:10:50 +01:00
dependabot[bot]
9826037476 build(deps): bump stefanbuck/github-issue-parser from 2.0.4 to 3.0.1
Bumps [stefanbuck/github-issue-parser](https://github.com/stefanbuck/github-issue-parser) from 2.0.4 to 3.0.1.
- [Release notes](https://github.com/stefanbuck/github-issue-parser/releases)
- [Commits](f80b14f788...c1a559d78b)

---
updated-dependencies:
- dependency-name: stefanbuck/github-issue-parser
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 19:18:30 +00:00
dependabot[bot]
4371496fa9 build(deps): bump ossf/scorecard-action from 2.0.6 to 2.1.2
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.0.6 to 2.1.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](99c53751e0...e38b1902ae)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 18:49:21 +00:00
dependabot[bot]
df242320e5 build(deps): bump github/super-linter from 4.9.6 to 4.9.7
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.9.6 to 4.9.7.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](01d3218744...bb2d833b08)

---
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>
2023-01-06 18:48:30 +00:00
dependabot[bot]
5afe9a300a build(deps): bump actions/checkout from 3.0.2 to 3.2.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.2 to 3.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.0.2...755da8c3cf115ac066823e79a1e1788f8940201b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 18:47:52 +00:00
dependabot[bot]
c129b184c9 build(deps): bump meson from 0.64.1 to 1.0.0 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 0.64.1 to 1.0.0.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/0.64.1...1.0.0)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 18:47:20 +00:00
Lennart Poettering
724f061db6 load-fragment: config_parse_emergency_action() doesn't ever get a Manager pointer passed in
In 'data' we get the location passed in we write stuff, and that's not
the Manager object.

And we neither get the Manager passed in via 'userdata', because at the
time we parse the emergency action for the manager the Manager is not
actually allocated yet.

hence, let's fix this differently, and pass in the user/system mode
descriptor via the 'ltype' argument.

Fixes: #25933
2023-01-06 16:15:46 +01:00
Lennart Poettering
2ae6917a1a load-fragment: remove EmergencyAction compat we were supposed to remove back in v241 2023-01-06 16:15:30 +01:00
Lennart Poettering
46730cd632 update TODO 2023-01-06 16:15:14 +01:00
Lennart Poettering
e793038a5e update TODO 2023-01-06 15:36:58 +01:00
Lennart Poettering
7122aee5ab
Merge pull request #25918 from bluca/smbios_sd_notify
Support AF_VSOCK in sd_notify and pick up notify_socket from creds
2023-01-06 15:21:27 +01:00
Quentin Deslandes
48d8516043 journald: fix followup comments on regex feature
Fix followup comments on PR #24058:
- Use `mempcpy_safe()`.
- Remove unused `pcre2_code` variable.
- Use `static const` when relevant.
2023-01-06 14:59:31 +01:00
Lennart Poettering
34680637e8 nspawn: guard acl_free() with a NULL check
Inspired by #25957 there's one other place where we don't guard
acl_free() calls with a NULL check.

Fix that.
2023-01-06 14:59:09 +01:00
Sam James
9f804ab04d tmpfiles: avoid null free() for acl attributes
When built with ACL support, we might be processing a tmpfiles
entry where there's no cause for us to call parse_acls_from_arg,
then we get to the end of parse_line without having ever populated
i.{acl_access, acl_default}.

Then we pass a null pointer into acl_free().

From UBSAN w/ GCC 13.0.0_pre20230101:
```
$ systemd-tmpfiles --clean
/var/tmp/portage/sys-apps/acl-2.3.1-r1/work/acl-2.3.1/libacl/acl_free.c:44:14: runtime error: applying non-zero offset 18446744073709551608 to null pointer
    #0 0x7f65d868b482 in acl_free /var/tmp/portage/sys-apps/acl-2.3.1-r1/work/acl-2.3.1/libacl/acl_free.c:44
    #1 0x55fe7e592249 in item_free_contents ../systemd-9999/src/tmpfiles/tmpfiles.c:2855
    #2 0x55fe7e5a347a in parse_line ../systemd-9999/src/tmpfiles/tmpfiles.c:3158
    #3 0x55fe7e5a347a in read_config_file ../systemd-9999/src/tmpfiles/tmpfiles.c:3897
    #4 0x55fe7e590c61 in read_config_files ../systemd-9999/src/tmpfiles/tmpfiles.c:3985
    #5 0x55fe7e590c61 in run ../systemd-9999/src/tmpfiles/tmpfiles.c:4157
    #6 0x55fe7e590c61 in main ../systemd-9999/src/tmpfiles/tmpfiles.c:4218
    #7 0x7f65d7ebe289  (/usr/lib64/libc.so.6+0x23289)
    #8 0x7f65d7ebe344 in __libc_start_main (/usr/lib64/libc.so.6+0x23344)
    #9 0x55fe7e591900 in _start (/usr/bin/systemd-tmpfiles+0x11900)
```
2023-01-06 14:58:46 +01:00
Lennart Poettering
578033356d man: document explicitly that LogRateLimit= has no effect on StandardOutput=file:…
Fixes: #25951
2023-01-06 14:13:09 +01:00
Daan De Meyer
e0ff0ee8f9
Merge pull request #25947 from poettering/resolved-dns-creds
resolved: add support for reading DNS config from kernel cmdline + service credentials
2023-01-06 14:11:57 +01:00
Lennart Poettering
2d935bbd22 gpt-auto-generator: improve log messages a bit
Fixes: #20331
2023-01-06 14:04:46 +01:00
Sam James
4e11b54b31 CODING_STYLE: fix 'better' typo 2023-01-06 14:03:19 +01:00
Lennart Poettering
e5d6dcce7f pid1: rework service_arm_timer() to optionally take a relative time value
In most cases this is actually what we want, hence simplify this case.
2023-01-06 11:29:09 +01:00
Lennart Poettering
ef8591951a sd-event: don't mistake USEC_INFINITY passed in for overflow
Let's pass USEC_INFINITY from sd_event_source_set_time_relative() to
sd_event_source_set_time() instead of raising EOVERFLOW.

We should raise EOVERFLOW only if your addition fails, but not if the
input already is USEC_INFINITY, since it's an entirely valid operation
to have an infinite time-out, and we should support that.
2023-01-06 11:29:09 +01:00