Commit graph

58471 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek e1c52cb271 docs/ARCHITECTURE: mention src/fundamental/ and add more details 2022-06-30 11:02:13 +02:00
Zbigniew Jędrzejewski-Szmek 28e7e9347d basic/socket-util: rename fd_inc_rcvbuf → fd_increase_rxbuf
See previous commit for justification.
2022-06-30 11:02:13 +02:00
Zbigniew Jędrzejewski-Szmek 78cca583fe sd-netlink: rename sd_netlink_inc_rcvbuf → sd_netlink_increase_rxbuf
We have RxBufferSize= and TxBufferSize= in .link files. Let's use the same
abbreviation here. OTOH, "inc" could be short for "increment" or "increase",
let's avoid that.
2022-06-30 11:02:13 +02:00
Zbigniew Jędrzejewski-Szmek 2c4ccaefc2 sd-bus: indentation 2022-06-30 11:02:13 +02:00
Zbigniew Jędrzejewski-Szmek 628f7b1e70 sd-bus: use assert_return() in public function sd_bus_message_dump
Also, document that NULL is allowed.
2022-06-30 10:55:39 +02:00
Zbigniew Jędrzejewski-Szmek 7e922b0584 sd-event: let sd_event_source_set_enabled accept NULL
Same story as before: disabling a non-existent event source shouldn't
need to be guarded by an if. I retained the wrapper so that that we don't
have to say SD_EVENT_OFF in the many places where this is called.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 71193c0b62 sd-event: allow sd_event_source_is_enabled() to return false for NULL
This is a natural use case, and instead of defining a wrapper to do this
for us, let's just make this part of the API. Calling with NULL was not
allowed, so this is not a breaking change to the interface.

(After sd_event_source_is_enabled was originally added, we introduced
sd_event_source_disable_unref() and other similar functions which accept
NULL. So not accepting NULL here is likely to confuse people. Let's just
make the API usable with minimal fuss.)
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 7d9337ed77 sd-netlink: allow sd_netlink_message_read() to be used for union types
Before, sd_netlink_message_read() expected to fill a buffer completely,
and would return -EIO if the attribute being read was shorter than the
buffer. This means that the function can be used to "peek" into attributes
(by specifying a short buffer to just read part of the attribute), but
cannot be used to read something into a union without knowing beforehand
which specific field in the union is being filled. That latter operation
seems more useful (messages are short, so we don't really need to do partial
reads), so let's allow reads that don't fill the output buffer completely.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 85f8afb706 man: document sd_bus_message_read_strv_extend() 2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek cf2edf1d5c sd-bus: export sd_bus_message_read_strv_extend()
The same story as before: it's a useful helper, other uses of the library
are likely to find it useful.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 944c124330 man: document sd_id128_string_equal() 2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek d13f105165 man: rework the text in sd-id128
In places the text was overly formal, e.g. "an 128-bit ID" was repeated, even
though it is clear from the context that we're talking about this type of ID.
OTOH, in other places the text was informal, e.g. "You can use …".
Also, "you may use f() to frob" → "f() frobs". The text without all the
flourishes is easier to read.

sd_id128_in_set_sentinel() was described only in passing when taking about
sd_id128_in_set(), now it gets is own brief paragraph.

The synopsis was missing.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek e16144844b sd-id128: rename and export sd_id128_string_equal()
We find this function useful in our code, so no reason not to export it.
I changed the order of last two words in the name to match the arguments.
(With "equal_string" I expected sd_id128_t first, string second, but in
actual use, the second argument is usually a long constant so it's nice
to keep this order of arguments.)
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 870c2aaf8c man: document sd_bus_error_setfv()
The description for sd_bus_error_set_errnof/sd_bus_error_set_errnofv are
adjusted to use the same pattern.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 4e116dd4fc meson: update man-generation rules for sd_hwdb_new_from_path
Forgotten in 60f0ba7556.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek fc69fab5ec sd-bus: export sd_bus_error_setfv()
The usual: if we find that function useful, other users of the library
will too. In particular, the v-variants are necessary to build pass-thru
wrappers.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 7a1f261da3 sd-bus: drop unused prototype
Function was exported in 07a0d22f9e,
but apparently we forgot to remove the old declaration.
2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek 2dbf1c0f15 libsystemd: drop unexported sd-utf8
It had two symbols which were not actually exported because they were not
listed in libsystemd.sym. They were also entirely unused in our codebase.
I don't think it makes much sense to export just those two functions, and
it doesn't make to build a string processing library in systemd either.

History of the file shows that it was created in
faaa5728d9 'utf8: export utf8 validation functions as part of sd-bus'
and hasn't gone even one non-trivial change since then ;)
2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek 84e1001541 libsystemd: export sd-netlink
It was added originally in 65f568bbeb. The API is
has stabilized pretty much, and generally follows the usual style for
libsystemd.  We've held it as a public-but-private library for almost 10 years,
let's export it.

sd_netlink_sendv() and sd_nfnl_nft_*() are excluded.

libsystemd.so seems to grow by 12k.
2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek 42d824dee3 test-lib*-sym: print symbols names in addition to addresses
This makes it easier to see what the test is doing.

I converted the code to use f-strings. They are already used in other scripts
necessary for build, so IIUC this is OK.
2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek 3e4f1dc9d9 sd-daemon: remove sd_ prefix from static function 2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek f2ef78d208 sd-netlink: remove sd_ prefix from static function 2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek b01f31954f Turn mempool_enabled() into a weak symbol
Before we had the following scheme:
mempool_enabled() would check mempool_use_allowed, and
libsystemd-shared would be linked with a .c file that provides mempool_use_allowed=true,
while other things would linked with a different .c file with mempool_use_allowed=false.

