Commit graph

39021 commits

Author SHA1 Message Date
Jan Janssen 3ed785e591 boot: Use open_volume when creating cpio 2022-07-07 10:06:44 +02:00
Yu Watanabe 557218776e systemctl: drop color settings in log message
`log_warning()` colorize the message gracefully.
2022-07-07 16:40:06 +09:00
Yu Watanabe 158fdd5326 systemctl: enable colorized logging by default 2022-07-07 16:40:06 +09:00
Michal Sekletar e73bf3425c logind: don't start user@UID.service instance for background sessions
We have had background session class for a long time (since commit
e2acb67baa), but so far the only difference in handling of background
sessions was logging, i.e. we log some messages with LOG_DEBUG for such
sessions.

Previously there were complains [1] about excessive logging for each
time cron session is started. We used to advise user to enable lingering
for users if they want to avoid these log messages. However, on servers
with a lot of users the extra processes that result from lingering just
adds too much overhead. Hence I think that our current handling of
background sessions is not ideal and we should make better use of this
attribute.

This commit introduces a change in default behavior of logind. Logind is
now not going to start user instance of systemd when background session
is created and that should address excessive logging problem for cron
where background class is used by default. When the same user actually
logs in normally then user instance will be started as previously.

Also note that PAM_TTY variable is now always set to some value for PAM
sessions started via PAMName= option. Otherwise we would categorize such
sessions as "background" and user manager won't be started.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1825942
2022-07-07 10:10:42 +09:00
Yu Watanabe 99080ed3f0
Merge pull request #23396 from msekletar/fix-idle-action-lock
logind: remember our idle state and use it to detect idle level transitions
2022-07-07 07:42:51 +09:00
Luca Boccassi c235945bd5
Merge pull request #23918 from yuwata/dissect
Revert "dissect: ID from os-release should be non-empty, not just non-NULL"
2022-07-06 21:31:04 +01:00
Thomas Haller da519f8c81 fundamental: adjust #if conditional for _fallthrough_ for clang
NetworkManager takes systemd sources. It gets compiler warnings
related to _fallthrough_. They probably can also affect systemd
itself.

A) on RHEL-7, gcc 4.8.5-44.el7 we get:

    ../src/libnm-systemd-shared/src/fundamental/macro-fundamental.h:45:22: error: "__clang__" is not defined [-Werror=undef]
     #if __GNUC__ >= 7 || __clang__
                          ^

   Presumably gcc older than 7 is supported, so fix this.

B) on Ubuntu 18.04, clang 1:6.0-41~exp5~ubuntu1 we get:

    ../src/libnm-systemd-core/src/libsystemd-network/sd-dhcp6-client.c:746:17: error: declaration does not declare anything [-Werror,-Wmissing-declarations]
                    _fallthrough_;
                    ^
    ../src/libnm-systemd-shared/src/fundamental/macro-fundamental.h:46:25: note: expanded from macro '_fallthrough_'
    #  define _fallthrough_ __attribute__((__fallthrough__))
                            ^

   Granted, README comments that clang >= 10 is required. However,
   parts of systemd build just fine with older clang. It seems unnecessary
   to break this and the fix helps NetworkManager.

Fixes: c0f5d58c9a ('meson: Document why -Wimplicit-fallthrough is not used with clang')
2022-07-06 22:10:23 +02:00
Zbigniew Jędrzejewski-Szmek 132b63bd31
Merge pull request #15205 from jlebon/pr/preset-all-firstboot
manager: optionally, do a full preset on first boot
2022-07-06 19:11:01 +02:00
Yu Watanabe d30d86b7ed dissect: refuse empty release ID 2022-07-06 19:16:24 +09:00
Yu Watanabe 8b2dcbbd00 Revert "dissect: ID from os-release should be non-empty, not just non-NULL"
This reverts commit a2cf73f0b6.

This is not necessary after 78ab2b5064.

Addresses https://github.com/systemd/systemd/pull/23454#discussion_r913611798.
2022-07-06 14:39:54 +09:00
Yu Watanabe 917c6bb4b3
Merge pull request #23916 from keszybz/assorted-patches
Assorted patches
2022-07-06 14:15:50 +09:00
Lennart Poettering 93258c7d72 json: actually use numeric C locale we just allocated
This fixes formatting of JSON real values, and uses C locale for them.
It's kinda interesting that this wasn't noticed before: the C locale
object we allocated was not used, hence doing the dance had zero effect.

This makes "test-varlink" pass again on systems with non-C locale.

