[Glibc-bsd-commits] r2208 - trunk/glibc-ports/kfreebsd

ps-guest at alioth.debian.org ps-guest at alioth.debian.org
Sun Jul 6 13:23:34 UTC 2008


Author: ps-guest
Date: 2008-07-06 13:23:32 +0000 (Sun, 06 Jul 2008)
New Revision: 2208

Added:
   trunk/glibc-ports/kfreebsd/open_2.c
Modified:
   trunk/glibc-ports/kfreebsd/Makefile
   trunk/glibc-ports/kfreebsd/openat.c
Log:
* add open_2 for fortify calls, untested



Modified: trunk/glibc-ports/kfreebsd/Makefile
===================================================================
--- trunk/glibc-ports/kfreebsd/Makefile	2008-07-03 13:10:33 UTC (rev 2207)
+++ trunk/glibc-ports/kfreebsd/Makefile	2008-07-06 13:23:32 UTC (rev 2208)
@@ -33,7 +33,7 @@
 # For <unistd.h>.
 sysdep_routines += sys_getcwd sys_lseek
 # For <fcntl.h>.
-sysdep_routines += sys_open
+sysdep_routines += sys_open open_2
 # For <sys/stat.h>.
 sysdep_routines += sys_fstat sys_lstat sys_mknod sys_nfstat sys_nlstat sys_nstat sys_stat
 # For <sys/statfs.h>.

Added: trunk/glibc-ports/kfreebsd/open_2.c
===================================================================
--- trunk/glibc-ports/kfreebsd/open_2.c	                        (rev 0)
+++ trunk/glibc-ports/kfreebsd/open_2.c	2008-07-06 13:23:32 UTC (rev 2208)
@@ -0,0 +1,2 @@
+#include <sysdeps/unix/sysv/linux/open_2.c>
+strong_alias (__open_2, __open64_2)

Modified: trunk/glibc-ports/kfreebsd/openat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/openat.c	2008-07-03 13:10:33 UTC (rev 2207)
+++ trunk/glibc-ports/kfreebsd/openat.c	2008-07-06 13:23:32 UTC (rev 2208)
@@ -93,3 +93,18 @@
 stub_warning (openat)
 stub_warning (openat64)
 
+int
+__openat_2 (fd, file, oflag)
+     int fd;
+     const char *file;
+     int oflag;
+{
+  if (oflag & O_CREAT)
+    __fortify_fail ("invalid openat call: O_CREAT without mode");
+
+  return __openat (file, oflag);
+}
+
+strong_alias (__openat_2, __openat64_2)
+stub_warning (__openat_2)
+stub_warning (__openat64_2)




More information about the Glibc-bsd-commits mailing list