summaryrefslogtreecommitdiff
path: root/src/shared/pager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-29 18:13:38 +0100
committerLennart Poettering <lennart@poettering.net>2018-01-04 13:27:27 +0100
commit85afeae88c59ce3e6fb534facbcc6fc819f95a0f (patch)
treebc243b9cc0905dd5f878e5a2dc9fce76f4884800 /src/shared/pager.c
parentb4a343112e465be168e6f868003e3e6c9cc4dae7 (diff)
downloadsystemd-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.c3
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");