mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-10 00:58:20 +03:00
Merge pull request #17359 from poettering/lesssecuresecure
paranoia: getenv_bool_secure("SYSTEMD_PAGERSECURE")
This commit is contained in:
commit
4aa2f53a35
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user