This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 17 Mar 2016 19:53:04 +0100
- Subject: [PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]
- Authentication-results: sourceware.org; auth=none
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;
}