Merge pull request #17359 from poettering/lesssecuresecure

paranoia: getenv_bool_secure("SYSTEMD_PAGERSECURE")
This commit is contained in:
Lennart Poettering 2020-10-15 13:55:57 +02:00 committed by GitHub
commit 4aa2f53a35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -171,7 +171,7 @@ int pager_open(PagerFlags flags) {
* pager. If they didn't, use secure mode when under euid is changed. If $SYSTEMD_PAGERSECURE
* wasn't explicitly set, and we autodetect the need for secure mode, only use the pager we
* know to be good. */
int use_secure_mode = getenv_bool("SYSTEMD_PAGERSECURE");
int use_secure_mode = getenv_bool_secure("SYSTEMD_PAGERSECURE");
bool trust_pager = use_secure_mode >= 0;
if (use_secure_mode == -ENXIO) {
uid_t uid;

View File

@ -63,7 +63,7 @@ int show_environment(int argc, char *argv[], void *userdata) {
static void invalid_callback(const char *p, void *userdata) {
_cleanup_free_ char *t = cescape(p);
log_debug("Ignoring invalid environment assignment \"%s\".", strnull(t));
}
@ -120,13 +120,13 @@ int import_environment(int argc, char *argv[], void *userdata) {
if (argc < 2) {
_cleanup_strv_free_ char **copy = NULL;
copy = strv_copy(environ);
if (!copy)
return log_oom();
strv_env_clean_with_callback(copy, invalid_callback, NULL);
r = sd_bus_message_append_strv(m, copy);
} else {