Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Oct 2002 09:59:23 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 19269 for review
Message-ID:  <200210141659.g9EGxNRl014394@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=19269

Change 19269 by rwatson@rwatson_tislabs on 2002/10/14 09:58:33

	Tunefs support for the FS_ACLS flag.

Affected files ...

.. //depot/projects/trustedbsd/mac/sbin/tunefs/tunefs.8#10 edit
.. //depot/projects/trustedbsd/mac/sbin/tunefs/tunefs.c#7 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sbin/tunefs/tunefs.8#10 (text+ko) ====

@@ -64,6 +64,8 @@
 The parameters which are to be changed are indicated by the flags
 given below:
 .Bl -tag -width indent
+.It Fl a Cm enable | disable
+Turn on/off the administrative ACL enable flag.
 .It Fl A
 The file system has several backups of the super-block.
 Specifying

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

@@ -93,12 +93,12 @@
 	char *special;
 	const char *name;
 	struct stat st;
-	int Aflag = 0, active = 0;
+	int Aflag = 0, active = 0, aflag = 0;
 	int eflag = 0, fflag = 0, lflag = 0, mflag = 0;
 	int nflag = 0, oflag = 0, pflag = 0, sflag = 0;
 	int evalue = 0, fvalue = 0;
 	int mvalue = 0, ovalue = 0, svalue = 0;
-	char *lvalue = NULL, *nvalue = NULL; 
+	char *avalue = NULL, *lvalue = NULL, *nvalue = NULL; 
 	struct fstab *fs;
 	const char *chg[2];
 	char device[MAXPATHLEN];
@@ -109,8 +109,18 @@
         if (argc < 3)
                 usage();
 	found_arg = 0; /* at least one arg is required */
-	while ((ch = getopt(argc, argv, "Ae:f:l:m:n:o:ps:")) != -1)
+	while ((ch = getopt(argc, argv, "a:Ae:f:l:m:n:o:ps:")) != -1)
 	  switch (ch) {
+	  case 'a':
+		found_arg = 1;
+		name = "ACLs";
+		avalue = optarg;
+		if (strcmp(avalue, "enable") && strcmp(avalue, "disable")) {
+			errx(10, "bad %s (options are %s)", name,
+			    "`enable' or `disable'");
+		}
+		aflag = 1;
+		break;
 	  case 'A':
 		found_arg = 1;
 		Aflag++;
@@ -223,6 +233,26 @@
 		printfs();
 		exit(0);
 	}
+	if (aflag) {
+		name = "ACLs";
+		if (strcmp(avalue, "enable") == 0) {
+			if (sblock.fs_flags & FS_ACLS) {
+				warnx("%s remains unchanged as enabled", name);
+			} else {
+				sblock.fs_flags |= FS_ACLS;
+				warnx("%s set", name);
+			}
+		} else if (strcmp(avalue, "disable") == 0) {
+			if ((~sblock.fs_flags & FS_ACLS) ==
+			    FS_ACLS) {
+				warnx("%s remains unchanged as disabled",
+				    name);
+			} else {
+				sblock.fs_flags &= ~FS_ACLS;
+				warnx("%s set", name);
+			}
+		}
+	}
 	if (eflag) {
 		name = "maximum blocks per file in a cylinder group";
 		if (sblock.fs_maxbpg == evalue) {

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




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