| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#31715)
This adds for both the D-Bus and the Varlink flavours of our polkit
client api a flags parameter. And then folds the "bool interactive" flag
that the D-Bus version so far had, into a flag, and also adds support
for it in the Varlink API.
Since this means the Varlink API gained another parameter, let's do what
we already did for the D-Bus API and add a _full() version of the API
that has the flags and the good_uid parameter, and one without both.
|
|\
| |
| | |
core/service: several trivial cleanups for fdstore
|
| | |
|
| |
| |
| |
| |
| |
| | |
Old versions of hostnamed used to propagate ENODEV/ENOENT as-is. Bad
idea. This was fixed in 171ddae1a122e9c97b4ef12ccb2d29e1ba7a318a, but
let's handle this gracefully in hostnamectl.
|
|/
|
|
|
|
| |
Otherwise if talking to an old hostnamed (which doesn't have these
fields) we'd assume the timestamp is valid even though it isn't and show
garbage.
|
| |
|
|
|
|
| |
hostnamed provides this, hence hostnamectl should show it
|
|
|
|
|
|
| |
For the very similar case of the product UUID we have its own error
BUS_ERROR_NO_PRODUCT_UUID if we have no UUID. Let's mirror this for the
hardware serial, and expose the same, to keep things nicely symmteric.
|
|
|
|
|
|
| |
Let's make sure the serial contains not control chars, and is UTF-8
clean. In particular the latter matters as D-Bus shouldn't kick us
from the bus.
|
|
|
|
| |
return it
|
|
|
|
| |
No idea what was going on here...
|
|
|
|
|
|
|
| |
We already support -j as shortcut for JSON mode in various tools. Let's
add one more. We probably should add this systematically (at least where
it doesn't conflict with an existing -j switch with other purpose). But
I am too lazy to add that now.
|
|
|
|
|
|
|
|
|
|
| |
There's some appetite to have the full os-release/machine-info data
exposed by hostnamed.
let's do so in the Describe() method and via Varlink. It's trivial after
all.
Inspired by: #18649
|
| |
|
|
|
|
|
|
|
|
|
| |
that way clients can distinguish whether there is no cid or whether
hostnamed doesn't support it nicely, by just looking if the prop exists
(but is null) or not.
This is similar how we already handle all other props in the JSON
record.
|
| |
|
|
|
|
|
| |
It's a bit weird to keep this separate in particular as the polkit
object is already part of the context.
|
| |
|
|
|
|
|
| |
This is a host identifier of major relevance, since it is how you
connect to this system if it is a VM, hence expose this nicely.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Fixes #30293.
|
|
|
|
|
|
| |
information about remote host
Prompted by #30293.
|
|
|
|
|
|
|
| |
This also makes write_env_file() and write_env_file_label() optionally
take dir_fd, and drop write_env_file_at().
Preparation for later commits.
|
|
|
|
| |
Fixes #28943
|
| |
|
|
|
|
|
|
|
| |
This converts the date into a relative timespan from the current time
on, and outputs it. It marks it yellow if older than two years, since
old firmware is probably a security risk. We don't make it red, since we
don't know though.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
safe_atou() by default determines the base from the prefix 0x, 0b, 0o
and for compat with just 0 for octal. This is not what we want here,
since the date components are padded with zeroes yet still decimal.
Hence force decimal parsing (and while we are at it, prohibit a couple
of unexpected decorations).
WIthout this we'd fail to parse any the 8th and 9th day of each months, as
well aus aug and september of every year, because these look like octal
numbers but cannot actually parsed as such.
Let's change the testcase to check for a date that exposes this
bheaviour.
|
|
|
|
|
| |
If we run in a container we should show info about the container, not
the host.
|
|
|
|
|
|
|
|
|
| |
By default, label_ops is initialized with a NULL pointer which translates
to noop labelling operations. In mac_selinux_init() and the new mac_smack_init(),
we initialize label_ops with a MAC specific LabelOps pointer.
We also introduce mac_init() to initialize any configured MACs and replace all
usages of mac_selinux_init() with mac_init().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In various tools and services we have a per-system and per-user concept.
So far we sometimes used a boolean indicating whether we are in system
mode, or a reversed boolean indicating whether we are in user mode, or
the LookupScope enum used by the lookup path logic.
Let's address that, in introduce a common enum for this, we can use all
across the board.
This is mostly just search/replace, no actual code changes.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The source (usually DMI/SMBIOS) only has 24h granularity, hence don't
show time as well, it's useless.
|
|
|
|
|
|
| |
Offer the firmware date as an epoch instead of the literal DMI string.
Closes #25679
|
|
|
|
| |
Expose /sys/class/dmi/id/bios_date as dbus property in hostnamed.
|
|
|
|
| |
Expose /sys/class/dmi/id/bios_vendor as dbus property in hostnamed.
|
| |
|
|
|
|
|
|
| |
The name "def.h" originates from before the rule of "no needless abbreviations"
was established. Let's rename the file to clarify that it contains a collection
of various semi-related constants.
|
|
|
|
|
| |
util.h is now about logarithms only, so we can rename it. Many files included
util.h for no apparent reason… Those includes are dropped.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In most cases we refernced the concept as "initrd". Let's convert most
remaining uses of "initramfs" to "initrd" too, to stay internally
consistent.
This leaves "initramfs" only where it's relevant to explain historical
concepts or where "initramfs" is part of the API (i.e. in
/run/initramfs).
Follow-up for: b66a6e1a5838b874b789820c090dd6850cf10513
|
|
|
|
|
|
|
|
|
|
|
|
| |
All users were setting this to some static string (usually "-"), so let's
simplify things by not doing strdup, but instead limiting callers to a fixed
set of values. In preparation for the next commit, the function is renamed from
"empty" to "replacement", because it'll be used for more than empty fields. I
didn't do the whole string-table setup, because it's all used internally in one
file and this way we can immediately assert if an invalid value is passed in.
Some callers were (void)ing the error, others were ignoring it, and others
propagating. It's nicer to remove the boilerplate.
|
|
|
|
|
| |
"n/a" is more ambiguous: not available or not set or maybe we didn't check it.
Let's just say directly that the field is not set.
|
| |
|
|
|
|
|
|
| |
Fixes a bug introduced by 8c8b1800e90d4307397300ef32b0f6d95efad057.
Fixes #24384.
|
|
|
|
| |
grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
|