Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Michael Biebl

Am 25.05.22 um 16:06 schrieb Vincent Lefevre:


The fact that the user doesn't run it himself doesn't matter.


Sure it does.



OpenPGP_signature
Description: OpenPGP digital signature


Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Vincent Lefevre
On 2022-05-25 15:54:02 +0200, Michael Biebl wrote:
> Am 25.05.2022 um 15:52 schrieb Vincent Lefevre:
> > On 2022-05-25 15:13:58 +0200, Michael Biebl wrote:
> > > It doesn't pass the LESS environment variable that's defined in the user
> > > session to the pager but runs that program in a defined, fixed and tested
> > > environment.
> > 
> > Since the user controls that program, e.g. by writing a script
> > called "pager" under his $PATH (e.g. in $HOME/bin), thus may
> > change the environment there, I'm wondering what you mean by
> > "fixed and tested environment".
> 
> It's not you/the user calling less, but systemd. Maybe that's your
> misconception.

My point is the end user chooses what this pager is. For instance,
in the ps output, as a child of journalctl:

vlefevre  112315  112314  0 16:03 pts/15   00:00:00 /bin/sh 
/home/vlefevre/bin/pager

The fact that the user doesn't run it himself doesn't matter.
So there is no such thing of "fixed and tested environment":
the user has the full control of what is run.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Michael Biebl

Am 25.05.2022 um 15:52 schrieb Vincent Lefevre:

On 2022-05-25 15:13:58 +0200, Michael Biebl wrote:

It doesn't pass the LESS environment variable that's defined in the user
session to the pager but runs that program in a defined, fixed and tested
environment.


Since the user controls that program, e.g. by writing a script
called "pager" under his $PATH (e.g. in $HOME/bin), thus may
change the environment there, I'm wondering what you mean by
"fixed and tested environment".



It's not you/the user calling less, but systemd. Maybe that's your 
misconception.




OpenPGP_signature
Description: OpenPGP digital signature


Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Vincent Lefevre
On 2022-05-25 15:13:58 +0200, Michael Biebl wrote:
> It doesn't pass the LESS environment variable that's defined in the user
> session to the pager but runs that program in a defined, fixed and tested
> environment.

Since the user controls that program, e.g. by writing a script
called "pager" under his $PATH (e.g. in $HOME/bin), thus may
change the environment there, I'm wondering what you mean by
"fixed and tested environment".

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Michael Biebl

Am 25.05.2022 um 15:41 schrieb Vincent Lefevre:

On 2022-05-25 15:22:26 +0200, Michael Biebl wrote:

Am 25.05.22 um 14:51 schrieb Vincent Lefevre:


user's LESS environment variable, like "-i"). If it passes
options via the LESS environment variable, then the manual
should say something like

Override the options passed to less via the LESS environment
variable, which is set to "FRSXMK" by default.


Mentioning the LESS variable here is an implementation detail and I don't
see how it makes it makes it any clearer what options are passed to less.


This is not just an implementation detail, because it has a visible
effect on the behavior when the user has a LESS environment variable.

   export LESS=FRSXMK ; less

is not the same thing as

   less -FRSXMK

So the user needs to know that systemd chooses something equivalent
to the former.



No, not really. The documentation says pretty clearly and explicitly 
which options are passed to less and ways to override that (and it does 
so reliably).


It doesn't go into details about LESS because that would only be a 
distraction.





OpenPGP_signature
Description: OpenPGP digital signature


Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Vincent Lefevre
On 2022-05-25 15:22:26 +0200, Michael Biebl wrote:
> Am 25.05.22 um 14:51 schrieb Vincent Lefevre:
> 
> > user's LESS environment variable, like "-i"). If it passes
> > options via the LESS environment variable, then the manual
> > should say something like
> > 
> >Override the options passed to less via the LESS environment
> >variable, which is set to "FRSXMK" by default.
> 
> Mentioning the LESS variable here is an implementation detail and I don't
> see how it makes it makes it any clearer what options are passed to less.

This is not just an implementation detail, because it has a visible
effect on the behavior when the user has a LESS environment variable.

  export LESS=FRSXMK ; less

is not the same thing as

  less -FRSXMK

So the user needs to know that systemd chooses something equivalent
to the former.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Michael Biebl

Am 25.05.22 um 14:51 schrieb Vincent Lefevre:


user's LESS environment variable, like "-i"). If it passes
options via the LESS environment variable, then the manual
should say something like

   Override the options passed to less via the LESS environment
   variable, which is set to "FRSXMK" by default.


Mentioning the LESS variable here is an implementation detail and I 
don't see how it makes it makes it any clearer what options are passed 
to less.


OpenPGP_signature
Description: OpenPGP digital signature


Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Michael Biebl

Am 25.05.22 um 14:51 schrieb Vincent Lefevre:

Control: reopen -1

On 2022-05-25 13:28:31 +0200, Michael Biebl wrote:

Am 24.05.22 um 15:23 schrieb Vincent Lefevre:

Package: systemd
Version: 251-2
Severity: minor

