PERFORCE change 18887 for review

Brian Feldman green at freebsd.org
Mon Oct 7 21:17:59 GMT 2002


http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18887

Change 18887 by green at green_laptop_2 on 2002/10/07 14:17:17

	Add an -n flag to setextattr(8): nul-terminate the extent (like
	what SEBSD wants).

Affected files ...

.. //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.8#3 edit
.. //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#5 edit

Differences ...

==== //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.8#3 (text+ko) ====

@@ -56,7 +56,7 @@
 .Ar attrname
 .Ar filename ...
 .Nm setextattr
-.Op Fl fq
+.Op Fl fnq
 .Ar attrnamespace
 .Ar attrname
 .Ar attrvalue
@@ -86,6 +86,8 @@
 .It Fl -f
 (Force) Ignore errors on individual filenames and continue with
 the remaining arguments.
+.It Fl -n
+(Nul-terminate) Nul-terminate the extent content written out.
 .It Fl -q
 (Quiet) Do not print out the pathname and suppress error messages.
 .It Fl -s

==== //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#5 (text+ko) ====

@@ -62,7 +62,7 @@
 		fprintf(stderr, " attrname filename ...\n");
 		exit(-1);
 	case EASET:
-		fprintf(stderr, "usage: setextattr [-fq] attrnamespace");
+		fprintf(stderr, "usage: setextattr [-fnq] attrnamespace");
 		fprintf(stderr, " attrname attrvalue filename ...\n");
 		exit(-1);
 	case EARM:
@@ -106,6 +106,7 @@
 		 minargc;
 
 	int	flag_force = 0;
+	int	flag_null = 0;
 	int	flag_quiet = 0;
 	int	flag_string = 0;
 	int	flag_hex = 0;
@@ -122,7 +123,7 @@
 		minargc = 3;
 	} else if (!strcmp(p, "setextattr")) {
 		what = EASET;
-		options = "fq";
+		options = "fnq";
 		minargc = 4;
 	} else if (!strcmp(p, "rmextattr")) {
 		what = EARM;
@@ -141,6 +142,9 @@
 		case 'f':
 			flag_force = 1;
 			break;
+		case 'n':
+			flag_null = 1;
+			break;
 		case 'q':
 			flag_quiet = 1;
 			break;
@@ -190,7 +194,8 @@
 			break;
 		case EASET:
 			error = extattr_set_link(argv[arg_counter],
-			    attrnamespace, attrname, buf, strlen(buf));
+			    attrnamespace, attrname, buf,
+			    strlen(buf) + flag_null);
 			if (error >= 0)
 				continue;
 			break;
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