summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2013-12-17core: always create /dev/kdbus/ns (and make it private 0700) after setting ↵Lennart Poettering
up the kdbus system bus
2013-12-16bus: when a busname unit refuses to activate a service it should flush the queueLennart Poettering
2013-12-16systemctl: properly initialize and free sd_bus_error in "systemctl cat"Lennart Poettering
We need to properly initialize all error structs before use and free them after use. Also, there's no point in flushing stdout if we output a \n anyway...
2013-12-16execute: also set SO_SNDBUF when spawning a service with stdout/stderr ↵Lennart Poettering
connected to journald
2013-12-16loopback-setup: remove stray hunkTom Gundersen
2013-12-16network: use SETLINK to bring up interfacesTom Gundersen
2013-12-16rtnl: replace message_append by typesafe versionsTom Gundersen
2013-12-16rtnl: simplify link_new()Tom Gundersen
Drop most of the arguments and instead introduce link_set_{flags,type}.
2013-12-16core: refuse doing %h, %s, %U specifier resolving in PID 1Lennart Poettering
These specifiers require NSS lookups to work, and we really shouldn't do them from PID 1 hence. With this change they are now only supported for user systemd instance, or when the configured user for a unit is root.
2013-12-14Add more _printf_'s for format-nonliteralsThomas Hindoe Paaboel Andersen
Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there.
2013-12-14bus: when connecting to a container's kdbus instance, enter namespace firstLennart Poettering
Previously we'd open the connection in the originating namespace, which meant most peers of the bus would not be able to make sense of the PID/UID/... identity of us since we didn't exist in the namespace they run in. However they require this identity for privilege decisions, hence disallowing access to anything from the host. Instead, when connecting to a container, create a temporary subprocess, make it join the container's namespace and then connect from there to the kdbus instance. This is similar to how we do it for socket conections already. THis also unifies the namespacing code used by machinectl and the bus APIs.
2013-12-13event: be more conservative when returning errors from event handler callbacksLennart Poettering
We really should return errors from event handlers if we have a continous problem and don't know any other solution.
2013-12-13namespace: include boot id in private tmp directoriesLennart Poettering
This way it is easy to only exclude directories from the current boot from automatic clean up in /var/tmp. Also, pick a longer name for the directories so that are globs in tmp.conf can be simpler yet equally accurate.
2013-12-12service: process watchdog timeouts with lowest priorityLennart Poettering
2013-12-12core: suppress gcc warnings on selinux-less systemsLennart Poettering
2013-12-12bus: instead of exposing the dbus1 flags when acquiring a name use our own ↵Lennart Poettering
that are closer to kdbus This turns around DO_NOT_QUEUE into QUEUE which implies a more useful default. (And negative options are awful anyway.)
2013-12-12core: fix bus registration on daemon reexecLennart Poettering
2013-12-12service: actually leave watchdog enabled in the states where it mattersLennart Poettering
2013-12-11service: clean up watchdog logic a bitLennart Poettering
2013-12-10core: fix Unit.SetProperties argument parsingDavid Herrmann
SetProperties has signature "ba(sv)", but the bus_unit_set_properties() helper already does a enter_container('a', "sv") so we have to skip it in bus_unit_method_set_properties().
2013-12-10core: epoll and signalfd has been moved into sd event loopShawn Landden
2013-12-10Revert "systemd: add a start job for all units in SYSTEMD_[USER_]WANTS="Lennart Poettering
This reverts commit e775289d56ace2f8d23e62ed79316d71332d6d05. We really should let the dependency logic add jobs for dependencies here rather than manually adding in jobs, overtaping the real problem.
2013-12-10core/manager: remove infinite loopShawn Landden
2013-12-10bus: introduce "trusted" bus concept and encode access control in object vtablesLennart Poettering
Introduces a new concept of "trusted" vs. "untrusted" busses. For the latter libsystemd-bus will automatically do per-method access control, for the former all access is automatically granted. Per-method access control is encoded in the vtables: by default all methods are only accessible to privileged clients. If the SD_BUS_VTABLE_UNPRIVILEGED flag is set for a method it is accessible to unprivileged clients too. By default whether a client is privileged is determined via checking for its CAP_SYS_ADMIN capability, but this can be altered via the SD_BUS_VTABLE_CAPABILITY() macro that can be ORed into the flags field of the method. Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED and SD_BUS_VTABLE_CAPABILITY() for controlling write access to them. Note however that read access is unrestricted, as PropertiesChanged messages might send out the values anyway as an unrestricted broadcast. By default the system bus is set to "untrusted" and the user bus is "trusted" since per-method access control on the latter is unnecessary. On dbus1 busses we check the UID of the caller rather than the configured capability since the capability cannot be determined without race. On kdbus the capability is checked if possible from the attached meta-data of a message and otherwise queried from the sending peer. This also decorates the vtables of the various daemons we ship with these flags.
2013-12-06Get rid of our reimplementation of basenameZbigniew Jędrzejewski-Szmek
The only problem is that libgen.h #defines basename to point to it's own broken implementation instead of the GNU one. This can be fixed by #undefining basename.
2013-12-05systemd: add a start job for all units in SYSTEMD_[USER_]WANTS=Zbigniew Jędrzejewski-Szmek
2013-12-05execute.h: remove redefinition of UnitThomas Hindoe Paaboel Andersen
Unit is typedef'ed in both unit.h and execute.h. The typedef existed first in unit.h and was later added to execute.h in c17ec25e4d9bd6c8e8617416f813e25b2ebbafc5 It is no longer needed so let's just keep the one in unit.h to avoid redefining it.
2013-12-05busname: improve condition checkLennart Poettering
2013-12-03bus: don't make use of the private bus socket if kdbus is availableLennart Poettering
2013-12-03core: use normal library call to query list of current namesLennart Poettering
2013-12-03bus: make sd_bus_request_name() and sd_bus_release_name() behave more like ↵Lennart Poettering
other calls Instead of returning an enum of return codes, make them return error codes like kdbus does internally. Also, document this behaviour so that clients can stick to it. (Also rework bus-control.c to always have to functions for dbus1 vs. kernel implementation of the various calls.)
2013-12-02systemd: treat reload failure as failureZbigniew Jędrzejewski-Szmek
systemctl reload "suceeded" on stopped units, but it is documented to fail in this case. https://bugzilla.redhat.com/show_bug.cgi?id=1036845
2013-12-02bus: add .busname unit type to implement kdbus-style bus activationLennart Poettering
2013-12-02core: extra paranoia when deserializing kdbus fdLennart Poettering
2013-12-01service: remove unneccesary Socket.got_socket_fdShawn Landden
2013-11-30bus: do kdbus only if this is enabled on the configure switchLennart Poettering
Since we want to retain the ability to break kernel ←→ userspace ABI after the next release, let's not make use by default of kdbus, so that people with future kernels will not suddenly break with current systemd versions. kdbus support is left in all builds but must now be explicitly requested at runtime (for example via setting $DBUS_SESSION_BUS). Via a configure switch the old behaviour can be restored. In fact, we change autogen.sh to do this, so that git builds (which run autogen.sh) get kdbus by default, but tarball builds (which ue the configure defaults) do not get it, and hence this stays out of the distros by default.
2013-11-30nspawn: set up a kdbus namespace when starting a containerLennart Poettering
2013-11-30bus: include unique and well known names in credentials objectLennart Poettering
2013-11-30core: allocate a kdbus bus for each systemd instance, if we canLennart Poettering
2013-11-28bus: merge sd_bus_get_owner() and sd_bus_get_owner_creds() into one callLennart Poettering
Since the backing ioctl for this on kdbus is the same we retain atomicity this way.
2013-11-28Remove some unused variablesZbigniew Jędrzejewski-Szmek
2013-11-28core: fix SetUnitPropertiesMarc-Antoine Perennou
2013-11-28bus: add new sd_bus_creds object to encapsulate process credentialsLennart Poettering
This way we can unify handling of credentials that are attached to messages, or can be queried for bus name owners or connection peers. This also adds the ability to extend incomplete credential information with data from /proc, Also, provide a convenience call that will automatically determine the most appropriate credential object for an incoming message, by using the the attached information if possible, the sending name information if available and otherwise the peer's credentials.
2013-11-28automount: log info about triggering processKay Sievers
2013-11-28core: initialize variableKay Sievers
2013-11-27namespace: comment typo fixLennart Poettering
2013-11-27service: add the ability for units to join other unit's PrivateNetwork= and ↵Lennart Poettering
PrivateTmp= namespaces
2013-11-26tree-wide usage of %m specifier instead of strerror(errno)Daniel Buch
Also for log_error() except where a specific error is specified e.g. errno ? strerror(errno) : "Some user specified message"
2013-11-26core: add new "flush" job mode to cancel all other jobs when queuing a new jobLennart Poettering
2013-11-26core: replace OnFailureIsolate= setting by a more generic OnFailureJobMode= ↵Lennart Poettering
setting and make use of it where applicable