summaryrefslogtreecommitdiff
path: root/src/libsystemd
Commit message (Collapse)AuthorAgeFilesLines
* Fix ObjectManager interface emitted for non-manager objectsigo958622022-07-251-15/+29
|
* test-bus-objects: Test interfaces added/removed signal interfacesigo958622022-07-251-0/+67
| | | | | `org.freedesktop.DBus.ObjectManager` should only be emitted if object in question has ObjectManager attached.
* Fix GetManagedObjects returning ObjectManager interface for non-manager objectsigo958622022-07-251-5/+14
|
* test-bus-objects: Test GetManagedObjects interfaces are correctigo958622022-07-251-0/+35
| | | | | | | | | Objects without ObjectManager should not have `org.freedesktop.DBus.ObjectManager` interface. Object with ObjectManager should do. Also added ASSERT_SE_NONNEG and ASSERT_NONNEG macros.
* Merge pull request #24020 from yuwata/network-rfkillYu Watanabe2022-07-243-0/+23
|\ | | | | network: fix wlan interface handling when its RF is killed
| * sd-device: introduce device_unref_and_replace()Yu Watanabe2022-07-231-0/+3
| |
| * sd-device: introduce device_clear_sysattr_cache()Yu Watanabe2022-07-232-0/+5
| |
| * sd-device: introduce device_get_sysattr_bool()Yu Watanabe2022-07-232-0/+15
| |
* | sd-netlink: introduce sd_nfnl_{send,call}_batch()Yu Watanabe2022-07-242-22/+176
| | | | | | | | | | This also introduces sd_nfnl_message_new() which can be also used for non-nftables subsystems.
* | sd-netlink: do not compare pointer with 0Yu Watanabe2022-07-241-1/+1
| |
* | sd-netlink: merge sd_nfnl_nft_message_{new,del}_setelems_begin()Yu Watanabe2022-07-242-53/+24
| | | | | | | | | | | | | | And this makes the new merged function `sd_nfnl_nft_message_new_setelems()` not open container, as containers should be opened and closed in the same function in general. Otherwise, it is hard to understand which level we are in the nested attribute tree.
* | sd-netlink: drop unused sd_nfnl_nft_message_del_table()Yu Watanabe2022-07-232-23/+0
| |
* | sd-netlink: introduce sd_netlink_message_append_container_data()Yu Watanabe2022-07-233-16/+26
| |
* | sd-netlink: several cleanups for netfilterYu Watanabe2022-07-232-39/+52
| | | | | | | | | | | | | | | | - rename family -> nfproto, and other arguments, - check specified nfproto, - change type of several function arguments that specify data length, - add several assertions, - drop unnecessary headers.
* | tree-wide: drop unnecessary inclusion of netlink-util.hYu Watanabe2022-07-232-2/+0
| |
* | sd-netlink: move rtnl_message_type_is_*() to netlink-message-rtnl.cYu Watanabe2022-07-232-40/+40
|/
* Merge pull request #23963 from matoro/mainLennart Poettering2022-07-212-12/+22
|\ | | | | Replace __sync intrinsics with __atomic
| * journal: replace __sync intrinsics with __atomicmatoro2022-07-142-12/+22
| |
* | Merge pull request #24035 from yuwata/sd-event-cleanupYu Watanabe2022-07-161-12/+12
|\ \ | | | | | | sd-event: tiny cleanups
| * | sd-event: introduce PROTECT_EVENT() macroYu Watanabe2022-07-161-7/+10
| | |
| * | sd-event: drop redundant codeYu Watanabe2022-07-161-5/+2
| |/ | | | | | | | | The function `source_io_unregister()` will be anyway called in `source_disconnect()`.
* | coredump: Try to write journald coredump metadata to the journalDaan De Meyer2022-07-152-1/+15
|/ | | | | | | | | | | | | | | | | Currently, if journald coredumps, the coredump is written to /var/lib/systemd/coredump but the coredump metadata is not written to the journal meaning we can't find out about the coredump's existence via the journal. This means that coredumpctl can't be used to work with journald coredumps, as well as any other tools that rely on journald to know about coredumps. To solve the issue, let's have systemd-coredump try to write systemd-journald coredump metadata to the journal. We have to be careful though, since if journald coredumps, there's no active reader on the receive end of the journal socket, so we have to make sure we don't deadlock trying to write to the socket. To avoid the deadlock, we put the socket in nonblocking mode before trying to write to it.
* sd-bus: do not pass NULL when received message with invalid typeYu Watanabe2022-07-141-1/+1
| | | | Fixes #24003.
* Merge pull request #23817 from yuwata/sd-device-send-udev-database-versionZbigniew Jędrzejewski-Szmek2022-07-135-32/+57
|\ | | | | sd-device: send udev database version
| * sd-device: send udev database versionYu Watanabe2022-07-092-0/+28
| | | | | | | | | | | | | | Otherwise, sd-device object received through sd-device-monitor does not show current tags. Fixes #23799.
| * sd-device: make device_get_properties_{nulstr,strv}() take NULL for result valueYu Watanabe2022-07-092-10/+10
| | | | | | | | | | | | In most cases, it is not necessary to call them without retrieving result. But, most of other getter functions for sd-device can take NULL. Let's follow the way for consistency.
| * sd-device: change type of properties nulstr from uint8_t* to char*Yu Watanabe2022-07-095-24/+21
| |
* | Merge pull request #23972 from yuwata/sd-deviceYu Watanabe2022-07-111-15/+12
|\ \ | | | | | | sd-device: do not return -ENOENT by sd_device_get_is_initialized()
| * | sd-device: shorten code a bitYu Watanabe2022-07-111-15/+9
| | |
| * | sd-device: make sd_device_get_is_initialized() not return -ENOENTYu Watanabe2022-07-111-0/+3
| |/
* | sd-netlink: add sizes for some IP and Ethernet addressesTopi Miettinen2022-07-112-12/+12
|/ | | | | Add sizes for some uses of NETLINK_TYPE_IN_ADDR and NETLINK_TYPE_ETHER_ADDR types.
* journal: Make sd_journal_previous/next() return 0 at HEAD/TAILDaan De Meyer2022-07-051-4/+4
| | | | | | | 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
* Merge pull request #23855 from keszybz/drop-list-is-emptyLennart Poettering2022-07-051-26/+26
|\ | | | | basic/list: drop LIST_IS_EMPTY
| * sd-event: rename field to indicate that it's a listZbigniew Jędrzejewski-Szmek2022-07-021-6/+6
| |
| * sd-event: rename field to indicate that it's a listZbigniew Jędrzejewski-Szmek2022-07-021-7/+7
| |
| * sd-event: align tableZbigniew Jędrzejewski-Szmek2022-07-021-11/+11
| |
| * basic/list: drop LIST_IS_EMPTYZbigniew Jędrzejewski-Szmek2022-07-021-4/+4
| | | | | | | | | | | | | | | | | | | | 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).
* | tree-wide: add global ascii_isdigit() + ascii_isalpha()Lennart Poettering2022-07-055-23/+17
| | | | | | | | | | | | | | | | 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: 8d9156660d6958c8d63b1d44692968f1b5d33920
* | sd-id128: don't allow chars > f in valid id128 valuesLennart Poettering2022-07-051-4/+4
| |
* | Merge pull request #23865 from keszybz/drop-memcpy-callZbigniew Jędrzejewski-Szmek2022-07-021-1/+1
|\ \ | | | | | | sd-id128: avoid an unnecessary function call in inline helper
| * | sd-journal: silence bogus gcc warningZbigniew Jędrzejewski-Szmek2022-07-011-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | basic/socket-util: rename fd_inc_rcvbuf → fd_increase_rxbufZbigniew Jędrzejewski-Szmek2022-06-303-4/+4
| | | | | | | | See previous commit for justification.
* | sd-netlink: rename sd_netlink_inc_rcvbuf → sd_netlink_increase_rxbufZbigniew Jędrzejewski-Szmek2022-06-302-2/+2
| | | | | | | | | | | | 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.
* | sd-bus: indentationZbigniew Jędrzejewski-Szmek2022-06-301-8/+8
| |
* | sd-bus: use assert_return() in public function sd_bus_message_dumpZbigniew Jędrzejewski-Szmek2022-06-301-1/+2
| | | | | | | | Also, document that NULL is allowed.
* | sd-event: let sd_event_source_set_enabled accept NULLZbigniew Jędrzejewski-Szmek2022-06-303-9/+9
| | | | | | | | | | | | 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.
* | sd-event: allow sd_event_source_is_enabled() to return false for NULLZbigniew Jędrzejewski-Szmek2022-06-303-8/+4
| | | | | | | | | | | | | | | | | | | | | | 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.)
* | sd-netlink: allow sd_netlink_message_read() to be used for union typesZbigniew Jędrzejewski-Szmek2022-06-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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.
* | sd-bus: export sd_bus_message_read_strv_extend()Zbigniew Jędrzejewski-Szmek2022-06-303-3/+3
| | | | | | | | | | The same story as before: it's a useful helper, other uses of the library are likely to find it useful.
* | sd-id128: rename and export sd_id128_string_equal()Zbigniew Jędrzejewski-Szmek2022-06-304-18/+18
| | | | | | | | | | | | | | | | 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.)