]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - io/openat_2.c
Fix BRE typos in check-safety.sh
[thirdparty/glibc.git] / io / openat_2.c
index 2345cc27813d76f4afc0a3766cbc08ed8958d53e..d9fd06723ccb3ceb549ae7ee5acd4811ea452d3c 100644 (file)
@@ -1,5 +1,5 @@
 /* _FORTIFY_SOURCE wrapper for openat.
-   Copyright (C) 2013-2015 Free Software Foundation, Inc.
+   Copyright (C) 2013-2022 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
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <fcntl.h>
 #include <stdio.h>
@@ -22,8 +22,8 @@
 int
 __openat_2 (int fd, const char *file, int oflag)
 {
-  if (oflag & O_CREAT)
-    __fortify_fail ("invalid openat call: O_CREAT without mode");
+  if (__OPEN_NEEDS_MODE (oflag))
+    __fortify_fail ("invalid openat call: O_CREAT or O_TMPFILE without mode");
 
   return __openat (fd, file, oflag);
 }