2010-05-05 11:38:25 +00:00
|
|
|
doc/find.texi | 4 ++++
|
|
|
|
find/defs.h | 3 +++
|
|
|
|
find/find.1 | 3 +++
|
|
|
|
find/ftsfind.c | 6 ++++++
|
|
|
|
find/parser.c | 9 +++++++++
|
|
|
|
find/util.c | 1 +
|
|
|
|
6 files changed, 26 insertions(+), 0 deletions(-)
|
|
|
|
|
2009-11-26 17:50:53 +00:00
|
|
|
diff --git a/doc/find.texi b/doc/find.texi
|
2010-04-03 15:50:55 +00:00
|
|
|
index b509f66..3ce5b1e 100644
|
2009-11-26 17:50:53 +00:00
|
|
|
--- a/doc/find.texi
|
|
|
|
+++ b/doc/find.texi
|
2010-04-03 15:50:55 +00:00
|
|
|
@@ -1438,6 +1438,10 @@ them.
|
2009-10-20 12:38:53 +00:00
|
|
|
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
|
|
|
|
+
|
|
|
|
@deffn Option -xdev
|
|
|
|
@deffnx Option -mount
|
|
|
|
Don't descend directories on other filesystems. These options are
|
2009-11-26 17:50:53 +00:00
|
|
|
diff --git a/find/defs.h b/find/defs.h
|
2010-05-05 11:38:25 +00:00
|
|
|
index 11d1d00..da3ff96 100644
|
2009-11-26 17:50:53 +00:00
|
|
|
--- a/find/defs.h
|
|
|
|
+++ b/find/defs.h
|
2010-05-05 11:38:25 +00:00
|
|
|
@@ -561,6 +561,9 @@ struct options
|
2009-10-20 12:38:53 +00:00
|
|
|
/* If true, don't cross filesystem boundaries. */
|
2010-05-05 11:38:25 +00:00
|
|
|
bool stay_on_filesystem;
|
2010-04-03 15:50:55 +00:00
|
|
|
|
2009-10-20 12:38:53 +00:00
|
|
|
+ /* If true, don't descend directories on autofs filesystems. */
|
2010-05-05 11:38:25 +00:00
|
|
|
+ bool bypass_autofs;
|
2009-11-26 17:50:53 +00:00
|
|
|
+
|
2010-04-03 15:50:55 +00:00
|
|
|
/* If true, we ignore the problem where we find that a directory entry
|
2009-10-20 12:38:53 +00:00
|
|
|
* no longer exists by the time we get around to processing it.
|
|
|
|
*/
|
2009-11-26 17:50:53 +00:00
|
|
|
diff --git a/find/find.1 b/find/find.1
|
2010-04-03 15:50:55 +00:00
|
|
|
index 5da6ddf..82dc802 100644
|
2009-11-26 17:50:53 +00:00
|
|
|
--- a/find/find.1
|
|
|
|
+++ b/find/find.1
|
2010-04-03 15:50:55 +00:00
|
|
|
@@ -460,6 +460,9 @@ if standard input is a tty, and to
|
2009-10-20 12:38:53 +00:00
|
|
|
.B \-nowarn
|
|
|
|
otherwise.
|
|
|
|
|
|
|
|
+.IP \-xautofs
|
|
|
|
+Don't descend directories on autofs filesystems.
|
|
|
|
+
|
|
|
|
.IP \-xdev
|
|
|
|
Don't descend directories on other filesystems.
|
|
|
|
|
2009-11-26 17:50:53 +00:00
|
|
|
diff --git a/find/ftsfind.c b/find/ftsfind.c
|
2010-05-05 11:38:25 +00:00
|
|
|
index 9fdb8ef..bd7cc37 100644
|
2009-11-26 17:50:53 +00:00
|
|
|
--- a/find/ftsfind.c
|
|
|
|
+++ b/find/ftsfind.c
|
2010-05-05 11:38:25 +00:00
|
|
|
@@ -485,6 +485,12 @@ consider_visiting (FTS *p, FTSENT *ent)
|
2009-10-20 12:38:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (options.bypass_autofs &&
|
|
|
|
+ 0 == strcmp ("autofs", filesystem_type (&statbuf, ent->fts_name)))
|
|
|
|
+ {
|
|
|
|
+ fts_set(p, ent, FTS_SKIP); /* descend no further */
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if ( (ent->fts_info == FTS_D) && !options.do_dir_first )
|
|
|
|
{
|
2010-04-03 15:50:55 +00:00
|
|
|
/* this is the preorder visit, but user said -depth */
|
2009-11-26 17:50:53 +00:00
|
|
|
diff --git a/find/parser.c b/find/parser.c
|
2010-05-05 11:38:25 +00:00
|
|
|
index 3da5721..e99caff 100644
|
2009-11-26 17:50:53 +00:00
|
|
|
--- a/find/parser.c
|
|
|
|
+++ b/find/parser.c
|
2010-05-05 11:38:25 +00:00
|
|
|
@@ -151,6 +151,7 @@ static bool parse_user (const struct parser_table*, char *argv[], int *
|
|
|
|
static bool parse_version (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_wholename (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_xdev (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
+static bool parse_xautofs (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_ignore_race (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_noignore_race (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_warn (const struct parser_table*, char *argv[], int *arg_ptr);
|
2010-04-03 15:50:55 +00:00
|
|
|
@@ -325,6 +326,7 @@ static struct parser_table const parse_table[] =
|
2009-10-20 12:38:53 +00:00
|
|
|
PARSE_TEST_NP ("wholename", wholename), /* GNU, replaced -path, but anyway -path will soon be in POSIX */
|
|
|
|
{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 */
|
|
|
|
#ifdef UNIMPLEMENTED_UNIX
|
|
|
|
/* It's pretty ugly for find to know about archive formats.
|
2010-05-05 11:38:25 +00:00
|
|
|
@@ -2795,6 +2797,13 @@ parse_xdev (const struct parser_table* entry, char **argv, int *arg_ptr)
|
2009-10-20 12:38:53 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 11:38:25 +00:00
|
|
|
static bool
|
2009-10-20 12:38:53 +00:00
|
|
|
+parse_xautofs (const struct parser_table* entry, char **argv, int *arg_ptr)
|
|
|
|
+{
|
|
|
|
+ options.bypass_autofs = true;
|
2010-05-05 11:38:25 +00:00
|
|
|
+ return parse_noop (entry, argv, arg_ptr);
|
2009-10-20 12:38:53 +00:00
|
|
|
+}
|
|
|
|
+
|
2010-05-05 11:38:25 +00:00
|
|
|
+static bool
|
2009-10-20 12:38:53 +00:00
|
|
|
parse_ignore_race (const struct parser_table* entry, char **argv, int *arg_ptr)
|
|
|
|
{
|
|
|
|
options.ignore_readdir_race = true;
|
2009-11-26 17:50:53 +00:00
|
|
|
diff --git a/find/util.c b/find/util.c
|
2010-05-05 11:38:25 +00:00
|
|
|
index 8577396..4d45f84 100644
|
2009-11-26 17:50:53 +00:00
|
|
|
--- a/find/util.c
|
|
|
|
+++ b/find/util.c
|
2010-05-05 11:38:25 +00:00
|
|
|
@@ -1006,6 +1006,7 @@ set_option_defaults (struct options *p)
|
2009-10-20 12:38:53 +00:00
|
|
|
|
|
|
|
p->full_days = false;
|
|
|
|
p->stay_on_filesystem = false;
|
|
|
|
+ p->bypass_autofs = false;
|
|
|
|
p->ignore_readdir_race = false;
|
|
|
|
|
|
|
|
if (p->posixly_correct)
|