svn commit: branches/busybox_1_1_stable/findutils

pgf at busybox.net pgf at busybox.net
Thu Mar 30 20:06:47 UTC 2006


Author: pgf
Date: 2006-03-30 12:06:46 -0800 (Thu, 30 Mar 2006)
New Revision: 14707

Log:
prevent find from ever descending into an xdev'ed directory.
(brought over from trunk r14665)


Modified:
   branches/busybox_1_1_stable/findutils/find.c


Changeset:
Modified: branches/busybox_1_1_stable/findutils/find.c
===================================================================
--- branches/busybox_1_1_stable/findutils/find.c	2006-03-30 13:54:30 UTC (rev 14706)
+++ branches/busybox_1_1_stable/findutils/find.c	2006-03-30 20:06:46 UTC (rev 14707)
@@ -79,6 +79,15 @@
 
 static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
 {
+#ifdef CONFIG_FEATURE_FIND_XDEV
+	if (S_ISDIR(statbuf->st_mode) && xdev_count) {
+		int i;
+		for (i=0; i<xdev_count; i++) {
+			if (xdev_dev[i] != statbuf->st_dev)
+				return SKIP;
+		}
+	}
+#endif
 	if (pattern != NULL) {
 		const char *tmp = strrchr(fileName, '/');
 
@@ -125,21 +134,6 @@
 			goto no_match;
 	}
 #endif
-#ifdef CONFIG_FEATURE_FIND_XDEV
-	if (xdev_count) {
-		int i;
-		for (i=0; i<xdev_count; i++) {
-			if (xdev_dev[i] == statbuf-> st_dev)
-				break;
-		}
-		if (i == xdev_count) {
-			if(S_ISDIR(statbuf->st_mode))
-				return SKIP;
-			else
-				goto no_match;
-		}
-	}
-#endif
 #ifdef CONFIG_FEATURE_FIND_NEWER
 	if (newer_mtime != 0) {
 		time_t file_age = newer_mtime - statbuf->st_mtime;




More information about the busybox-cvs mailing list