summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use FORK_REARRANGE_STDIO and FORK_CLOSE_ALL_FDSYu Watanabe2023-02-211-8/+3
|
* process-util: rename FORK_NULL_STDIO -> FORK_REARRANGE_STDIOYu Watanabe2023-02-211-1/+4
| | | | And make safe_fork_full() takes fds to be assigned to stdio.
* Merge pull request #26350 from keszybz/reload-messagesLuca Boccassi2023-02-081-4/+10
|\ | | | | Improve messages emitted when Reload or Reexec is requested
| * sd-bus: adjust line breaksZbigniew Jędrzejewski-Szmek2023-02-081-4/+10
| |
* | Merge pull request #26328 from yuwata/udev-worker-set-process-nameZbigniew Jędrzejewski-Szmek2023-02-081-4/+1
|\ \ | | | | | | udev: set worker process name
| * | tree-wide: set FORK_RLIMIT_NOFILE_SAFE flagYu Watanabe2023-02-071-4/+1
| |/ | | | | | | No functional changes, just refactoring.
* | resolve: define normal macros for BUS_ERROR_DNS error codesZbigniew Jędrzejewski-Szmek2023-02-072-18/+37
|/ | | | | | This result is identical after cpp is done, so we don't save anything by not having the usual macros. And with the usual macros it's easier to grep and code-crossreferencing works better.
* sd-bus: Log extra fields when processing bus messageDaan De Meyer2023-01-083-0/+29
|
* tree-wide: use -EBADF moreYu Watanabe2022-12-211-1/+1
|
* tree-wide: introduce PIPE_EBADF macroYu Watanabe2022-12-203-3/+3
|
* tree-wide: use -EBADF also in pipe initializersZbigniew Jędrzejewski-Szmek2022-12-193-3/+3
| | | | In some places, initialization is dropped when unnecesary.
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-194-13/+13
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* core/unit: allow overriding an ongoing freeze operationmsizanoen12022-12-081-0/+1
| | | | | | | Sometimes a freeze operation can hang due to the presence of kernel threads inside the unit cgroup (e.g. QEMU-KVM). This ensures that the ThawUnit operation invoked by systemd-sleep at wakeup always thaws the unit.
* sd-bus: handle -EINTR return from bus_poll()Lennart Poettering2022-11-222-4/+19
| | | | | | | | | | In sd_bus_wait(), let's convert EINTR to a return code of 0, thus asking the caller do loop again and enter sd_bus_process() again (which will not find any queued events). This way we'll not return an error on something that isn't really an error. This should typically make sure things are properly handled by the caller, magically, without eating up the event entirely, and still giving the caller time to run some code if they want.
* strv: move nulstr utilities to nulstr-util.[ch]Lennart Poettering2022-11-131-0/+1
| | | | | | | Let's move them out of the generic, already very long strv.[ch] module into the more specific nulst-util.[ch] No code changes.
* sd-bus: Use goto finish instead of return in bus_add_match_fullDaan De Meyer2022-11-111-1/+1
| | | | Fixes #25340
* Rename def.h to constants.hZbigniew Jędrzejewski-Szmek2022-11-083-3/+3
| | | | | | The name "def.h" originates from before the rule of "no needless abbreviations" was established. Let's rename the file to clarify that it contains a collection of various semi-related constants.
* basic: rename util.h to logarithm.hZbigniew Jędrzejewski-Szmek2022-11-088-9/+0
| | | | | util.h is now about logarithms only, so we can rename it. Many files included util.h for no apparent reason… Those includes are dropped.
* basic: move container_get_leader() to process-util.[ch]Zbigniew Jędrzejewski-Szmek2022-11-081-1/+0
| | | | | basic/util.[ch] is a grab-bag of unrelated functions. Let's move a few of the remaning functions to better locations.
* sd-bus: convenience functions to emit a signal to a destination (#25123)Erik Moqvist2022-10-313-4/+80
| | | * sd-bus: convenience functions to emit a signal to a destination
* systemctl,manager: refuse linking unit files underneath the search pathsZbigniew Jędrzejewski-Szmek2022-10-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | We treat symlinks to unit files outside of the search path differently from symlinks to unit files *in* the search path. The former are "linked" unit files, while the latter are enablement symlinks and such and will be removed when disabling the unit. The history of the check for in_search_path() is interesting: this condition was added already in the first version of the code in 830964834f330836b9d33752e83de09d4f38da87. Since the beginning, matching arguments would simply be ignored. I think this is dubious. The man page says: > Link a unit file that is *not* in the unit file search paths > into the unit file search path But for backwards-compat, let's continue to silently do nothing for files *in* the search path. The case of symlinks to unit files underneath the search path, but in some subdirectory, is less clear. We didn't check for this case, so it was implicitly allowed. But that's just an oversight, we don't want to allow people to create additional subhierarchies under our hierarchy. Let's check for this case and refuse. Closes #24605.
* Merge pull request #24933 from keszybz/erradicate-strerrorLuca Boccassi2022-10-114-16/+19
|\ | | | | Erradicate strerror
| * sd-bus: make bus_error_message() a thread-safe macroZbigniew Jędrzejewski-Szmek2022-10-112-5/+11
| | | | | | | | | | | | | | | | | | | | strerror_r() is used instead of strerror(). The usual trick is employed: we allocate a buffer that lives until the end of the surrounding block to provide the scratch space. This change is particularly important forn sd-bus and the pam modules, which may be called from threaded code. I checked the codebase, and we only use bus_error_message() in log statements, so the returned pointer is not used beyond its valid lifetime.
| * tree-wide: define and use STRERROR_OR_EOF()Zbigniew Jędrzejewski-Szmek2022-10-111-1/+1
| |
| * tree-wide: use STRERROR()Zbigniew Jędrzejewski-Szmek2022-10-111-1/+1
| |
| * sd-bus: decrease indentationZbigniew Jędrzejewski-Szmek2022-10-071-9/+6
| |
* | bus: Process authentication after writeMarius Vollmer2022-10-041-31/+35
|/ | | | | Once everything has been written, a server bus might now process a pending "BEGIN" and start the bus.
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-133-14/+6
|
* tree-wide: Fix field width specifier warningsJan Janssen2022-08-301-1/+1
| | | | | The casting here isn't pretty, but at least it makes it obvious what is happening instead of implicit and it allows enabling -Wformat-signedness.
* tree-wide: port things dirname_malloc() → path_extract_directory()Lennart Poettering2022-08-232-8/+1
|
* tree-wide: pass proper values (not bools) to sd_event_source_set_enabled()Lennart Poettering2022-08-191-1/+1
|
* bus: use inline trace argument for ANONYMOUS authDavid Rheinsberg2022-08-051-52/+62
| | | | | | | | | | | | Rather than using a separate DATA round to transmit the trace-string of the ANONYMOUS authentication scheme, transmit it inline as argument. This requires a refactor of the client-side SASL parser, as we now have a different set of replies depending on the mode used. This fixes an issue where libdbus-1 does not query for trace-strings if not transmit inline as AUTH-ANONYMOUS argument. It is unclear from the wording of the spec whether this is a violation by libdbus-1. However, we can work around it by simply changing our mode of transmittal.
* 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.
* sd-bus: do not pass NULL when received message with invalid typeYu Watanabe2022-07-141-1/+1
| | | | Fixes #24003.
* tree-wide: add global ascii_isdigit() + ascii_isalpha()Lennart Poettering2022-07-051-16/+10
| | | | | | | | 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
* basic/socket-util: rename fd_inc_rcvbuf → fd_increase_rxbufZbigniew Jędrzejewski-Szmek2022-06-301-1/+1
| | | | See previous commit for justification.
* 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-bus: export sd_bus_message_read_strv_extend()Zbigniew Jędrzejewski-Szmek2022-06-302-3/+2
| | | | | The same story as before: it's a useful helper, other uses of the library are likely to find it useful.
* sd-bus: export sd_bus_error_setfv()Zbigniew Jędrzejewski-Szmek2022-06-304-6/+4
| | | | | | 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.
* sd-bus: drop unused prototypeZbigniew Jędrzejewski-Szmek2022-06-301-1/+0
| | | | | Function was exported in 07a0d22f9ec5a0cac2385b73dc08b12a811cead8, but apparently we forgot to remove the old declaration.
* Merge pull request #23821 from dtardon/ascii-loggingYu Watanabe2022-06-291-1/+3
|\ | | | | Allow ASCII fallback for Unicode characters in logs
| * tree-wide: allow ASCII fallback for → in logsDavid Tardon2022-06-281-1/+3
| |
* | Use https for freedesktop.orgMichael Biebl2022-06-281-1/+1
|/ | | | grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
* test-bus-address: silence gcc warning about NULL arg to strcmp()Zbigniew Jędrzejewski-Szmek2022-06-091-7/+5
| | | | | The code was overly complicated… We know what value we expect, we can test it directly.
* sd-bus: drop constant argument for message_extend_fields()Yu Watanabe2022-06-011-5/+5
|
* sd-bus: drop D-Bus version 2 format supportYu Watanabe2022-06-017-2255/+367
| | | | It seems the format is used only by kdbus.