diff options
author | Luca Boccassi <bluca@debian.org> | 2024-02-28 19:01:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-28 19:01:52 +0100 |
commit | e72ae41b51a2738438e1f3669265d7c37d9d33f6 (patch) | |
tree | e63e9bf02843994665b058cb13dc109eedf897ad /src/basic | |
parent | Merge pull request #31526 from poettering/proc-cmdline-underscorify (diff) | |
parent | env-util: also rename getenv_uint64_secure() → secure_getenv_uint64() (diff) | |
download | systemd-e72ae41b51a2738438e1f3669265d7c37d9d33f6.tar.xz systemd-e72ae41b51a2738438e1f3669265d7c37d9d33f6.zip |
Merge pull request #31524 from poettering/secure-getenv-naming-fix
change naming order getenv_xyz_secure() → secure_getenv_xyz() to match glibc
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/env-util.c | 4 | ||||
-rw-r--r-- | src/basic/env-util.h | 4 | ||||
-rw-r--r-- | src/basic/initrd-util.c | 2 | ||||
-rw-r--r-- | src/basic/locale-util.c | 2 | ||||
-rw-r--r-- | src/basic/log.c | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 3bb2654657..7608f90a4a 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -963,7 +963,7 @@ int getenv_bool(const char *p) { return parse_boolean(e); } -int getenv_bool_secure(const char *p) { +int secure_getenv_bool(const char *p) { const char *e; e = secure_getenv(p); @@ -973,7 +973,7 @@ int getenv_bool_secure(const char *p) { return parse_boolean(e); } -int getenv_uint64_secure(const char *p, uint64_t *ret) { +int secure_getenv_uint64(const char *p, uint64_t *ret) { const char *e; assert(p); diff --git a/src/basic/env-util.h b/src/basic/env-util.h index 15d867a3d9..6610ca8ca1 100644 --- a/src/basic/env-util.h +++ b/src/basic/env-util.h @@ -62,9 +62,9 @@ static inline char* strv_env_get(char * const *x, const char *n) { char *strv_env_pairs_get(char **l, const char *name) _pure_; int getenv_bool(const char *p); -int getenv_bool_secure(const char *p); +int secure_getenv_bool(const char *p); -int getenv_uint64_secure(const char *p, uint64_t *ret); +int secure_getenv_uint64(const char *p, uint64_t *ret); /* Like setenv, but calls unsetenv if value == NULL. */ int set_unset_env(const char *name, const char *value, bool overwrite); diff --git a/src/basic/initrd-util.c b/src/basic/initrd-util.c index 03ccfbe483..d3aa933977 100644 --- a/src/basic/initrd-util.c +++ b/src/basic/initrd-util.c @@ -21,7 +21,7 @@ bool in_initrd(void) { * This can be overridden by setting SYSTEMD_IN_INITRD=0|1. */ - r = getenv_bool_secure("SYSTEMD_IN_INITRD"); + r = secure_getenv_bool("SYSTEMD_IN_INITRD"); if (r < 0 && r != -ENXIO) log_debug_errno(r, "Failed to parse $SYSTEMD_IN_INITRD, ignoring: %m"); diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c index e6da5dbc63..23565273dd 100644 --- a/src/basic/locale-util.c +++ b/src/basic/locale-util.c @@ -295,7 +295,7 @@ bool is_locale_utf8(void) { if (cached_answer >= 0) goto out; - r = getenv_bool_secure("SYSTEMD_UTF8"); + r = secure_getenv_bool("SYSTEMD_UTF8"); if (r >= 0) { cached_answer = r; goto out; diff --git a/src/basic/log.c b/src/basic/log.c index 7ddca92afa..172a2c8ada 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -1674,7 +1674,7 @@ bool log_context_enabled(void) { if (saved_log_context_enabled >= 0) return saved_log_context_enabled; - r = getenv_bool_secure("SYSTEMD_ENABLE_LOG_CONTEXT"); + r = secure_getenv_bool("SYSTEMD_ENABLE_LOG_CONTEXT"); if (r < 0 && r != -ENXIO) log_debug_errno(r, "Failed to parse $SYSTEMD_ENABLE_LOG_CONTEXT, ignoring: %m"); |