0a42426 pager: make pager secure when under euid is changed or explicitly requested

Authored and Committed by zbyszek 3 years ago
    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
    
        
file modified
+24 -6
file modified
+42 -21