diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-29 18:13:38 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-01-04 13:27:27 +0100 |
commit | 85afeae88c59ce3e6fb534facbcc6fc819f95a0f (patch) | |
tree | bc243b9cc0905dd5f878e5a2dc9fce76f4884800 /src/shared/pager.c | |
parent | b4a343112e465be168e6f868003e3e6c9cc4dae7 (diff) | |
download | systemd-85afeae88c59ce3e6fb534facbcc6fc819f95a0f.tar.gz |
pager,agent: insist that we are called from the main thread
We maintain static process-wide variables in these subsystems without
locking, hence let's refuse operation unless we are called from the main
thread (which we do anyway) just as a safety precaution.
Diffstat (limited to 'src/shared/pager.c')
-rw-r--r-- | src/shared/pager.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/pager.c b/src/shared/pager.c index 18c8f6c18c..d26fa0e6fb 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -73,6 +73,9 @@ int pager_open(bool no_pager, bool jump_to_end) { if (terminal_is_dumb()) return 0; + if (!is_main_thread()) + return -EPERM; + pager = getenv("SYSTEMD_PAGER"); if (!pager) pager = getenv("PAGER"); |