Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Mar 2000 13:16:33 -0800 (PST)
From:      rmukerji@execpc.com
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/17232: chown(1) and chgrp(1) do not honor -v flag per documentation - patch included
Message-ID:  <200003062116.NAA27267@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         17232
>Category:       misc
>Synopsis:       chown(1) and chgrp(1) do not honor -v flag per documentation - patch included
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar  6 13:20:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Arindum Mukerji
>Release:        4.0-CURRENT
>Organization:
>Environment:
FreeBSD playground.testbed.eng 4.0-CURRENT FreeBSD 4.0-CURRENT #9: Sun Mar  5 13:15:55 CST 2000     arm@playground.testbed.eng:/usr/src/sys/compile/HADES  i386

>Description:
From owner-freebsd-current@FreeBSD.ORG  Mon Mar  6 13:36:20 2000
From: Dave Boers <djb@relativity.student.utwente.nl>                                       
Reply-To: djb@relativity.student.utwente.nl                                                
To: freebsd-current@freebsd.org                                                            
Cc: dalroi@wit401310.student.utwente.nl                                                    
Subject: Small bug in chown and chgrp ?                                                    
Date: Mon, 6 Mar 2000 20:36:08 +0100                                                       
Message-ID: <20000306203608.B26973@relativity.student.utwente.nl>
X-Mailer: Mutt 1.0.1i                                                                      

Hi all,

I've been bitten by the following:

44 relativity ~ % chown -v djb:wheel test
chown: illegal option -- v                                                                 
usage: chown [-R [-H | -L | -P]] [-f] [-h] [-v] owner[:group] file ...                     
       chown [-R [-H | -L | -P]] [-f] [-h] [-v] :group file ...
       chgrp [-R [-H | -L | -P]] [-f] [-h] [-v] group file ...

Where "test" is an ordinary directory.
        
It seems that chown's behavior is inconsistent with both the usage message
and the man page. The same goes for chgrp.

Regards,
                
Dave Boers.     
                        
--                                                                                         
  Dave Boers             < djb @ relativity . student . utwente . nl >                     
  Don't let your schooling interfere with your education. (Mark Twain)            
>How-To-Repeat:
# chown -v arm foo
chown: illegal option -- v
usage: chown [-R [-H | -L | -P]] [-f] [-h] [-v] owner[:group] file ...
       chown [-R [-H | -L | -P]] [-f] [-h] [-v] :group file ...
       chgrp [-R [-H | -L | -P]] [-f] [-h] [-v] group file ...

>Fix:
% cvs diff -u chown.c 
Index: chown.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/chown/chown.c,v
retrieving revision 1.14
diff -u -r1.14 chown.c
--- chown.c     1999/11/27 19:25:07     1.14
+++ chown.c     2000/03/06 21:14:36
@@ -86,7 +86,7 @@
        ischown = myname[2] == 'o';
 
        Hflag = Lflag = Pflag = hflag = 0;
-       while ((ch = getopt(argc, argv, "HLPRfh")) != -1)
+       while ((ch = getopt(argc, argv, "HLPRfhv")) != -1)
                switch (ch) {
                case 'H':
                        Hflag = 1;
@@ -108,6 +108,9 @@
                        break;
                case 'h':
                        hflag = 1;
+                       break;
+               case 'v':
+                       vflag = 1;
                        break;
                case '?':
                default:


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


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003062116.NAA27267>