Age | Commit message (Collapse) | Author |
|
: characters can be entered with the \: escape sequence.
|
|
Overlayfs uses , as an option separator and : as a list separator. These
characters are both valid in file paths, so overlayfs allows file paths
which contain these characters to backslash escape these values.
|
|
This modifies the strv in-place, replacing strings with their escaped
version. It's mostly just a convenience function for when you need to
join a strv together because it's passed as a string to something, and
the separator needs escaping.
|
|
This is for shell-style \ escaping rather than quoting, which while it
has the same effect in produced shell commands, is not exclusively
useful for shell commands.
shell_escape would be useful for producing sed commands, as you would be
able to \ escape the normal special characters, plus whichever argument
separator was chosen; or it could be used to escape arguments passed to
the overlayfs mount command.
|
|
: characters in bind paths can be entered as the \: escape sequence.
|
|
strv_split_extract is to strv_split_quotes as extract_first_word was to
unquote_first_word.
Now there's extract_first_word for extracting a single argument,
extract_many_words for extracting a bounded number of arguments,
and strv_split_extract for extracting an arbitrary number of arguments.
|
|
This now accepts : characters with the \: escape sequence.
Other escape sequences are also interpreted, but having a \ in your file
path is less likely than :, so this shouldn't break anyone's existing
tools.
|
|
If EXTRACT_DONT_COALESCE_SEPARATORS is passed, then leading separators,
trailing separators and spans of multiple separators aren't skipped, and
empty arguments from before, after or between separators may be extracted.
|
|
This adds an EXTRACT_QUOTES option to allow the previous behaviour, of
not interpreting any character inside ' or " quotes as separators.
|
|
It now takes a separators argument, which defaults to WHITESPACE if NULL
is passed.
|
|
To add a flag to allow an empty string to be parsed as an argument, we
need to be able to distinguish between the end of the string, and after
the end of the string, so when we *do* reach the end, let's set *p to
this state.
|
|
This is so that, when called in a loop, unquote_first_word can
distinguish between reaching the end of a string because it has consumed
all the input before the end, and consuming all the input.
This is important because we later add a flag that allows
char *in = "";
char *out;
unquote_first_word(&in, &out, flags);
To put "" in out, and set in = NULL, so the trailing empty string of the
input can be consumed, and mark that the input has been consumed.
|
|
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1251334
|
|
Fix for #376, plus some other fixes
|
|
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.
|
|
We never made use of it, let's get rid of it.
|
|
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.
|
|
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.
|
|
The kernel nowadays sends these along, and that's OK, hence don't even
debug log about it, but completely ignore it.
|
|
execute: don't fail if we create the runtime directory from two proce…
|
|
simultaneously
If a service has both ExecStart= and ExecStartPost= set with
Type=simple, then it might happen that we have two children create the
runtime directory of a service (as configured with RuntimeDirectory=) at
the same time. Previously we did this with mkdir_safe() which will
create the dir only if it is missing, but if it already exists will at
least verify the access mode and ownership to match the right values.
This is problematic in this case, since it creates and then adjusts the
settings, thus it might happen that one child creates the directory with
root owner, another one then verifies it, and only afterwards the
directory ownership is fixed by the original child, while the second
child already failed.
With this change we'll now always adjust the access mode, so that we
know that it is right. In the worst case this means we adjust the
mode/ownership even though its unnecessary, but this should have no
negative effect.
https://bugzilla.redhat.com/show_bug.cgi?id=1226509
|
|
|
|
The ->done callback in the unit's vtable might call into
unit_unwatch_bus_name() and corrupt memory by that.
Move the call down, and clean up the bus slot in case it hasn't been done
yet.
|
|
The kernel may return EBADSLT if a reply slot cannot be found. Make sure
to ignore it just like we ignore EPERM (the comment still applies).
|
|
Currently, PID1 installs an unfiltered NameOwnerChanged signal match, and
dispatches the signals itself. This does not scale, as right now, PID1
wakes up every time a bus client connects.
To fix this, install individual matches once they are requested by
unit_watch_bus_name(), and remove the watches again through their slot in
unit_unwatch_bus_name().
If the bus is not available during unit_watch_bus_name(), just store
name in the 'watch_bus' hashmap, and let bus_setup_api() do the installing
later.
|
|
Coverity #1315324
|
|
Manual merge of https://github.com/systemd/systemd/pull/751.
|
|
|
|
All users are now setting lowercase=false.
|
|
When the user requests to set hostname, and we are setting both
pretty and static hostnames, and the name is a valid FQDN, we
use it as the static hostname, and unset the pretty hostname.
The change is that a FQDN with a trailing dot is accepted and ignored.
https://bugzilla.redhat.com/show_bug.cgi?id=1238246
Lowercasing of the static name is not done anymore.
$ hostnamectl set-hostname Foobar.
=> static is "Foobar", pretty is "Foobar."
$ hostnamectl set-hostname Foobar.org.
=> static is "Foobar.org", pretty is unset
$ hostnamectl set-hostname Foobar.org..
=> static is "Foobar.org", pretty is "Foobar.org.."
|
|
|
|
|
|
Tests are modified to check behaviour with relax and without relax.
New tests are added for hostname_cleanup().
Tests are moved a new file (test-hostname-util) because there's
now a bunch of them.
New parameter is not used anywhere, except in tests, so there should
be no observable change.
|
|
tree-wide: do not return error codes as bool
|
|
|
|
|
|
Follow-up for PR #877.
|
|
networkd: save private-zone DHCP options
|
|
https://github.com/systemd/systemd/issues/875
|
|
|
|
Save the private options along side the rest of the options in the lease
files.
|
|
This stores private-zone DHCP options inside of their respective DHCP
lease. These options aren't used by networkd (what would it do with
them?), but saving them will allow other programs to query the values.
To improve performance, the options are stored in ascending order by
tag.
|
|
Let logind use the sd_bus_track helper object to track the controllers of
sessions. This does not only remove quite some code but also kills the
unconditional matches for all NameOwnerChanged signals.
The latter is something we should never ever do, as it wakes up the daemon
every time a client connects, which doesn't scale.
|
|
journald: fix count of object meta fields
|
|
hwdb: add Logitech LX8 DPI and wheel click settings
|
|
There are 12 object meta fields created in dispatch_message_real(), but
we only allocated space for 11. Fix this.
Fixes #866.
|
|
Let's make this less dramatic, in order to not confuse people too much
making them think that this was something to actually fix.
|
|
sysctl: bump loglevel when attempting to write invalid values [v2]
|
|
|