]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use O_CLOEXEC in a few more places
authorUlrich Drepper <drepper@gmail.com>
Tue, 15 Nov 2011 19:00:58 +0000 (14:00 -0500)
committerUlrich Drepper <drepper@gmail.com>
Tue, 15 Nov 2011 19:00:58 +0000 (14:00 -0500)
ChangeLog
locale/loadarchive.c
locale/loadlocale.c

index 84cd7004a3b488b4c62c7ef81e95d9e442d09e98..c469e10ef64dd125def75457b309ec3677fc1b2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-11-15  Ulrich Drepper  <drepper@gmail.com>
+
+       * locale/loadarchive.c (_nl_load_locale_from_archive): Open files to
+       O_CLOEXEC.
+       * locale/loadlocale.c (_nl_load_locale): Likewise.
+
 2011-11-15  Andreas Schwab  <schwab@redhat.com>
 
        * sysdeps/unix/sysv/linux/clock_gettime.c (SYSDEP_GETTIME_CPU)
index 663202e54ebeb0c1d2d1ef6a51c3e10dd0f4819f..47a6127a52a40035101553a4bd5c752bc2a617f3 100644 (file)
@@ -1,5 +1,5 @@
 /* Code to load locale data from the locale archive file.
-   Copyright (C) 2002, 2003, 2005, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005, 2010, 2011 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
@@ -203,7 +203,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
       archmapped = &headmap;
 
       /* The archive has never been opened.  */
-      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
       if (fd < 0)
        /* Cannot open the archive, for whatever reason.  */
        return NULL;
@@ -394,7 +394,8 @@ _nl_load_locale_from_archive (int category, const char **namep)
          if (fd == -1)
            {
              struct stat64 st;
-             fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+             fd = open_not_cancel_2 (archfname,
+                                     O_RDONLY|O_LARGEFILE|O_CLOEXEC);
              if (fd == -1)
                /* Cannot open the archive, for whatever reason.  */
                return NULL;
index 61e6f7f0a652efd7692797d956270ead47e213be..d33a49413433cd2f315687c31161475243ea74e5 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions to read locale data files.
-   Copyright (C) 1996-2004, 2005, 2006, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1996-2004, 2005, 2006, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -173,7 +173,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
   file->decided = 1;
   file->data = NULL;
 
-  fd = open_not_cancel_2 (file->filename, O_RDONLY);
+  fd = open_not_cancel_2 (file->filename, O_RDONLY | O_CLOEXEC);
   if (__builtin_expect (fd, 0) < 0)
     /* Cannot open the file.  */
     return;
@@ -201,7 +201,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
                 _nl_category_names.str + _nl_category_name_idxs[category],
                 _nl_category_name_sizes[category] + 1);
 
-      fd = open_not_cancel_2 (newp, O_RDONLY);
+      fd = open_not_cancel_2 (newp, O_RDONLY | O_CLOEXEC);
       if (__builtin_expect (fd, 0) < 0)
        return;