PERFORCE change 109987 for review

Todd Miller millert at FreeBSD.org
Tue Nov 14 20:46:31 UTC 2006


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

Change 109987 by millert at millert_g5tower on 2006/11/14 20:39:16

	Skip mount points entirely.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/restorecon/restorecon.c#5 edit
.. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/setfiles/setfiles.c#5 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/restorecon/restorecon.c#5 (text+ko) ====

@@ -307,11 +307,14 @@
 		}
 		while ((ftsent = fts_read(fts)) != NULL) {
 			switch (ftsent->fts_info) {
+			case FTS_D:		/* dir in pre-order */
+				if (fts->fts_dev != ftsent->fts_dev)
+					break;
+				/* FALLTHROUGH */
+			case FTS_F:		/* file */
+			case FTS_SL:		/* symlink */
+			case FTS_W:		/* whiteout */
 			case FTS_DEFAULT:
-			case FTS_D:
-			case FTS_F:
-			case FTS_SL:
-			case FTS_W:
 				apply_spec(ftsent->fts_path, ftsent->fts_statp);
 				break;
 			case FTS_DNR:
@@ -330,6 +333,12 @@
 				    progname, ftsent->fts_path,
 				    strerror(ftsent->fts_errno));
 				break;
+			case FTS_DP:		/* skip post-order dir */
+			case FTS_DC:		/* skip dir cycle */
+			case FTS_DOT:		/* skip . and .. */
+			case FTS_SLNONE:	/* skip dead symlinks */
+			default:
+				break;
 			}
 		}
 	} else {

==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/setfiles/setfiles.c#5 (text+ko) ====

@@ -671,11 +671,14 @@
 			/* Walk the file tree, calling apply_spec on each file. */
 			while ((ftsent = fts_read(fts)) != NULL) {
 				switch (ftsent->fts_info) {
-				case FTS_DEFAULT:
 				case FTS_D:		/* dir in pre-order */
+					if (fts->fts_dev != ftsent->fts_dev)
+						break;
+					/* FALLTHROUGH */
 				case FTS_F:		/* file */
 				case FTS_SL:		/* symlink */
 				case FTS_W:		/* whiteout */
+				case FTS_DEFAULT:
 					apply_spec(ftsent->fts_path,
 					    ftsent->fts_statp);
 					break;


More information about the p4-projects mailing list