1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

71856 Commits

Author SHA1 Message Date
Yu Watanabe
aa8200e971 sd-dhcp-server: also expose lease expiration timestamp in realtime
Here, we use map_clock_usec_raw(), instead of map_clock_usec() to reduce
number of calls of now() -> clock_gettime().
2024-03-12 01:57:17 +09:00
Yu Watanabe
3ecd6fa98b time-util: expose map_clock_usec_internal() as map_clock_usec_raw()
This will be used later.
2024-03-12 01:57:17 +09:00
Yu Watanabe
b923ada838 sd-dhcp-server-lease: move functions to build json format
No functional change, just preparation for later commits.
2024-03-12 01:57:17 +09:00
Yu Watanabe
5a2f378362 sd-dhcp-server: refuse invalid hostname in request
Currently, the received hostname is not used for assigning an address to
the host, or options in the subsequent reply message. But, the parsed
hostname is exposed through DBus, and possibly Varlink in the future.
Let's ignore spurious hostname.
2024-03-12 01:57:17 +09:00
Yu Watanabe
fa3357b9e8 dhcp-option: refuse control and non-UTF8 characters in string option
We oftem save parsed DHCP options into a file, or expose them
through DBus or Varlink. In such case, control characters or non-UTF8
characters may cause many kind of unexpected errors. In general, a DHCP
message that have string options with spurious characters is mostly
malformed or broken. Let's refuse them.

This also makes dhcp_option_parse_string() do not free 'ret' argument,
to follow our usual coding style. So, callers now need to free the
pre-exisitng string if necessary.

Fixes #31708.
2024-03-12 01:57:17 +09:00
Yu Watanabe
c84a5f5eaf test-network: add support for systemd-networkd-persistent-storage.service 2024-03-12 01:57:16 +09:00
Yu Watanabe
91676b6458 networkctl: introduce "persistent-storage" command
Then, this introduces systemd-networkd-persistent-storage.service.

systemd-networkd.service is an early starting service. So, at the time
it is started, the persistent storage for the service may not be ready,
and we cannot use StateDirectory=systemd/network in
systemd-networkd.service.

The newly added systemd-networkd-persistent-storage.service creates the
state directory for networkd, and notify systemd-networkd that the
directory is usable.
2024-03-12 01:57:16 +09:00
Yu Watanabe
f90eb08627 network/varlink: introduce io.systemd.Network.SetPersistentStorage method
And make the networkd use state directory.

Currently, the state directory and the method are not used, but will be used later.
2024-03-12 01:57:11 +09:00
Adrian Vovk
58d061b5aa
data-fd-util: Fixup header
inttypes.h doesn't define size_t
2024-03-11 12:24:30 -04:00
Yu Watanabe
83cc18257e test-network: copy system unit files from build or source directory
Addresses https://github.com/systemd/systemd/pull/30021#issuecomment-1971090682.
2024-03-12 01:17:40 +09:00
Yu Watanabe
f66045c7d4 test-network: drop unused options and variables
This also renames several variables, and replace RuntimeError with
assert.
2024-03-12 01:14:40 +09:00
Mike Yuan
2f41f10bcd
pidref: use fd_inode_same to compare pidfds 2024-03-11 22:57:50 +08:00
Mike Yuan
945a8210c7
stat-util: struct stat could be initialized with (st_mode & S_IFMT == 0)
For anonymous inodes, the result would be 0, but
the struct stat is initialized obviously.
So let's switch to st_dev for the check, which
is guaranteed to be non-zero.

Also this is completely unnecessary for statx(),
since we check stx_mask first and that on its own
denotes that the struct is initialized.
2024-03-11 22:57:50 +08:00
Mike Yuan
0cdb8df620
stat-util: introduce fd_inode_same 2024-03-11 22:53:08 +08:00
Luca Boccassi
14300cdde4 polkit: update the rest of bus_verify_polkit_async_full() calls to new flags parameter
Looks like the compiler doesn't even notice these were left over
as the types end up matching somehow

Follow-up for 29556b75d8025580eebe160a1fa1459965912ee2
2024-03-11 14:17:45 +00:00
Lennart Poettering
9f65355b85 fd-util: beef up fd_verify_safe_flags() features
Let's make fd_verify_safe_flags() even more useful:

