]> Savannah Git Hosting - gnulib.git/commitdiff
Document xstdopen vs *-safer better
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Nov 2024 20:32:27 +0000 (12:32 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Nov 2024 21:49:36 +0000 (13:49 -0800)
doc/posix-functions/stderr.texi
doc/posix-functions/stdin.texi
doc/posix-functions/stdout.texi
doc/xstdopen.texi

index cf91cf22903280324eaa729c1128ad21b229a816..a5274fe54c03b4044679ded3e3c8b8fd7c80eecd 100644 (file)
@@ -24,6 +24,7 @@ POSIX states that a setuid application can guarantee that fd 2 is
 open, but some systems guarantee this even for non-setuid programs.
 If an application is executed with fd 2 closed, use of @code{stderr}
 can affect an unrelated file that happened to be assigned to fd 2.
-The gnulib *-safer modules may be used to guarantee that fd 2 stays
+The gnulib @code{xstdopen} or the *-safer modules may be used to
+guarantee that fd 2 stays
 reserved for @code{stderr}.
 @end itemize
index cc28b141cdbeb08a789bcb63e0f837d3b6d2572b..3b7672a62041e51d94fb7433810294c82e99ff8d 100644 (file)
@@ -22,6 +22,7 @@ POSIX states that a setuid application can guarantee that fd 0 is
 open, but some systems guarantee this even for non-setuid programs.
 If an application is executed with fd 0 closed, use of @code{stdin}
 can affect an unrelated file that happened to be assigned to fd 0.
-The gnulib *-safer modules may be used to guarantee that fd 0 stays
+The gnulib @code{xstdopen} or the *-safer modules may be used to
+guarantee that fd 0 stays
 reserved for @code{stdin}.
 @end itemize
index 8e8c7f5c062831598b05ceec4dc6880d6119a97a..071bdc5fb7e09fdb117f460bdb6bb51b92742cdf 100644 (file)
@@ -24,6 +24,7 @@ POSIX states that a setuid application can guarantee that fd 1 is
 open, but some systems guarantee this even for non-setuid programs.
 If an application is executed with fd 1 closed, use of @code{stdout}
 can affect an unrelated file that happened to be assigned to fd 1.
-The gnulib *-safer modules may be used to guarantee that fd 1 stays
+The gnulib @code{xstdopen} or the *-safer modules may be used to
+guarantee that fd 1 stays
 reserved for @code{stdout}.
 @end itemize
index 8a7c60a693b04abd1498bb363d037bae5572555b..d125f662b432c275fefed8bb72e74a49be6c7aeb 100644 (file)
@@ -143,9 +143,12 @@ The @code{*-safer} modules:
 @code{stdlib-safer}.
 @end itemize
 
-The approach with the @code{xstdopen} module is simpler, but it adds three
+The approach with the @code{xstdopen} module is simple, but it adds three
 system calls to program startup.  Whereas the approach with the @code{*-safer}
-modules is more complex, but adds no overhead (no additional system calls)
+modules is more complicated and error-prone,
+and does not fix the problem if system library functions call one
+of the affected functions,
+but adds no overhead (no additional system calls)
 in the normal case.
 
 To use the approach with the @code{xstdopen} module: