From nobody@nwww.freebsd.org  Thu May  2 09:11:38 2002
Return-Path: <nobody@nwww.freebsd.org>
Received: from nwww.freebsd.org (nwww.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 3965937B400
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  2 May 2002 09:11:37 -0700 (PDT)
Received: from nwww.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g42GCehG060467
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 2 May 2002 09:12:40 -0700 (PDT)
	(envelope-from nobody@nwww.freebsd.org)
Received: (from nobody@localhost)
	by nwww.freebsd.org (8.12.2/8.12.2/Submit) id g42GCed2060466;
	Thu, 2 May 2002 09:12:40 -0700 (PDT)
Message-Id: <200205021612.g42GCed2060466@nwww.freebsd.org>
Date: Thu, 2 May 2002 09:12:40 -0700 (PDT)
From: Christian Ullrich <chris+freebsd@chrullrich.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pw(8) prints warnings after successful NIS map updates
X-Send-Pr-Version: www-1.0

>Number:         37672
>Category:       bin
>Synopsis:       pw(8) prints warnings after successful NIS map updates
>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:   Thu May 02 09:20:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Christian Ullrich
>Release:        4.5-RELEASE
>Organization:
>Environment:
FreeBSD ser1.chrullrich.de 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Wed May  1 16:24:30 CEST 2002     toor@ser1.chrullrich.de:/usr/src/sys/compile/SER1  i386
>Description:
pw prints warnings after changing and deleting users in NIS.
This is caused by wrong conditional expressions in pw_user.c.

>How-To-Repeat:

>Fix:
--- pw_user.c.orig      Mon Oct 15 15:46:09 2001
+++ pw_user.c   Tue Apr 30 23:33:56 2002
@@ -675,7 +675,7 @@
                        rc = addnispwent(cnf->nispasswd, pwd);
                        if (rc == -1)
                                warnx("User '%s' already exists in NIS passwd", pwd->pw_name);
-                       else
+                       else if (rc != 0)
                                warn("NIS passwd update");
                        /* NOTE: we treat NIS-only update errors as non-fatal */
                }
@@ -693,7 +693,7 @@
                                rc = chgnispwent(cnf->nispasswd, a_name->val, pwd);
                                if (rc == -1)
                                        warn("User '%s' not found in NIS passwd", pwd->pw_name);
-                               else
+                               else if (rc != 0)
                                        warn("NIS passwd update");
                                /* NOTE: NIS-only update errors are not fatal */
                        }

>Release-Note:
>Audit-Trail:
>Unformatted:
