1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 09:56:51 +03:00
Commit Graph

12908 Commits

Author SHA1 Message Date
Lennart Poettering
f00c31213a bus: also add error parameter to object find and enumerator callbacks
Just in order to bring things inline with the method and property
callbacks.
2013-11-22 01:42:15 +01:00
Lennart Poettering
969987ea93 bus: restore selinux access control to PID 1 for properties 2013-11-21 23:36:51 +01:00
Lennart Poettering
9f5eb56a13 timer: make timer accuracy configurable
And make it default to 1min
2013-11-21 22:08:20 +01:00
Kay Sievers
b850b06e1e build-sys: enable gcc Link Time Optimization when optimization is enabled 2013-11-21 21:56:18 +01:00
Lennart Poettering
92b315dfb4 core: actually make SwitchRoot() bus call do the deed 2013-11-21 21:36:04 +01:00
Lennart Poettering
1302759d15 core: fix serilization of ListJobs() response 2013-11-21 21:32:23 +01:00
Lennart Poettering
ceb19081fe core: fix serialization of client tracker 2013-11-21 21:18:02 +01:00
Lennart Poettering
6ce270b10a core: fix deserialization of StartTransientUnit() parameters 2013-11-21 21:12:36 +01:00
Lennart Poettering
21586b77de bus: properly serialize unit file change list 2013-11-21 21:12:36 +01:00
Lennart Poettering
86b8d28971 logind,machined,run: properly invoke StartTransientUnit() bus call 2013-11-21 21:12:36 +01:00
Lennart Poettering
ebcf1f97de bus: rework message handlers to always take an error argument
Message handler callbacks can be simplified drastically if the
dispatcher automatically replies to method calls if errors are returned.

Thus: add an sd_bus_error argument to all message handlers. When we
dispatch a message handler and it returns negative or a set sd_bus_error
we send this as message error back to the client. This means errors
returned by handlers by default are given back to clients instead of
rippling all the way up to the event loop, which is desirable to make
things robust.

As a side-effect we can now easily turn the SELinux checks into normal
function calls, since the method call dispatcher will generate the right
error replies automatically now.

Also, make sure we always pass the error structure to all property and
method handlers as last argument to follow the usual style of passing
variables for return values as last argument.
2013-11-21 21:12:36 +01:00
Lennart Poettering
0ccad099d4 hostnamed: modernizations 2013-11-21 21:12:36 +01:00
Lennart Poettering
9d5a3757c3 manager: always sort environment block, it's prettier 2013-11-21 21:12:36 +01:00
Lennart Poettering
51b4ea6f48 bus: the :no-sender hack is now unnecessary, since the new library doesn't require this anymore 2013-11-21 21:12:36 +01:00
Tom Gundersen
5a3eb5a77d networkd: make sure Network and Link can always be freed
Also, don't fail a link just because we can't find its MAC address.
2013-11-21 21:04:04 +01:00
Tom Gundersen
602cc437e8 networkd: avoid segfault 2013-11-21 20:48:06 +01:00
Daniel Mack
94d56326a1 src/core/selinux-access: #include <sys/socket.h>
Fixes the following build errors on Fedora 20:

  CC       src/core/libsystemd_core_la-selinux-access.lo
src/core/selinux-access.c: In function 'get_audit_data':
src/core/selinux-access.c:245:22: error: storage size of 'ucred' isn't known
         struct ucred ucred;
                      ^
src/core/selinux-access.c:259:9: warning: implicit declaration of function 'getsockopt' [-Wimplicit-function-declaration]
         r = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len);
         ^
src/core/selinux-access.c:259:28: error: 'SOL_SOCKET' undeclared (first use in this function)
         r = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len);
                            ^
src/core/selinux-access.c:259:28: note: each undeclared identifier is reported only once for each function it appears in
src/core/selinux-access.c:259:40: error: 'SO_PEERCRED' undeclared (first use in this function)
         r = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len);
                                        ^
src/core/selinux-access.c:245:22: warning: unused variable 'ucred' [-Wunused-variable]
         struct ucred ucred;
                      ^
