diff options
author | Eric Blake <ebb9@byu.net> | 2009-08-19 10:02:19 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-08-19 10:50:36 -0600 |
commit | ccb9c6798066958dd14c1005a7d5ffc1cbd6edae (patch) | |
tree | 90a0268c84a274c3e66d80dd311b6d85f15ab484 /lib/stdio--.h | |
parent | fb8c836ade0d4ab8050c2c381795ce098b701115 (diff) | |
download | gnulib-ccb9c6798066958dd14c1005a7d5ffc1cbd6edae.tar.gz |
popen-safer: prevent popen from clobbering std descriptors
* modules/popen-safer: New file.
* lib/popen-safer.c: Likewise.
* m4/stdio-safer.m4 (gl_POPEN_SAFER): New macro.
* lib/stdio--.h (popen): Provide override.
* lib/stdio-safer.h (popen_safer): Provide declaration.
* tests/test-popen.c (includes): Partially test this.
* modules/popen-safer-tests: New file, for more tests.
* tests/test-popen-safer.c: Likewise.
* MODULES.html.sh (file stream based Input/Output): Mention it.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'lib/stdio--.h')
-rw-r--r-- | lib/stdio--.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/stdio--.h b/lib/stdio--.h index eafbdb127b..ed90dda5a5 100644 --- a/lib/stdio--.h +++ b/lib/stdio--.h @@ -29,3 +29,8 @@ # undef tmpfile # define tmpfile tmpfile_safer #endif + +#if GNULIB_POPEN_SAFER +# undef popen +# define popen popen_safer +#endif |