Bug 41926

Summary: 'h' missing in getopt() call in STABLE's chmod
Product: Base System Reporter: Andre Albsmeier <Andre.Albsmeier>
Component: binAssignee: Tom Rhodes <trhodes>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.6-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Andre Albsmeier 2002-08-23 10:20:01 UTC
/bin/chmod supports the -h flag but it's missing in the getopt call.
It is described in the man page but missing in the SYNOPSIS line as well.

How-To-Repeat: 
chmod -h 
man chmod
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2002-08-23 14:59:24 UTC
Responsible Changed
From-To: freebsd-bugs->johan

I will handle this.
Comment 2 Johan Karlsson freebsd_committer freebsd_triage 2002-08-23 15:04:37 UTC
Responsible Changed
From-To: johan->trhodes

Over to Tom who MFC parts of chmod.1 rev 1.25 in rev 1.17.2.10 
Tom please either back out that part or	MFC all of it and the 
code change in chmod.c rev 1.21. 

I prefer to have all of it MFCed but please clear the with  
ru and bde.
Comment 3 Andre Albsmeier 2002-09-17 16:10:33 UTC
As pointed out by bde the usage messages needs a change as well:

--- chmod.c.ORI	Tue Sep 17 17:06:35 2002
+++ chmod.c	Tue Sep 17 17:07:44 2002
@@ -78,7 +78,7 @@
 	set = NULL;
 	omode = 0;
 	Hflag = Lflag = Pflag = Rflag = fflag = hflag = vflag = 0;
-	while ((ch = getopt(argc, argv, "HLPRXfgorstuvwx")) != -1)
+	while ((ch = getopt(argc, argv, "HLPRXfghorstuvwx")) != -1)
 		switch (ch) {
 		case 'H':
 			Hflag = 1;
@@ -214,6 +214,6 @@
 usage()
 {
 	(void)fprintf(stderr,
-	    "usage: chmod [-fv] [-R [-H | -L | -P]] mode file ...\n");
+	    "usage: chmod [-fhv] [-R [-H | -L | -P]] mode file ...\n");
 	exit(1);
 }
--- chmod.1.ORI	Tue Sep 17 17:07:16 2002
+++ chmod.1	Tue Sep 17 17:07:57 2002
@@ -44,7 +44,7 @@
 .Sh SYNOPSIS
 .Nm
 .Oo
-.Fl fv
+.Fl fhv
 .Fl R
 .Op Fl H | Fl L | Fl P
 .Oc
Comment 4 Tom Rhodes freebsd_committer freebsd_triage 2002-09-18 00:38:55 UTC
State Changed
From-To: open->closed

MFC complete!  Thanks for the submission, and reminder!
Comment 5 Tom Rhodes freebsd_committer freebsd_triage 2002-09-19 00:41:10 UTC
State Changed
From-To: closed->patched

When the function is MFC'ed then I'll MFC this.  Until then, remain in 
'patched' state.  Most likely I'll do this after the release.
Comment 6 Tom Rhodes freebsd_committer freebsd_triage 2002-10-18 02:50:28 UTC
State Changed
From-To: patched->closed

This has now been MFC'ed.  Thanks!