| Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
Use varlink to detect networkd's network namespace when executing
networkctl rather than the D-Bus interface.
Signed-off-by: Matt Layher <mdlayher@gmail.com>
|
|
No functional change, just refactoring.
|
|
No functional change, just refactoring.
|
|
No functional change, just refactoring.
|
|
While at it, this replaces strndupa_safe() with strndup(), as the input
is a user-controlled string.
No functional change, just refactoring.
|
|
No functional change, just refactoring.
|
|
Also rename get_max_brightness() -> read_max_brightness() for
consistency with read_brightness().
|
|
As per https://github.com/systemd/systemd/pull/30547#discussion_r1434371627
|
|
|
|
|
|
The unit actually uses /dev/kmsg, not /dev/kvm
Follow-up for ae7482b994e6a9bc8e
|
|
These are unused or used in the same order. So, this patch does not
change any behavior, just for naming consistency with the function
prototype.
Closes #30570.
|
|
Let's get networkd onto Varlink. This only adds the most basic of
operations.
I'd love to see networkd do Varlink for all its basic operations so that
networkctl can use that, and work correctly before D-Bus is up. Right
now, many of networkctls calls simply don't work before D-Bus, and I'd
like to see that improved.
|
|
RootImage= is used
We cannot determine the SELinux label ahead of time if RootImage= is
used, since we'd have to mount the image then, hence don't, and handle
this cleanly, and gracefully.
While we are at it, stop "reaching over" so much from the socket code to
the service code, and instead provide function that most of the hard
work in service.c that socket.c just calls.
While we are at it, add debug logging and stuff.
I noticed the issue when also noticing #30560, but that one is harder to
fix, hence I avoided it for now.
|
|
Even /dev isn't always guaranteed to be a mount point, so let's drop
this part of the test.
|
|
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
|
|
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
|
|
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
|
|
This simplifies bus_verify_polkit_async() and related calls quite a bit:
1. This removes any support for authentication-by-Linux-capability. This
is ultimately a kdbus leftover: with classic AF_UNIX transports we
cannot authenticate by capabilities securely (because we cannot
acquire it from the peer without races), hence we never actually did.
Since the necessary kernel work didn't materialize in the last 10y,
and is unlikely to be added, let's just kill this context. We cannot
quite remove the caps stuff from sd-bus for API compat, but for our
polkit logic let's kill it.
2. The "good_uid" and "interactive" params are only necessary in very
few cases, hence let's move them to a new call
bus_verify_polkit_async_full() and make bus_verify_polkit_async() a
wrapper around it without those two parameters.
This also fixes a bunch of wrong uses of the "interactive" bool. The
bool makes no sense today as the ALLOW_INTERACTIVE_AUTHORIZATION field
in the D-Bus message header replaces it fully. We only need it to
implement method calls we introduced prior to that header field becoming
available in D-Bus. And it should only be used on such old method calls,
and otherwise always be set to false.
This does not change behaviour in any way. Just simplifies stuff.
Fixes: #21586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This adds a new --background= switch that allows specifiying a
background color for the terminal while the tool runs.
It also teaches the tool when invoked as uid0 to tint the terminal in a
reddish hue when operating as root, and in a yellowish hue when
operating as any other user.
This should highlight nicely when the user is operating with elevated
privileges, or changed privileges.
|
|
We already have HSV → RGB, add the opposite operation.
|
|
|
|
As the bytes flow through our terminal forwarder we can color the
background of the terminal with a color of our choices, if that's
desired.
This will later allow us to color the background of the uid0 tool when
running as root with a slightly alarming red color.
This does two things:
1. When an ANSI sequence is seen that resets the background color, it is
extended to immediately set the color to our choice.
2. When a newline is seen it is immeidately extended to set the
background color again and clear the current line till the end.
Net effect: all lines written while we forward the ttys will be shown
with the background color of choice.
|
|
|
|
|
|
Otherwise we don't get the new PAM snippet for the uid0 PAM stack
installed.
|
|
|
|
This turns "systemd-run" into a multi-call binary. When invoked under
the name "uid0", then it behaves a bit more like traditional "sudo".
This mostly means defaults appropriuate for that, for example a PAM
stack, interactivity and more.
Fixes: #29199
|
|
|
|
|
|
|
|
to reply
We already checked the flags before, and updated the state accordingly,
hence let's only look at the state afterwards. This allows us to use the
same expressions for all cases where we want to reply automatically to
clients.
|
|
|
|
Let's make sure method call handlers failing will result in that very
method call failing but not the whole connection. We mostly got that
right, except for "oneway" calls where the method reply is supposed to
be eaten up, but wasn't. Fix that.
|
|
Most code in varlink.c got that right, but some didn't. Fix that.
|
|
|
|
it's not entirely clear to me if the manual NUL termination is
necessary, but let's better be safe than sorry, since this is apparently
up to the LSMs, and I am not sure we can trust them all.
A lot of other code (such as dbus-broker) patches in the NUL byte, hence
let's be rather safe-then-sorry, it's trivial after all.
|
|
as backing for dbus property
Note sure why it didn't occur earlier to me, but now that we have this
nice helper to get the effective value of the set_login_environment
field instead of just falling back to "false".
Follow-up for: #30552
|
|
Fixes #25676
|
|
This geneally makes sense as setting up a PAM session pretty much
defines what a login session is.
In context of #30547 this has the benefit that we can take benefit of
the SetLoginEnvironment= effect without having to set it explicitly,
thus retaining some compat of the uid0 client towards older systemd
service managers.
|