about summary refs log tree commit diff
path: root/nss/nss_files/files-alias.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-07-16 16:12:46 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-07-21 07:32:46 +0200
commit299210c1fa67e2dfb564475986fce11cd33db9ad (patch)
tree7230de5a2b2d0556428f53f28d2d5f2ccfad12d8 /nss/nss_files/files-alias.c
parent469c03907b116c37c98d8ad7a9edac2bdbf3e934 (diff)
downloadglibc-299210c1fa67e2dfb564475986fce11cd33db9ad.tar.gz
glibc-299210c1fa67e2dfb564475986fce11cd33db9ad.tar.xz
glibc-299210c1fa67e2dfb564475986fce11cd33db9ad.zip
nss_files: Consolidate file opening in __nss_files_fopen
Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nss/nss_files/files-alias.c')
-rw-r--r--nss/nss_files/files-alias.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
index 6aff7b4c10..43fb2c49a5 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
@@ -29,6 +29,7 @@
 #include <kernel-features.h>
 
 #include "nsswitch.h"
+#include <nss_files.h>
 
 NSS_DECLARE_MODULE_FUNCTIONS (files)
 
@@ -49,7 +50,7 @@ internal_setent (FILE **stream)
 
   if (*stream == NULL)
     {
-      *stream = fopen ("/etc/aliases", "rce");
+      *stream = __nss_files_fopen ("/etc/aliases");
 
       if (*stream == NULL)
 	status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
@@ -215,7 +216,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
 
 		      first_unused = cp;
 
-		      listfile = fopen (&cp[9], "rce");
+		      listfile = __nss_files_fopen (&cp[9]);
 		      /* If the file does not exist we simply ignore
 			 the statement.  */
 		      if (listfile != NULL