From taob@alpha.risc.org  Sun Apr 27 13:47:54 1997
Received: from alpha.risc.org (taob@209-20-0-29.dialin.interlog.com [209.20.0.29])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA28158
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Apr 1997 13:47:52 -0700 (PDT)
Received: (from taob@localhost)
          by alpha.risc.org (8.8.4/8.8.4)
	  id QAA10058; Sun, 27 Apr 1997 16:47:28 -0400 (EDT)
Message-Id: <199704272047.QAA10058@alpha.risc.org>
Date: Sun, 27 Apr 1997 16:47:28 -0400 (EDT)
From: taob@risc.org
Reply-To: taob@risc.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: More accurate vipw/chpass/passwd message
X-Send-Pr-Version: 3.2

>Number:         3397
>Category:       bin
>Synopsis:       vipw does not distinguish between rebuilding and updating *pwd.db
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 27 13:50:01 PDT 1997
>Closed-Date:    Sun Aug 24 20:32:47 MEST 1997
>Last-Modified:  Sun Aug 24 20:33:08 MEST 1997
>Originator:     Brian Tao
>Release:        FreeBSD 2.2-970420-RELENG i386
>Organization:
>Environment:

	Any FreeBSD release with guido's incremental db update code to
/usr/src/usr.sbin/pwd_mkdb/pwd_mkdb.c (July 1 1996).

>Description:

	vipw's /usr/src/usr.sbin/vipw/pw_util.c will say "rebuilding the
database..." regardless of whether it is completely rebuilding the
databases or just updating a single entry.  This is just a cosmetic
fix.

>How-To-Repeat:

	vipw will rebuild the entire database, chpass et al. only update
the changed user's entry.

>Fix:

    Note that vipw, chpass and passwd all need to be rebuilt after
this patch.


*** /usr/src/usr.sbin/vipw/pw_util.c.orig	Sun Apr 27 16:08:59 1997
--- /usr/src/usr.sbin/vipw/pw_util.c	Sun Apr 27 16:09:00 1997
***************
*** 144,155 ****
  	int pstat;
  	pid_t pid;
  
- 	warnx("rebuilding the database...");
  	(void)fflush(stderr);
  	if (!(pid = vfork())) {
  		if(!username) {
  			execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", tempname, NULL);
  		} else {
  			execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-u", 
  					username, tempname, NULL);
  		}
--- 144,156 ----
  	int pstat;
  	pid_t pid;
  
  	(void)fflush(stderr);
  	if (!(pid = vfork())) {
  		if(!username) {
+ 			warnx("rebuilding the database...");
  			execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", tempname, NULL);
  		} else {
+ 			warnx("updating the database...");
  			execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-u", 
  					username, tempname, NULL);
  		}

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Sun Aug 24 20:32:47 MEST 1997 
State-Changed-Why:  

Suggested fix applied in rev 1.6 of pw_util.c, thanks! 
>Unformatted:
