public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]
@ 2016-03-17 18:53 Florian Weimer
  2016-03-29  8:34 ` Florian Weimer
  2016-03-29  9:04 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Weimer @ 2016-03-17 18:53 UTC (permalink / raw)
  To: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

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

[-- Attachment #2: 0001-nss_db-Propagate-ERANGE-error-if-parse_line-fails-BZ.patch --]
[-- Type: text/x-patch, Size: 594 bytes --]

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;
 	    }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]
  2016-03-17 18:53 [PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837] Florian Weimer
@ 2016-03-29  8:34 ` Florian Weimer
  2016-03-29  9:04 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2016-03-29  8:34 UTC (permalink / raw)
  To: GNU C Library

On 03/17/2016 07:53 PM, Florian Weimer wrote:
> 	[BZ #19837]
> 	* nss/nss_db/db-XXX.c (_nss_db_getENTNAME_r): Propagate ERANGE
> 	error if parse_line fails.

Ping?

  <https://sourceware.org/ml/libc-alpha/2016-03/msg00456.html>

Thanks,
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]
  2016-03-17 18:53 [PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837] Florian Weimer
  2016-03-29  8:34 ` Florian Weimer
@ 2016-03-29  9:04 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2016-03-29  9:04 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

Florian Weimer <fweimer@redhat.com> writes:

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

Ok.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-29  9:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-17 18:53 [PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837] Florian Weimer
2016-03-29  8:34 ` Florian Weimer
2016-03-29  9:04 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).