1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-12 13:18:14 +03:00
Commit Graph

63992 Commits

Author SHA1 Message Date
David Tardon
27beea26ef install: drop unused function 2023-04-12 17:09:41 +02:00
David Tardon
1abcc826ca test: use _cleanup_ for UnitFileList hash 2023-04-12 17:09:41 +02:00
David Tardon
6ff02eac41 systemctl-list-unit-files: drop workaround for Coverity
This partially reverts commit 0da999fada .
2023-04-12 17:09:38 +02:00
David Tardon
0bd5a57a57 systemctl: drop stray assignment 2023-04-12 17:04:38 +02:00
David Tardon
6ecf4b7819 systemctl: use _cleanup_ for UnitFileList hash
This also fixes a memory leak in the old code.

valgrind systemctl -t socket --root=/ list-unit-files >/dev/null
==2601899== Memcheck, a memory error detector
==2601899== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==2601899== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info
==2601899== Command: systemctl -t socket --root=/ list-unit-files
==2601899==
==2601899==
==2601899== HEAP SUMMARY:
==2601899==     in use at exit: 39,984 bytes in 994 blocks
==2601899==   total heap usage: 344,414 allocs, 343,420 frees, 2,001,612,404 bytes allocated
==2601899==
==2601899== LEAK SUMMARY:
==2601899==    definitely lost: 7,952 bytes in 497 blocks
==2601899==    indirectly lost: 32,032 bytes in 497 blocks
==2601899==      possibly lost: 0 bytes in 0 blocks
==2601899==    still reachable: 0 bytes in 0 blocks
==2601899==         suppressed: 0 bytes in 0 blocks
==2601899== Rerun with --leak-check=full to see details of leaked memory
==2601899==
==2601899== For lists of detected and suppressed errors, rerun with: -s
==2601899== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
2023-04-12 17:03:55 +02:00
Yu Watanabe
8e1d6003fb
Merge pull request #27217 from yuwata/boot-entry-at
boot-entry: introduce _at() variant
2023-04-12 22:59:54 +09:00
Lennart Poettering
db1f7c84ea varlink: honour "sensitive" flag of json variant objects all the way into the socket
Let's honour the flag if it is set, just to be safe.

(This only handles the case for the writing side: whenever the client
code hands us a json object with the flag set we'll honour it till the
it's out of reach for us. This does *not* handle the reading side, which
is left for a later patch once needed. We probably should add a
per-connection flag that simply globally enables the sensitive logic for
all messages coming in on a specific varlink conneciton.)
2023-04-12 15:14:21 +02:00
Lennart Poettering
7947dbe322 test: add varlink fd passing test 2023-04-12 15:14:21 +02:00
Lennart Poettering
d37cdac6ce varlink: implement file descriptor passing
Let's add infrastructure to implement fd passing in varlink, when used
over AF_UNIX.

This will optionally associate one or more fds with a message sent via
varlink and deliver it to the server.
2023-04-12 15:14:21 +02:00
Lennart Poettering
790446bd6c varlink: add helper that clears the currently processed incoming message JSON object
Some minor refactoring. This adds a helper call whose only job is to
unref the JSON object of the currently processed incoming message.

This doesn't make too much sense on its own, given this just replaces
one line by another. However, in a later patch when we'll add fd passing
we'll extend the function to also destroy associated fds, and then it
will start to make more sense.
2023-04-12 15:14:21 +02:00
Lennart Poettering
8531631763 varlink: get rid of "reply" field
So far, if we do a synchronous varlink call from the client side via
varlink_call(), we'll
move the returned json object from "v->current" into "v->reply", and
keep it referenced there until the next call. We then return a pointer
to it. This ensures that the json object remains valid between two
varlink_call() invocations.

