From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 15 19:20:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5266816A46D for ; Tue, 15 Jan 2008 19:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3C2FC13C4EC for ; Tue, 15 Jan 2008 19:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m0FJK2Pk016272 for ; Tue, 15 Jan 2008 19:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m0FJK2LE016271; Tue, 15 Jan 2008 19:20:02 GMT (envelope-from gnats) Resent-Date: Tue, 15 Jan 2008 19:20:02 GMT Resent-Message-Id: <200801151920.m0FJK2LE016271@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sven Berkvens-Matthijsse Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B44416A46C for ; Tue, 15 Jan 2008 19:17:25 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 8556713C46B for ; Tue, 15 Jan 2008 19:17:25 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m0FJG76w038282 for ; Tue, 15 Jan 2008 19:16:07 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m0FJG7nr038281; Tue, 15 Jan 2008 19:16:07 GMT (envelope-from nobody) Message-Id: <200801151916.m0FJG7nr038281@www.freebsd.org> Date: Tue, 15 Jan 2008 19:16:07 GMT From: Sven Berkvens-Matthijsse To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/119695: pw(8) does not interact with nscd(8) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2008 19:20:02 -0000 >Number: 119695 >Category: bin >Synopsis: pw(8) does not interact with nscd(8) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 15 19:20:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Sven Berkvens-Matthijsse >Release: FreeBSD 7.0-PRERELEASE #5: Thu Jan 10 18:27:04 CET 2008 amd64 >Organization: De Kattenfabriek >Environment: FreeBSD paws.berkvens.net 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #5: Thu Jan 10 18:27:04 CET 2008 sven@paws.berkvens.net:/usr/obj/usr/src/sys/PAWS amd64 >Description: I was installing the print/cups port when the portupgrade failed because the group 'cups' disappeared after it was added. This happened because I have a /etc/nsswitch.conf with the following in it: # # nsswitch.conf(5) - name service switch configuration file # $FreeBSD: src/etc/nsswitch.conf,v 1.1 2006/05/03 15:14:47 ume Exp $ # group: cache compat group_compat: nis hosts: cache files dns networks: cache files passwd: cache compat passwd_compat: nis shells: files services: cache compat services_compat: nis protocols: cache files rpc: cache files This causes the following line, which the port tried to do: if ! pw groupshow cups ; then pw groupadd cups -g 193 ; fi to fail, because the groupshow command causes the nscd to cache a negative lookup entry. The groupadd command then adds the user to the /etc/group file, but FAILS to inform the nscd(8) daemon that all cached entries in the group file should be purged from memory. Next, the port checks whether the group 'cups' now exists, but gets a 'NO' because the negative answer is still in the cache. I'm not sure whether the vipw(8) utility or similar other utilities exhibit the same problems. >How-To-Repeat: Set up the /etc/nsswitch.conf file as above (or similar, at least adding 'cache' to the passwd or group lines). Make sure the nscd daemon is running. Then try something similar to the command above. >Fix: The pw(8) utility should inform the nscd(8) daemon of the changes that it makes. So should any system utilities that edit the password or group files in any way. >Release-Note: >Audit-Trail: >Unformatted: