mirror of
https://github.com/python/cpython.git
synced 2025-11-13 07:26:31 +00:00
Improve the documentation for the os.P_* constants used with the os.spawn*()
functions to include information about how they affect the operation of those functions when used as the "mode" parameter. This closes SF bug #468384. Added warnings to the os.tempnam() and os.tmpnam() functions regarding their security problem. These warning mirror the warnings added to the runtime by Skip Montanaro.
This commit is contained in:
parent
92350b3a1f
commit
938a8d723c
1 changed files with 29 additions and 9 deletions
|
|
@ -795,6 +795,8 @@ files if \var{dir} is omitted or \code{None}. If given and not
|
||||||
filename. Applications are responsible for properly creating and
|
filename. Applications are responsible for properly creating and
|
||||||
managing files created using paths returned by \function{tempnam()};
|
managing files created using paths returned by \function{tempnam()};
|
||||||
no automatic cleanup is provided.
|
no automatic cleanup is provided.
|
||||||
|
\warning{Use of \function{tempnam()} is vulnerable to symlink attacks;
|
||||||
|
consider using \function{tmpfile()} instead.}
|
||||||
Availability: \UNIX, Windows.
|
Availability: \UNIX, Windows.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
|
@ -805,6 +807,8 @@ entry in a common location for temporary files. Applications are
|
||||||
responsible for properly creating and managing files created using
|
responsible for properly creating and managing files created using
|
||||||
paths returned by \function{tmpnam()}; no automatic cleanup is
|
paths returned by \function{tmpnam()}; no automatic cleanup is
|
||||||
provided.
|
provided.
|
||||||
|
\warning{Use of \function{tmpnam()} is vulnerable to symlink attacks;
|
||||||
|
consider using \function{tmpfile()} instead.}
|
||||||
Availability: \UNIX, Windows.
|
Availability: \UNIX, Windows.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
|
@ -1011,20 +1015,36 @@ Availability: \UNIX{}, Windows.
|
||||||
\versionadded{1.6}
|
\versionadded{1.6}
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{datadesc}{P_WAIT}
|
\begin{datadesc}{P_NOWAIT}
|
||||||
\dataline{P_NOWAIT}
|
|
||||||
\dataline{P_NOWAITO}
|
\dataline{P_NOWAITO}
|
||||||
Possible values for the \var{mode} parameter to \function{spawnv()}
|
Possible values for the \var{mode} parameter to the \function{spawn*()}
|
||||||
and \function{spawnve()}.
|
family of functions. If either of these values is given, the
|
||||||
|
\function{spawn*()} functions will return as soon as the new process
|
||||||
|
has been created, with the process ID as the return value.
|
||||||
Availability: \UNIX{}, Windows.
|
Availability: \UNIX{}, Windows.
|
||||||
\versionadded{1.6}
|
\versionadded{1.6}
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{P_OVERLAY}
|
\begin{datadesc}{P_WAIT}
|
||||||
\dataline{P_DETACH}
|
Possible value for the \var{mode} parameter to the \function{spawn*()}
|
||||||
Possible values for the \var{mode} parameter to \function{spawnv()}
|
family of functions. If this is given as \var{mode}, the
|
||||||
and \function{spawnve()}. These are less portable than those listed
|
\function{spawn*()} functions will not return until the new process
|
||||||
above.
|
has run to completion and will return the exit code of the process the
|
||||||
|
run is successful, or \code{-\var{signal}} if a signal kills the
|
||||||
|
process.
|
||||||
|
Availability: \UNIX{}, Windows.
|
||||||
|
\versionadded{1.6}
|
||||||
|
\end{datadesc}
|
||||||
|
|
||||||
|
\begin{datadesc}{P_DETACH}
|
||||||
|
\dataline{P_OVERLAY}
|
||||||
|
Possible values for the \var{mode} parameter to the
|
||||||
|
\function{spawn*()} family of functions. These are less portable than
|
||||||
|
those listed above.
|
||||||
|
\constant{P_DETACH} is similar to \constant{P_NOWAIT}, but the new
|
||||||
|
process is detached from the console of the calling process.
|
||||||
|
If \constant{P_OVERLAY} is used, the current process will be replaced;
|
||||||
|
the \function{spawn*()} function will not return.
|
||||||
Availability: Windows.
|
Availability: Windows.
|
||||||
\versionadded{1.6}
|
\versionadded{1.6}
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue