Skip to contentSkip to conversation

exec.3: Clarify that execvpe uses PATH from the caller, not envp

PATCH In review Alejandro Colomar 2 participants 2 messages Mar 19, 2021 – Apr 4, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exec.3: Clarify that execvpe uses PATH from the caller, not envp

From: Josh Triplett <[email protected]>

Checked via the latest glibc source. execvpe calls getenv("PATH") and searches that; the PATH in envp does not affect the search.

---
 man3/exec.3 | 7 +++++++
 1 file changed, 7 insertions(+)
man3/exec.3 +7 -0
index 3d936d08d..9c5b02b5c 100644
@@ -146,6 +146,13 @@ a list that includes the directories returned by
 and possibly also the current working directory;
 see NOTES for further details.
 .PP
+.BR execvpe ()
+searches for the program using the value of
+.B PATH
+from the caller's environment, not from the
+.I envp
+argument.
+.PP
 If the specified filename includes a slash character, then
 .B PATH
 is ignored, and the file at the specified pathname is executed.
Signature · 1 line
2.30.1
#1 lore raw

Hi Alex,

Quoted 4 lines · Alejandro Colomar

From: Josh Triplett <[email protected]>

Checked via the latest glibc source. execvpe calls getenv("PATH") and searches that; the PATH in envp does not affect the search.

Thanks. Patch applied.

Cheers,

Michael

Quoted 25 lines
---
 man3/exec.3 | 7 +++++++
 1 file changed, 7 insertions(+)
man3/exec.3 +7 -0
index 3d936d08d..9c5b02b5c 100644
@@ -146,6 +146,13 @@ a list that includes the directories returned by
 and possibly also the current working directory;
 see NOTES for further details.
 .PP
+.BR execvpe ()
+searches for the program using the value of
+.B PATH
+from the caller's environment, not from the
+.I envp
+argument.
+.PP
 If the specified filename includes a slash character, then
 .B PATH
 is ignored, and the file at the specified pathname is executed.
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/