But the thing is, we don't need a separate field for that, we can just
leave the data in "v->current". This means VARLINK_IDLE_CLIENT state
will be permitted with and without v->current initialized. Initially,
after connection setup it will be set to NULL, but after the first
varlink_call() it will be set to the most recent response, pinning it
into memory.
2023-04-12 15:14:21 +02:00
Lennart Poettering
a3861b4726 varlink: add some comments explaining what by various errors are defined 2023-04-12 15:14:21 +02:00
Daan De Meyer
88eec29d18 core: Send ERRNO= via notify socket on exit 2023-04-12 15:03:45 +02:00
Daan De Meyer
3a89cb84a6 core: Propagate exit status via notify socket when running in VM
When running in a container, we can propagate the exit status of
pid1 as usual via the process exit status. This is not possible
when running in a VM. Instead, let's send EXIT_STATUS=%i via the
notify socket if one is configured. The user running the VM can then
pick up the exit status from the notify socket after the VM has shut
down.
2023-04-12 15:03:43 +02:00
Daan De Meyer
623a00020f notify: Add EXIT_STATUS field
Whenever one of our tools or daemons exits, let's send the exit status
via sd-notify in the EXIT_STATUS field.
2023-04-12 15:02:34 +02:00
Lennart Poettering
4f25844a4b sysext: define a default image dissection policy for confext images 2023-04-12 14:54:44 +02:00
Lennart Poettering
b151e69671 discover-image: bring discover path list up-to-date.
While merge 3af48a86d9 was for a working
PR it was based on an older version of git main. Let's catch up with the
search path changes from de862276ed.
2023-04-12 14:41:32 +02:00
Daan De Meyer
14cb10b737 Fix compilation error 2023-04-12 14:36:14 +02:00
Thierry Martin
2f091b1b49 nspawn: container network interface naming
systemd-nspawn now optionally supports colon-separated pair of
host interface name and container interface name for --network-macvlan, --network-ipvlan and --network-interface options.
Also supported in .nspawn configuration files (i.e Interface=, MACVLAN=, IPVLAN= parameters).

man page changed for ntwk interface naming
2023-04-12 14:28:43 +02:00
Lennart Poettering
3af48a86d9
Merge pull request #25608 from poettering/dissect-moar
dissect: add dissection policies
2023-04-12 13:46:08 +02:00
Luca Boccassi
068943453f
Merge pull request #27165 from poettering/fdstore-envvar
service: tell service processes that the fdstore is available via an e…
2023-04-12 12:13:43 +01:00
Yu Watanabe
d2d969bb45 boot-entry: introduce boot_entry_token_ensure_at() 2023-04-12 19:47:34 +09:00
Yu Watanabe
e61ab091b7
Merge pull request #27223 from dtardon/install-changes
Simplify use of bus_deserialize_and_dump_unit_file_changes()
2023-04-12 19:30:51 +09:00
Daan De Meyer
ea24ed79f6
Merge pull request #27220 from yuwata/sd-device-follow-ups-for-devlink
sd-device: several follow-ups about devlink creation
2023-04-12 11:49:08 +02:00
Lennart Poettering
1412ad9a81 man: rebreak all of sd_notify(3)
No change of contents, just some rebreaking of the full file to match
our current line break settings.
2023-04-12 10:34:37 +02:00
Lennart Poettering
75b29fda71 service: tell service processes that the fdstore is available via an env var 2023-04-12 10:34:31 +02:00
David Tardon
234d964c2e systemctl: reduce variable scope 2023-04-12 09:53:55 +02:00
David Tardon
5e891cbb5c tree-wide: drop unneeded output params
Neither of the callers of bus_deserialize_and_dump_unit_file_changes()
touches the changes array, so let's simplify things and keep it internal
to the function.
2023-04-12 09:53:55 +02:00
Yu Watanabe
f643ca1767
Merge pull request #27033 from dtardon/array-cleanup
Use CLEANUP_ARRAY more
2023-04-12 16:43:39 +09:00
Yu Watanabe
fda18ce2b6 boot-entry: use chase_and_fopen_unlocked() to open /etc/kernel/entry-token
Otherwise, when 'root' is specified, the file may be a symlink to a host
file, and we may read wrong entry.
2023-04-12 16:23:03 +09:00
Yu Watanabe
7e430500d2 udev-test: add more testcases for SYMLINK 2023-04-12 10:52:14 +09:00
Frantisek Sumsal
82929336c7 test: drop binary stripping stuff
Stripping the binaries in the test images makes potential stack straces
quite useless, so let's drop the stripping stuff to make test fails a bit
more developer friendly.

