From patchwork Thu Mar 17 18:53:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 599217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qQyDJ5rnxz9s8g for ; Fri, 18 Mar 2016 05:53:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=TW7fjxUV; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=Zfy7llgB9k2WEUZ/9/M6MaO9+q5pp 2+m5zPlivM2R6ExIfJhAnPTTwO8DamkX/buQhLN0aV5zeJX16q8z1sAFxusVVV8r RLh4dgDY/KrlNHI78KWm1vXEp0Ak39cj0EIUEvhck5J1UnYLI2qvu2TO+7mw1VX4 4eStazwECRLQqk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=icY1A4+aZsGOzmSgRh7M863Ny6U=; b=TW7 fjxUVtrQkkQ17mY1CUlYvjPEjWY7vsSA73AnwfcGaXJtgIrmu8UnovF1kFmuyGJJ KQ+Sz7R8sig7tSj8A41Ug9QGHll9WELs67ncXklyvI6UbYXyeVeK3EgIGsaXHOw2 /nYxJmbXZ8/qrl3RH+pxhjDzxEE+Ywf4LH3PpB4U= Received: (qmail 22290 invoked by alias); 17 Mar 2016 18:53:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 22234 invoked by uid 89); 17 Mar 2016 18:53:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=symptom X-HELO: mx1.redhat.com To: GNU C Library From: Florian Weimer Subject: [PATCH] nss_db: Propagate ERANGE error if parse_line fails [BZ #19837] Message-ID: <56EAFD10.9040705@redhat.com> Date: Thu, 17 Mar 2016 19:53:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 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 [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; }