| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
Place this new helpers in a new source file os-util.[ch], and move the
existing and related call path_is_os_tree() to it as well.
|
| |
|
|
|
|
|
|
|
| |
Most our other parsing functions do this, let's do this here too,
internally we accept that anyway. Also, the closely related
load_env_file() and load_env_file_pairs() also do this, so let's be
systematic.
|
|
|
|
|
|
|
|
| |
We already have a flag for creating a new mount namespace for the child.
Let's add an extension to that: a new FORK_MOUNTNFS_SLAVE flag. When
used in combination will mark all mounts in the child namespace as
MS_SLAVE so that the child can freely mount or unmount stuff but it
won't leak into the parent.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This call creates an fd from another fd containing the same data.
Specifically, repeated read() on the returned fd should return the same
data as the original fd. This call is useful when we want to copy data
out of disk images and suchlike, and want to be pass fds with the data
around without having to keep the disk image continously mounted.
The implementation tries to be somewhat smart and tries to prefer
memfds/pipes over files in /tmp or /var/tmp based on the size of the
data, but has appropropriate fallbacks in place.
|
|
|
|
|
|
|
| |
The clone syscall uses the same semantics as on 64-bit. The trap number
for syscall entry is different.
Bug: https://bugs.gentoo.org/656368
|
|
|
|
|
| |
If multiple RestrictNamespaces= settings are set, then merge the settings.
This also drops supporting "~yes" and "~no".
|
|
|
|
|
|
| |
This also drops namespace_flag_to_string_many_with_check(), and
renames namespace_flag_{from,to}_string_many() to
namespace_flags_{from,to}_string().
|
|
|
|
|
| |
We always ignore the unused bits. So, it is not necessary to check
them.
|
|
|
|
|
|
|
| |
Externally it's an uint64_t anyway, and internally we most just
initialize it to physical_memory() which returns uint64_t, hence there's
exactly zero value in using it as size_t internally. Hence, let's fix
that, and use uint64_t everywhere.
|
|
|
|
|
| |
We should always do debug logging when we eat up error conditions. Let's
do so here too.
|
|
|
|
|
|
|
| |
Let's look into the right cgroupsv2 attribute.
Also, while we are at it, add debug logging for all error conditions we
eat up silently otherwise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as long as possible
If we log to the pty that is configured as stdin/stdout/stderr of the
container too early we risk filling it up in full before we start
processing the pty from the parent process, resulting in deadlocks.
Let's hence keep a copy of the original tty we were started on before
setting up stdin/stdout/stderr, so that we can log to it, and keep using
it as long as we can.
Since the kernel's pty internal buffer is pretty small this actually
triggered deadlocks when we debug logged at lot from nspawn's child
processes, see: https://github.com/systemd/systemd/pull/9024#issuecomment-390403674
With this change we won't use the pty at all, only the actual payload we
start will, and hence we won't deadlock on it, ever.
|
|
|
|
| |
Closes #9072.
|
|
|
|
|
| |
Preparation for setting DynamicUser= to other services which
request bus names.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This makes most header files easier to look at. Also Emacs gets really
slow when browsing through large sections of overly long prototypes,
which is much improved by this macro.
We should probably not do something similar with too many other cases,
as macros like this might help readability for some, but make it worse
for others. But I think given the complexity of this specific prototype
and how often we use it, it's worth doing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This builds on the previous GENERIC_PARSER_ARGS macro work. I think in
general it is a better idea to declare macros that generate full C
statements instead of just parts of them, hence, let's introduce
CONFIG_PARSER_PROTOTYPE() which defines a full C function prototype,
instead of the pre-existing way of defining the C function prototype
manually, but then using GENERIC_PARSER_ARGS to define its arguments.
This doesn't drop GENERIC_PARSER_ARGS though, but renames it to
CONFIG_PARSER_ARGUMENTS, and changes the ConfigParserCallback function
type to use it. The new name follows more closely how the other symbols
in the header are named.
|
|
|
|
| |
Attempted to remove disk file system under "/tmp/systemd-temporary-aWPkbQ", and we can't allow that.
|
|
|
|
| |
macro
|
|
|
|
|
|
|
|
|
|
|
| |
The macro is inspired by the other string table macros, and takes the
same arguments in the same order and dumps a string table to stdout.
Since it's typesafe it's nice to implement this as macro rather than
regular function.
This new macro is useful for implementing commands such as "systemctl -t
help" and similar, i.e. wherever we want to dump all values of an enum
to stdout.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
be 64 bits
On both 32 and 64 bits, the result is:
enum Enum → 32 bits, unsigned
enum BigEnum → 32 bits, unsigned
enum BigEnum2 → 64 bits, unsigned
big_enum2_pos → 4
big_enum2_neg → 8
The last two lines show that even if the enum is 64 bit, and the field of an
enum is defined with UINT64_C(), the field can still be smaller.
|
|
|
|
|
|
|
|
|
|
|
| |
%_environmnentdir /usr/lib/environment.d
%_modulesloaddir /usr/lib/modules-load.d
%_modprobedir /usr/lib/modprobe.d
This makes installing files there more convenient because people don't need to
construct the path from %_prefix/lib/… .
See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/.
|
|
|
|
|
|
|
|
|
|
|
| |
%_environmnentdir /usr/lib/environment.d
%_modulesloaddir /usr/lib/modules-load.d
%_modprobedir /usr/lib/modprobe.d
This makes installing files there more convenient because people don't need to
construct the path from %_prefix/lib/… .
See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/.
|
|
|
|
|
|
|
|
|
|
|
| |
Functions whose only purpose is to be used with _cleanup_() should not
touch errno, so that failing removals do not alter errno at unexpected
places.
This is already done in unlink_and_freep(), rmdir_and_freep(),
rm_rf_physical_and_freep(), hence do so for unlink_tempfilep(), too.
Follow-up for #9013
|
|
|
|
|
|
|
|
|
|
| |
In https://github.com/systemd/systemd/pull/6561, `run_target`
was changed to `custom_target`, which inadvertently caused
relative paths to be passed to ctags due to
https://github.com/mesonbuild/meson/issues/3589.
The switch to `run_target` causes absolute paths to be
passed again and makes it easier to jump from file to
file, hopefully delaying the need to exit Vim :-)
|
| |
|
|
|
|
|
|
|
|
|
| |
Initializing just some of the values doesn't make sense. We should handle them
all in the same way. In those tests there are no jumps, all steps are covered
with assert_se(), so we know everything will be set if we get to the end of the
function. And _not_ initializing those variables has the advantage that it
allows valgrind to catch potential initalization errors in the function being
tested.
|
|
|
|
|
|
| |
We were inconsitently using them in some cases, but in majority not.
Using assignment in assert_se is very common, not an exception like in
'if', so let's drop the extra parens everywhere.
|
|
|
|
|
|
|
| |
f1470e424b2b5337e3c383d68dc5a26af1ff4ce6 removed one check, but missed a similar
one a few lines down.
CID #1390949.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This simplifies the use of tempfiles in tests and fixes "leaked"
temporary files in test-fileio, test-catalog, test-conf-parser.
Not the whole tree is converted.
|
| |
|
|
|
|
| |
And let's make use of it in execute.c
|
|
|
|
|
|
|
|
|
|
| |
parse-util.c
And port config_parse_exec_oom_score_adjust() over to use it.
While we are at it, let's also fix config_parse_exec_oom_score_adjust()
to accept an empty string for turning off OOM score adjustments set
earlier.
|
|
|
|
| |
empty_to_null()
|
|
|
|
|
| |
Let's make sure we properly handle cases where RLIMIT_NOFILE is set to
infinity, zero or values outside of the "int" range.
|
|
|
|
|
|
|
| |
That way we can use it in nspawn.
Also, while we are at it, let's rename the call config_parse_rlimit(),
i.e. insert the "r", to clarify what kind of limit this is about.
|
|
|
|
|
| |
let's make the call more generic, so that we can also easily use it for
parsing "RLIMIT_xyz" style constants.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Configuration through environment variable is inconvenient with meson, because
they cannot be convieniently changed and/or are not preserved during
reconfiguration (https://github.com/mesonbuild/meson/issues/1503).
This adds -Dvalgrind=true/false, which has the advantage that it can be set
at any time with meson configure -Dvalgrind=... and ninja will rebuild targets
as necessary. Additional minor advantages are better consistency with the
options for hashmap debugging, and typo avoidance with '#if' instead of '#ifdef'.
|
| |
|
|
|
|
| |
Array type option is supported since 0.44.0.
|
|
|
|
|
| |
This bumps the required minimum version of meson to 0.44, as
`warning()` method is supported since 0.44.
|
|
|
|
|
| |
This bumps the required minimum version of meson to 0.43, as
`get_supported_arguments()` is supported since meson-0.43.
|