Related: https://github.com/systemd/systemd-centos-ci/pull/616
2023-04-12 10:33:32 +09:00
Yu Watanabe
70e4510805 sd-device: absolute devlink must start with /dev/
This also makes device node path is handled with the same logic.

Addresses https://github.com/systemd/systemd/pull/27169#discussion_r1162739511.

Follow-up for 2c5f119c3c.
2023-04-12 09:20:11 +09:00
Yu Watanabe
3b5fc5fb1b boot-entry: prioritize machine ID only when it is not randomly generated
Preparation for later commits. The parameter will be used in
kernel-install later.
2023-04-12 08:31:50 +09:00
Daan De Meyer
965b481d9b
Merge pull request #27214 from DaanDeMeyer/firstboot
firstboot: Use root directory file descriptor for everything
2023-04-11 22:30:09 +02:00
Tanishka
fd7623193d Modified to use STRV_MAKE() in strv_env_name_is_valid() function listed in env-util.c 2023-04-11 21:05:22 +02:00
Zbigniew Jędrzejewski-Szmek
f843f8be9c
Merge pull request #27209 from jamacku/patch-1
Don't run release workflow on `systemd-security` & drop checkout action
2023-04-11 20:44:48 +02:00
Mike Yuan
8a826a979a systemctl: suppress error for try-* if unit is masked
Closes #16521
2023-04-11 17:54:02 +01:00
Jan Janssen
b87d6da447 boot: Fix alignment of long long inside structs on x86
On x86 EFI follows the windows ABI, which expects 8-byte aligned long
long. The x86 sysv ELF ABI expects them to be 8-byte aligned when used
alone, but 4-byte aligned when they appear inside of structs:

    struct S {
        int i;
        long long ll;
    };

    // _Static_assert(sizeof(struct S) == 12, "x86 sysv ABI");
    _Static_assert(sizeof(struct S) == 16, "EFI/MS ABI");

To get the behavior we need when building with sysv ELF ABI we need to
pass '-malign-double' to the compiler as done by EDK2.

This in turn will make ubsan unhappy as the stack may not be properly
aligned on entry, so we have to tell the compiler explicitly to re-align
the stack on entry to efi_main.

This fixes loading EFI drivers on x86 that were previously always
rejected as the EFI_LOADED_IMAGE_PROTOCOL had a wrong memory layout.

See also: https://github.com/rhboot/shim/pull/516
2023-04-11 17:09:18 +01:00
Jan Macku
19cdda7c3a ci: drop checkout from release workflow
It's not required as per comment - https://github.com/systemd/systemd/pull/27110#issuecomment-1499653913
2023-04-11 16:59:18 +02:00
Jan Macku
9718afd194 ci: don't run release wf on systemd-security 2023-04-11 16:59:18 +02:00
David Tardon
f86a41291b portabled-image-bus: use CLEANUP_ARRAY 2023-04-11 16:32:48 +02:00
David Tardon
a5290effe8 portabled-image-bus: use CLEANUP_ARRAY 2023-04-11 16:32:47 +02:00
David Tardon
2b4b01b00a portabled-image-bus: use CLEANUP_ARRAY 2023-04-11 16:32:46 +02:00
David Tardon
0dab8d5dc7 portabled-bus: use CLEANUP_ARRAY 2023-04-11 16:32:45 +02:00
David Tardon
bd92527752 sd-bus: use _cleanup_ 2023-04-11 16:31:52 +02:00
David Tardon
04375b6213 sd-bus: use CLEANUP_ARRAY 2023-04-11 16:30:07 +02:00
David Tardon
29933daf9e execute: use CLEANUP_ARRAY 2023-04-11 16:25:07 +02:00
David Tardon
93404d340e execute: use more automatic cleanup 2023-04-11 16:16:33 +02:00
Bill Peterson
5f8a9e6905
hwdb: add matrix for Asus BR1100F (#27197) 2023-04-11 23:11:16 +09:00