In the new scheme, mempool_enabled() itself is a weak symbol. If it's
not found, we assume false. So it only needs to be provided for libsystemd-shared,
where it can return false or true.

test-set-disable-mempool is libshared, so it gets the symbol. But then we
actually disable the mempool via envvar. mempool_enable() is called to check
its return value directly.
2022-06-29 16:51:52 +02:00
Daan De Meyer f63d1b0efa journal: Fix missing parenthesis 2022-06-29 14:05:23 +02:00
Yu Watanabe 840a49f3dc virt: fix detection of Parallels virtualization
If Parallels virtualization is detected from DMI, then trust that over CPUID.

Fixes issue caused by 28b1a3eac2.

Fixes #23856.
2022-06-29 14:03:54 +02:00
Daan De Meyer 969e1b86c2
Merge pull request #23836 from yuwata/journal-file-check-object-header
sd-journal: check object header before verifying object data
2022-06-29 12:12:26 +02:00
Yu Watanabe b8478c14c7 sd-journal: data object may be invalid after data_object_in_hash_table()
Fixes a bug introduced by 578cd1855b.

The function `data_object_in_hash_table()` calls
`journal_file_move_to_object()` with `OBJECT_DATA`. Hence,
previously obtained pointer to a data object may be now invalid.

Fixes #23794.
2022-06-29 04:54:05 +09:00
Yu Watanabe a30630f5dc sd-journal: also check object header before verifying object data
Otherwise, the check by journal_file_check_object() may be meaning less
when the header is broken.
2022-06-29 03:42:37 +09:00
Yu Watanabe 31fdd89fc6 sd-journal: drop unused argument from journal_file_check_object()
And rename the function.
2022-06-29 03:42:37 +09:00
Yu Watanabe 586fb79e27 sd-journal: shorten code a bit 2022-06-29 03:42:37 +09:00
Yu Watanabe 909a6b87b0 sd-journal: align table 2022-06-29 03:42:37 +09:00
Yu Watanabe d5548eb618
Merge pull request #23821 from dtardon/ascii-logging
Allow ASCII fallback for Unicode characters in logs
2022-06-29 03:36:35 +09:00
Yu Watanabe 94f881fd8e
Merge pull request #23849 from mbiebl/more-https
Use https for freedesktop.org
2022-06-29 03:22:51 +09:00
Zbigniew Jędrzejewski-Szmek a4d60b3e1c
Merge pull request #23827 from yuwata/sd-event-process-buffered-inotify-data
sd-event: process buffered inotify data
2022-06-28 18:25:14 +02:00
Michael Biebl 85fce6f42c Use https for gnu.org 2022-06-28 16:07:35 +02:00
Michael Biebl e2285c5735 Use https for man7.org 2022-06-28 16:05:31 +02:00
Michael Biebl 41d6f3bf4d Use https for freedesktop.org
grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
2022-06-28 13:10:05 +02:00
Yu Watanabe aaec221660
Merge pull request #23181 from thesamesam/parisc-seccomp
Add seccomp support for PARISC (HPPA)
2022-06-28 20:01:01 +09:00
David Tardon 28e5e1e97f tree-wide: allow ASCII fallback for … in logs 2022-06-28 12:50:44 +02:00
David Tardon e2341b6bc3 tree-wide: allow ASCII fallback for → in logs 2022-06-28 12:50:43 +02:00
Sam James 5a9276f659 gpt: add PARISC UUIDs
Not doing PARISC64 for now as no userland exists for it yet.
2022-06-28 04:52:42 +01:00
Sam James 344e6b62fc seccomp: add PARISC (HPPA support)
We have to skip the W^X protections as we need executable
memory on PARISC for now. Kernel work is in progress (started
w/ 5.18).

Closes: https://github.com/systemd/systemd/issues/23180
2022-06-28 04:39:29 +01:00
Sam James d40de37edd basic/missing-syscalls: add PARISC (HPPA support)
Bug: https://github.com/systemd/systemd/issues/23180
2022-06-28 04:28:57 +01:00
Jan Macku f0390fa034 github: add more components to RFE issue template
Follow-up to: #23838
2022-06-28 02:18:42 +09:00
Yu Watanabe c7b5a5a736 test: add another test for inotify event source
The test case is for issue #23826.
2022-06-28 00:05:14 +09:00
Yu Watanabe 067fc91702 sd-event: make sd_event_prepare() return positive when buffered inotify data exists
Previously, even if there is buffered inotify data, sd_event_prepare()
did not process the data when there is no pending event source.

Fixes #23826.
2022-06-28 00:05:14 +09:00
Yu Watanabe 32861b4c76 sd-event: use LIST_IS_EMPTY() 2022-06-28 00:05:14 +09:00
Piotr Drąg eaee50fee2 po: add a false positive to POTFILES.skip
Scripts used to detect files that should be in POTFILES.in, like
intltool-update -m used on https://l10n.gnome.org/module/systemd/,
falsely detect this file as containing translations. Avoid this
behavior by putting the file in POTFILES.skip.
2022-06-27 22:59:26 +09:00
Yu Watanabe 54e0cfc44e network: grouping elements in network_free() 2022-06-27 15:52:31 +02:00
Yu Watanabe b09a5659e2
Merge pull request #23842 from medhefgo/boot-std
boot: Use standard types
2022-06-27 22:32:31 +09:00