| Commit message (Collapse) | Author | Age |
|
|
|
| |
(cherry picked from commit 1b88ed3b7db37241323348f640f9adb61c0df47a)
|
|
|
|
| |
(cherry picked from commit d5ddc930150633f9ce38ed4a6dc9accfd7ceaaac)
|
|
|
|
| |
(cherry picked from commit 709d058756da7139181355b63cfad2288eefddfe)
|
|
|
|
| |
(cherry picked from commit 75bbdf478c73d78bbe5bdee6f468c2e84a1844c6)
|
|
|
|
| |
(cherry picked from commit e555d12635007da7263d0a43ed7307e70a07720d)
|
|
|
|
| |
(cherry picked from commit 04857cd801022d9f9933efb484c6253572f09870)
|
|
|
|
|
|
| |
Let's log the error messages if we get any at debug level.
(cherry picked from commit bd26aee1f6bea13fe25b3feb2a5e9cd1be522e7e)
|
|
|
|
| |
(cherry picked from commit 74fb9617a8d1958d89b4b829a6fe544ac30bb81c)
|
|
|
|
|
|
|
|
|
| |
This new call move an sd_bus_error into another one.
(cherry picked from commit 190128e407eb24a445554c0e1f956a1d51f97338)
In the backport, the new function is made non-public, declared in bus-error.h
not sd-bus.h.
|
|
|
|
| |
(cherry picked from commit cce08496e7353e3e9903b42695aba3f9d259b90a)
|
|
|
|
| |
(cherry picked from commit d88ffeeeefda4c3447223fd36f8e30f23c931e48)
|
|
|
|
|
|
|
| |
Whether we are stopping or not is highly relevant, hence don't forget it
across restarts.
(cherry picked from commit d865bc024bf28c17120d7322a81e9a99997a59f6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
let's make sure we log about every failure
Also, complain about systems where /dev/tty0 exists but
/sys/class/tty/tty0/active does not. Such systems (usually container
environments) are pretty broken as they mount something that is not a VC
to /dev/tty0 and they really shouldn't.
Systems should either have a VC or not, but not badly fake one by
mounting things wildly.
This just adds a warning message, as before we'll simply turn off VC
handling in this case.
(cherry picked from commit 0b6d55cae9b8adc507fbea95d1b2874729a77386)
|
|
|
|
| |
(cherry picked from commit b25ba6cf673036e46cbaec77d3c7859ed83d3ca8)
|
|
|
|
|
|
|
| |
This just copies what we already do for user and seat files to session
files.
(cherry picked from commit 44176400138e18d9087e0864ca97041416a90d47)
|
|
|
|
|
|
|
|
|
|
|
| |
Previously this was serialized as part of the user object. This didn't
work however, as we load users first, and sessions seconds and hence
referencing a session from the user load logic cannot work.
Fix this by storing an IS_DISPLAY property along with each session, and
make the session with this set display session when it is loaded.
(cherry picked from commit 1c8280fd47b6561d35b15b3b6d49bdeacf891bfd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let's update things a bit to follow current practices:
- User structure initialization rather than zero-initialized allocation
- Always propagate proper errors from allocation functions
- Use _cleanup_ for freeing objects when allocation fails half-way
- Make destructors return NULL
(cherry picked from commit 8c29a4570993105fecc12288596d2ee77c7f82b8)
|
|
|
|
|
|
| |
CID 1394372
(cherry picked from commit ee7b9f1dfc4653cc8ce26d57cbed249d7f9cea4b)
|
|
|
|
| |
(cherry picked from commit e99742ef3e9d847da04e71fec0eb426063b25068)
|
|
|
|
|
|
|
| |
Most places use the whole buffer for name, without leaving extra space
for the trailing NUL.
(cherry picked from commit f369f47c264dd56f630e91697006efd647542feb)
|
|
|
|
|
|
| |
Follow-up for a5d8835c78112206bbf0812dd4cb471f803bfe88.
(cherry picked from commit be44b572f3543e589e381f8a0a04ade71c4c2e03)
|
|
|
|
|
|
| |
This adds a test for 715a970548d03fed18dc66c411c8b42ff21029cf.
(cherry picked from commit cb3e926a5da4f73b48f71b541febe646bc1008d7)
|
|
|
|
|
|
|
| |
This adds tests for b4f607433cac749b617e15b3d5d122322ed2bc71 and
205c085bc36c2c61a09dc40621d8561b135d9b57 (#9792).
(cherry picked from commit 3ffd12bfbe9f91b392d80fbf6a8b2def2a13bf6d)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mempool use is enabled or disabled based on the mempool_use_allowed symbol that
is linked in.
Should fix assert crashes in external programs caused by #9792.
Replaces #10286.
v2:
- use two different source files instead of a gcc constructor
(cherry picked from commit a5d8835c78112206bbf0812dd4cb471f803bfe88)
|
|
|
|
|
|
|
|
| |
https://github.com/mesonbuild/meson/issues/1644 was resolved in 0.42:
https://github.com/mesonbuild/meson/pull/2191/commits/be4428005dff8b17af5696c8f05567de9af1a8c5,
but still no-go.
(cherry picked from commit 6939fb9eb4c76de630b71f6b2ad98686d7fbd1bf)
|
|
|
|
|
|
|
|
| |
The linked page is gone, and I can't quite remember what the
warning was about. Something about recursive copying... Everything
seems to work.
(cherry picked from commit c42c98192484f48342c2c032ea3d00022bd20e92)
|
|
|
|
|
|
| |
It was added way back, and seems to work fine now without it.
(cherry picked from commit 5dbf13fa6c2d5311a9fc236a0a95c1babcc11937)
|
|
|
|
| |
(cherry picked from commit 19d8c9c9b7b3507eb2fdcf668a85456a4ae0dbeb)
|
|
|
|
|
|
| |
The only user is in hashmap.c, but it's a mempool thing.
(cherry picked from commit 7c48ea02800782651b7da373c6165abb052f1382)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
between threads
When clients don't follow protocol and use the same object from
different threads, then we previously would silently corrupt memory.
With this assert we'll fail with an assert(). This doesn't fix anything
but certainly makes mis-uses easier to detect and debug.
Triggered by https://bugzilla.redhat.com/show_bug.cgi?id=1609349
(cherry picked from commit 205c085bc36c2c61a09dc40621d8561b135d9b57)
|
|
|
|
|
|
|
|
| |
hashmaps
Triggered by https://bugzilla.redhat.com/show_bug.cgi?id=1609349
(cherry picked from commit b4f607433cac749b617e15b3d5d122322ed2bc71)
|
|
|
|
|
|
|
|
| |
Let's make sure the integers we parse out are not larger than USHRT_MAX.
This is a good idea as the kernel's TIOCSWINSZ ioctl for sizing
terminals can't take larger values, and we shouldn't risk an overflow.
(cherry picked from commit d09a71356e3ed78be7cef3cd7d9919dc77508b41)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
/etc/systemd/sleep.conf gains four new switches:
AllowSuspend=, AllowHibernation=, AllowSuspendThenHibernate=, AllowHybridSleep=.
Disabling specific modes was already possible by masking suspend.target,
hibernate.target, suspend-then-hibernate.target, or hybrid-sleep.target.
But this is not convenient for distributions, which want to set some defaults
based on what they want to support. Having those available as configuration
makes it easy to put a config file in /usr/lib/systemd/sleep.conf.d/ that
overrides the defaults and gives instructions how to undo that override.
(cherry picked from commit e8f1d00d695f491654d50e57c82623288d3bcbeb)
|
|
|
|
| |
(cherry picked from commit 5fdf2d51c244288ac41443d1bd81365fab7b7b81)
|
|
|
|
|
|
|
|
|
|
|
| |
Comes with tests.
Also add direct test for $SYSTEMD_PROC_CMDLINE.
In test-proc-cmdline, "true" was masquerading as PROC_CMDLINE_STRIP_RD_PREFIX,
fix that. Also, reorder functions to match call order.
(cherry picked from commit 9a135c084ae6d06734ec3380f0eafdecd7c216f8)
|
|
|
|
| |
(cherry picked from commit 0307ea49c70b1ed4f3af3c80566c8c098dc080bb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For non-`seat0` seats, attaching a graphics card to a seat can
lead to it getting created. This is because the graphics device
is a "master device" which means that device is a seat-defining
device.
`seat0` may get created, even before the graphics driver is loaded,
though. This is because the graphics driver is loaded
asynchronously at startup, and `seat0` is the primary seat of
system, associated with the system VTs.
When a graphics card is attached to a seat the `CanGraphical`
property on that seat will flip to `true`.
For seats that haven't been created yet (non-`seat0` seats), this
leads to `seat_start` getting called which ultimately causes the
seat to get serialized to `/run/systemd/seats`.
For `seat0`, which is already created, `seat_start` will return
immediately, which means the updated `CanGraphical` state will
never get written to `/run/systemd/seats`.
The end result is that clients querying `sd_seat_can_graphical`
won't get the correct answer for `seat0` in cases where the
graphics device takes a long time to load until some other peice
of seat state is updated.
This commit fixes the problem by calling `seat_save` explicitly
for already running seats at the time a graphics device is
attached.
(cherry picked from commit ad1bf59c67e8d05629a4db00bbbe4d4c1c37fe46)
|
|
|
|
| |
(cherry picked from commit 14ee72b7d8de34a6b02767b865c3c49ceef2ed84)
|
|
|
|
| |
(cherry picked from commit eaa680c09e5701a62e8ac819211e5969eda84f2d)
|
|
|
|
|
|
|
|
|
| |
LGTM was complaining:
> Multiplication result may overflow 'int' before it is converted to 'long'.
Fix this by changing all types to ssize_t and add a check for overflow
while at it.
(cherry picked from commit 3d6c1844744f631995af72867d5f293430d8015b)
|
|
|
|
|
|
|
|
|
|
| |
We would read (-1), and then add 1 to it, call message_peek_body(..., 0, ...),
and when trying to make use of the data.
The fuzzer test case is just for one site, but they all look similar.
v2: fix two UINT8_MAX/UINT32_MAX mismatches founds by LGTM
(cherry picked from commit 902000c19830f5e5a96e8948d691b42e91ecb1e7)
|
|
|
|
| |
(cherry picked from commit d831fb6f2bde829f9309aea242f502587662d1cc)
|
|
|
|
|
|
|
| |
The change is similar to that in the previous commit, but I don't have
a reproducer / test case case for this one, so I'm keeping it seperate.
(cherry picked from commit 3d338a302f56c0ef0445660d9856794abe1af8b5)
|
|
|
|
|
|
|
|
|
| |
We copied part of the string into a buffer that was off by two.
If the element signature had length one, we'd copy 0 bytes and crash when
looking at the "first" byte. Otherwise, we would crash because strncpy would
not terminate the string.
(cherry picked from commit 73777ddba5100fe6c0791cd37a91f24a515f3202)
|
|
|
|
|
|
|
|
|
|
| |
This is similar to the grandparent commit 'fix calculation of offsets table',
except that now the change is for array elements. Same story as before: we need
to make sure that the offsets increase enough taking alignment into account.
While at it, rename 'p' to 'previous' to match similar code in other places.
(cherry picked from commit f88214cf9d66c93f4d22c4c8980de9ee3ff45bab)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The offsets specify the ends of variable length data. We would trust the
incoming data, putting the offsets specified in our message
into the offsets tables after doing some superficial verification.
But when actually reading the data we apply alignment, so we would take
the previous offset, align it, making it bigger then current offset, and
then we'd try to read data of negative length.
In the attached example, the message specifies the following offsets:
[1, 4]
but the alignment of those items is
[1, 8]
so we'd calculate the second item as starting at 8 and ending at 4.
(cherry picked from commit 12603b84d2fb07603e2ea94b240c6b78ad17510e)
|
|
|
|
|
|
|
| |
We'd calculate the "real" length of the string as 'item_size - 1', which does
not work out well when item_size == 0.
(cherry picked from commit 81b6e63029eefcb0ec03a3a7c248490e38106073)
|
|
|
|
|
|
|
| |
-EINVAL means the arguments were somehow wrong, so translate the code we get
internally into -EBADMSG when returning.
(cherry picked from commit 69bd42ca072dfb2f7603b1f82053063293ab54b5)
|
|
|
|
|
|
|
|
|
|
| |
The alternative would be to treat gvariant and !gvariant messages differently.
But this is a problem because we check signatures is variuos places before we
have an actual message, for example in sd_bus_add_object_vtable(). It seems
better to treat things consistent (i.e. follow the lowest common denominator)
and disallow empty structures everywhere.
(cherry picked from commit ec6bda56cbca9509b1abde1122645630caca877c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We didn't free one of the fields in two of the places.
$ valgrind --show-leak-kinds=all --leak-check=full \
build/fuzz-bus-message \
test/fuzz/fuzz-bus-message/leak-c09c0e2256d43bc5e2d02748c8d8760e7bc25d20
...
==14457== HEAP SUMMARY:
==14457== in use at exit: 3 bytes in 1 blocks
==14457== total heap usage: 509 allocs, 508 frees, 51,016 bytes allocated
==14457==
==14457== 3 bytes in 1 blocks are definitely lost in loss record 1 of 1
==14457== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
==14457== by 0x53AFE79: strndup (in /usr/lib64/libc-2.27.so)
==14457== by 0x4F52EB8: free_and_strndup (string-util.c:1039)
==14457== by 0x4F8E1AB: sd_bus_message_peek_type (bus-message.c:4193)
==14457== by 0x4F76CB5: bus_message_dump (bus-dump.c:144)
==14457== by 0x108F12: LLVMFuzzerTestOneInput (fuzz-bus-message.c:24)
==14457== by 0x1090F7: main (fuzz-main.c:34)
==14457==
==14457== LEAK SUMMARY:
==14457== definitely lost: 3 bytes in 1 blocks
(cherry picked from commit 6d1e0f4fcba8d6f425da3dc91805db95399b3c8b)
|