c5de3e1
diff --git a/doc/find.texi b/doc/find.texi
c5de3e1
index 2e5958d..8944096 100644
c5de3e1
--- a/doc/find.texi
c5de3e1
+++ b/doc/find.texi
c5de3e1
@@ -1413,6 +1413,10 @@ them.
29ef88d
 There are two ways to avoid searching certain filesystems.  One way is
29ef88d
 to tell @code{find} to only search one filesystem:
29ef88d
 
29ef88d
+@deffn Option -xautofs
29ef88d
+Don't descend directories on autofs filesystems.
29ef88d
+@end deffn
29ef88d
+
29ef88d
 @deffn Option -xdev
29ef88d
 @deffnx Option -mount
29ef88d
 Don't descend directories on other filesystems.  These options are
c5de3e1
diff --git a/find/defs.h b/find/defs.h
c5de3e1
index 1708d83..a0e7059 100644
c5de3e1
--- a/find/defs.h
c5de3e1
+++ b/find/defs.h
c5de3e1
@@ -550,6 +550,9 @@ struct options
29ef88d
   /* If true, don't cross filesystem boundaries. */
29ef88d
   boolean stay_on_filesystem;
29ef88d
   
29ef88d
+  /* If true, don't descend directories on autofs filesystems. */
29ef88d
+  boolean bypass_autofs;
c5de3e1
+
29ef88d
   /* If true, we ignore the problem where we find that a directory entry 
29ef88d
    * no longer exists by the time we get around to processing it.
29ef88d
    */
c5de3e1
diff --git a/find/find.1 b/find/find.1
c5de3e1
index 8b67ae3..f9c61a3 100644
c5de3e1
--- a/find/find.1
c5de3e1
+++ b/find/find.1
c5de3e1
@@ -451,6 +451,9 @@ if standard input is a tty, and to
29ef88d
 .B \-nowarn
29ef88d
 otherwise.
29ef88d
 
29ef88d
+.IP \-xautofs
29ef88d
+Don't descend directories on autofs filesystems.
29ef88d
+
29ef88d
 .IP \-xdev
29ef88d
 Don't descend directories on other filesystems.
29ef88d
 
c5de3e1
diff --git a/find/ftsfind.c b/find/ftsfind.c
c5de3e1
index b59d896..838b81f 100644
c5de3e1
--- a/find/ftsfind.c
c5de3e1
+++ b/find/ftsfind.c
29ef88d
@@ -525,6 +525,12 @@ consider_visiting(FTS *p, FTSENT *ent)
29ef88d
 	}
29ef88d
     }
29ef88d
 
29ef88d
+  if (options.bypass_autofs &&
29ef88d
+      0 == strcmp ("autofs", filesystem_type (&statbuf, ent->fts_name)))
29ef88d
+    {
29ef88d
+      fts_set(p, ent, FTS_SKIP); /* descend no further */
29ef88d
+    }
29ef88d
+
29ef88d
   if ( (ent->fts_info == FTS_D) && !options.do_dir_first )
29ef88d
     {
29ef88d
       /* this is the preorder visit, but user said -depth */ 
c5de3e1
diff --git a/find/parser.c b/find/parser.c
c5de3e1
index 534b670..036ddb8 100644
c5de3e1
--- a/find/parser.c
c5de3e1
+++ b/find/parser.c
c5de3e1
@@ -150,6 +150,7 @@ static boolean parse_user          PARAMS((const struct parser_table*, char *arg
29ef88d
 static boolean parse_version       PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
29ef88d
 static boolean parse_wholename     PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
29ef88d
 static boolean parse_xdev          PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
29ef88d
+static boolean parse_xautofs       PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
29ef88d
 static boolean parse_ignore_race   PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
29ef88d
 static boolean parse_noignore_race PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
29ef88d
 static boolean parse_warn          PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
c5de3e1
@@ -320,6 +321,7 @@ static struct parser_table const parse_table[] =
29ef88d
   PARSE_TEST_NP    ("wholename",             wholename), /* GNU, replaced -path, but anyway -path will soon be in POSIX */
29ef88d
   {ARG_TEST,       "writable",               parse_accesscheck, pred_writable}, /* GNU, 4.3.0+ */
29ef88d
   PARSE_OPTION     ("xdev",                  xdev), /* POSIX */
29ef88d
+  PARSE_OPTION     ("xautofs",               xautofs),
29ef88d
   PARSE_TEST       ("xtype",                 xtype),	     /* GNU */
29ef88d
 #ifdef UNIMPLEMENTED_UNIX
29ef88d
   /* It's pretty ugly for find to know about archive formats.
c5de3e1
@@ -2560,6 +2562,16 @@ parse_xdev (const struct parser_table* entry, char **argv, int *arg_ptr)
29ef88d
 }
29ef88d
 
29ef88d
 static boolean
29ef88d
+parse_xautofs (const struct parser_table* entry, char **argv, int *arg_ptr)
29ef88d
+{
29ef88d
+  (void) argv;
29ef88d
+  (void) arg_ptr;
29ef88d
+  (void) entry;
29ef88d
+  options.bypass_autofs = true;
29ef88d
+  return true;
29ef88d
+}
29ef88d
+
29ef88d
+static boolean
29ef88d
 parse_ignore_race (const struct parser_table* entry, char **argv, int *arg_ptr)
29ef88d
 {
29ef88d
   options.ignore_readdir_race = true;
c5de3e1
diff --git a/find/util.c b/find/util.c
c5de3e1
index a06eada..d3cb467 100644
c5de3e1
--- a/find/util.c
c5de3e1
+++ b/find/util.c
29ef88d
@@ -933,6 +933,7 @@ set_option_defaults(struct options *p)
29ef88d
 
29ef88d
   p->full_days = false;
29ef88d
   p->stay_on_filesystem = false;
29ef88d
+  p->bypass_autofs = false;
29ef88d
   p->ignore_readdir_race = false;
29ef88d
 
29ef88d
   if (p->posixly_correct)