PERFORCE change 21008 for review

Brian Feldman green at freebsd.org
Tue Nov 12 20:28:25 GMT 2002


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

Change 21008 by green at green_laptop_2 on 2002/11/12 12:27:37

	Make ls(1) use correct logic for finding the path names for
	files to look up MAC labels for.

Affected files ...

.. //depot/projects/trustedbsd/mac/bin/ls/ls.c#20 edit

Differences ...

==== //depot/projects/trustedbsd/mac/bin/ls/ls.c#20 (text+ko) ====

@@ -691,17 +691,15 @@
 
 					error = mac_prepare_file_label(&label);
 					if (error == -1) {
-						warn("%s", cur->fts_name);
+						warn("MAC label for %s/%s",
+						    cur->fts_parent->fts_path,
+						    cur->fts_name);
 						goto label_out;
 					}
 
-					if (cur->fts_level == FTS_ROOTLEVEL)
-						snprintf(name, sizeof(name),
-						    "%s", cur->fts_name);
-					else
-						snprintf(name, sizeof(name),
-						    "%s/%s", cur->fts_parent->fts_accpath,
-						    cur->fts_name);
+					snprintf(name, sizeof(name), "%s/%s",
+					    cur->fts_parent->fts_accpath,
+					    cur->fts_name);
 
 					if (options & FTS_LOGICAL)
 						error = mac_get_file(name,
@@ -710,7 +708,9 @@
 						error = mac_get_link(name,
 						    label);
 					if (error == -1) {
-						warn("%s", cur->fts_name);
+						warn("MAC label for %s/%s",
+						    cur->fts_parent->fts_path,
+						    cur->fts_name);
 						mac_free(label);
 						goto label_out;
 					}
@@ -718,7 +718,9 @@
 					error = mac_to_text(label,
 					    &labelstr);
 					if (error == -1) {
-						warn("%s", cur->fts_name);
+						warn("MAC label for %s/%s",
+						    cur->fts_parent->fts_path,
+						    cur->fts_name);
 						mac_free(label);
 						goto label_out;
 					}
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