1. let's return the cleaned up flags (i.e. just the access mode) after
   validation, hiding all the noise, such as O_NOFOLLOW, O_LARGEFILE and
   similar.

2. let's add a "full" version of the call that allows passing additional
   flags that are OK to be set.
2024-03-11 14:49:51 +01:00
Antonio Alvarez Feijoo
4313b99136
shared/service-util: actually use the bus_introspect argument in help()
If `bus_introspect` is false, do not print the `--bus-introspect=PATH` option.

Also, modernize help output.
2024-03-11 13:56:30 +01:00
Luca Boccassi
c7edd9f13d
Merge pull request #31711 from YHNdnzj/gpt-auto-has-node
gpt-auto: ignore fstab_has_node failure
2024-03-11 12:40:22 +00:00
Antonio Alvarez Feijoo
65064e2ff0
tree-wide: drop custom formatting for print() help messages
Follow-up for bc556335b1c568c98688cc1f586b5f753fcddac6
2024-03-11 13:34:34 +01:00
Lennart Poettering
29556b75d8
polkit: turn "interactive" flag to polkit APIs into a proper flags field (#31715)
This adds for both the D-Bus and the Varlink flavours of our polkit
client api a flags parameter. And then folds the "bool interactive" flag
that the D-Bus version so far had, into a flag, and also adds support
for it in the Varlink API.

Since this means the Varlink API gained another parameter, let's do what
we already did for the D-Bus API and add a _full() version of the API
that has the flags and the good_uid parameter, and one without both.
2024-03-11 11:57:45 +00:00
cpackham-atlnz
ed01b92e1c
basic: add PIDFS magic (#31709)
Kernel commit cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b added pidfs.
Update filesystems-gperf.gperf and missing_magic.h accordingly.

This fixes the following error building against a bleeding edge kernel.
```
../src/basic/meson.build:234:8: ERROR: Problem encountered: Unknown filesystems defined in kernel headers:

Filesystem found in kernel header but not in filesystems-gperf.gperf: PID_FS_MAGIC
```
2024-03-11 11:55:36 +00:00
Sergey A
b95d4f897f po: Translated using Weblate (Russian)
Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Sergey A <sw@atrus.ru>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ru/
Translation: systemd/main
2024-03-11 12:52:08 +01:00
Luca Boccassi
2bbe5ca178 semaphore: remove workaround for adduser
Offending commit has been reverted, so it's no longer necessary:

9016769691

Follow-up for 8b7485c505f1e7a55896069224109adaf10c16b9
2024-03-11 11:15:12 +00:00
Lennart Poettering
efb4858f11 polkit: trivial simplification 2024-03-11 10:44:53 +00:00
Luca Boccassi
03292f9663
Merge pull request #31706 from DaanDeMeyer/smbios
systemd-boot: Add support for reading extra kernel cmdline from SMBIOS
2024-03-11 10:44:11 +00:00
Luca Boccassi
3b5512b973
Merge pull request #31675 from rpigott/dns-refuse
resolved: refuse queries with no suitable scope
2024-03-11 10:43:18 +00:00
Evgeny Vereshchagin
5801a18ed3 fuzz: save/load DHCP client leases
to make sure it more or less works with all sorts of leases.

Prompted by https://github.com/systemd/systemd/pull/30021#discussion_r1519123802
2024-03-11 09:41:44 +00:00
Frantisek Sumsal
b460b36d12
Merge pull request #31692 from bluca/semaphore_autopkgtest_fixes
semaphore: move back to autopkgtest master branch and rearrange build deps
2024-03-11 10:00:58 +01:00
Mike Yuan
622f2dcc71
gpt-auto: ignore fstab_has_node failure
After 8a1326581d9b066377f8d9f2d58e1bdfd8b645d0,
we always check whether there're mounts under
/boot/ or /efi/ first. Let's relax the check
for fstab_has_node hence, since on initrd-less
systems it might produce wrong results.
2024-03-11 15:34:05 +08:00
Mike Yuan
18f9ecd40c
fstab-util: remove unreachable return 2024-03-11 15:27:04 +08:00
İ. Ensar Gülşen
d3ca25645f hwdb: Add touchpad configuration for ThinkPad E495 2024-03-10 23:25:32 +00:00
Daan De Meyer
f710037984 man: Mention that SMBIOS type 11 strings are ignored inside CVM 2024-03-10 21:24:52 +01:00
Luca Boccassi
c936de2802
Merge pull request #31705 from YHNdnzj/quotacheck-followup
Some follow-ups for quotacheck
2024-03-10 19:58:01 +00:00
Luca Boccassi
3cf1e7d678 man: fix systemd-measure manpage conditional
Follow-up for ec3cf73f303cf99ba73c91b734401b3ad2c218e9
2024-03-10 17:50:54 +00:00
Mike Yuan
edec55ea61 man/systemd-hibernate-resume: generator now enables rather than creates the service
Follow-up for a628d933cc67cc8b183dc809ba1451aa5b2996e5
2024-03-10 16:13:19 +00:00
Daan De Meyer
365e90b946 systemd-boot: Add support for reading extra kernel cmdline from SMBIOS
Same as io.systemd.stub.kernel-cmdline-extra, but for type 1 entries
booted by systemd-boot.
2024-03-10 16:30:34 +01:00
Mike Yuan
b2d4ce7e58
quotacheck: store argv[*] in static var
As per our coding style
2024-03-10 23:11:47 +08:00
Mike Yuan
5926d69200
quotacheck: minor modernization 2024-03-10 23:08:34 +08:00
Mike Yuan
af720f38d9
units: make quota services bind to corresponding mount units
Follow-up for a628d933cc67cc8b183dc809ba1451aa5b2996e5

systemd-growfs@.service does the same.
2024-03-10 22:57:22 +08:00
Yu Watanabe
1d87a00a95 mkosi: fix typo
Follow-up for 4d0f1451b58dbd4b94da579b800adef4f4e42c34.
2024-03-10 14:09:41 +09:00
Thomas Blume
fc5c6eccb4 units: make templates for quotaon and systemd-quotacheck service 2024-03-09 19:32:09 +00:00
Luca Boccassi
b028cd3bd8 semaphore: drop some manual build deps, handled by package
The package now pulls in more dependencies, so can drop some. Also we don't need libarchive-dev
and libcurl4-openssl-dev from backports.
2024-03-09 12:43:36 +00:00
Luca Boccassi
8b7485c505 semaphore: move back to autopkgtest master branch
Instead of fixing the commit, we can workaround the adduser issue by
simply creating a user manually beforehand, which means the broken
codepath in autopkgtest is not taken. We can remove it once it's
fixed upstream, which is in progress:

https://salsa.debian.org/ci-team/autopkgtest/-/merge_requests/297
2024-03-09 12:42:32 +00:00
Vasiliy Stelmachenok
9bb89a55a2 core/exec-invoke: Fix missing arguments for PR_SET_MEMORY_MERGE call
Without it prctl will always fail, even if using a kernel version that
supports the PR_SET_MEMORY_MERGE call.
2024-03-09 00:19:16 +00:00
Ronan Pigott
591810c02e resolved: also reply NOTIMP when refusing a query based on RR type
In some cases we refuse a query based on the RR type, mostly old
deprecated types. Let's return NOTIMP in this case, which best
communicates why the query failed.
2024-03-08 14:48:03 -07:00
Chandra Pratap
793732d32b extract-word: increase test-extract-word coverage for unicode inputs
In the current testing scheme in test-extract-word, we only
have two test cases covering unicode strings. Improve upon
this by adding more cases for the same.

Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
2024-03-08 21:29:08 +00:00
Abraham Samuel Adekunle
c18caed19b add unittest cases for argv_looks_like_help 2024-03-08 21:27:55 +00:00
Unique-Usman
ffc7f3e9cb Added a new test to cover login-util.c 2024-03-08 21:27:22 +00:00
Antonio Alvarez Feijoo
6be9f641ce man/kernel-install: add add-all command to synopsis 2024-03-08 21:26:48 +00:00
Daan De Meyer
45a0bb4bb5 mkosi: Add BuildSourcesEphemeral=yes
Required to make sure that any changes packaging specs make to the
source files are thrown away after the build so they don't mess with
the source tree.
2024-03-08 19:37:27 +01:00