summaryrefslogtreecommitdiff
path: root/src/libsystemd
AgeCommit message (Collapse)Author
2015-06-10bus: fix bloom_add_prefixes() to add all required dataDavid Herrmann
Lets look at an example where we add arg0="/foo/bar/waldo" to a bloom-filter. The following strings are added: "arg0:/foo/bar/waldo" "arg0-slash-prefix:/foo/bar" "arg0-slash-prefix:/foo" Two problems arise: 1) If we match on "arg0path=/foo/bar/waldo", the dbus-spec explicitly states that equal strings are also considered prefixes. However, in the bloom-match, we can only provide a single match-filter. Therefore, we have to add "arg0-slash-prefix:/foo/bar/waldo" there, but this never occured in the bloom-mask of the message. Hence, this patch makes sure bloom_add_prefixes() adds the full path as prefix, too. 2) If we match on "arg0path=/foo/", the dbus-spec states that arg0path does prefix-matching with the trailing slash _included_, unlike path_namespace= matches, which does *not* include them. This is inconsistent, but we have to support the specs. Therefore, we must add prefixes with _and_ without trailing separators. Hence, this patch makes sure bloom_add_prefixes() adds all prefixes with the trailing slash included. The final set of strings added therefore is: "arg0:/foo/bar/waldo" "arg0-slash-prefix:/foo/bar/waldo" "arg0-slash-prefix:/foo/bar/" "arg0-slash-prefix:/foo/bar" "arg0-slash-prefix:/foo/" "arg0-slash-prefix:/foo" "arg0-slash-prefix:/"
2015-06-10util: introduce CMSG_FOREACH() macro and make use of it everywhereLennart Poettering
It's only marginally shorter then the usual for() loop, but certainly more readable.
2015-06-10Merge pull request #142 from teg/sd-network-unref-NULLLennart Poettering
sd-network: allow NULL in sd_network_monitor_unref
2015-06-10sd-network: allow NULL in sd_network_monitor_unrefTom Gundersen
Match rest of codebase, we always allow unref'ing NULL.
2015-06-10Merge pull request #85 from keszybz/selinux-contextZbigniew Jędrzejewski-Szmek
2015-06-10sd-bus: remove ucred parameter from bus_message_from_header() since we don't ↵Lennart Poettering
use it anymore
2015-06-10sd-bus: fix early exit when we lack all data in bus_get_owner_creds_dbus1()Lennart Poettering
2015-06-10bus-message: remove shadow warning with log_debug_bus_message()Lennart Poettering
2015-06-10sd-bus: store selinux context at connection timeZbigniew Jędrzejewski-Szmek
This appears to be the right time to do it for SOCK_STREAM unix sockets. Also: condition bus_get_owner_creds_dbus1 was reversed. Split it out to a separate variable for clarity and fix. https://bugzilla.redhat.com/show_bug.cgi?id=1224211
2015-06-10sd-bus: do not use per-datagram auxiliary informationZbigniew Jędrzejewski-Szmek
SELinux information cannot be retrieved this way, since we are using stream unix sockets and SCM_SECURITY does not work for them. SCM_CREDENTIALS use dropped to be consistent. We also should get this information at connection time. https://bugzilla.redhat.com/show_bug.cgi?id=1224211 "SCM_SECURITY was only added for datagram sockets."
2015-06-10sd-bus: Correct typoTorstein Husebø
2015-06-10Merge pull request #117 from ↵Lennart Poettering
utezduyar/feat/dump-sync-dbus-message-with-logging-on sd-bus: dump sync messages in debug mode
2015-06-10sd-bus: dump sync messages in debug modeUmut Tezduyar Lindskog
2015-06-10logind,sd-event: drop spurious new-linesLennart Poettering
2015-06-10tree-wide: whenever we fork off a foreign child process reset signal ↵Lennart Poettering
mask/handlers Also, when the child is potentially long-running make sure to set a death signal. Also, ignore the result of the reset operations explicitly by casting them to (void).
2015-06-09bus-creds: always set SD_BUS_CREDS_PID when we set pid in the maskZbigniew Jędrzejewski-Szmek
Also reorder the code a bit to be easier to parse.
2015-06-09sd-bus: add async convenience method call APIUmut Tezduyar Lindskog
2015-06-05bus: don't force send-masks on kdbus busesDavid Herrmann
Right now we always pass KDBUS_ITEM_ATTACH_FLAGS_RECV to KDBUS_CMD_BUS_MAKE, effectively forcing every bus connection to do the same during KDBUS_CMD_HELLO. This used to be a workaround to make sure all metadata is always present. However, we refrained from that approach and intend to make all metadata collection solely rely on /proc access restrictions. Therefore, there is no need to force the send-flags mask on newly created buses.
2015-06-04bus: update kdbus.hDavid Herrmann
Sync with upstream.
2015-06-04sd-event: don't touch fd's accross forksTom Gundersen
We protect most of the API from use accross forks, but we still allow both sd_event and sd_event_source objects to be unref'ed. This would cause problems as it would unregister sources from the underlying eventfd, hence also affecting the original instance in the parent process. This fixes the issue by not touching the fds on unref when done accross a fork, but still free the memory. This fixes a regression introduced by "udevd: move main-loop to sd-event": 693d371d30fee where the worker processes were disabling the inotify event source in the main daemon.
2015-06-03Merge pull request #65 from teg/enumerate-accept-nullKay Sievers
libudev: enumerate - accept NULL parameters in add_match()
2015-06-03kdbus: remove attach_flags_mask module parameter settingKay Sievers
2015-06-03libudev: enumerate - accept NULL parameters in add_match()Tom Gundersen
This was a regression introduced when moving to sd-device.
2015-06-02fix double semicolon typoThomas Hindoe Paaboel Andersen
2015-06-02sd-device: get_driver - remember if a device does not have a driverTom Gundersen
Don't try to read it again.
2015-06-02sd-device: get_subsystem - don't complain if a device does not have a subsystemTom Gundersen
2015-06-01sd-device: ensure update_properties_buf() is a noop on failureTom Gundersen
Don't clobber the sd_device struct, and don't leak memory when memory allocation fails.
2015-06-01sd-device: fix invalid property strv pointersMartin Pitt
In device_update_properties_bufs(), the strv is built from pointers into the single nul-terminated buf_nulstr string, to avoid allocating the key=value strings twice. However, we must not do that while building and GREEDY_REALLOC0()'ing buf_nulstr, as each time when this actually reallocates memory the pointers we wrote into buf_strv so far become invalid. So change the logic to first completely build the new buf_nulstr, and then iterate over it to pick out the pointers to the individual key=value strings for properties_strv. This fixes invalid environment for udev callouts.
2015-05-29util: split out signal-util.[ch] from util.[ch]Lennart Poettering
No functional changes.
2015-05-28sd-device: enumerator - fix matching on properties and sysattrsTom Gundersen
This was a regression that broke $ udevadm trigger -nv --property-match=DEVNAME=/dev/sda1 --attr-match=size=409600 Reported by David Reisner.
2015-05-27sd-device: fix device_get_properties_strv()Tom Gundersen
A NULL pointer was inserted as the first element of the strv. This had the effect of always passing the empty environment to processes spawned by udev. Reported by Michał Bartoszkiewicz.
2015-05-26treewide: fix typosTorstein Husebø
2015-05-22sd-bus,sd-event: make public APIsLennart Poettering
With the v221 release these APIs should be public, stable APIs, hence let's install their headers by default now, and add their symbols to the .sym file.
2015-05-20sd-device: fix return codes on errorZbigniew Jędrzejewski-Szmek
asprintf() does not set errno.
2015-05-19bus-socket: simplify initalization of struct msghdrZbigniew Jędrzejewski-Szmek
2015-05-15systemctl: introduce --now for enable, disable and maskJan Synacek
https://bugs.freedesktop.org/show_bug.cgi?id=42940
2015-05-14test-bus-chat: various modernizationsLennart Poettering
2015-05-14sd-bus: fix memory leak in test-bus-chatCristian Rodríguez
Building with address sanitizer enabled on GCC 5.1.x a memory leak is reported because we never close the bus, fix it by using cleanup variable attribute.
2015-05-14util: introduce memmem_safe() and make use of itLennart Poettering
GNU memmem() requires a nonnull first parameter. Let's introduce memmem_safe() that removes this restriction for zero-length parameters, and make use of it where appropriate. http://lists.freedesktop.org/archives/systemd-devel/2015-May/031705.html
2015-05-11treewide: Correct typos and spell plural of bus consistentTorstein Husebø
2015-05-06bus: don't switch to kdbus if not requestedDavid Herrmann
Whenever systemd is re-executed, it tries to create a system bus via kdbus. If the system did not have kdbus loaded during bootup, but the module is loaded later on manually, this will cause two system buses running (kdbus and dbus-daemon in parallel). This patch makes sure we never try to create kdbus buses if it wasn't explicitly requested on the command-line.
2015-04-30sym: adding missing symbols to .sym fileLennart Poettering
2015-04-30sd-bus,sd-login: add api for querying the slice within the the user systemd ↵Lennart Poettering
instance of a process units are organized in slice trees, not only for the system instance, but also for user systemd instances, expose this properly.
2015-04-30sd-bus: when we get ENOTTY on the HELLO ioctl assume incompatible API versionLennart Poettering
As perparation for future incompatible kdbus kernel API changes.
2015-04-29networkd: introduce vti6 tunnelSusant Sahani
This patch add support to create vti6 tunnel test: vt6.network [Match] Name=wlan0 [Network] Tunnel=ip6vti vti6.netdev [NetDev] Name=ip6vti Kind=vti6 [Tunnel] Local=2a00:ffde:4567:edde::4987 Remote=2001:473:fece:cafe::5179 ip link 11: ip6_vti0@NONE: <NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 :: brd :: 12: ip6vti@wlan0: <POINTOPOINT,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 2a00:ffde:4567:edde::4987 peer 2001:473:fece:cafe::5179
2015-04-29sd-bus: properly handle creds that are known but undefined for a processLennart Poettering
A number of fields do not apply to all processes, including: there a processes without a controlling tty, without parent process, without service, user services or session. To distuingish these cases from the case where we simply don't have the data, always return ENXIO for them, while returning ENODATA for the case where we really lack the information. Also update the credentials dumping code to show this properly. Fields that are known but do not apply are now shown as "n/a". Note that this also changes some of the calls in process-util.c and cgroup-util.c to return ENXIO for these cases.
2015-04-29sd-bus: allow passing NULL as bus parameter to sd_bus_send()Lennart Poettering
If NULL is specified for the bus it is now automatically derived from the passed in message. This commit also changes a number of invocations of sd_bus_send() to make use of this.
2015-04-29sd-bus: drop bus parameter from message callback prototypeLennart Poettering
This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
2015-04-29test: rename test-bus-kernel-benchmark to test-bus-benchmarkTom Gundersen
This can now benchmark more than just kdbus.
2015-04-29sd-bus: benchmark - also support testing non-kdbus transportsTom Gundersen
We introduce two news types of benchmarks in chart-mode: - 'legacy' connects using the session bus - 'direct' connects using a peer-to-peer socket We should probably also introduce a mode for testing the dbus1-kdbus proxy.