mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
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>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user