about summary refs log tree commit diff
path: root/nss/nss_files
diff options
context:
space:
mode:
Diffstat (limited to 'nss/nss_files')
-rw-r--r--nss/nss_files/files-grp.c6
-rw-r--r--nss/nss_files/files-pwd.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/nss/nss_files/files-grp.c b/nss/nss_files/files-grp.c
index 8e047b6475..20a723b650 100644
--- a/nss/nss_files/files-grp.c
+++ b/nss/nss_files/files-grp.c
@@ -32,12 +32,14 @@ struct grent_data {};
 
 DB_LOOKUP (grnam, 1 + strlen (name), (".%s", name),
 	   {
-	     if (! strcmp (name, result->gr_name))
+	     if (name[0] != '-' && name[0] != '+'
+		 && ! strcmp (name, result->gr_name))
 	       break;
 	   }, const char *name)
 
 DB_LOOKUP (grgid, 20, ("=%lu", (unsigned long int) gid),
 	   {
-	     if (result->gr_gid == gid)
+	     if (result->gr_gid == gid && result->gr_name[0] != '+'
+		 && result->gr_name[0] != '-')
 	       break;
 	   }, gid_t gid)
diff --git a/nss/nss_files/files-pwd.c b/nss/nss_files/files-pwd.c
index a778d015d8..30008559ae 100644
--- a/nss/nss_files/files-pwd.c
+++ b/nss/nss_files/files-pwd.c
@@ -32,12 +32,14 @@ struct pwent_data {};
 
 DB_LOOKUP (pwnam, 1 + strlen (name), (".%s", name),
 	   {
-	     if (! strcmp (name, result->pw_name))
+	     if (name[0] != '+' && name[0] != '-'
+		 && ! strcmp (name, result->pw_name))
 	       break;
 	   }, const char *name)
 
 DB_LOOKUP (pwuid, 20, ("=%lu", (unsigned long int) uid),
 	   {
-	     if (result->pw_uid == uid)
+	     if (result->pw_uid == uid && result->pw_name[0] != '+'
+		 && result->pw_name[0] != '-')
 	       break;
 	   }, uid_t uid)