(My guess: noone noticed this because "long double" was used before by
the JSON code and that had no locale supporting printer or so?)
2022-07-05 22:14:50 +02:00
Daan De Meyer 977ad21b5b journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL
Currently, both these functions don't return 0 if we're at HEAD/TAIL
and move in the corresponding direction. Let's fix that.

Replaces #23480
2022-07-05 22:13:40 +02:00
Zbigniew Jędrzejewski-Szmek 891fc28b45 tree-wide: drop duplicated semicolons 2022-07-05 21:49:12 +02:00
Lennart Poettering a87af99ef1
Merge pull request #23855 from keszybz/drop-list-is-empty
basic/list: drop LIST_IS_EMPTY
2022-07-05 17:29:53 +02:00
Daan De Meyer 87a3a4a802 firstboot: Don't skip passwd/shadow logic if only one of the files exists
If one of the files exists but not the other one, we want to make sure
we create the other file to make sure the passwd database is in a valid
state.
2022-07-05 17:09:16 +02:00
Lennart Poettering e386a6d69b
Merge pull request #23906 from poettering/isdigitisalpha
tree-wide: add global ascii_isalpha() + ascii_isdigit() and use it everywhere
2022-07-05 16:40:39 +02:00
Quentin Deslandes 57f28dee00 machine: switch to BusLocator-oriented helpers
Replace existing sd_bus_x calls with counterparts from bus-locator.h.
2022-07-05 16:40:16 +02:00
Lennart Poettering ff25d3385d tree-wide: add global ascii_isdigit() + ascii_isalpha()
We now have a local implementation in string-util-fundamental.c, but
it's useful at a lot of other places, hence let's give it a more
expressive name and share it across the tree.

