From nighthawk@unrealircd.com  Mon Aug  5 07:20:19 2002
Return-Path: <nighthawk@unrealircd.com>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6324C37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Aug 2002 07:20:19 -0700 (PDT)
Received: from firedrake.etherix.com (pc1-oxfd1-6-cust131.oxf.cable.ntl.com [80.3.240.131])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6840343E6A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Aug 2002 07:20:18 -0700 (PDT)
	(envelope-from nighthawk@unrealircd.com)
Received: by firedrake.etherix.com (Postfix, from userid 1001)
	id 6110271E; Mon,  5 Aug 2002 15:18:24 +0100 (BST)
Message-Id: <20020805141824.6110271E@firedrake.etherix.com>
Date: Mon,  5 Aug 2002 15:18:24 +0100 (BST)
From: Edward Brocklesby <nighthawk@unrealircd.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: "-vv" (very verbose) flag for chown
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         41341
>Category:       bin
>Synopsis:       "-vv" (very verbose) flag for chown
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    johan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 05 07:30:02 PDT 2002
>Closed-Date:    Fri Apr 25 15:26:40 PDT 2003
>Last-Modified:  Fri Apr 25 15:26:40 PDT 2003
>Originator:     Edward Brocklesby
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:
System: FreeBSD firedrake.internal 4.6-STABLE FreeBSD 4.6-STABLE #1: Wed Jul 17 18:43:50 BST 2002 root@firedrake.internal:/usr/obj/usr/src/sys/FIREDRAKE i386

>Description:

http://firedrake.etherix.com/~ejb/chown-vvflag.diff

Similar to pr bin/40709 (-vv flag for chmod), this patch provides
the same functionality to chown and chgrp. The old and new ownership
is printed in the following form:

/usr/home/ejb/test: 1001:20 -> 0:20

UIDs and GIDs are printed in numeric form in order to prevent a passwd
lookup for every file.

The provided patch is against:

     $FreeBSD: src/usr.sbin/chown/chown.c,v 1.24 2002/07/17 16:22:24 dwmalone Exp $
     $FreeBSD: src/usr.sbin/chown/chown.8,v 1.20 2002/07/14 14:42:43 charnier Exp $

from cvs head.

>How-To-Repeat:
>Fix:
(See description.)
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: johan 
State-Changed-When: Fri Aug 23 09:08:56 PDT 2002 
State-Changed-Why:  
I get 
Not Found 
The requested URL /~ejb/chown-vvflag.diff was not found on this server. 
Apache/2.0.40 Server at firedrake.etherix.com Port 80 
when trying to fetch the patch. 

Can you please send the patch attched in a mail 
to bug-followup@freebsd.org with the subject of 
this mail intact. 



Responsible-Changed-From-To: freebsd-bugs->johan 
Responsible-Changed-By: johan 
Responsible-Changed-When: Fri Aug 23 09:08:56 PDT 2002 
Responsible-Changed-Why:  
I will have a look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41341 

From: Edward Brocklesby <ejb@lythe.org.uk>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/41341 (Patch included)
Date: Sun, 2 Feb 2003 17:13:31 +0000

 --------------Boundary-00=_JIYOGC0PEHUGJFE0GWP9
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: 8bit
 
 Hi,
 
 Sorry for the delay in replying to this.  A patch as requested can be found 
 attached to this mail.
 
 Regards,
 Edward.
 --------------Boundary-00=_JIYOGC0PEHUGJFE0GWP9
 Content-Type: text/x-diff;
   charset="iso-8859-1";
   name="chown-vvflag.diff"
 Content-Transfer-Encoding: 8bit
 Content-Disposition: attachment; filename="chown-vvflag.diff"
 
 ? chgrp.1.gz
 ? chown
 ? chown.8.gz
 Index: chown.8
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/chown/chown.8,v
 retrieving revision 1.21
 diff -u -r1.21 chown.8
 --- chown.8	2003/01/26 02:40:23	1.21
 +++ chown.8	2003/02/02 16:59:31
 @@ -96,6 +96,10 @@
  Cause
  .Nm
  to be verbose, showing files as the owner is modified.
 +If the
 +.Fl v
 +flag is specified more than once, chown will print the filename, followed
 +by the old and new uid/gid.
  .El
  .Pp
  The
 Index: chown.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/chown/chown.c,v
 retrieving revision 1.25
 diff -u -r1.25 chown.c
 --- chown.c	2002/12/30 10:16:56	1.25
 +++ chown.c	2003/02/02 16:59:32
 @@ -106,7 +106,7 @@
  			hflag = 1;
  			break;
  		case 'v':
 -			vflag = 1;
 +			vflag++;
  			break;
  		case '?':
  		default:
 @@ -191,7 +191,12 @@
  				rval = 1;
  			}
  		} else {
 -			if (vflag)
 +			if (vflag > 1)
 +				printf("%s: %u:%u -> %u:%u\n", p->fts_path,
 +				    p->fts_statp->st_uid, p->fts_statp->st_gid,
 +				    (uid == (uid_t)-1) ? p->fts_statp->st_uid : uid,
 +				    (gid == (gid_t)-1) ? p->fts_statp->st_gid : gid);
 +			else if (vflag)
  				printf("%s\n", p->fts_path);
  		}
  	}
 
 --------------Boundary-00=_JIYOGC0PEHUGJFE0GWP9--
State-Changed-From-To: feedback->open 
State-Changed-By: johan 
State-Changed-When: Sun Feb 2 09:47:43 PST 2003 
State-Changed-Why:  
Got the patch. Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41341 
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Fri Apr 25 15:26:07 PDT 2003 
State-Changed-Why:  
Committed, thanks for the patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41341 
>Unformatted:
