b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
a90fb858ac91de4c14c9b68da6060731954515b7 |
|
27-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
machined: add early checks for unrealistically large image/pool sizes |
05e8f270a9ca97e1014184df113494b143639fb8 |
|
27-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
machined: when the pool limit is set to infinity don't resize backing loopback file
An unlimited quota makes a lot of sense, but we really should try to propagate this onto the loopback file size, since
an infinitely sized file makes no sense.
Fixes: #2314 #2253 |
cf7d1a30e44bf380027a2e73f9bf13f423a33cc1 |
|
25-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
logind,machined: bump TasksMax=
Issue #2388 suggests the current TasksMax= setting for user processes is to low. Bump it to 12K. Also, bump the
container TasksMax= from 8K to 16K, so that it remains higher than the one for user processes.
(Compare: the kernel default limit for processes system-wide is 32K).
Fixes #2388 |
b3267152783d5784c45010615045d4e8ee459da2 |
|
13-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tree-wide: check if errno is greater than zero (2)
Compare errno with zero in a way that tells gcc that
(if the condition is true) errno is positive. |
b370fec2b964c9ced48379824e896f44ad02a59a |
|
04-Dec-2015 |
Alban Crequy <alban@kinvolk.io> |
nspawn: set TasksMax in machined instead of nspawn
https://github.com/systemd/systemd/issues/2016 |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
4a0b58c4a30ecaa61202f845ed86f75b36370cd0 |
|
17-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: use right cast macros for UIDs, GIDs and PIDs |
06820eafdbc3dd89cb1f7563564c7d91426709ca |
|
15-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
machined,logind: be more careful when accepting PIDs and UIDs from clients
Always validate first before we start processing the data. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
15a5e95075a7f6007dd97b2a165c8ed16fe683df |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out printf() helpers to stdio-util.h |
b1d4f8e154bf61b5de1b27461ef8e9c8c5e838a1 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out user/group/uid/gid calls into user-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
5bcd08db289cd02aad8a89b37b2a46244a7bd473 |
|
22-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
btrfs: beef-up btrfs support with a limited understanding of quota
With this change we understand more than just leaf quota groups for
btrfs file systems. Specifically:
- When we create a subvolume we can now optionally add the new subvolume
to all qgroups its parent subvolume was member of too. Alternatively
it is also possible to insert an intermediary quota group between the
parent's qgroups and the subvolume's leaf qgroup, which is useful for
a concept of "subtree" qgroups, that contain a subvolume and all its
children.
- The remove logic for subvolumes has been updated to optionally remove
any leaf qgroups or "subtree" qgroups, following the logic above.
- The snapshot logic for subvolumes has been updated to replicate the
original qgroup setup of the source, if it follows the "subtree"
design described above. It will not cover qgroup setups that introduce
arbitrary qgroups, especially those orthogonal to the subvolume
hierarchy.
This also tries to be more graceful when setting up /var/lib/machines as
btrfs. For example, if mkfs.btrfs is missing we don't even try to set it
up as loopback device.
Fixes #1559
Fixes #1129 |
c077529ba6852192c464772ce907670850210dfe |
|
22-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: drop UID_IS_INVALID() in favour of uid_is_valid()
No need to keep both functions, settle on uid_is_valid() for everything. |
403ed0e5c914f2a0a683403d8ba7eaf96e3ffcdf |
|
05-Sep-2015 |
Michael Chapman <mike@very.puzzling.org> |
bus-util: support details in CheckAuthorization calls
Extra details for an action can be supplied when calling polkit's
CheckAuthorization method. Details are a list of key/value string pairs.
Custom policy can use these details when making authorization decisions. |
a79366e22a43ed81017e2d8c2426431d369f3cfa |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: userns is only supported for container-class machines
We do not support userns for VM machines or for the host itself. |
fbe550738d03b178bb004a1390e74115e904118a |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: introduce pseudo-machine ".host" refererring to the host system
Some of the operations machined/machinectl implement are also very
useful when applied to the host system (such as machinectl login,
machinectl shell or machinectl status), hence introduce a pseudo-machine
by the name of ".host" in machined that refers to the host system, and
may be used top execute operations on the host system with.
This copies the pseudo-image ".host" machined already implements for
image related commands.
(This commit also adds a PK privilege for opening a PTY in a container,
which was previously not accessible for non-root.) |
25300b5a1fcf54674a69d0f4ab08925be00b0227 |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
util: make machine_name_is_valid() a macro and move it to hostname-util.h
As it turns out machine_name_is_valid() does the exact same thing as
hostname_is_valid() these days, as it just invoked that and checked the
name length was < 64. However, hostname_is_valid() checks the length
against HOST_NAME_MAX anyway (which is 64 on Linux), hence any
additional check is redundant.
We hence replace machine_name_is_valid() by a macro that simply maps it
to hostname_is_valid() but sets the allow_trailing_dot parameter to
false. We also move this this call to hostname-util.h, to the same place
as the hostname_is_valid() declaration. |
077c8c366b58222629ed953abf2faa74ebadb769 |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: always look for leader PID first
When looking for the machine belonging to a PID, always look for the
leader first, only then fall back to a cgroup check. We keep direct
track of the leader PID, but only indirectly of the cgroup, hence prefer
the PID. |
49af9e1368571f4e423cde0fd45ee284451434d1 |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: add new OpenShell() bus call
This new bus call opens an interactive shell in a container. It works
like the existing OpenLogin() call, but does not involve getty, and
instead opens an arbitrary command line.
This is similar to "systemd-run -t -M" but is controlled by a specific
PolicyKit privilege. |
49f3fffd94591bdf2bd6c2233a9300daeab79566 |
|
06-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: rework state tracking logic for machines
This splits up the stopping logic for machines into two steps: first on
machine_stop() we begin with the shutdown of a machine by queuing the
stop method call for it. Then, in machine_finalize() we actually remove
the rest of its runtime context. This mimics closely how sessions are
handled in logind.
This also reworks the GC logic to strictly check the current state of
the machine unit, rather than shortcutting a few cases, like for example
assuming that UnitRemoved really means a machine is gone (which it isn't
since Reloading might trigger it, see #376).
Fixes #376. |
491ac9f2c4aeda8c40edde35112404b737e38b60 |
|
06-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
logind,machined: various smaller cleanups
Use mfree() where we can.
Drop unnecessary {}.
Drop unnecessary variable declarations.
Cast syscall invocations where explicitly don't care for the return
value to (void).
Reword a comment. |
65d73cf042ba7de11d254f5c4714f467db64b7c3 |
|
06-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined,logind: don't generate errors on signal match functions
If we get a weird signal, then we should log about it, but not return an
error, since sd-bus will not call us again then anymore, but for these
signals we match here we actually do want to be called on the next
invocation. |
c01ff965b48bb9693dcd77cbc748b5d8676766b0 |
|
09-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
nss-mymachines: map userns users of containers to real user names
Given a container "foo", that maps user id $UID to container user, using
user namespaces, this NSS module extenstion will now map the $UID to a
name "vu-foo-$TUID" for the translated UID $UID.
Similar, userns groups are mapped to "vg-foo-$TGID" for translated GIDs
of $GID.
This simple change should make userns users more discoverable. Also,
given that many tools like "adduser" check NSS before allocating a UID,
should lower the chance of UID range conflicts between tools. |
9030ca462bd13cd6536299814e4a71d5c5e85be9 |
|
29-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: allow passing NULL as bus parameter to sd_bus_send()
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. |
190700621f95160d364f8ec1d3e360246c41ce75 |
|
29-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: drop bus parameter from message callback prototype
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(). |
9b420b3cfb8b93daf50e4cdbc92b05f2209ef893 |
|
28-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: make sure to track machine unit states properly
If a unit is stopped for a moment, we need to invalidate our knowledge
of it, otherwise we might be confused by automatic restarts
This makes reboots for nspawn containers run as service work correctly.
https://bugs.freedesktop.org/show_bug.cgi?id=87428 |
6482f6269c87d2249e52e889a63adbdd50f2d691 |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add formats-util.h |
cb81cd8073392936882643af0129934bf67e96c4 |
|
10-Mar-2015 |
Lennart Poettering <lennart@poettering.net> |
shared: the btrfs quota field is called "referenced" not "referred" |
26166c88e0b47b83972f32b5057ecbffe06bf904 |
|
03-Mar-2015 |
Lennart Poettering <lennart@poettering.net> |
importd: automatically grow /var/lib/machines/ loopback filesystem during downloads
If /var/lib/machines is mounted as btrfs loopback file system in
/var/lib/machines.raw with this change we automatically grow the file
system as it fills up. After each 10M we write to it during imports, we
check the free disk space, and if the fill level grows beyond 66% we
increase the size of the file system to 3x the fill level (thus lowering
it to 33%). |
4cee5eede280b7fd48c18a1942616c4ac896a554 |
|
02-Mar-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: also set up /var/lib/machines as btrfs, if "machinectl set-limit" is called |
efe0286285a7432f738fafae840fa4eda51c2986 |
|
26-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: if /var/lib/machines is backed by a loop file, resize it on "machinectl set-limit"
When the pool size limit is altered with "machinectl set-limit", then
not only set the subvolume quota of the /var/lib/machine subvolume, but
also resize the backing loop file and the btrfs file system on it
dynamically. |
d6ce17c7f02ed3facdb45f65f546e587c2f00950 |
|
25-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
machined,machinectl: add calls for changing container/VM quotas |
160e3793adf2da2bd9ae3fe6b8881bb937e6e71b |
|
24-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
machined/machinectl: when "machinectl image-status" is used without arguments show statistics about pool |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
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. |
70244d1d25eb80b57e160ea004d0e6bf793d4caf |
|
18-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: open up most of machined's commands to unprivileged clients via PolicyKit |
0370612e0522191f929e3feb7d4937fff3d421e2 |
|
17-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: make "machinectl copy-to" and "machinectl copy-from" server side operations
This way, any bus client can make use of these calls. |
90adaa25e894a580930ef2c3e65ab8db8295515a |
|
17-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: move logic for bind mounting into containers from machinectl to machined
This extends the bus interface, adding BindMountMachine() for bind
mounting directories from the host into the container. |
c19de71113f956809995fc68817e055e9f61f607 |
|
19-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: refer to the disk space allocated for an image to "usage" rather than "size"
After all, it's closer to the "du"-reported value than to the file
sizes... |
c00a4c8f55e51be98274e86beba14117e25dab9c |
|
29-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
Revert "machined: don't force terminate registered machines"
This reverts commit 206e7a5f7b55ac61188efd895e65ab26e478cbb2.
We actually want to allow shutting down containers that use
RegisterMachine() rather than CreateMachine() to register their own
unit. It should be safe to do so, since the primary usecase for
RegisterMachine() are container managers that run only a single
container within their own unit, such as systemd-nspawn. |
e5f5b5b9c92d59ef3cb5169982cb6f436c9206fa |
|
29-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: ignore spurious error |
1ddb263d21099ae42195c2bc382bdf72a7f24f82 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: don't look for images on each property get, but cache the image object inbetween |
b6b1849830f5e4a6065c3b0c993668e500c954d3 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: add support for reporting image size via btrfs quota |
ebd93cb684806ac0f352139e69ac8f53eb49f5e4 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machinectl/machined: implement "rename", "clone", "read-only" verbs for machine images |
086821244b5113f00a0ef993b78dc56aae2a8f6c |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: add "machinectl remove" for removing images |
003dffde2c1b93afbc9aff24b277276f65424406 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: Move image discovery logic into src/shared, so that we can make use of it from nspawn |
9bb0c7cfbb253c5b983efaed51a65bcbf422d8d7 |
|
25-Dec-2014 |
Filipe Brandenburger <filbranden@google.com> |
machined: remove spurious include of <sys/capability.h>
They do not use any functions from libcap directly. The CAP_KILL constant in
use by these files comes from <linux/capability.h> imported through
"missing.h".
Tested that "systemd-machined" builds cleanly and works after this change. |
10f9c75519671e7c7ab8993b54fe22da7c2d0c38 |
|
25-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: beef up machined image listing with creation/modification times of subvolumes
We make use of the btrfs subvol crtime for this, and for gpt images of a
manually managed xattr, if we can. |
d04c1fb8e215600b4950c6778c6c16ddafc14024 |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: introduce polkit for OpenLogin() call
This way "machinectl login" can be opened up to run without privileges. |
5f8cc96a0301c1177b11dd2e89370ef0b2ef577b |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: add new call OpenMachineLogin() that starts a getty in a container on a pty and returns the pty master fd to the client
This is a one-stop solution for "machinectl login", and should simplify
getting logins in containers. |
40205d706e1210763ff4c98a317556375bd04bcd |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: add OpenMachinePTY() bus call for allocating a PTY device within a container
Then, port "machinectl" over to make use of it. |
c2ce6a3d82b717c4c1e6245ad8c6ce1173f502d0 |
|
19-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: add new GetImage() bus call for retrieving the bus path for an image |
cd61c3bfd718fb398cc53ced906266a9297782c9 |
|
19-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined/machinectl: add logic to show list of available images
This adds a new bus call to machined that enumerates /var/lib/container
and returns all trees stored in it, distuingishing three types:
- GPT disk images, which are files suffixed with ".gpt"
- directory trees
- btrfs subvolumes |
96aad8d15a324d0e956a4e5653a11a67b209b41a |
|
10-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: move common errors src/shared/bus-errors.h → src/libsystemd/sd-bus/bus-common-errors.h
Stuff in src/shared/ should not use stuff from src/libsystemd/ really. |
8d07a7c47159ebc2bcc775e2c1997cb44bd1ac95 |
|
06-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: reorder method calls in vtable |
a931ad47a8623163a29d898224d8a8c1177ffdaf |
|
05-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
core: introduce new Delegate=yes/no property controlling creation of cgroup subhierarchies
For priviliged units this resource control property ensures that the
processes have all controllers systemd manages enabled.
For unpriviliged services (those with User= set) this ensures that
access rights to the service cgroup is granted to the user in question,
to create further subgroups. Note that this only applies to the
name=systemd hierarchy though, as access to other controllers is not
safe for unpriviliged processes.
Delegate=yes should be set for container scopes where a systemd instance
inside the container shall manage the hierarchies below its own cgroup
and have access to all controllers.
Delegate=yes should also be set for user@.service, so that systemd
--user can run, controlling its own cgroup tree.
This commit changes machined, systemd-nspawn@.service and user@.service
to set this boolean, in order to ensure that container management will
just work, and the user systemd instance can run fine. |
3a6fb33c54bc64398e0af1c9d7c74a6b614a849d |
|
04-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: fix address API signatures |
9b5ed6feda08290edce3bf916fa7362733dd30ea |
|
10-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: allow registering host-side network interfaces for communication with containers |
8d90c8a8d6867ffcfb61a11b73205cd7b1a72f3a |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machine: properly distuingish created and registered machines |
717603e391b52983ca1fd218e7333a1b9dfc5c05 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machinectl: show /etc/os-release information of container in status output |
206e7a5f7b55ac61188efd895e65ab26e478cbb2 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: don't force terminate registered machines
When a machine is registered in machined with CreateMachine it is OK to
kill the machine when it is terminated, but when an existing unit is
simply registered via RegisterMachine we shouldn't do that, as the unit
is controlled by somebody else. |
7f0d207d2c816e0a8cb2742b0a789911f7c99356 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: support connecting to remote hosts, directly into containers
systemctl -H root@foobar:waldi
will now show a list of services running on container "waldi" on host
"foobar", using "root" for authenticating at "foobar".
Since entereing a container requires priviliges, this will only work
correctly for root logins. |
878cd7e95ca303f9851d227a22d2022bd49944b0 |
|
18-May-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: add logic to query IP addresses of containers |
de0671ee7fe465e108f62dcbbbe9366f81dd9e9a |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unnecessary casts in printfs
No functional change expected :) |
de58a50e24a0d55e3bbcc77f8f6170a7322acf52 |
|
18-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: fix Kill() bus call on machine objects when "what" is specified as "leader" |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that. |
89f7c8465cd1ab37347dd0c15920bce31e8225df |
|
11-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: optionally, allow registration of pre-existing units (scopes
or services) as machine with machined |
4e05c4951aaaa57c9c6f3fb91723e7b93b1bbbda |
|
07-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: since we can now somewhat reliable get notifications for dying
scopes we don't need to lower the stop timeout anymore |
adacb9575a09981fcf11279f2f661e3fc21e58ff |
|
10-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: introduce "trusted" bus concept and encode access control in object vtables
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. |
5b12334d35eadf1f45cc3d631fd1a2e72ffaea0a |
|
28-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: add new sd_bus_creds object to encapsulate process credentials
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. |
86b8d289717bad2800342efca0a5023aa8374e9c |
|
21-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
logind,machined,run: properly invoke StartTransientUnit() bus call |
ebcf1f97de4f6b1580ae55eb56b1a3939fe6b602 |
|
21-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
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. |
df2d202e6ed4001a21c6512c244acad5d4706c87 |
|
21-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: let's simplify things by getting rid of unnecessary bus parameters |
718db96199eb307751264e4163555662c9a389fa |
|
20-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
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. |
c49b30a23583ff39daaa26696bcab478d2fee0bb |
|
12-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: rename sd_bus_send_with_reply_and_block() to sd_bus_call()
The call is one of the most important ones we expose, where we place
major emphasis on. We should make sure to give it a short, memorable
name. |
23c80348e656a4e6fd9ba8f17523a65b6fa349a0 |
|
07-Nov-2013 |
Kay Sievers <kay@vrfy.org> |
machine: add missing header include |
ab49725fd8587ef2b90dd0a67b2c915bc772d089 |
|
07-Nov-2013 |
Kay Sievers <kay@vrfy.org> |
machine: move symbols referenced by shared code from main to shared file
With --enable-address-sanitizer we get:
machined-dbus.c:228: undefined reference to 'manager_add_machine' |
927b1649448b812a7620ad013f4752d597b12407 |
|
05-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: add virtual object paths that always can be used to refer to the callers session, user, seat or machine object
This way clients can skip invoking GetSessionByPID() for their own PID
or a similar call to access these objects. |
4e724d9c5ab76c3f8327945317463ef706011082 |
|
05-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: automatically determine client side PID if GetSessionByPID() is called with a PID == 0 |
a658cafa98ab55ea948c29bc87eb3945d515fb41 |
|
05-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: simplifications |
c335068380fe8c9d843cdb2cf8a00f822cfabed3 |
|
30-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: port over to libsystemd-bus |
a3e7f417d72ba3251fd6b3a228a2721a4b725a03 |
|
13-Oct-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
bus: fix access to unitialized variable in error path
src/machine/machined-dbus.c:237:13: warning: Branch condition evaluates to a garbage value
if (m)
^ |
bd16acf35e13a19cd2ded0a0c2ef774a98f73808 |
|
26-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Move functions around to fix underlinking in test-machine-tables |
1dc2ced4646a78b3dee9e3ea44130f938d6425bc |
|
18-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove six unused variables and add annotation
clang FTW! |
76e665855edef5b7103cb09d114377d477bfae02 |
|
26-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: update the session state file before we send out the CreateSession() reply
https://bugs.freedesktop.org/show_bug.cgi?id=67273 |
cba38758b4d49c6fe7c2f0eea255e11ee9df23eb |
|
26-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: update state file after generating the session fifo, not before
https://bugs.freedesktop.org/show_bug.cgi?id=67273 |
554604b3073467af75dc94fac9e2343148603289 |
|
11-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: forward scope properties array from client to systemd
This makes nspawn's --scope= switch work again. |
6797c324a653f119a3d7133122648aaa4878ddd6 |
|
10-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: don't misunderstand UnitRemoved signals during reloading
When PID 1 reloads the units logind/machined will see UnitRemoved
signals for all units. Instead of trusting these immediately, let's
check the actual unit state before considering a unit gone, so that
reloading PID 1 is not mistaken as the end of all sessions. |
943aca8efb39453e3994ccdd1e08534b788c5aee |
|
03-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind/machined: properly notice when units are gc'ed |
8aec412ff697bc14995746953912ca6fdf2c9ba8 |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: sync to /run after job completed |
6a4e0b13473baed129522310c39f3bb70f46ed42 |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
nspawn: use the corect method signature for CreateMachine() |
1ee306e1248866617c96ed9f4263f375588ad838 |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: split out machine registration stuff from logind
Embedded folks don't need the machine registration stuff, hence it's
nice to make this optional. Also, I'd expect that machinectl will grow
additional commands quickly, for example to join existing containers and
suchlike, hence it's better keeping that separate from loginctl. |