This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: tmpfile security hole
- From: Charles Wilson <libtool at cwilson dot fastmail dot fm>
- To: newlib at sourceware dot org
- Date: Thu, 17 May 2007 00:40:47 -0400
- Subject: Re: tmpfile security hole
So, I'm trying to knock together this libtool patch for Steve, and I
update newlib to latest.
Boom, on i686-pc-linux-gnu:
../../../../../src/newlib/libc/stdio/tmpfile.c: In function '_tmpfile_r':
../../../../../src/newlib/libc/stdio/tmpfile.c:73: error: 'S_IRUSR'
undeclared (first use in this function)
../../../../../src/newlib/libc/stdio/tmpfile.c:73: error: (Each
undeclared identifier is reported only once
../../../../../src/newlib/libc/stdio/tmpfile.c:73: error: for each
function it appears in.)
../../../../../src/newlib/libc/stdio/tmpfile.c:73: error: 'S_IWUSR'
undeclared (first use in this function)
Looks like tmpfile.c (and tmpfile64.c) are missing #include
<sys/stat.h>. The attached patch fixes it.
--
Chuck
2007-05-17 Charles Wilson <...>
* stdio/tmpfile.c: include <sys/stat.h>
* stdio64/tmpfile64.c: ditto
Index: libc/stdio64/tmpfile64.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio64/tmpfile64.c,v
retrieving revision 1.4
diff -u -r1.4 tmpfile64.c
--- libc/stdio64/tmpfile64.c 16 May 2007 20:06:08 -0000 1.4
+++ libc/stdio64/tmpfile64.c 17 May 2007 04:35:21 -0000
@@ -50,6 +50,7 @@
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
+#include <sys/stat.h>
#ifndef O_BINARY
# define O_BINARY 0
Index: libc/stdio/tmpfile.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/tmpfile.c,v
retrieving revision 1.4
diff -u -r1.4 tmpfile.c
--- libc/stdio/tmpfile.c 16 May 2007 20:06:07 -0000 1.4
+++ libc/stdio/tmpfile.c 17 May 2007 04:35:37 -0000
@@ -50,6 +50,7 @@
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
+#include <sys/stat.h>
#ifndef O_BINARY
# define O_BINARY 0