Note: on my machine, /usr/bin/pager points to the "less" alternative.

When I run journalctl, searching for strings in the "less" pager is
case-sensitive, while I have -i in $LESS.

I've eventually found that my LESS environment variable was replaced
by "FRSXMK", but this is not documented.


This is documented here:
https://www.freedesktop.org/software/systemd/man/journalctl.html#%24SYSTEMD_LESS


There is no mention of the LESS environment variable there.
As I read "options passed to less", this consists in running
"less -FRSXMK" (this is the usual way options are passed to
programs and has the advantage to honor some options of the
user's LESS environment variable, like "-i"). If it passes
options via the LESS environment variable, then the manual
should say something like


It doesn't pass the LESS environment variable that's defined in the user 
session to the pager but runs that program in a defined, fixed and 
tested environment.


Internally it uses the LESS environment variable to pass those options 
to less.


See
https://github.com/systemd/systemd/blob/main/src/shared/pager.c#L132
https://github.com/systemd/systemd/blob/main/src/shared/pager.c#L158


It's basically the same with systemctl, where the environment of the 
user executing the command does not leak into the environment of the 
service (say PATH).


This is by design I'd say.






OpenPGP_signature
Description: OpenPGP digital signature


Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-25 Thread Vincent Lefevre
Control: reopen -1

On 2022-05-25 13:28:31 +0200, Michael Biebl wrote:
> Am 24.05.22 um 15:23 schrieb Vincent Lefevre:
> > Package: systemd
> > Version: 251-2
> > Severity: minor
> > 
> > Note: on my machine, /usr/bin/pager points to the "less" alternative.
> > 
> > When I run journalctl, searching for strings in the "less" pager is
> > case-sensitive, while I have -i in $LESS.
> > 
> > I've eventually found that my LESS environment variable was replaced
> > by "FRSXMK", but this is not documented.
> 
> This is documented here:
> https://www.freedesktop.org/software/systemd/man/journalctl.html#%24SYSTEMD_LESS

There is no mention of the LESS environment variable there.
As I read "options passed to less", this consists in running
"less -FRSXMK" (this is the usual way options are passed to
programs and has the advantage to honor some options of the
user's LESS environment variable, like "-i"). If it passes
options via the LESS environment variable, then the manual
should say something like

  Override the options passed to less via the LESS environment
  variable, which is set to "FRSXMK" by default.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

2022-05-24 Thread Vincent Lefevre
Package: systemd
Version: 251-2
Severity: minor

Note: on my machine, /usr/bin/pager points to the "less" alternative.

When I run journalctl, searching for strings in the "less" pager is
case-sensitive, while I have -i in $LESS.

I've eventually found that my LESS environment variable was replaced
by "FRSXMK", but this is not documented. I could see this by putting
a "pager" script in my $PATH, where I output the $LESS value.

Well, journalctl(1) mentions "FRSXMK", but nothing about the LESS
environment variable (these options could be passed as a "less"
argument), and what "default" means is ambiguous (when the user
defines $LESS, he changes the default).

If the user has his own LESS environment variable, it should be kept,
otherwise the behavior is surprising.

-- Package-specific info:

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'stable-security'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.17.0-2-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages systemd depends on:
ii  adduser  3.121
ii  libacl1  2.3.1-1
ii  libapparmor1 3.0.4-2
ii  libaudit11:3.0.7-1+b1
ii  libblkid12.38-4
ii  libc62.33-7
ii  libcap2  1:2.44-1
ii  libcrypt11:4.4.27-1.1
ii  libcryptsetup12  2:2.4.3-1
ii  libfdisk12.38-4
ii  libgcrypt20  1.10.1-2
ii  libgnutls30  3.7.4-2
ii  libgpg-error01.45-2
ii  libip4tc21.8.8-1
ii  libkmod2 29-1
ii  liblz4-1 1.9.3-2
ii  liblzma5 5.2.5-2.1
ii  libmount12.38-4
ii  libpam0g 1.4.0-13
ii  libseccomp2  2.5.4-1
ii  libselinux1  3.3-1+b2
ii  libsystemd0  251-2
ii  libzstd1 1.5.2+dfsg-1
ii  mount2.38-4
ii  util-linux   2.38-4

Versions of packages systemd recommends:
ii  dbus [default-dbus-system-bus]   1.14.0-1
ii  systemd-timesyncd [time-daemon]  251-2

Versions of packages systemd suggests:
ii  libfido2-11.11.0-1
pn  libtss2-esys-3.0.2-0  
pn  libtss2-mu0   
pn  libtss2-rc0   
ii  policykit-1   0.105-33
pn  systemd-container 

Versions of packages systemd is related to:
ii  dbus-user-session  1.14.0-1
pn  dracut 
ii  initramfs-tools0.141
ii  libnss-systemd 251-2
ii  libpam-systemd 251-2
ii  udev   251-2

-- Configuration Files:
/etc/systemd/journald.conf changed:
[Journal]
Storage=persistent

/etc/systemd/system.conf changed:
[Manager]
DefaultTimeoutStopSec=20s


-- no debconf information

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)