]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/pager.c
pager: make pager secure when under euid is changed or explicitly requested 17270/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Oct 2020 09:15:05 +0000 (11:15 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 14 Oct 2020 08:04:12 +0000 (10:04 +0200)
commit0a42426d797406b4b01a0d9c13bb759c2629d108
treed7651fb8af1a2fb3ca22e78451282f12f39019a5
parent1b5b507cd2d1d7a2b053151abb548475ad9c5c3b
pager: make pager secure when under euid is changed or explicitly requested

The variable is renamed to SYSTEMD_PAGERSECURE (because it's not just about
less now), and we automatically enable secure mode in certain cases, but not
otherwise.

This approach is more nuanced, but should provide a better experience for
users:

- Previusly we would set LESSSECURE=1 and trust the pager to make use of
  it. But this has an effect only on less. We need to not start pagers which
  are insecure when in secure mode. In particular more is like that and is a
  very popular pager.

- We don't enable secure mode always, which means that those other pagers can
  reasonably used.

- We do the right thing by default, but the user has ultimate control by
  setting SYSTEMD_PAGERSECURE.

Fixes #5666.

v2:
- also check $PKEXEC_UID

v3:
- use 'sd_pid_get_owner_uid() != geteuid()' as the condition
man/less-variables.xml
src/shared/pager.c