This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]


Other call sites of parse_line already use these error codes (including
one earlier in this file).

The symptom is that getgrent (without _r) would not retry reading with a
larger buffer.

It's not possible to write a test for  this without resorting to chroot.

Thanks,
Florian
2016-03-17  Florian Weimer  <fweimer@redhat.com>

	[BZ #19837]
	* nss/nss_db/db-XXX.c (_nss_db_getENTNAME_r): Propagate ERANGE
	error if parse_line fails.

diff --git a/nss/nss_db/db-XXX.c b/nss/nss_db/db-XXX.c
index 03c18d7..125a5e9 100644
--- a/nss/nss_db/db-XXX.c
+++ b/nss/nss_db/db-XXX.c
@@ -288,8 +288,8 @@ CONCAT(_nss_db_get,ENTNAME_r) (struct STRUCTURE *result, char *buffer,
 	    }
 	  if (err < 0)
 	    {
-	      H_ERRNO_SET (HOST_NOT_FOUND);
-	      status = NSS_STATUS_NOTFOUND;
+	      H_ERRNO_SET (NETDB_INTERNAL);
+	      status = NSS_STATUS_TRYAGAIN;
 	      break;
 	    }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]