PERFORCE change 21070 for review

Brian Feldman green at freebsd.org
Fri Nov 15 16:58:09 GMT 2002


http://perforce.freebsd.org/chv.cgi?CH=21070

Change 21070 by green at green_laptop_2 on 2002/11/15 08:58:01

	* Correct the usage for setfmac(8) in its manpage and that
	  of setf{,s}mac(8) in the usage() statement.
	* Implement -R for recursive labelling for setfmac.8 since it's
	  essentially free now.

Affected files ...

.. //depot/projects/trustedbsd/mac/sbin/setfsmac/setfmac.8#2 edit
.. //depot/projects/trustedbsd/mac/sbin/setfsmac/setfsmac.c#7 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sbin/setfsmac/setfmac.8#2 (text+ko) ====

@@ -39,9 +39,9 @@
 .Nd set MAC label for a file system object
 .Sh SYNOPSIS
 .Nm
-.Ar label
-.Ar file
-.Op Ar file ...
+.Op Fl Rh
+.Ar label file
+.Op Ar ...
 .Sh DESCRIPTION
 The
 .Nm

==== //depot/projects/trustedbsd/mac/sbin/setfsmac/setfsmac.c#7 (text+ko) ====

@@ -86,7 +86,7 @@
 	FTSENT *ftsent;
 	FTS *fts;
 	struct label_specs *specs;
-	int eflag = 0, xflag = 0, vflag = 0, hflag;
+	int eflag = 0, xflag = 0, vflag = 0, Rflag = 0, hflag;
 	int ch, is_setfmac;
 	char *bn;
 
@@ -96,8 +96,11 @@
 	is_setfmac = strcmp(bn, "setfmac") == 0;
 	hflag = is_setfmac ? FTS_LOGICAL : FTS_PHYSICAL;
 	specs = new_specs();
-	while ((ch = getopt(argc, argv, is_setfmac ? "h" : "ef:s:vx")) != -1) {
+	while ((ch = getopt(argc, argv, is_setfmac ? "Rh" : "ef:s:vx")) != -1) {
 		switch (ch) {
+		case 'R':
+			Rflag = 1;
+			break;
 		case 'e':
 			eflag = 1;
 			break;
@@ -143,7 +146,7 @@
 		case FTS_D:		/* do pre-order */
 		case FTS_DC:		/* do cyclic? */
 			/* don't ever recurse directories as setfmac(8) */
-			if (is_setfmac)
+			if (is_setfmac && !Rflag)
 				fts_set(fts, ftsent, FTS_SKIP);
 		case FTS_DEFAULT:	/* do default */
 		case FTS_F:		/* do regular */
@@ -180,9 +183,9 @@
 {
 
 	if (is_setfmac)
-		fprintf(stderr, "usage: setfmac [-h] label path ...\n");
+		fprintf(stderr, "usage: setfmac [-Rh] label path [...]\n");
 	else
-		fprintf(stderr, "usage: setfsmac [-evx] [-f specfile [...]] [-s specfile [...]] path ...\n");
+		fprintf(stderr, "usage: setfsmac [-evx] [-f specfile [...]] [-s specfile [...]] path [...]\n");
 	exit(1);
 }
 
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list