Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#991984: Please document minimal environment variable needed for sensible-utils

1 view
Skip to first unread message

Bastien Roucariès

unread,
Aug 7, 2021, 11:10:03 AM8/7/21
to
Package: debian-policy
Version: 4.5.1.0
Severity: important
Control: block 991982 by -1
Control: block 987675 by -1


Dear Maintainer,

For now $env -i sensible-utils, fail due to $HOME and $TERM not set.

I am for now working around HOME not set in sensible-utils core, but posix [1]
documentation does not document really the value that should be set for a
correct behavior of program.

Nevertheless:
- we should expect that PATH is set to a sensible value (note that it depends
of the shell), but nevertheless not setting PATH is not really safe
- HOME may not be set. If set the value may be incorrect (su -)
- TERM may not be set. If set the value may not be correct
- USER may not be set. If set the value may be incorrect (su -)

So I will like to have a footnote saying that sensible-pager/sensible-editor
etc, should test if they work under env -i, and if they do not work fallback to
return 126 (according to shell documentation Command invoked cannot execute),
thus allowing sensible-utils to fallback to vi that is safe and tested under
env -i

Bastien




[1] https://pubs.opengroup.org/onlinepubs/9699919799/

Bastien Roucariès

unread,
Aug 8, 2021, 11:10:03 AM8/8/21
to
Hi,

I believe we must follow POSIX way here [1].

May be a note saying that:
sensible-editor may be used in recovering situation. Therefore it could be
used in case where environment is unset (env -i) or where some filesystems are
not fully initialised. In this case it should behave like vi under a POSIX
system. Particularly TERM and HOME may be empty or unset. If sensible-editor
could not be run in this borderline case it should fail return error 126 in
order to fallback to safe default (vi)
[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html
signature.asc

Russ Allbery

unread,
Sep 18, 2022, 10:40:03 PM9/18/22
to
"Bastien Roucariès" <roucarie...@gmail.com> writes:

> Dear Maintainer,

> For now $env -i sensible-utils, fail due to $HOME and $TERM not set.

> I am for now working around HOME not set in sensible-utils core, but
> posix [1] documentation does not document really the value that should
> be set for a correct behavior of program.

> Nevertheless:
> - we should expect that PATH is set to a sensible value (note that it depends
> of the shell), but nevertheless not setting PATH is not really safe
> - HOME may not be set. If set the value may be incorrect (su -)
> - TERM may not be set. If set the value may not be correct
> - USER may not be set. If set the value may be incorrect (su -)

> So I will like to have a footnote saying that
> sensible-pager/sensible-editor etc, should test if they work under env
> -i, and if they do not work fallback to return 126 (according to shell
> documentation Command invoked cannot execute), thus allowing
> sensible-utils to fallback to vi that is safe and tested under env -i

I think it is a fine idea to attempt to support those situations in
sensible-editor and sensible-pager and document them there, but I'm not
sure what Policy change you're asking for here or why this would be a
matter for Policy.

Policy does not mandate any specific behavior for sensible-editor and
sensible-pager other than that they will implement the EDITOR and PAGER
environment variable checking for you. I think that's best left to the
maintainer of those programs to decide.

We also don't expect that the editor or pager invoked following the rules
in Policy 11.4 (and, by extension, sensible-editor and sensible-pager
themselves) will work in unusual situations, such as ones without standard
environment variables set. We can't: the user is free to set EDITOR and
PAGER to anything they chose, including programs not in Debian. So you
can't really expect any particular behavior from whatever EDITOR or PAGER
is set to. Maybe it will fail with a helpful error code, maybe it will
start and not work but not exit, maybe something else entirely will
happen. This is really outside of our control.

--
Russ Allbery (r...@debian.org) <https://www.eyrie.org/~eagle/>

Bastien Roucariès

unread,
Sep 10, 2023, 4:30:03 AM9/10/23
to
Le dimanche 10 septembre 2023, 04:33:06 UTC Debian Bug Tracking System a écrit :
> This is an automatic notification regarding your Bug report
> which was filed against the debian-policy package:
>
> #991984: Please document minimal environment variable needed for sensible-utils
>
> It has been closed by Russ Allbery <r...@debian.org>.
>
> Their explanation is attached below along with your original report.
> If this explanation is unsatisfactory and you have not received a
> better one in a separate message then please contact Russ Allbery <r...@debian.org> by
> replying to this email.
>
Seems sensible note that linux manpages mandate now some behavior for EDITOR, PAGER and VISUAL

Bastien

signature.asc

Edward Little

unread,
Sep 10, 2023, 9:20:05 PM9/10/23
to
Please remove the following email address:  e.lit...@gmail.com

On Sun, Sep 10, 2023 at 12:33 AM Debian Bug Tracking System <ow...@bugs.debian.org> wrote:
Your message dated Sat, 09 Sep 2023 21:28:34 -0700
with message-id <87jzsyz...@hope.eyrie.org>
and subject line Re: Bug#991984: Please document minimal environment variable needed for sensible-utils
has caused the Debian Bug report #991984,
regarding Please document minimal environment variable needed for sensible-utils
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


--
991984: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991984
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
---------- Forwarded message ----------
From: Russ Allbery <r...@debian.org>
To: "Bastien Roucariès" <roucarie...@gmail.com>
Cc: 99198...@bugs.debian.org
Bcc: 
Date: Sat, 09 Sep 2023 21:28:34 -0700
Subject: Re: Bug#991984: Please document minimal environment variable needed for sensible-utils

Russ Allbery <r...@debian.org> writes:

> Policy does not mandate any specific behavior for sensible-editor and
> sensible-pager other than that they will implement the EDITOR and PAGER
> environment variable checking for you.  I think that's best left to the
> maintainer of those programs to decide.

> We also don't expect that the editor or pager invoked following the
> rules in Policy 11.4 (and, by extension, sensible-editor and
> sensible-pager themselves) will work in unusual situations, such as ones
> without standard environment variables set.  We can't: the user is free
> to set EDITOR and PAGER to anything they chose, including programs not
> in Debian.  So you can't really expect any particular behavior from
> whatever EDITOR or PAGER is set to.  Maybe it will fail with a helpful
> error code, maybe it will start and not work but not exit, maybe
> something else entirely will happen.  This is really outside of our
> control.

There was no further discussion of this over the past year, so I'm going
to go ahead and close this bug with the above comment.

Edward Little

unread,
Sep 10, 2023, 9:20:05 PM9/10/23
to
Please remove the following email address:  e.lit...@gmail.com

0 new messages