From bd7b8f5891979b929e4a186bec6715254e53fedf Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 08 2020 11:33:07 +0000 Subject: Apply patch glibc-rh1871397-2.patch patch_name: glibc-rh1871397-2.patch present_in_specfile: true location_in_specfile: 365 --- diff --git a/nss/nss_compat/compat-grp.c b/nss/nss_compat/compat-grp.c index fca9f48..4f17280 100644 --- a/nss/nss_compat/compat-grp.c +++ b/nss/nss_compat/compat-grp.c @@ -26,6 +26,7 @@ #include #include #include +#include static service_user *ni; static enum nss_status (*nss_setgrent) (int stayopen); @@ -106,13 +107,10 @@ internal_setgrent (ent_t *ent, int stayopen, int needent) if (ent->stream == NULL) { - ent->stream = fopen ("/etc/group", "rme"); + ent->stream = __nss_files_fopen ("/etc/group"); if (ent->stream == NULL) status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL; - else - /* We take care of locking ourself. */ - __fsetlocking (ent->stream, FSETLOCKING_BYCALLER); } else rewind (ent->stream); diff --git a/nss/nss_compat/compat-initgroups.c b/nss/nss_compat/compat-initgroups.c index d7a89ea..4431fdf 100644 --- a/nss/nss_compat/compat-initgroups.c +++ b/nss/nss_compat/compat-initgroups.c @@ -29,6 +29,7 @@ #include #include #include +#include static service_user *ni; /* Type of the lookup function. */ @@ -121,13 +122,10 @@ internal_setgrent (ent_t *ent) else ent->blacklist.current = 0; - ent->stream = fopen ("/etc/group", "rme"); + ent->stream = __nss_files_fopen ("/etc/group"); if (ent->stream == NULL) status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL; - else - /* We take care of locking ourself. */ - __fsetlocking (ent->stream, FSETLOCKING_BYCALLER); return status; } diff --git a/nss/nss_compat/compat-pwd.c b/nss/nss_compat/compat-pwd.c index 8832fb7..55cf505 100644 --- a/nss/nss_compat/compat-pwd.c +++ b/nss/nss_compat/compat-pwd.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "netgroup.h" #include "nisdomain.h" @@ -221,13 +222,10 @@ internal_setpwent (ent_t *ent, int stayopen, int needent) if (ent->stream == NULL) { - ent->stream = fopen ("/etc/passwd", "rme"); + ent->stream = __nss_files_fopen ("/etc/passwd"); if (ent->stream == NULL) status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL; - else - /* We take care of locking ourself. */ - __fsetlocking (ent->stream, FSETLOCKING_BYCALLER); } else rewind (ent->stream); diff --git a/nss/nss_compat/compat-spwd.c b/nss/nss_compat/compat-spwd.c index 684a060..9007892 100644 --- a/nss/nss_compat/compat-spwd.c +++ b/nss/nss_compat/compat-spwd.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "netgroup.h" #include "nisdomain.h" @@ -177,13 +178,10 @@ internal_setspent (ent_t *ent, int stayopen, int needent) if (ent->stream == NULL) { - ent->stream = fopen ("/etc/shadow", "rme"); + ent->stream = __nss_files_fopen ("/etc/shadow"); if (ent->stream == NULL) status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL; - else - /* We take care of locking ourself. */ - __fsetlocking (ent->stream, FSETLOCKING_BYCALLER); } else rewind (ent->stream);