* [PATCH] environ.7: Document the valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL
@ 2021-01-19 20:45 Alejandro Colomar
2021-01-20 8:34 ` AW: " Walter Harms
2021-01-20 8:48 ` Michael Kerrisk (man-pages)
0 siblings, 2 replies; 3+ messages in thread
From: Alejandro Colomar @ 2021-01-19 20:45 UTC (permalink / raw)
To: mtk.manpages
Cc: roucaries.bastien, Bastien Roucariès, linux-man,
Dr . Tobias Quathamer, Vincent Lefevre, Alejandro Colomar
From: Bastien Roucariès <rouca@debian.org>
The environ(7) man page says:
SHELL The pathname of the user's login shell.
PAGER The user's preferred utility to display text files.
EDITOR/VISUAL
The user's preferred utility to edit text files.
but doesn't say whether the pathnames must be absolute or they can
be resolved using $PATH, or whether they can have options.
Note that at least for SHELL, this is not specified by POSIX.
This issue was raised in the Austin Group mailing-list, and the answer
is that "what constitutes a valid value for a platform
should be documented" [1].
Since OpenSSH assumes that $SHELL is an absolute pathname (when set),
it is supposed that the documentation should be:
SHELL The absolute pathname of the user's login shell.
For PAGER, POSIX says: "Any string acceptable as a command_string
operand to the sh -c command shall be valid."
For EDITOR, it does not need to be an absolute pathname since POSIX
gives the example:
EDITOR=vi fc
and since it is specified as "the name of a utility", It assumes that
arguments (options) must not be provided. Page 3013 about "more", it
is said: "If the last pathname component in EDITOR is either vi or ex,
[...]", thus again, it is assumed to be a pathname.
For VISUAL, POSIX says: "Determine a pathname of a utility to invoke
when the visual command [...]", thus it is also a pathname. It is not
clear whether the pathname must be absolute, but for consistency with
EDITOR, it will be resolved using $PATH.
[1] https://www.mail-archive.com/austin-group-l@opengroup.org/msg01399.html
Reported-by: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Bastien Roucaries <rouca@debian.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man7/environ.7 | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/man7/environ.7 b/man7/environ.7
index 7d2bc5a86..b30f9a38e 100644
--- a/man7/environ.7
+++ b/man7/environ.7
@@ -113,16 +113,22 @@ The current working directory.
Set by some shells.
.TP
.B SHELL
-The pathname of the user's login shell.
+The absolute pathname of the user's login shell.
.TP
.B TERM
The terminal type for which output is to be prepared.
.TP
.B PAGER
The user's preferred utility to display text files.
+Any string acceptable as a command_string operand to the
+.I sh -c
+command shall be valid.
.TP
.BR EDITOR / VISUAL
The user's preferred utility to edit text files.
+Any string acceptable as a command_string operand to the
+.I sh -c
+command shall be valid.
.\" .TP
.\" .B BROWSER
.\" The user's preferred utility to browse URLs. Sequence of colon-separated
--
2.30.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* AW: [PATCH] environ.7: Document the valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL
2021-01-19 20:45 [PATCH] environ.7: Document the valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL Alejandro Colomar
@ 2021-01-20 8:34 ` Walter Harms
2021-01-20 8:48 ` Michael Kerrisk (man-pages)
1 sibling, 0 replies; 3+ messages in thread
From: Walter Harms @ 2021-01-20 8:34 UTC (permalink / raw)
To: Alejandro Colomar, mtk.manpages
Cc: roucaries.bastien, Bastien Roucariès, linux-man,
Dr . Tobias Quathamer, Vincent Lefevre
FYI:
i took a dive into busybox to see what is expected for SHELL there.
According to the code the value is used like the path in
struct passwd. In the end the value was executed via execv.
I have to admit that i always use a absolute value and was curious.
jm2c,
wh
________________________________________
Von: Alejandro Colomar <alx.manpages@gmail.com>
Gesendet: Dienstag, 19. Januar 2021 21:45:00
An: mtk.manpages@gmail.com
Cc: roucaries.bastien@gmail.com; Bastien Roucariès; linux-man@vger.kernel.org; Dr . Tobias Quathamer; Vincent Lefevre; Alejandro Colomar
Betreff: [PATCH] environ.7: Document the valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL
From: Bastien Roucariès <rouca@debian.org>
The environ(7) man page says:
SHELL The pathname of the user's login shell.
PAGER The user's preferred utility to display text files.
EDITOR/VISUAL
The user's preferred utility to edit text files.
but doesn't say whether the pathnames must be absolute or they can
be resolved using $PATH, or whether they can have options.
Note that at least for SHELL, this is not specified by POSIX.
This issue was raised in the Austin Group mailing-list, and the answer
is that "what constitutes a valid value for a platform
should be documented" [1].
Since OpenSSH assumes that $SHELL is an absolute pathname (when set),
it is supposed that the documentation should be:
SHELL The absolute pathname of the user's login shell.
For PAGER, POSIX says: "Any string acceptable as a command_string
operand to the sh -c command shall be valid."
For EDITOR, it does not need to be an absolute pathname since POSIX
gives the example:
EDITOR=vi fc
and since it is specified as "the name of a utility", It assumes that
arguments (options) must not be provided. Page 3013 about "more", it
is said: "If the last pathname component in EDITOR is either vi or ex,
[...]", thus again, it is assumed to be a pathname.
For VISUAL, POSIX says: "Determine a pathname of a utility to invoke
when the visual command [...]", thus it is also a pathname. It is not
clear whether the pathname must be absolute, but for consistency with
EDITOR, it will be resolved using $PATH.
[1] https://www.mail-archive.com/austin-group-l@opengroup.org/msg01399.html
Reported-by: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Bastien Roucaries <rouca@debian.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man7/environ.7 | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/man7/environ.7 b/man7/environ.7
index 7d2bc5a86..b30f9a38e 100644
--- a/man7/environ.7
+++ b/man7/environ.7
@@ -113,16 +113,22 @@ The current working directory.
Set by some shells.
.TP
.B SHELL
-The pathname of the user's login shell.
+The absolute pathname of the user's login shell.
.TP
.B TERM
The terminal type for which output is to be prepared.
.TP
.B PAGER
The user's preferred utility to display text files.
+Any string acceptable as a command_string operand to the
+.I sh -c
+command shall be valid.
.TP
.BR EDITOR / VISUAL
The user's preferred utility to edit text files.
+Any string acceptable as a command_string operand to the
+.I sh -c
+command shall be valid.
.\" .TP
.\" .B BROWSER
.\" The user's preferred utility to browse URLs. Sequence of colon-separated
--
2.30.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] environ.7: Document the valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL
2021-01-19 20:45 [PATCH] environ.7: Document the valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL Alejandro Colomar
2021-01-20 8:34 ` AW: " Walter Harms
@ 2021-01-20 8:48 ` Michael Kerrisk (man-pages)
1 sibling, 0 replies; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-01-20 8:48 UTC (permalink / raw)
To: Alejandro Colomar
Cc: mtk.manpages, roucaries.bastien, Bastien Roucariès,
linux-man, Dr . Tobias Quathamer, Vincent Lefevre
Hi Alex,
On 1/19/21 9:45 PM, Alejandro Colomar wrote:
> From: Bastien Roucariès <rouca@debian.org>
>
> The environ(7) man page says:
>
> SHELL The pathname of the user's login shell.
>
> PAGER The user's preferred utility to display text files.
>
> EDITOR/VISUAL
> The user's preferred utility to edit text files.
>
> but doesn't say whether the pathnames must be absolute or they can
> be resolved using $PATH, or whether they can have options.
>
> Note that at least for SHELL, this is not specified by POSIX.
> This issue was raised in the Austin Group mailing-list, and the answer
> is that "what constitutes a valid value for a platform
> should be documented" [1].
>
> Since OpenSSH assumes that $SHELL is an absolute pathname (when set),
> it is supposed that the documentation should be:
>
> SHELL The absolute pathname of the user's login shell.
>
> For PAGER, POSIX says: "Any string acceptable as a command_string
> operand to the sh -c command shall be valid."
>
> For EDITOR, it does not need to be an absolute pathname since POSIX
> gives the example:
>
> EDITOR=vi fc
>
> and since it is specified as "the name of a utility", It assumes that
> arguments (options) must not be provided. Page 3013 about "more", it
> is said: "If the last pathname component in EDITOR is either vi or ex,
> [...]", thus again, it is assumed to be a pathname.
>
> For VISUAL, POSIX says: "Determine a pathname of a utility to invoke
> when the visual command [...]", thus it is also a pathname. It is not
> clear whether the pathname must be absolute, but for consistency with
> EDITOR, it will be resolved using $PATH.
>
> [1] https://www.mail-archive.com/austin-group-l@opengroup.org/msg01399.html
>
> Reported-by: Vincent Lefevre <vincent@vinc17.net>
> Signed-off-by: Bastien Roucaries <rouca@debian.org>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Thanks. Patych applied.
Cheers,
Michael
> ---
> man7/environ.7 | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/man7/environ.7 b/man7/environ.7
> index 7d2bc5a86..b30f9a38e 100644
> --- a/man7/environ.7
> +++ b/man7/environ.7
> @@ -113,16 +113,22 @@ The current working directory.
> Set by some shells.
> .TP
> .B SHELL
> -The pathname of the user's login shell.
> +The absolute pathname of the user's login shell.
> .TP
> .B TERM
> The terminal type for which output is to be prepared.
> .TP
> .B PAGER
> The user's preferred utility to display text files.
> +Any string acceptable as a command_string operand to the
> +.I sh -c
> +command shall be valid.
> .TP
> .BR EDITOR / VISUAL
> The user's preferred utility to edit text files.
> +Any string acceptable as a command_string operand to the
> +.I sh -c
> +command shall be valid.
> .\" .TP
> .\" .B BROWSER
> .\" The user's preferred utility to browse URLs. Sequence of colon-separated
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-20 9:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 20:45 [PATCH] environ.7: Document the valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL Alejandro Colomar
2021-01-20 8:34 ` AW: " Walter Harms
2021-01-20 8:48 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).