| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
Same justification as for HAVE_UTMP.
|
|
|
|
| |
Same justification as for HAVE_UTMP.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The advantage is that is the name is mispellt, cpp will warn us.
$ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/"
$ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;'
$ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g'
$ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g'
+ manual changes to meson.build
squash! build-sys: use #if Y instead of #ifdef Y everywhere
v2:
- fix incorrect setting of HAVE_LIBIDN2
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit ee043777be58251e7441b4f04594e9e3792d7fb2.
It broke almost everywhere it touched. The places that
handn't been converted, were mostly followed by special
handling for the invalid PID `0`. That explains why they
tested for `pid < 0` instead of `pid <= 0`.
I think that one was the first commit I reviewed, heh.
|
|
|
|
|
|
|
| |
This is a legacy of autotools, where one detection routine used a different
prefix then the others.
$ git grep -e HAVE_DECL_ -l|xargs sed -i s/HAVE_DECL_/HAVE_/g
|
|
|
|
|
|
|
|
|
|
| |
Don't miscount number of "../" to generate, if we "." is included in an
input path.
Also, refuse if we encounter "../" since we can't possibly follow that
up properly, without file system access.
Some other modernizations.
|
|
|
|
|
|
| |
The included cocci was used to generate the changes.
Thanks to @flo-wer for pointing this case out.
|
|
|
|
|
| |
In addition to the changes from #6933 this handles cases that could be
matched with the included cocci file.
|
| |
|
|
|
|
|
|
|
| |
Let's manage the list of file systems that do a specific thing at one
place, following similar naming.
No functional changes.
|
|
|
|
|
|
|
| |
system
Specifically, squashfs and iso9660 are always read-only, hence make sure
we never even think about mounting them writable.
|
|
|
|
|
| |
We really shouldn't silently translate the error code here for no
reason.
|
|
|
|
|
|
| |
This we can then make use in execute.c to make error logging a bit less
special when preparing for process execution, as we can still log but
don't have any fds open continously.
|
|
|
|
| |
code for log_oom() too
|
|
|
|
|
|
| |
Also drop the redundant states and make all similar changes too.
Thankfully the swap.c state engine is much simpler than mount.c's, hence
this should be easier to digest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the mount unit state engine in the following ways:
1. The MOUNT_MOUNTING_SIGTERM and MOUNT_MOUNTING_SIGKILL are removed.
They have been pretty much equivalent to MOUNT_UNMOUNTING_SIGTERM and
MOUNT_UNMOUNTING_SIGKILL in what they do, and the outcome has been
the same as well: the unit is stopped. Hence, let's simplify things a
bit, and merge them. Note that we keep
MOUNT_REMOUNTING_{SIGTERM|SIGKILL} however, as those states have a
different outcome: the unit remains started.
2. mount_enter_signal() will now honour the SendSIGKILL= option of the
mount unit if it was set. This was previously done already when we
entered the signal states through a timeout, and was simply missing
here.
3. A new helper function mount_enter_dead_or_mounted() is added that
places the mount unit in either MOUNT_DEAD or MOUNT_MOUNTED,
depending on what the kernel thinks about the mount's state. This
function is called at various places now, wherever we finished an
operation, and want to make sure our own state reflects again what
the kernel thinks. Previously we had very similar code in a number of
places and in other places didn't recheck the kernel state. Let's do
that with the same logic and function at all relevant places now.
4. Rework mount_stop(): never forget about running control processes.
Instead: when we have a start (i.e. a /bin/mount) process running,
and are asked to stop, then enter the kill states for it, so that it
gets cleaned up. This fixes #6048. Moreover, when we have a reload
process running convert the possible states into the relevant
unmounting states, so that we can properly execute the requested
operation.
Fixes #6048
|
|
|
|
| |
in vararg
|
|
|
|
|
| |
This returned value so far wasn't used anywhere, so there's no change
in behaviour.
|
|
|
|
| |
`strlen` returns a `size_t` and `alloca` expects a `size_t`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ systemctl show elogind-journald -p CapabilityBoundingSet,AmbientCapabilities
CapabilityBoundingSet=cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_setgid ...
AmbientCapabilities=(null)
↓
$ systemctl show elogind-journald -p CapabilityBoundingSet,AmbientCapabilities
CapabilityBoundingSet=cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_setgid ...
AmbientCapabilities=
Partially fixes #6511. Add some basic tests for the printing function.
|
|
|
|
| |
Fixup for f4b51a2d09. Suggested by Evgeny Vereshchagin.
|
|
|
|
|
| |
if there was something in the read buffer already errno might not be set
on error, let's detect that case.
|
|
|
|
|
|
|
|
| |
Let's read one byte more than the file size we read from stat() on the
first fread() invocation. That way, the first read() will already be
short and indicate eof to fread().
This is a minor optimization, and replaces #3908.
|
|
|
|
|
|
| |
That way, write_string_stream_ts() becomes more powerful, and we can
remove duplicate code from write_string_file_atomic() and
write_string_file_ts().
|
|
|
|
|
|
| |
Let's make write_string_stream() and write_string_file() more alike, and
pass the same flag set so that we can remove a number of boolean
parameters.
|
|
|
|
|
| |
Let's make sure "ts" is taken into account when writing atomic files,
too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On cgroupsv2 we should also chown()/chmod() the subtree_control file,
so that children can use controllers the way they like.
On cgroupsv1 we should also chown()/chmod() cgroups.clone_children, as
not setting this for new cgroups makes little sense, and hence delegated
clients should be able to write to it.
Note that error handling for both cases is different. subtree_control
matters so we check for errors, but the clone_children/tasks stuff
doesn't really, as it's legacy stuff. Hence we only log errors and
proceed.
Fixes: #6216
|
|
|
|
|
|
|
| |
These errors don't really matter, that's why we log and proceed in the
current code. However, we currently log at LOG_WARNING, but we really
shouldn't given that this is library code. Hence downgrade this to
LOG_DEBUG.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new recognizable log message for each unit invocation that
contains structured information about consumed resources of the unit as
a whole after it terminated. This is particular useful for apps that
want to figure out what the resource consumption of a unit given a
specific invocation ID was.
The log message is only generated for units that have at least one
XyzAccounting= property turned on, and currently only covers IP traffic and CPU
time metrics.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds IOVEC_INIT() and IOVEC_MAKE() for initializing iovec structures
from a pointer and a size. On top of these IOVEC_INIT_STRING() and
IOVEC_MAKE_STRING() are added which take a string and automatically
determine the size of the string using strlen().
This patch removes the old IOVEC_SET_STRING() macro, given that
IOVEC_MAKE_STRING() is now useful for similar purposes. Note that the
old IOVEC_SET_STRING() invocations were two characters shorter than the
new ones using IOVEC_MAKE_STRING(), but I think the new syntax is more
readable and more generic as it simply resolves to a C99 literal
structure initialization. Moreover, we can use very similar syntax now
for initializing strings and pointer+size iovec entries. We canalso use
the new macros to initialize function parameters on-the-fly or array
definitions. And given that we shouldn't have so many ways to do the
same stuff, let's just settle on the new macros.
(This also converts some code to use _cleanup_ where dynamically
allocated strings were using IOVEC_SET_STRING() before, to modernize
things a bit)
|
| |
|
|
|
|
|
| |
This object takes a number of bpf_insn members and wraps them together with
the in-kernel reference id. Will be needed by the firewall code.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixup for f4b51a2d09. Suggested by Evgeny Vereshchagin.
|
| |
|
|
|
|
|
| |
if there was something in the read buffer already errno might not be set
on error, let's detect that case.
|
|
|
|
|
|
|
|
| |
Let's read one byte more than the file size we read from stat() on the
first fread() invocation. That way, the first read() will already be
short and indicate eof to fread().
This is a minor optimization, and replaces #3908.
|
|
|
|
|
|
| |
That way, write_string_stream_ts() becomes more powerful, and we can
remove duplicate code from write_string_file_atomic() and
write_string_file_ts().
|
|
|
|
|
|
| |
Let's make write_string_stream() and write_string_file() more alike, and
pass the same flag set so that we can remove a number of boolean
parameters.
|
|
|
|
|
| |
Let's make sure "ts" is taken into account when writing atomic files,
too.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
LONG_LINE_MAX is much like LINE_MAX, but longer.
As it turns out LINE_MAX at 4096 is too short for many usecases. Since
the general concept of having a common maximum line length limit makes
sense let's add our own, and make it larger (1MB for now).
|
|
|
|
|
|
|
| |
read_line() is much like getline(), and returns a line read from a
FILE*, of arbitrary sizes. In contrast to gets() it will grow the buffer
dynamically, and in contrast to getline() it will place a user-specified
boundary on the line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On cgroupsv2 we should also chown()/chmod() the subtree_control file,
so that children can use controllers the way they like.
On cgroupsv1 we should also chown()/chmod() cgroups.clone_children, as
not setting this for new cgroups makes little sense, and hence delegated
clients should be able to write to it.
Note that error handling for both cases is different. subtree_control
matters so we check for errors, but the clone_children/tasks stuff
doesn't really, as it's legacy stuff. Hence we only log errors and
proceed.
Fixes: #6216
|
|
|
|
|
|
|
| |
These errors don't really matter, that's why we log and proceed in the
current code. However, we currently log at LOG_WARNING, but we really
shouldn't given that this is library code. Hence downgrade this to
LOG_DEBUG.
|