summaryrefslogtreecommitdiff
path: root/io/open.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-31 17:46:17 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-31 17:46:17 +0000
commit8833066b122427710a9e14a888ce6cfa862332d3 (patch)
tree29591019d695919417b3698618d6a342e97381d6 /io/open.c
parentfedca46896bdb702cb988837a0c2c5447e72ba2b (diff)
Updated to fedora-glibc-20070731T1624cvs/fedora-glibc-2_6_90-1
Diffstat (limited to 'io/open.c')
-rw-r--r--io/open.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/io/open.c b/io/open.c
index 188110b3f3..c104406245 100644
--- a/io/open.c
+++ b/io/open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,2002,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,9 @@
#include <fcntl.h>
#include <stdarg.h>
#include <stddef.h>
+#include <stdio.h>
+
+extern char **__libc_argv attribute_hidden;
/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
a third argument is the file protection. */
@@ -51,4 +54,18 @@ libc_hidden_def (__open)
stub_warning (open)
weak_alias (__open, open)
+
+
+int
+__open_2 (file, oflag)
+ const char *file;
+ int oflag;
+{
+ if (oflag & O_CREAT)
+ __fortify_fail ("invalid open call: O_CREAT without mode");
+
+ return __open (file, oflag);
+}
+stub_warning (__open_2)
+
#include <stub-tag.h>