From patchwork Mon Jun 17 19:38:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 1117473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-102774-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Ldyo4dKC"; dkim-atps=neutral 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 45SM2w5hP1z9s7h for ; Tue, 18 Jun 2019 05:38:48 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject; q=dns; s= default; b=CE0Z6drCPe0SE1nTIE3FfqcijWcmtXxg/Q5unB/BIa5OadLyIZvLM ayELTCaASfet8X2ejg453ohVht7ZaHbTuzIaEXhwt35iVwqO/xAc9BURkEGAdnKl kXUCz/E7FJQLPjBOKCwXW7wyTBHszHb8gv3hC9o60mNvSnLDRwgix0= 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:date:message-id:from:to:subject; s=default; bh=t6jCB9jCkZgVGq5+JQU9+t4BMXM=; b=Ldyo4dKClxUJESFCZsUGU2juEkrf 0qIkgVg1XSqN4ev7potSV7o48Vk/emqGd7CsEhF+6nDxqczbsqAGlZfIyQ8AQVcG 9TUzSu9RZFkfSNyTvMFMOedLAsig0MKAVsWlTHOBb4JaUuB4ZIEoG8/0ehDsyLT4 vXDLpVrZO964ryE= Received: (qmail 60405 invoked by alias); 17 Jun 2019 19:38:43 -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 60396 invoked by uid 89); 17 Jun 2019 19:38:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:646 X-HELO: mx1.redhat.com Date: Mon, 17 Jun 2019 15:38:38 -0400 Message-Id: From: DJ Delorie To: libc-alpha@sourceware.org Subject: nss_db: reset mapping after last get*ent nss_db allows for getpwent et al to be called without a set*ent, but it only works once. After the last get*ent a set*ent is required to restart, because the end*ent did not properly reset the module. Resetting it to NULL allows for a proper restart. * nss/nss_db/db-open.c (internal_endent): Reset mapping to NULL. diff --git a/nss/nss_db/db-open.c b/nss/nss_db/db-open.c index 8a83d6b930..f7c53b4486 100644 --- a/nss/nss_db/db-open.c +++ b/nss/nss_db/db-open.c @@ -64,4 +64,5 @@ void internal_endent (struct nss_db_map *mapping) { munmap (mapping->header, mapping->len); + mapping->header = NULL; }