diff --git a/src/activate/activate.c b/src/activate/activate.c index 9a83bc7f24..7eae9e22c2 100644 --- a/src/activate/activate.c +++ b/src/activate/activate.c @@ -10,6 +10,7 @@ #include "sd-daemon.h" #include "alloc-util.h" +#include "errno-util.h" #include "escape.h" #include "fd-util.h" #include "log.h" diff --git a/src/analyze/analyze-security.c b/src/analyze/analyze-security.c index 9e4cac6e29..a978ed6da8 100644 --- a/src/analyze/analyze-security.c +++ b/src/analyze/analyze-security.c @@ -13,6 +13,7 @@ #include "locale-util.h" #include "macro.h" #include "missing.h" +#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" #include "pretty-print.h" diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index f838daada8..299c5917bc 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -29,6 +29,7 @@ #include "locale-util.h" #include "log.h" #include "main-func.h" +#include "nulstr-util.h" #include "pager.h" #include "parse-util.h" #include "path-util.h" diff --git a/src/basic/async.c b/src/basic/async.c index c45ca01847..daa95cd102 100644 --- a/src/basic/async.c +++ b/src/basic/async.c @@ -6,6 +6,7 @@ #include #include "async.h" +#include "errno-util.h" #include "fd-util.h" #include "log.h" #include "macro.h" diff --git a/src/basic/def.h b/src/basic/def.h index 929da726ae..2af0b763f0 100644 --- a/src/basic/def.h +++ b/src/basic/def.h @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once -#include "util.h" - #define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC) #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC) #define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC) @@ -21,29 +19,6 @@ #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT #define SIGNALS_IGNORE SIGPIPE -#if HAVE_SPLIT_USR -#define KBD_KEYMAP_DIRS \ - "/usr/share/keymaps/\0" \ - "/usr/share/kbd/keymaps/\0" \ - "/usr/lib/kbd/keymaps/\0" \ - "/lib/kbd/keymaps/\0" -#else -#define KBD_KEYMAP_DIRS \ - "/usr/share/keymaps/\0" \ - "/usr/share/kbd/keymaps/\0" \ - "/usr/lib/kbd/keymaps/\0" -#endif - -/* Note that we use the new /run prefix here (instead of /var/run) since we require them to be aliases and that way we - * become independent of /var being mounted */ -#define DEFAULT_SYSTEM_BUS_ADDRESS "unix:path=/run/dbus/system_bus_socket" -#define DEFAULT_USER_BUS_ADDRESS_FMT "unix:path=%s/bus" - -#define PLYMOUTH_SOCKET { \ - .un.sun_family = AF_UNIX, \ - .un.sun_path = "\0/org/freedesktop/plymouthd", \ - } - #define NOTIFY_FD_MAX 768 #define NOTIFY_BUFFER_MAX PIPE_BUF diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h new file mode 100644 index 0000000000..2d72b8ce9e --- /dev/null +++ b/src/basic/errno-util.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include "macro.h" + +static inline void _reset_errno_(int *saved_errno) { + if (*saved_errno < 0) /* Invalidated by UNPROTECT_ERRNO? */ + return; + + errno = *saved_errno; +} + +#define PROTECT_ERRNO \ + _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno + +#define UNPROTECT_ERRNO \ + do { \ + errno = _saved_errno_; \ + _saved_errno_ = -1; \ + } while (false) + +static inline int negative_errno(void) { + /* This helper should be used to shut up gcc if you know 'errno' is + * negative. Instead of "return -errno;", use "return negative_errno();" + * It will suppress bogus gcc warnings in case it assumes 'errno' might + * be 0 and thus the caller's error-handling might not be triggered. */ + assert_return(errno > 0, -EINVAL); + return -errno; +} diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h index 9c9044669d..b9651205e6 100644 --- a/src/basic/fs-util.h +++ b/src/basic/fs-util.h @@ -10,8 +10,8 @@ #include #include +#include "errno-util.h" #include "time-util.h" -#include "util.h" int unlink_noerrno(const char *path); diff --git a/src/basic/kbd-util.c b/src/basic/kbd-util.c new file mode 100644 index 0000000000..17d4022dbe --- /dev/null +++ b/src/basic/kbd-util.c @@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ + +#include + +#include "kbd-util.h" +#include "log.h" +#include "nulstr-util.h" +#include "path-util.h" +#include "set.h" +#include "string-util.h" +#include "strv.h" +#include "utf8.h" + +static thread_local Set *keymaps = NULL; + +static int nftw_cb( + const char *fpath, + const struct stat *sb, + int tflag, + struct FTW *ftwbuf) { + + _cleanup_free_ char *p = NULL; + char *e; + int r; + + if (tflag != FTW_F) + return 0; + + if (!endswith(fpath, ".map") && + !endswith(fpath, ".map.gz")) + return 0; + + p = strdup(basename(fpath)); + if (!p) + return FTW_STOP; + + e = endswith(p, ".map"); + if (e) + *e = 0; + + e = endswith(p, ".map.gz"); + if (e) + *e = 0; + + if (!keymap_is_valid(p)) + return 0; + + r = set_consume(keymaps, TAKE_PTR(p)); + if (r < 0 && r != -EEXIST) + return r; + + return 0; +} + +int get_keymaps(char ***ret) { + _cleanup_strv_free_ char **l = NULL; + const char *dir; + int r; + + keymaps = set_new(&string_hash_ops); + if (!keymaps) + return -ENOMEM; + + NULSTR_FOREACH(dir, KBD_KEYMAP_DIRS) { + r = nftw(dir, nftw_cb, 20, FTW_PHYS|FTW_ACTIONRETVAL); + + if (r == FTW_STOP) + log_debug("Directory not found %s", dir); + else if (r < 0) + log_debug_errno(r, "Can't add keymap: %m"); + } + + l = set_get_strv(keymaps); + if (!l) { + set_free_free(keymaps); + return -ENOMEM; + } + + set_free(keymaps); + + if (strv_isempty(l)) + return -ENOENT; + + strv_sort(l); + + *ret = TAKE_PTR(l); + + return 0; +} + +bool keymap_is_valid(const char *name) { + + if (isempty(name)) + return false; + + if (strlen(name) >= 128) + return false; + + if (!utf8_is_valid(name)) + return false; + + if (!filename_is_valid(name)) + return false; + + if (!string_is_safe(name)) + return false; + + return true; +} diff --git a/src/basic/kbd-util.h b/src/basic/kbd-util.h new file mode 100644 index 0000000000..9efd2c7052 --- /dev/null +++ b/src/basic/kbd-util.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#if HAVE_SPLIT_USR +#define KBD_KEYMAP_DIRS \ + "/usr/share/keymaps/\0" \ + "/usr/share/kbd/keymaps/\0" \ + "/usr/lib/kbd/keymaps/\0" \ + "/lib/kbd/keymaps/\0" +#else +#define KBD_KEYMAP_DIRS \ + "/usr/share/keymaps/\0" \ + "/usr/share/kbd/keymaps/\0" \ + "/usr/lib/kbd/keymaps/\0" +#endif + +int get_keymaps(char ***l); +bool keymap_is_valid(const char *name); diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c index fc1577a83f..6f41f50641 100644 --- a/src/basic/locale-util.c +++ b/src/basic/locale-util.c @@ -255,99 +255,6 @@ out: return (bool) cached_answer; } -static thread_local Set *keymaps = NULL; - -static int nftw_cb( - const char *fpath, - const struct stat *sb, - int tflag, - struct FTW *ftwbuf) { - - char *p, *e; - int r; - - if (tflag != FTW_F) - return 0; - - if (!endswith(fpath, ".map") && - !endswith(fpath, ".map.gz")) - return 0; - - p = strdup(basename(fpath)); - if (!p) - return FTW_STOP; - - e = endswith(p, ".map"); - if (e) - *e = 0; - - e = endswith(p, ".map.gz"); - if (e) - *e = 0; - - r = set_consume(keymaps, p); - if (r < 0 && r != -EEXIST) - return r; - - return 0; -} - -int get_keymaps(char ***ret) { - _cleanup_strv_free_ char **l = NULL; - const char *dir; - int r; - - keymaps = set_new(&string_hash_ops); - if (!keymaps) - return -ENOMEM; - - NULSTR_FOREACH(dir, KBD_KEYMAP_DIRS) { - r = nftw(dir, nftw_cb, 20, FTW_PHYS|FTW_ACTIONRETVAL); - - if (r == FTW_STOP) - log_debug("Directory not found %s", dir); - else if (r < 0) - log_debug_errno(r, "Can't add keymap: %m"); - } - - l = set_get_strv(keymaps); - if (!l) { - set_free_free(keymaps); - return -ENOMEM; - } - - set_free(keymaps); - - if (strv_isempty(l)) - return -ENOENT; - - strv_sort(l); - - *ret = TAKE_PTR(l); - - return 0; -} - -bool keymap_is_valid(const char *name) { - - if (isempty(name)) - return false; - - if (strlen(name) >= 128) - return false; - - if (!utf8_is_valid(name)) - return false; - - if (!filename_is_valid(name)) - return false; - - if (!string_is_safe(name)) - return false; - - return true; -} - static bool emoji_enabled(void) { static int cached_emoji_enabled = -1; diff --git a/src/basic/locale-util.h b/src/basic/locale-util.h index e64f0ce15c..78abbafd8f 100644 --- a/src/basic/locale-util.h +++ b/src/basic/locale-util.h @@ -68,9 +68,6 @@ const char *special_glyph(SpecialGlyph code) _const_; const char* locale_variable_to_string(LocaleVariable i) _const_; LocaleVariable locale_variable_from_string(const char *s) _pure_; -int get_keymaps(char ***l); -bool keymap_is_valid(const char *name); - static inline void freelocalep(locale_t *p) { if (*p == (locale_t) 0) return; diff --git a/src/basic/log.c b/src/basic/log.c index 84621932db..3b7bff3a97 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -19,6 +19,7 @@ #include "sd-messages.h" #include "alloc-util.h" +#include "errno-util.h" #include "fd-util.h" #include "format-util.h" #include "io-util.h" @@ -37,7 +38,6 @@ #include "terminal-util.h" #include "time-util.h" #include "utf8.h" -#include "util.h" #define SNDBUF_SIZE (8*1024*1024) diff --git a/src/basic/memory-util.c b/src/basic/memory-util.c index 3b078af20b..5f327ef0d7 100644 --- a/src/basic/memory-util.c +++ b/src/basic/memory-util.c @@ -37,3 +37,21 @@ bool memeqzero(const void *data, size_t length) { /* Now we know first 16 bytes are NUL, memcmp with self. */ return memcmp(data, p + i, length) == 0; } + +#if !HAVE_EXPLICIT_BZERO +/* + * The pointer to memset() is volatile so that compiler must de-reference the pointer and can't assume that + * it points to any function in particular (such as memset(), which it then might further "optimize"). This + * approach is inspired by openssl's crypto/mem_clr.c. + */ +typedef void *(*memset_t)(void *,int,size_t); + +static volatile memset_t memset_func = memset; + +void* explicit_bzero_safe(void *p, size_t l) { + if (l > 0) + memset_func(p, '\0', l); + + return p; +} +#endif diff --git a/src/basic/memory-util.h b/src/basic/memory-util.h index 2d74b14a20..e1e6624d3b 100644 --- a/src/basic/memory-util.h +++ b/src/basic/memory-util.h @@ -51,3 +51,29 @@ static inline void *mempset(void *s, int c, size_t n) { memset(s, c, n); return (uint8_t*)s + n; } + +/* Normal memmem() requires haystack to be nonnull, which is annoying for zero-length buffers */ +static inline void *memmem_safe(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) { + + if (needlelen <= 0) + return (void*) haystack; + + if (haystacklen < needlelen) + return NULL; + + assert(haystack); + assert(needle); + + return memmem(haystack, haystacklen, needle, needlelen); +} + +#if HAVE_EXPLICIT_BZERO +static inline void* explicit_bzero_safe(void *p, size_t l) { + if (l > 0) + explicit_bzero(p, l); + + return p; +} +#else +void *explicit_bzero_safe(void *p, size_t l); +#endif diff --git a/src/basic/meson.build b/src/basic/meson.build index 30466ce946..91e0df3d2f 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -45,6 +45,7 @@ basic_sources = files(''' env-util.h errno-list.c errno-list.h + errno-util.h escape.c escape.h ether-addr-util.c @@ -75,6 +76,8 @@ basic_sources = files(''' io-util.c io-util.h ioprio.h + kbd-util.c + kbd-util.h khash.c khash.h label.c @@ -134,12 +137,16 @@ basic_sources = files(''' namespace-util.c namespace-util.h nss-util.h + nulstr-util.c + nulstr-util.h ordered-set.c ordered-set.h parse-util.c parse-util.h path-util.c path-util.h + plymouth-util.c + plymouth-util.h prioq.c prioq.h proc-cmdline.c diff --git a/src/basic/nulstr-util.c b/src/basic/nulstr-util.c new file mode 100644 index 0000000000..b12d020232 --- /dev/null +++ b/src/basic/nulstr-util.c @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ + +#include "nulstr-util.h" +#include "string-util.h" + +bool nulstr_contains(const char *nulstr, const char *needle) { + const char *i; + + if (!nulstr) + return false; + + NULSTR_FOREACH(i, nulstr) + if (streq(i, needle)) + return true; + + return false; +} diff --git a/src/basic/nulstr-util.h b/src/basic/nulstr-util.h new file mode 100644 index 0000000000..436b271f3c --- /dev/null +++ b/src/basic/nulstr-util.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include +#include + +#define NULSTR_FOREACH(i, l) \ + for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) + +#define NULSTR_FOREACH_PAIR(i, j, l) \ + for ((i) = (l), (j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr((j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i)) + +bool nulstr_contains(const char *nulstr, const char *needle); diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 1fa813b747..55cb140d87 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -21,6 +21,7 @@ #include "log.h" #include "macro.h" #include "missing.h" +#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" #include "stat-util.h" diff --git a/src/basic/plymouth-util.c b/src/basic/plymouth-util.c new file mode 100644 index 0000000000..2023ec3671 --- /dev/null +++ b/src/basic/plymouth-util.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ + +#include + +#include "plymouth-util.h" + +bool plymouth_running(void) { + return access("/run/plymouth/pid", F_OK) >= 0; +} diff --git a/src/basic/plymouth-util.h b/src/basic/plymouth-util.h new file mode 100644 index 0000000000..e0539910c4 --- /dev/null +++ b/src/basic/plymouth-util.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#define PLYMOUTH_SOCKET { \ + .un.sun_family = AF_UNIX, \ + .un.sun_path = "\0/org/freedesktop/plymouthd", \ + } + +bool plymouth_running(void); diff --git a/src/basic/rm-rf.h b/src/basic/rm-rf.h index 3ee2b97e37..d42ebef434 100644 --- a/src/basic/rm-rf.h +++ b/src/basic/rm-rf.h @@ -3,7 +3,7 @@ #include -#include "util.h" +#include "errno-util.h" typedef enum RemoveFlags { REMOVE_ONLY_DIRECTORIES = 1 << 0, diff --git a/src/basic/selinux-util.c b/src/basic/selinux-util.c index dc06f3d074..375da920f7 100644 --- a/src/basic/selinux-util.c +++ b/src/basic/selinux-util.c @@ -16,6 +16,7 @@ #endif #include "alloc-util.h" +#include "errno-util.h" #include "fd-util.h" #include "log.h" #include "macro.h" @@ -23,7 +24,6 @@ #include "selinux-util.h" #include "stdio-util.h" #include "time-util.h" -#include "util.h" #if HAVE_SELINUX DEFINE_TRIVIAL_CLEANUP_FUNC(char*, freecon); diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 93917bc0f0..5001a2be3a 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -10,14 +10,15 @@ #include "alloc-util.h" #include "escape.h" +#include "fileio.h" #include "gunicode.h" #include "locale-util.h" #include "macro.h" +#include "memory-util.h" #include "string-util.h" #include "terminal-util.h" #include "utf8.h" #include "util.h" -#include "fileio.h" int strcmp_ptr(const char *a, const char *b) { @@ -675,19 +676,6 @@ char *cellescape(char *buf, size_t len, const char *s) { return buf; } -bool nulstr_contains(const char *nulstr, const char *needle) { - const char *i; - - if (!nulstr) - return false; - - NULSTR_FOREACH(i, nulstr) - if (streq(i, needle)) - return true; - - return false; -} - char* strshorten(char *s, size_t l) { assert(s); @@ -1048,25 +1036,6 @@ int free_and_strndup(char **p, const char *s, size_t l) { return 1; } -#if !HAVE_EXPLICIT_BZERO -/* - * Pointer to memset is volatile so that compiler must de-reference - * the pointer and can't assume that it points to any function in - * particular (such as memset, which it then might further "optimize") - * This approach is inspired by openssl's crypto/mem_clr.c. - */ -typedef void *(*memset_t)(void *,int,size_t); - -static volatile memset_t memset_func = memset; - -void* explicit_bzero_safe(void *p, size_t l) { - if (l > 0) - memset_func(p, '\0', l); - - return p; -} -#endif - char* string_erase(char *x) { if (!x) return NULL; diff --git a/src/basic/string-util.h b/src/basic/string-util.h index 38070abb22..b0909dddca 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -165,8 +165,6 @@ char *cellescape(char *buf, size_t len, const char *s); /* This limit is arbitrary, enough to give some idea what the string contains */ #define CELLESCAPE_DEFAULT_LENGTH 64 -bool nulstr_contains(const char *nulstr, const char *needle); - char* strshorten(char *s, size_t l); char *strreplace(const char *text, const char *old_string, const char *new_string); @@ -184,32 +182,6 @@ int split_pair(const char *s, const char *sep, char **l, char **r); int free_and_strdup(char **p, const char *s); int free_and_strndup(char **p, const char *s, size_t l); -/* Normal memmem() requires haystack to be nonnull, which is annoying for zero-length buffers */ -static inline void *memmem_safe(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) { - - if (needlelen <= 0) - return (void*) haystack; - - if (haystacklen < needlelen) - return NULL; - - assert(haystack); - assert(needle); - - return memmem(haystack, haystacklen, needle, needlelen); -} - -#if HAVE_EXPLICIT_BZERO -static inline void* explicit_bzero_safe(void *p, size_t l) { - if (l > 0) - explicit_bzero(p, l); - - return p; -} -#else -void *explicit_bzero_safe(void *p, size_t l); -#endif - char *string_erase(char *x); char *string_free_erase(char *s); diff --git a/src/basic/strv.c b/src/basic/strv.c index 3700ce5b30..21c106149b 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -11,6 +11,7 @@ #include "escape.h" #include "extract-word.h" #include "fileio.h" +#include "nulstr-util.h" #include "sort-util.h" #include "string-util.h" #include "strv.h" diff --git a/src/basic/util.c b/src/basic/util.c index ce3e321925..93d610bc98 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -51,19 +51,6 @@ int saved_argc = 0; char **saved_argv = NULL; static int saved_in_initrd = -1; -bool plymouth_running(void) { - return access("/run/plymouth/pid", F_OK) >= 0; -} - -bool display_is_local(const char *display) { - assert(display); - - return - display[0] == ':' && - display[1] >= '0' && - display[1] <= '9'; -} - bool kexec_loaded(void) { _cleanup_free_ char *s = NULL; diff --git a/src/basic/util.h b/src/basic/util.h index 02fc31e69e..0d40db059a 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -43,16 +43,6 @@ static inline const char* enable_disable(bool b) { return b ? "enable" : "disable"; } -bool plymouth_running(void); - -bool display_is_local(const char *display) _pure_; - -#define NULSTR_FOREACH(i, l) \ - for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) - -#define NULSTR_FOREACH_PAIR(i, j, l) \ - for ((i) = (l), (j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr((j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i)) - extern int saved_argc; extern char **saved_argv; @@ -65,31 +55,6 @@ void in_initrd_force(bool value); int on_ac_power(void); -static inline void _reset_errno_(int *saved_errno) { - if (*saved_errno < 0) /* Invalidated by UNPROTECT_ERRNO? */ - return; - - errno = *saved_errno; -} - -#define PROTECT_ERRNO \ - _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno - -#define UNPROTECT_ERRNO \ - do { \ - errno = _saved_errno_; \ - _saved_errno_ = -1; \ - } while (false) - -static inline int negative_errno(void) { - /* This helper should be used to shut up gcc if you know 'errno' is - * negative. Instead of "return -errno;", use "return negative_errno();" - * It will suppress bogus gcc warnings in case it assumes 'errno' might - * be 0 and thus the caller's error-handling might not be triggered. */ - assert_return(errno > 0, -EINVAL); - return -errno; -} - static inline unsigned u64log2(uint64_t n) { #if __SIZEOF_LONG_LONG__ == 8 return (n > 1) ? (unsigned) __builtin_clzll(n) ^ 63U : 0; diff --git a/src/core/cgroup.c b/src/core/cgroup.c index ccf06173db..059bf29eb9 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -5,15 +5,16 @@ #include "alloc-util.h" #include "blockdev-util.h" +#include "bpf-devices.h" #include "bpf-firewall.h" #include "btrfs-util.h" -#include "bpf-devices.h" #include "bus-error.h" #include "cgroup-util.h" #include "cgroup.h" #include "fd-util.h" #include "fileio.h" #include "fs-util.h" +#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" #include "process-util.h" diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 805bdbca9b..2f62c7acb5 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -41,6 +41,7 @@ #include "log.h" #include "missing.h" #include "mountpoint-util.h" +#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" #include "process-util.h" diff --git a/src/core/main.c b/src/core/main.c index c0fa33bab4..981513bbc3 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -138,11 +138,11 @@ static EmergencyAction arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE; _noreturn_ static void freeze_or_exit_or_reboot(void) { - /* If we are running in a contianer, let's prefer exiting, after all we can propagate an exit code to the - * container manager, and thus inform it that something went wrong. */ + /* If we are running in a container, let's prefer exiting, after all we can propagate an exit code to + * the container manager, and thus inform it that something went wrong. */ if (detect_container() > 0) { log_emergency("Exiting PID 1..."); - exit(EXIT_EXCEPTION); + _exit(EXIT_EXCEPTION); } if (arg_crash_reboot) { diff --git a/src/core/manager.c b/src/core/manager.c index e60ee32b06..eecf48dea5 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -58,6 +58,7 @@ #include "parse-util.h" #include "path-lookup.h" #include "path-util.h" +#include "plymouth-util.h" #include "process-util.h" #include "ratelimit.h" #include "rlimit-util.h" diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c index 3ce6164b06..b97285e556 100644 --- a/src/core/mount-setup.c +++ b/src/core/mount-setup.c @@ -23,12 +23,12 @@ #include "mkdir.h" #include "mount-setup.h" #include "mountpoint-util.h" +#include "nulstr-util.h" #include "path-util.h" #include "set.h" #include "smack-util.h" #include "strv.h" #include "user-util.h" -#include "util.h" #include "virt.h" typedef enum MountMode { diff --git a/src/core/namespace.c b/src/core/namespace.c index 582f6cb249..e6013c757e 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -23,6 +23,7 @@ #include "mountpoint-util.h" #include "namespace-util.h" #include "namespace.h" +#include "nulstr-util.h" #include "path-util.h" #include "selinux-util.h" #include "socket-util.h" diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index a16ea1024b..87e0cefbab 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -16,12 +16,12 @@ #include "log.h" #include "main-func.h" #include "mount-util.h" +#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" +#include "pretty-print.h" #include "string-util.h" #include "strv.h" -#include "pretty-print.h" -#include "util.h" /* internal helper */ #define ANY_LUKS "LUKS" diff --git a/src/delta/delta.c b/src/delta/delta.c index 1ffbc6c571..c28a816d67 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -14,6 +14,7 @@ #include "locale-util.h" #include "log.h" #include "main-func.h" +#include "nulstr-util.h" #include "pager.h" #include "parse-util.h" #include "path-util.h" @@ -24,7 +25,6 @@ #include "string-util.h" #include "strv.h" #include "terminal-util.h" -#include "util.h" static const char prefixes[] = "/etc\0" diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index dde11576ea..6bbdafa81a 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -27,6 +27,7 @@ #include "fileio.h" #include "fs-util.h" #include "hostname-util.h" +#include "kbd-util.h" #include "locale-util.h" #include "main-func.h" #include "mkdir.h" diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 7777450c35..058a71b109 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -19,6 +19,7 @@ #include "main-func.h" #include "missing_capability.h" #include "nscd-flush.h" +#include "nulstr-util.h" #include "os-util.h" #include "parse-util.h" #include "path-util.h" diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c index 8618454131..5ef11fa1a4 100644 --- a/src/journal/journal-send.c +++ b/src/journal/journal-send.c @@ -13,6 +13,7 @@ #include "sd-journal.h" #include "alloc-util.h" +#include "errno-util.h" #include "fd-util.h" #include "io-util.h" #include "memfd-util.h" @@ -20,7 +21,6 @@ #include "stdio-util.h" #include "string-util.h" #include "tmpfile-util.h" -#include "util.h" #define SNDBUF_SIZE (8*1024*1024) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 9b813a14a0..42a5a09608 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -52,6 +52,7 @@ #include "logs-show.h" #include "memory-util.h" #include "mkdir.h" +#include "nulstr-util.h" #include "pager.h" #include "parse-util.h" #include "path-util.h" diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c index 7152564293..e2f7bd7ec4 100644 --- a/src/journal/mmap-cache.c +++ b/src/journal/mmap-cache.c @@ -5,6 +5,7 @@ #include #include "alloc-util.h" +#include "errno-util.h" #include "fd-util.h" #include "hashmap.h" #include "list.h" diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 0f996283cd..82e7d59fbb 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -32,6 +32,7 @@ #include "list.h" #include "lookup3.h" #include "missing.h" +#include "nulstr-util.h" #include "path-util.h" #include "process-util.h" #include "replace-var.h" diff --git a/src/journal/test-compress-benchmark.c b/src/journal/test-compress-benchmark.c index 1838f5b7d9..1005997058 100644 --- a/src/journal/test-compress-benchmark.c +++ b/src/journal/test-compress-benchmark.c @@ -5,12 +5,12 @@ #include "env-util.h" #include "macro.h" #include "memory-util.h" +#include "nulstr-util.h" #include "parse-util.h" #include "process-util.h" #include "random-util.h" #include "string-util.h" #include "tests.h" -#include "util.h" typedef int (compress_t)(const void *src, uint64_t src_size, void *dst, size_t dst_alloc_size, size_t *dst_size); diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c index dc952375b6..96319645d1 100644 --- a/src/libsystemd/sd-bus/bus-error.c +++ b/src/libsystemd/sd-bus/bus-error.c @@ -12,6 +12,7 @@ #include "alloc-util.h" #include "bus-error.h" #include "errno-list.h" +#include "errno-util.h" #include "string-util.h" #include "util.h" diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h index 63f1404758..c73860fb65 100644 --- a/src/libsystemd/sd-bus/bus-internal.h +++ b/src/libsystemd/sd-bus/bus-internal.h @@ -16,6 +16,11 @@ #include "socket-util.h" #include "util.h" +/* Note that we use the new /run prefix here (instead of /var/run) since we require them to be aliases and + * that way we become independent of /var being mounted */ +#define DEFAULT_SYSTEM_BUS_ADDRESS "unix:path=/run/dbus/system_bus_socket" +#define DEFAULT_USER_BUS_ADDRESS_FMT "unix:path=%s/bus" + struct reply_callback { sd_bus_message_handler_t callback; usec_t timeout_usec; /* this is a relative timeout until we reach the BUS_HELLO state, and an absolute one right after */ diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c index 6f17eeeee9..a0855001e3 100644 --- a/src/libsystemd/sd-device/device-private.c +++ b/src/libsystemd/sd-device/device-private.c @@ -16,6 +16,7 @@ #include "hashmap.h" #include "macro.h" #include "mkdir.h" +#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" #include "set.h" @@ -25,7 +26,6 @@ #include "strxcpyx.h" #include "tmpfile-util.h" #include "user-util.h" -#include "util.h" int device_add_property(sd_device *device, const char *key, const char *value) { int r; diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c index d8c37c3fd4..77531d9505 100644 --- a/src/libsystemd/sd-hwdb/sd-hwdb.c +++ b/src/libsystemd/sd-hwdb/sd-hwdb.c @@ -18,8 +18,8 @@ #include "hashmap.h" #include "hwdb-internal.h" #include "hwdb-util.h" +#include "nulstr-util.h" #include "string-util.h" -#include "util.h" struct sd_hwdb { unsigned n_ref; diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c index fdad3bd697..868cc023b1 100644 --- a/src/libsystemd/sd-resolve/sd-resolve.c +++ b/src/libsystemd/sd-resolve/sd-resolve.c @@ -16,6 +16,7 @@ #include "alloc-util.h" #include "dns-domain.h" +#include "errno-util.h" #include "fd-util.h" #include "io-util.h" #include "list.h" diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c index 6b6b32a591..67f33612de 100644 --- a/src/locale/keymap-util.c +++ b/src/locale/keymap-util.c @@ -6,17 +6,18 @@ #include #include "bus-util.h" -#include "def.h" -#include "env-file.h" #include "env-file-label.h" +#include "env-file.h" #include "env-util.h" #include "fd-util.h" #include "fileio-label.h" #include "fileio.h" +#include "kbd-util.h" #include "keymap-util.h" #include "locale-util.h" #include "macro.h" #include "mkdir.h" +#include "nulstr-util.h" #include "string-util.h" #include "strv.h" #include "tmpfile-util.h" diff --git a/src/locale/localectl.c b/src/locale/localectl.c index 683b127ba1..c8b195d9a6 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -11,9 +11,9 @@ #include "bus-error.h" #include "bus-util.h" -#include "def.h" #include "fd-util.h" #include "fileio.h" +#include "kbd-util.h" #include "locale-util.h" #include "main-func.h" #include "memory-util.h" diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index 997b74eb88..864b358eb9 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -15,9 +15,9 @@ #include "audit-util.h" #include "bus-common-errors.h" #include "bus-error.h" +#include "bus-internal.h" #include "bus-util.h" #include "cgroup-util.h" -#include "def.h" #include "fd-util.h" #include "fileio.h" #include "format-util.h" @@ -115,6 +115,15 @@ static int get_user_data( return PAM_SUCCESS; } +static bool display_is_local(const char *display) { + assert(display); + + return + display[0] == ':' && + display[1] >= '0' && + display[1] <= '9'; +} + static int socket_from_display(const char *display, char **path) { size_t k; char *f, *c; diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index b24698469d..c8607bcec3 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -37,6 +37,7 @@ #include "macro.h" #include "main-func.h" #include "mkdir.h" +#include "nulstr-util.h" #include "pager.h" #include "parse-util.h" #include "path-util.h" diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index c6cc82b12f..05203057b6 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -74,6 +74,7 @@ #include "nspawn-settings.h" #include "nspawn-setuid.h" #include "nspawn-stub-pid1.h" +#include "nulstr-util.h" #include "os-util.h" #include "pager.h" #include "parse-util.h" diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c index e491351dee..707caaa321 100644 --- a/src/nss-myhostname/nss-myhostname.c +++ b/src/nss-myhostname/nss-myhostname.c @@ -8,13 +8,13 @@ #include #include "alloc-util.h" +#include "errno-util.h" #include "hostname-util.h" #include "local-addresses.h" #include "macro.h" #include "nss-util.h" #include "signal-util.h" #include "string-util.h" -#include "util.h" /* We use 127.0.0.2 as IPv4 address. This has the advantage over * 127.0.0.1 that it can be translated back to the local hostname. For diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index da003e6aa7..a73ac939a7 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -9,6 +9,7 @@ #include "alloc-util.h" #include "bus-common-errors.h" #include "env-util.h" +#include "errno-util.h" #include "hostname-util.h" #include "in-addr-util.h" #include "macro.h" diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c index 8370fed076..12c9c4f7f3 100644 --- a/src/nss-resolve/nss-resolve.c +++ b/src/nss-resolve/nss-resolve.c @@ -9,13 +9,13 @@ #include "sd-bus.h" #include "bus-common-errors.h" +#include "errno-util.h" #include "in-addr-util.h" #include "macro.h" #include "nss-util.h" #include "resolved-def.h" -#include "string-util.h" -#include "util.h" #include "signal-util.h" +#include "string-util.h" NSS_GETHOSTBYNAME_PROTOTYPES(resolve); NSS_GETHOSTBYADDR_PROTOTYPES(resolve); diff --git a/src/portable/portable.c b/src/portable/portable.c index 9d0d21c115..44e6ca2d30 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -17,6 +17,7 @@ #include "loop-util.h" #include "machine-image.h" #include "mkdir.h" +#include "nulstr-util.h" #include "os-util.h" #include "path-lookup.h" #include "portable.h" diff --git a/src/reply-password/reply-password.c b/src/reply-password/reply-password.c index ee7a0ea130..f8f6c2d3ec 100644 --- a/src/reply-password/reply-password.c +++ b/src/reply-password/reply-password.c @@ -11,6 +11,7 @@ #include "fileio.h" #include "log.h" #include "macro.h" +#include "memory-util.h" #include "socket-util.h" #include "string-util.h" #include "util.h" diff --git a/src/resolve/resolved-dns-trust-anchor.c b/src/resolve/resolved-dns-trust-anchor.c index e5a27ca688..d25b5f9d95 100644 --- a/src/resolve/resolved-dns-trust-anchor.c +++ b/src/resolve/resolved-dns-trust-anchor.c @@ -9,6 +9,7 @@ #include "fd-util.h" #include "fileio.h" #include "hexdecoct.h" +#include "nulstr-util.h" #include "parse-util.h" #include "resolved-dns-dnssec.h" #include "resolved-dns-trust-anchor.h" diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c index 89d7a7d59b..52460cacad 100644 --- a/src/shared/base-filesystem.c +++ b/src/shared/base-filesystem.c @@ -13,10 +13,10 @@ #include "fd-util.h" #include "log.h" #include "macro.h" +#include "nulstr-util.h" #include "string-util.h" #include "umask-util.h" #include "user-util.h" -#include "util.h" typedef struct BaseFilesystem { const char *dir; diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index e7ee90aa9c..601bde6d4d 100644 --- a/src/shared/calendarspec.c +++ b/src/shared/calendarspec.c @@ -14,6 +14,7 @@ #include "alloc-util.h" #include "calendarspec.h" +#include "errno-util.h" #include "fileio.h" #include "macro.h" #include "parse-util.h" diff --git a/src/shared/clock-util.c b/src/shared/clock-util.c index 1877a81434..32cce1e109 100644 --- a/src/shared/clock-util.c +++ b/src/shared/clock-util.c @@ -12,11 +12,11 @@ #include "alloc-util.h" #include "clock-util.h" +#include "errno-util.h" #include "fd-util.h" #include "fileio.h" #include "macro.h" #include "string-util.h" -#include "util.h" int clock_get_hwclock(struct tm *tm) { _cleanup_close_ int fd = -1; diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index aa8283313f..2df09edaf5 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -19,6 +19,7 @@ #include "log.h" #include "macro.h" #include "missing.h" +#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" #include "process-util.h" diff --git a/src/shared/dev-setup.c b/src/shared/dev-setup.c index b545c2a1c0..12e80e4b98 100644 --- a/src/shared/dev-setup.c +++ b/src/shared/dev-setup.c @@ -8,10 +8,10 @@ #include "dev-setup.h" #include "label.h" #include "log.h" +#include "nulstr-util.h" #include "path-util.h" #include "umask-util.h" #include "user-util.h" -#include "util.h" int dev_setup(const char *prefix, uid_t uid, gid_t gid) { static const char symlinks[] = diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 201a515589..ce210bfd43 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -29,6 +29,7 @@ #include "missing.h" #include "mount-util.h" #include "mountpoint-util.h" +#include "nulstr-util.h" #include "os-util.h" #include "path-util.h" #include "process-util.h" diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c index 6fd9866c00..118d591c09 100644 --- a/src/shared/fstab-util.c +++ b/src/shared/fstab-util.c @@ -11,11 +11,11 @@ #include "fstab-util.h" #include "macro.h" #include "mount-util.h" +#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" #include "string-util.h" #include "strv.h" -#include "util.h" int fstab_has_fstype(const char *fstype) { _cleanup_endmntent_ FILE *f = NULL; diff --git a/src/shared/import-util.c b/src/shared/import-util.c index bcd6c0c5ea..dad6c1c2fe 100644 --- a/src/shared/import-util.c +++ b/src/shared/import-util.c @@ -8,10 +8,10 @@ #include "import-util.h" #include "log.h" #include "macro.h" +#include "nulstr-util.h" #include "path-util.h" #include "string-table.h" #include "string-util.h" -#include "util.h" int import_url_last_component(const char *url, char **ret) { const char *e, *p; diff --git a/src/shared/json.c b/src/shared/json.c index 55163a733b..253957d298 100644 --- a/src/shared/json.c +++ b/src/shared/json.c @@ -11,6 +11,7 @@ #include "sd-messages.h" #include "alloc-util.h" +#include "errno-util.h" #include "fd-util.h" #include "fileio.h" #include "float.h" diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index 3d61221056..c5a6f2d4ee 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -31,6 +31,7 @@ #include "machine-image.h" #include "macro.h" #include "mkdir.h" +#include "nulstr-util.h" #include "os-util.h" #include "path-util.h" #include "rm-rf.h" @@ -39,7 +40,6 @@ #include "strv.h" #include "time-util.h" #include "utf8.h" -#include "util.h" #include "xattr-util.h" static const char* const image_search_path[_IMAGE_CLASS_MAX] = { diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c index 98a0066bae..54f9679e16 100644 --- a/src/shared/seccomp-util.c +++ b/src/shared/seccomp-util.c @@ -10,15 +10,15 @@ #include "af-list.h" #include "alloc-util.h" +#include "errno-list.h" #include "macro.h" #include "nsflags.h" +#include "nulstr-util.h" #include "process-util.h" #include "seccomp-util.h" #include "set.h" #include "string-util.h" #include "strv.h" -#include "util.h" -#include "errno-list.h" const uint32_t seccomp_local_archs[] = { diff --git a/src/test/test-chown-rec.c b/src/test/test-chown-rec.c index 9e14672b2f..7e93e487d2 100644 --- a/src/test/test-chown-rec.c +++ b/src/test/test-chown-rec.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include +#include #include "alloc-util.h" #include "chown-recursive.h" diff --git a/src/test/test-condition.c b/src/test/test-condition.c index 5c2d00af88..875d0d56c5 100644 --- a/src/test/test-condition.c +++ b/src/test/test-condition.c @@ -19,15 +19,15 @@ #include "ima-util.h" #include "log.h" #include "macro.h" +#include "nulstr-util.h" #include "selinux-util.h" #include "set.h" #include "smack-util.h" #include "string-util.h" #include "strv.h" +#include "tests.h" #include "tomoyo-util.h" #include "user-util.h" -#include "tests.h" -#include "util.h" #include "virt.h" static void test_condition_test_path(void) { diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c index 5376aa84c4..325c3b32cc 100644 --- a/src/test/test-hashmap-plain.c +++ b/src/test/test-hashmap-plain.c @@ -3,11 +3,11 @@ #include "alloc-util.h" #include "hashmap.h" #include "log.h" +#include "nulstr-util.h" #include "stdio-util.h" #include "string-util.h" #include "strv.h" #include "tests.h" -#include "util.h" void test_hashmap_funcs(void); diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c index c6f8c1fb4f..f1d044082b 100644 --- a/src/test/test-locale-util.c +++ b/src/test/test-locale-util.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include "kbd-util.h" #include "locale-util.h" #include "macro.h" #include "strv.h" diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c index 65f1aae5a7..d79481853a 100644 --- a/src/test/test-seccomp.c +++ b/src/test/test-seccomp.c @@ -16,6 +16,7 @@ #include "memory-util.h" #include "missing.h" #include "nsflags.h" +#include "nulstr-util.h" #include "process-util.h" #include "raw-clone.h" #include "seccomp-util.h" diff --git a/src/test/test-strv.c b/src/test/test-strv.c index 31ef1abb44..18ad03669c 100644 --- a/src/test/test-strv.c +++ b/src/test/test-strv.c @@ -4,10 +4,10 @@ #include "alloc-util.h" #include "escape.h" +#include "nulstr-util.h" #include "specifier.h" #include "string-util.h" #include "strv.h" -#include "util.h" static void test_specifier_printf(void) { static const Specifier table[] = { diff --git a/src/test/test-util.c b/src/test/test-util.c index 1920cbc84a..120baa3593 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -5,10 +5,10 @@ #include #include -#include "def.h" #include "fileio.h" #include "fs-util.h" #include "limits-util.h" +#include "memory-util.h" #include "missing_syscall.h" #include "parse-util.h" #include "process-util.h" @@ -16,7 +16,7 @@ #include "rm-rf.h" #include "string-util.h" #include "tests.h" -#include "memory-util.h" +#include "util.h" static void test_align_power2(void) { unsigned long i, p2; diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index d974d4451d..2d3418dda1 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -34,6 +34,7 @@ #include "memory-util.h" #include "mkdir.h" #include "path-util.h" +#include "plymouth-util.h" #include "pretty-print.h" #include "process-util.h" #include "signal-util.h"