summaryrefslogtreecommitdiff
path: root/src/libsystemd
Commit message (Collapse)AuthorAge
* Rename more things to elogindAndy Wingo2015-04-19
|
* Compiling.Andy Wingo2015-04-08
|
* sd-device: get_sysattr_value - don't leak returned valueTom Gundersen2015-04-03
| | | | | | | This was getting leaked as a copy was added to the hashmap, simply add the returned value instead. This should fix CID #1292806.
* sd-device: initialize variableTom Gundersen2015-04-03
| | | | sysnum would not be initialized if sysname had no trailing digits.
* libsystemd: add sd-device libraryTom Gundersen2015-04-02
| | | | | | | | | | | | This provides equivalent functionality to libudev-device, but in the systemd style. The public API only caters to creating sd_device objects from for devices that already exist in /sys, there is no support for listening for monitoring events or creating devices received over the udev netlink protocol. The private API contains the necessary functionality to make sd-device a drop-in replacement for libudev-device, but which we would not otherwise want to export.
* fix gcc warnings about uninitialized variablesHarald Hoyer2015-03-27
| | | | | | | | | | | | | like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
* sd-rtnl: Always enable IFA_FLAGSPatrik Flykt2015-03-27
| | | | | IFA_FLAGS is a discrete value and has no preprocessor #define defined for it. Fix this by always using the value.
* sd-rtnl: handle empty multi-part message from the kernelAlin Rauta2015-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We strips out NLMSG_DONE piece from a multi-part message adding into the receive queue only the messages containing actual data. If we send a request to the kernel for getting the forwarding database table (just an example), the response will be a multi-part message like below: 1. FDB entry 1; 2. FDB entry 2; 3. NLMSG_DONE; We strip out "3. NLMSG_DONE;" part and places into the receive queue a pointer to "1. FDB entry 1; 2. FDB entry 2". But if the FDB table is empty, the respose from the kernel will look like below: 1. NLMSG_DONE; We strip out "1. NLMSG_DONE;" part and since there is no actual data got, it continues waiting until reaching timeout. Therefore, a call to "sd_rtnl_call" to send and wait for a response from kernel will exit with timeout which is interpreted as error in communication. This patch puts the NLMSG_DONE message on the receive queue if it ends an empty multi-part message. This situation is detected in sd_rtnl_call() and in the callback code and NULL is returned to the caller instead. [tomegun: - added/reworded commit message - extend the same support to sd_rtnl_call_async() - drop debug logging from library, we only do this if something is really wrong, but an empty multi-part message is perfectly normal - modernize the code we touch whilst we are at it]
* Add (void) where we don't care about return valueZbigniew Jędrzejewski-Szmek2015-03-15
|
* sd-event: sd_event_run - only return 0 on timeoutTom Gundersen2015-03-14
| | | | sd_event_dispatch() returns 0 on FINISH, so let's eat that up.
* sd-event: rename PASSIVE/PREPARED to INITIAL/ARMEDTom Gundersen2015-03-14
|
* sd-daemon: simplify sd_pid_notify_with_fdsZbigniew Jędrzejewski-Szmek2015-03-13
| | | | | | | | Coverity was complaining that CMSG_NXTHDR is used without checking the return value. In this case it cannot fail, but it is a good excuse to simplify the function a bit. CID #1261726.
* bus: explicitly ignore failure during error handlingZbigniew Jędrzejewski-Szmek2015-03-13
| | | | CID #1237548.
* Use space after a silencing (void)Zbigniew Jędrzejewski-Szmek2015-03-13
| | | | | We were using a space more often than not, and this way is codified in CODING_STYLE.
* sd-resolve: use different element of union to make code more readableZbigniew Jędrzejewski-Szmek2015-03-13
| | | | | | They both point to the same location, but the reader is not forced to look back to the beginning of the function to see that.
* sd-rtnl: read_message - don't set group if not neededTom Gundersen2015-03-13
|
* sd-rtnl: process - only apply matches to broadcast messagesTom Gundersen2015-03-13
|
* sd-rtnl: improve detection of broadcast messagesTom Gundersen2015-03-13
| | | | | | Do not rely on nl_pid == 0, but check the groups instead. We currently avoid using nl_pid == 0 for unicast anyway, so this should be redundant, but let's try to be correct.
* sd-rtnl: never set serial to 0Tom Gundersen2015-03-13
| | | | | | | In the unlikely event that we wrap the counter, skip 0 as this is used for broadcasts. Suggested by Richard Maw.
* tree-wide: there is no ENOTSUP on linuxDavid Herrmann2015-03-13
| | | | Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
* bus: stop using EDEADLOCKDavid Herrmann2015-03-13
| | | | | | | The error code is called EDEADLK, stop using legacy names like EDEADLOCK. Note that _some_ weird architectures define them differently (namely, mips and sparc), but on all sane architectures they're exactly the same. So stay with the widely used code, which is EDEADLK.
* sd-event: fix typoZbigniew Jędrzejewski-Szmek2015-03-13
|
* networkd: Begin with serial number 1 for netlink requestsRichard Maw2015-03-12
| | | | | | | | | | | | | | | | | | | | | "Notifications are of informal nature and no reply is expected, therefore the sequence number is typically set to 0."[1] If networkd is started soon after recent netlink activity, then there will be messages with sequence number 0 in the buffer. The first thing networkd does is to request a dump of all the links. If it uses sequence number 0 for this, then it may confuse the dump request's response with that of a notification. This will result in it failing to properly enumerate all the links, but more importantly, when it comes to enumerate all the addresses, it will still have the link dump in progress, so the address enumeration will fail with -EBUSY. [1]: http://www.infradead.org/~tgr/libnl/doc/core.html#core_msg_types [tomegun: sequence -> serial]
* bus: remarshal kdbus messages received from the kernelDavid Herrmann2015-03-11
| | | | | | If we receive an sd_bus_message from the kernel, m->kdbus will contain additional items that cannot be used when sending a message. Therefore, always remarshal the message if it is used again.
* bus: drop redundant assignmentDavid Herrmann2015-03-11
| | | | | This assignment is already done in the parent context, no need to do it again.
* add REMOTE_ADDR and REMOTE_PORT for Accept=yesShawn Landden2015-03-10
|
* Introduce loop_read_exact helperZbigniew Jędrzejewski-Szmek2015-03-09
| | | | | | | | Usually when using loop_read(), we want to read the full buffer. Add a helper that mirrors loop_write(), and returns 0 when full buffer was read, and an error otherwise. Use -ENODATA for the short read, to distinguish it from a read error.
* bus: fix leak in error pathZbigniew Jędrzejewski-Szmek2015-03-07
| | | | CID #1271349.
* bus-util: remove stray errno assignmentZbigniew Jędrzejewski-Szmek2015-03-07
|
* Remove the cap on epoll eventsHannes Reinecke2015-03-04
| | | | | | | Currently the code will silently blank out events if there are more then 512 epoll events, causing them never to be handled at all. This patch removes the cap on the number of events for epoll_wait, thereby avoiding this issue.
* sd-daemon: replace VLA with alloca(), to make llvm happyLennart Poettering2015-03-02
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=89379
* sd-bus: sync kdbus.h (ABI break)Daniel Mack2015-03-02
| | | | | | | | | | | | | After some reconsideration, we decided to move the binary protocol back to 64-bit wide UIDs and GIDs. After all, it should be possible to redefine [gu]id_t to uint64_t and things should continue to work. As we want to avoid such data types in kdbus.h, let's move back to 64-bit values and be safe. In sd-bus, we have to do a translation between uint64_t and gid_t now for supplementary gids. Some inline comments have also been updated in kdbus upstream.
* networkd: add support for Uplink Failure DetectionAlin Rauta2015-02-27
| | | | | | | Introduce BindCarrier= to indicate the set of links that determine if the current link should be brought UP or DOWN. [tomegun: add a bit to commit message]
* sd-rtnl: types - fix check for unsupported typeTom Gundersen2015-02-26
| | | | Spotted by Thomas H.P. Andersen <phomes@gmail.com>
* sd-rtnl: types - don't assert_return in private APITom Gundersen2015-02-26
|
* sd-bus: test-bus-kernel-benchmark: don't rely on fixed unique namesDaniel Mack2015-02-24
| | | | | | | The kernel part of kdbus does not allow userspace to make any assumption on which unique address the first user on the bus will get. Instead, use sd_bus_get_unique_name() to get the server's address.
* sd-bus: sync kdbus.hDaniel Mack2015-02-24
| | | | | | | | | | Follow two small changes in the kdbus API: * Flags are now returned in cmd->return_flags by KDBUS_CMD_NAME_ACQUIRE * struct kdbus_item_list has been dropped. The information stored in this struct was redundant since awhile already, as all commands report their returned slice size anyway.
* libsystemd: revert one hunk of duplicate ifdef removalZbigniew Jędrzejewski-Szmek2015-02-23
| | | | | | | | | | | This change exposed a bug in kernel headers: /usr/include/linux/if_bridge.h:184:20: error: field 'ip6' has incomplete type struct in6_addr ip6; ^ /usr/include/linux/if_tunnel.h:76:19: error: field 'prefix' has incomplete type struct in6_addr prefix; ^
* sd-bus, shared: fix includesDaniel Mack2015-02-24
| | | | | | | | | | | | | | | | Include <sys/socket.h> from util.h and bus-message.h in order to build errors like the ones below on kdbus enabled systems. ./src/shared/util.h:976:32: warning: its scope is only this definition or declaration, which is probably not what you want In file included from src/libsystemd/sd-bus/bus-kernel.c:37:0: ./src/shared/util.h:1081:28: warning: 'struct msghdr' declared inside parameter list void cmsg_close_all(struct msghdr *mh); ^ CC src/libsystemd/sd-bus/libsystemd_la-bus-creds.lo In file included from src/libsystemd/sd-bus/bus-creds.c:25:0: ./src/shared/util.h:976:32: warning: 'struct ucred' declared inside parameter list int getpeercred(int fd, struct ucred *ucred); ^
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* bus: sync with kdbus.git (ABI break)David Herrmann2015-02-19
| | | | | | This syncs up the new KDBUS_CMD_CONN_INFO behavior: - attach-flags are passed in .attach_flags, instead of directly merged with the command flags.
* logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering2015-02-18
| | | | | | Also, allow clients to alter their own objects without any further priviliges. i.e. this allows clients to kill and lock their own sessions without involving PK.
* sd-bus: allow setting a per-connection default value for the ↵Lennart Poettering2015-02-18
| | | | | | | | | "allow-interactive-authentication" message flag Most of our client tools want to set this bit for all their method calls, even though it defaults to off in sd-bus, and rightfully so. Hence, to simplify thing, introduce a per sd_bus-object flag that sets the default value for all messages created on the connection.
* bus: sync with kdbusDavid Herrmann2015-02-17
| | | | | | Pull in new kdbus changes, namely: - EOVERFLOW is replaces by KDBUS_RECV_RETURN_DROPPED_MSGS - ENOMSG is merged with EAGAIN for consistency
* bus: don't rely on static IDs in testsDavid Herrmann2015-02-17
| | | | | We should never put any constraints on the IDs returned by the kernel. Use sd_bus_get_unique_name() to retrieve the ID of a peer.
* sd-bus: make sure we always serialize the reply cookie as 64bit on dbus2, ↵Lennart Poettering2015-02-16
| | | | and 32bit on dbus1
* Revert "Revert "sd-bus: change serialization of kdbus messages to qualify in ↵Lennart Poettering2015-02-16
| | | | | | their entirety as gvariant objects"" This reverts commit 954871d8ba15911d014f76ed2c7a9492953cf39d.
* sd-bus: initialize a few structs at time or declarationLennart Poettering2015-02-13
|
* exit-on-idle: only exit if actually idleTom Gundersen2015-02-13
| | | | | | | sd_event_wait() returning 0 usually means that it timed out, which means it must have been idle. However, sd_event_wait() may return 0 in case an event was triggered but it turned out there was nothing to do. Make the check for idle explicit to avoid this edge-case.
* sd-bus: export sd_bus_error_set_errnofv()Lennart Poettering2015-02-13
|