Follow-up for: 8d9156660d
2022-07-05 14:25:07 +02:00
Lennart Poettering 82c3a0b74c sd-id128: don't allow chars > f in valid id128 values 2022-07-05 14:23:11 +02:00
Li kunyu aea29a300d
tree-wide: Remove the repeated ';' from code (#23901) 2022-07-05 16:06:47 +09:00
nl6720 0e68582323 tree-wide: link to docs.kernel.org for kernel documentation
https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation.
See https://git.kernel.org/pub/scm/docs/kernel/website.git/commit/?id=ebc1c372850f249dd143c6d942e66c88ec610520

These URLs are shorter and nicer looking.
2022-07-04 19:56:53 +02:00
Yu Watanabe 5932c87000
Merge pull request #23886 from keszybz/https-links-kernel
tree-wide: use html links for kernel docs
2022-07-03 00:55:59 +09:00
Zbigniew Jędrzejewski-Szmek 025f1279c7
Merge pull request #23088 from yuwata/udev-event-blocker
udev: cleanups for event blocker
2022-07-02 17:08:45 +02:00
Zbigniew Jędrzejewski-Szmek 7b3b2e5ad6
Merge pull request #23865 from keszybz/drop-memcpy-call
sd-id128: avoid an unnecessary function call in inline helper
2022-07-02 16:59:32 +02:00
Zbigniew Jędrzejewski-Szmek 4b2942aaea
Merge pull request #23835 from yuwata/nspawn-private-users-identity
nspawn: follow-ups for --private-users=identity
2022-07-02 12:58:06 +02:00
Zbigniew Jędrzejewski-Szmek c4f2bff121 test-list: rename field to indicate that it's a list
With this commit, lists are generally either names with plural (items),
or in a way that indicates a multi-item container (queue, *_list, or similar).
2022-07-02 12:51:37 +02:00
Zbigniew Jędrzejewski-Szmek eb506199f0 systemctl: rename field for clarity 2022-07-02 12:51:37 +02:00
Zbigniew Jędrzejewski-Szmek d5fe7f7fb1 udev: rename field
When we start, the contents of the variable match the name. But then
in the loop, the variable doesn't point at the old head any more. So let's
rename it to something with a plural.
2022-07-02 12:46:19 +02:00
Zbigniew Jędrzejewski-Szmek ed828563a5 sd-event: rename field to indicate that it's a list 2022-07-02 12:46:19 +02:00
Zbigniew Jędrzejewski-Szmek 0601b95877 sd-event: rename field to indicate that it's a list 2022-07-02 12:46:19 +02:00
Zbigniew Jędrzejewski-Szmek 3f3548f8d2 sd-event: align table 2022-07-02 12:46:19 +02:00
Zbigniew Jędrzejewski-Szmek d70f15f5aa resolved: rename field to indicate that it's a list 2022-07-02 12:46:19 +02:00
Zbigniew Jędrzejewski-Szmek 64903d18df basic/list: drop LIST_IS_EMPTY
This was a trivial wrapper that didn't provide any added value. With more
complicated structures like strvs, hashmaps, sets, and arrays, it is possible
to have an empty container. But in case of a list, the list is empty only when
the head is missing.

Also, we generally want the positive condition, so we replace many
if (!LIST_IS_EMPTY(x)) with just if (x).
2022-07-02 12:46:16 +02:00
Zbigniew Jędrzejewski-Szmek 1474e66a52 homework: silence gcc warning
gcc was warning that found_fs_uuid was used unitialized. The issue stemmed from
the call to open(), where gcc seemingly didn't know that errno must be negative.
When that is set, we can drop some unnecessary initializations without warnings.
2022-07-02 12:39:26 +02:00
Yu Watanabe 0e85550eb5 debug-generator: shorten code a bit 2022-07-02 12:20:14 +02:00
Zbigniew Jędrzejewski-Szmek 2f8211c64a tree-wide: use html links for kernel docs
Instead of using "*.txt" as reference name, use the actual destination title.
2022-07-02 12:13:00 +02:00
Yu Watanabe bffde9b586 core: do not filter out systemd.unit= and run-level specifier from kernel command line
Fixes a bug introduced by 846f1da465.

The commit 846f1da465 made systemd.unit=
filtered out from the command line. That causes debug-generator does not
work as expected on daemon-reexecute, and we cannot call `systemctl
daemon-reexecute` in our test suite running on nspawn.

Fixes issue reported in https://github.com/systemd/systemd/pull/23851#issuecomment-1170992052.
2022-07-02 05:07:23 +09:00
Zbigniew Jędrzejewski-Szmek 55ce4e1bcb sd-journal: silence bogus gcc warning
In function 'sd_id128_equal',
    inlined from 'journal_file_verify' at ../src/libsystemd/sd-journal/journal-verify.c:1047:29:
../src/systemd/sd-id128.h:119:43: error: 'entry_boot_id.qwords[0]' may be used uninitialized [-Werror=maybe-uninitialized]
  119 |         return a.qwords[0] == b.qwords[0] && a.qwords[1] == b.qwords[1];
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/libsystemd/sd-journal/journal-verify.c: In function 'journal_file_verify':
../src/libsystemd/sd-journal/journal-verify.c:823:20: note: 'entry_boot_id.qwords[0]' was declared here
  823 |         sd_id128_t entry_boot_id;
      |                    ^~~~~~~~~~~~~
cc1: all warnings being treated as errors

entry_boot_id is only used when entry_monotonic_set has been set, and that's
only done in one place where entry_boot_id is also initalized.
2022-07-01 13:42:46 +02:00
Yu Watanabe 3daf1f913c journalctl: fix to show user slice
Fixes #23867.
2022-07-01 09:29:16 +01:00
Yu Watanabe 3bdb60055e
Merge pull request #23868 from keszybz/lib-resplit-2
Export sd-netlink and clean up exported interfaces a bit
2022-07-01 13:13:42 +09:00
Zbigniew Jędrzejewski-Szmek 9075066955 logind: log wall messages to the journal
Currently kde installs a fake utmp session to listen for this. This provides an
alternative mechanism as discussed in #23574.

Example with 'shutdown 6 -r' and shutdown -c':
    PRIORITY=6
    SYSLOG_FACILITY=4
    SYSLOG_IDENTIFIER=systemd-logind
    ...
    CODE_FILE=src/login/logind-utmp.c
    CODE_LINE=90
    CODE_FUNC=warn_wall
    MESSAGE_ID=9e7066279dc8403da79ce4b1a69064b2
    OPERATOR=root
    MESSAGE=The system will reboot at Thu 2022-06-30 12:16:43 CEST!
    ACTION=reboot

    PRIORITY=5
    SYSLOG_FACILITY=4
    SYSLOG_IDENTIFIER=systemd-logind
    ...
    OPERATOR=root
    CODE_FILE=src/login/logind-dbus.c
    CODE_LINE=2407
    CODE_FUNC=method_cancel_scheduled_shutdown
    MESSAGE=System shutdown has been cancelled
    MESSAGE_ID=249f6fb9e6e2428c96f3f0875681ffa3
    ACTION=reboot
2022-06-30 19:28:41 +01:00
Michal Sekletar 4e2cfb778b logind: remember our idle state and use it to detect idle level transitions
Fixes #16391
2022-06-30 18:16:58 +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 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 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 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
Zbigniew Jędrzejewski-Szmek d0aec7d4da sd-id128: avoid an unnecessary function call in inline helper
When optimizing, the compiler will most likely replace the call to memcmp(),
but at -O0, the code that is emitted builds the call preamble and does the
call. Let's use the same pattern as with sd_id128_is_null() and
sd_id128_is_allf() and avoid the call.
2022-06-29 15:41:51 +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
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 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
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
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
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
Zbigniew Jędrzejewski-Szmek 6b0485c29a test-sd-hwdb: adjust the test to actually do anything
Without the terminating colon we wouldn't match anything, so the loop over
properties was skipped.
2022-06-27 22:31:24 +09:00
Jan Janssen e5a1b8f9a3 boot: Use stdbool
The way the UEFI spec defines BOOLEAN is fully compatible to stdbool, so
it is perfectly safe to switch to it. Although any other values than 0/1
are undefined by the spec, we could theoretically have cases where a
sloppy firmware hands us a bad BOOLEAN (since gnu-efi/edk2 declare it
as uint8_t). So any uses where we pass a pointer to BOOLEAN are left
untouched.
2022-06-27 12:27:23 +02:00
Jan Janssen 07d0fde49e boot: Use char
This also switches to _cleanup_free_. Otherwise no code changes.
2022-06-27 12:26:57 +02:00
Jan Janssen 3639d1b021 boot: Use char16_t
This also switches to _cleanup_free_. Otherwise no code changes.
2022-06-27 12:26:21 +02:00
Jan Janssen db4122d130 boot: Use stdint types 2022-06-27 12:16:27 +02:00
Jan Janssen 2a5e4fe414 boot: Remove use of EFI_ERROR
The macro is ugly and annoying to use and provides no real benefit. The
only reason to use it would be to allow warnings to go through. But any
EFI APIs we call do not return warning status codes or we do not check
the return value anyway. The only other case would be BS->StartImage,
where we already treat anything other than EFI_SUCCESS as an error
anyway.

This also helps the compiler and code analyzers to better reason about
the code. In particular, this can help reduce use of uninitialized
variable warnings.
2022-06-27 12:16:27 +02:00
Jan Janssen 8599bdb67c boot: Rename remaining EFI_STATUS vars to err for consistency 2022-06-27 12:16:27 +02:00
Jan Janssen 6b852d22b6 fundamental: Remove types-fundamental.h
This removes the fundamental typedefs in favor of just using standard C
types. These are all used internally anyway and also do not do anything
special to warrant any redefinition to EFI types.

Even for BOOLEAN we can safely use stdbool. The defition from the EFI
specification is fully compatible, including making any other values
than 0/1 as undefined.

The exception is sd_char as those need to be char16_t. The typedef is
moved to string-util-fundamental.h instead.
2022-06-27 12:16:27 +02:00
Yu Watanabe 5ad08191d8 nspawn: support PrivateUsers=identity
Follow-up for 33eac552ab.

Fixes #23825.
2022-06-27 10:33:10 +09:00
Yu Watanabe b917743d50 nspawn: update help message for user namespacing
Follow-up for 33eac552ab.
2022-06-27 10:31:41 +09:00
Jan Janssen 4e5c39597a sha256: Use stdbool and uintptr_t
This also syncs the copyright blurb with current glibc sources. The
written by line does not appear in upstream, so it should be okay to
remove.
2022-06-24 17:51:17 +01:00
Yu Watanabe c3613ee51e udev: allow to execute longer command line
Fixes #23607.
2022-06-24 20:09:24 +09:00
Jan Janssen c4ba5fef78 boot: Fix calls to ResetSystem
gnu-efi falsely declares a return type for ResetSystem when it should be
void. The spec also says that it never returns, so just assert.
2022-06-23 18:41:35 +02:00
Zbigniew Jędrzejewski-Szmek e5c09aad37 logind: simplify code
Follow-up for 4885d7490b.
2022-06-23 17:55:09 +02:00
Zbigniew Jędrzejewski-Szmek ef88c81bbe
Merge pull request #23802 from yuwata/core-watchdog-follow-ups
core: cleanups for watchdog
2022-06-23 09:59:24 +02:00
David Tardon 4885d7490b logind-session-dbus: allow to set display name via dbus
Currently, the only way to set display name of a graphical session is to
pass it to CreateSession(). But modern display managers like gdm start
the display server as part of the user session, which means that the
display name isn't known yet when the session is being created. Hence,
let's make it possible to set it later.
2022-06-22 22:34:29 +02:00
Jan Janssen 35148e8ff9 bootspec: Add PE file name to log messages
Fixes: #23783
2022-06-23 01:34:28 +09:00