commit
6ee6ae116d
@ -19,7 +19,7 @@ index c584298..9731b71 100644
|
||||
@@ -1474,6 +1474,10 @@ them.
|
||||
There are two ways to avoid searching certain filesystems. One way is
|
||||
to tell @code{find} to only search one filesystem:
|
||||
|
||||
|
||||
+@deffn Option -xautofs
|
||||
+Don't descend directories on autofs filesystems.
|
||||
+@end deffn
|
||||
@ -34,7 +34,7 @@ index 11d1d00..f95ce72 100644
|
||||
@@ -574,6 +574,9 @@ struct options
|
||||
/* If true, don't cross filesystem boundaries. */
|
||||
bool stay_on_filesystem;
|
||||
|
||||
|
||||
+ /* If true, don't descend directories on autofs filesystems. */
|
||||
+ bool bypass_autofs;
|
||||
+
|
||||
@ -48,21 +48,21 @@ index e851f82..a4799ff 100644
|
||||
@@ -567,6 +567,9 @@ to stat them; this gives a significant increase in search speed.
|
||||
.IP "\-version, \-\-version"
|
||||
Print the \fBfind\fR version number and exit.
|
||||
|
||||
|
||||
+.IP \-xautofs
|
||||
+Don't descend directories on autofs filesystems.
|
||||
+
|
||||
.IP \-xdev
|
||||
Don't descend directories on other filesystems.
|
||||
|
||||
|
||||
diff --git a/find/ftsfind.c b/find/ftsfind.c
|
||||
index 9fdb8ef..bd7cc37 100644
|
||||
--- a/find/ftsfind.c
|
||||
+++ b/find/ftsfind.c
|
||||
@@ -479,6 +479,12 @@ consider_visiting (FTS *p, FTSENT *ent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+ if (options.bypass_autofs &&
|
||||
+ 0 == strcmp ("autofs", filesystem_type (&statbuf, ent->fts_name)))
|
||||
+ {
|
||||
@ -89,13 +89,13 @@ index 52a1ef6..995aec3 100644
|
||||
{ARG_TEST, "writable", parse_accesscheck, pred_writable}, /* GNU, 4.3.0+ */
|
||||
PARSE_OPTION ("xdev", xdev), /* POSIX */
|
||||
+ PARSE_OPTION ("xautofs", xautofs),
|
||||
PARSE_TEST ("xtype", xtype), /* GNU */
|
||||
PARSE_TEST ("xtype", xtype), /* GNU */
|
||||
#ifdef UNIMPLEMENTED_UNIX
|
||||
/* It's pretty ugly for find to know about archive formats.
|
||||
@@ -2603,6 +2605,13 @@ parse_xdev (const struct parser_table* entry, char **argv, int *arg_ptr)
|
||||
return parse_noop (entry, argv, arg_ptr);
|
||||
}
|
||||
|
||||
|
||||
+static bool
|
||||
+parse_xautofs (const struct parser_table* entry, char **argv, int *arg_ptr)
|
||||
+{
|
||||
@ -120,12 +120,13 @@ index 8577396..4d45f84 100644
|
||||
tests (N can be +N or -N or N): -amin N -anewer FILE -atime N -cmin N\n\
|
||||
-cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME\n\
|
||||
@@ -1044,6 +1044,7 @@ set_option_defaults (struct options *p)
|
||||
|
||||
|
||||
p->full_days = false;
|
||||
p->stay_on_filesystem = false;
|
||||
+ p->bypass_autofs = false;
|
||||
p->ignore_readdir_race = false;
|
||||
|
||||
|
||||
if (p->posixly_correct)
|
||||
--
|
||||
--
|
||||
1.7.4.4
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user