make[2]: *** [src/core/libsystemd_core_la-selinux-access.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
2013-11-21 20:33:23 +01:00
Kay Sievers
29db78811d bus: update kdbus.h 2013-11-21 20:16:56 +01:00
Václav Pavlín
fa7abba232 man: suggest using hash= atribut for swap in example
(#883941)
2013-11-21 15:34:01 +01:00
Tom Gundersen
002f5de9a9 networkd: don't filter on udev tags
This removed the requirement for devices to be tagged with
'systemd-networkd' before they will be visible to networkd.

Still, as by default we don't ship any .network files, network
devices will simply be tracked, but not touched, unless the
admin configures things explicitly.
2013-11-21 15:33:02 +01:00
Tom Gundersen
0b9e3f2cfd efi-boot-generator: don't mount /boot eagerly 2013-11-21 12:36:05 +01:00
Lennart Poettering
fa0fed4975 bus: fix seriliazation of activation errors 2013-11-21 02:14:05 +01:00
Lennart Poettering
14c24659cd bus: rename SD_BUS_ERROR_MAKE to SD_BUS_ERROR_MAKE_CONST to indicate it only works for const strings 2013-11-21 02:11:06 +01:00
Lennart Poettering
df2d202e6e bus: let's simplify things by getting rid of unnecessary bus parameters 2013-11-21 02:07:35 +01:00
Lennart Poettering
28383ba189 bus: add API calls to escape string components of objects paths 2013-11-21 01:03:26 +01:00
Lennart Poettering
850516e012 sd-event: try to move timer wakeups to the same spot within each minute 2013-11-21 00:46:13 +01:00
Lennart Poettering
2e41a51ea4 socket: fix segfault 2013-11-21 00:06:11 +01:00
Lennart Poettering
54b434b1b5 valgrind: make running PID 1 in valgrind useful
Since valgrind only generates useful output on exit() (rather than
exec()) we need to explicitly exit when valgrind is detected.
2013-11-20 22:12:47 +01:00
Lennart Poettering
420c7379fb nspawn: add new --drop-capability= switch 2013-11-20 22:10:42 +01:00
Lennart Poettering
1b5995b039 event: make sure to possibly disarm the timerfds before we reenter epoll_wait 2013-11-20 20:58:17 +01:00
Lennart Poettering
c57b5ca301 event: don't disarm invalid timerfd 2013-11-20 20:58:17 +01:00
Lennart Poettering
86befb4098 bus: make sure an additional ref to a busevent source doesn't cause the event source to be triggered again 2013-11-20 20:58:17 +01:00
Lennart Poettering
2576a19ed2 event: whenever a time source changes pending state reshuffle elapsation prioqs 2013-11-20 20:58:17 +01:00
Lennart Poettering
503f39c35e event: when we change the io events to watch we need to figure out if a an event is pending again 2013-11-20 20:58:17 +01:00
Lennart Poettering
a99badf5ed sd-event: fix comparison functions 2013-11-20 20:58:17 +01:00
Lennart Poettering
3772995afa manager: don't do plymouth in a container
Given that plymouth listens on an abstract namespace socket and if
CLONE_NEWNET is not used the abstract namespace is shared with the host
we might actually end up send plymouth data to the host.
2013-11-20 20:58:17 +01:00
Lennart Poettering
b51f299ae1 busctl: when no match is specified, add default match 2013-11-20 20:58:16 +01:00
Lennart Poettering
f8cfb5f5f3 bus: add color and indentation to bus_message_dump() 2013-11-20 20:58:16 +01:00
Lennart Poettering
718db96199 core: convert PID 1 to libsystemd-bus
This patch converts PID 1 to libsystemd-bus and thus drops the
dependency on libdbus. The only remaining code using libdbus is a test
case that validates our bus marshalling against libdbus' marshalling,
and this dependency can be turned off.

This patch also adds a couple of things to libsystem-bus, that are
necessary to make the port work:

- Synthesizing of "Disconnected" messages when bus connections are
  severed.

- Support for attaching multiple vtables for the same interface on the
  same path.

This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus
calls which used an inappropriate signature.

As a side effect we will now generate PropertiesChanged messages which
carry property contents, rather than just invalidation information.
2013-11-20 20:52:36 +01:00
Lennart Poettering
3febea3a0b hashmap: be a bit more conservative with pre-allocating hash tables and items 2013-11-20 19:37:02 +01:00
Lennart Poettering
e8372f7e3e install: when determining where default.target points to, accept a file instead of a symlink, too 2013-11-20 19:37:02 +01:00
Lennart Poettering
a454d241ef test: exit early if we would conflict with running user systemd 2013-11-20 19:37:02 +01:00
Lennart Poettering
911121a7c8 bus: add sd_bus_send_to() API call 2013-11-20 19:37:02 +01:00
Lennart Poettering
aea93debfa bus: bump serial number counter when sending already sealed messages 2013-11-20 19:36:14 +01:00
Lennart Poettering
80c1974018 bus: sd_bus_error_setxyz calls should always return the error as errno style negative int 2013-11-20 19:36:14 +01:00
Lennart Poettering
725d7e6ceb libudev: always return NULL in _unref() APIs
Returning anything else but NULL would suggest the caller's reference
might still be valid, but it isn't, because the caller just invoked
_unref() after all.

This turns the return value into a typesafe shortcut that allows
unreffing and resetting a reference in one line. In contrast to
solutions for this which take a pointer to a pointer to accomplish the
same this solution is just syntactic sugar the developer can make use of
but doesn't have to, and this is particularly useful when immediately
unreffing objects returned by function calls.
2013-11-20 19:36:14 +01:00
Lennart Poettering
994e023433 libudev: always return valid negative error codes on API functions 2013-11-20 19:36:14 +01:00
Lennart Poettering
135168183e calendar: support 'yearly' and 'annually' names the same way as cron 2013-11-20 19:36:14 +01:00
Lennart Poettering
8e64fd110d hwclock: modernizations 2013-11-20 19:36:14 +01:00
Lennart Poettering
d3cfcae9db macro: add _unlikely_() to assert_return()
As the name indicates assert_return() is really just for assertions,
i.e. where it's a programming error if the assertion does not hold.
Hence it is safe to add _unlikely_() decorators for the expression to
check.
2013-11-20 19:36:14 +01:00