Ian Kent 7bcbae
autofs-5.0.7 - don't use dirent d_type to filter out files in scandir()
Ian Kent 7bcbae
Ian Kent 7bcbae
From: Leonardo Chiquitto <leonardo.lists@gmail.com>
Ian Kent 7bcbae
Ian Kent 7bcbae
The "d_type" field of a dirent structure is not filled in by all
Ian Kent 7bcbae
file systems (XFS being one example), so we can't rely on it to
Ian Kent 7bcbae
check file types.
Ian Kent 7bcbae
---
Ian Kent 7bcbae
Ian Kent 7bcbae
 CHANGELOG            |    1 +
Ian Kent 7bcbae
 modules/lookup_dir.c |    4 ----
Ian Kent 7bcbae
 2 files changed, 1 insertions(+), 4 deletions(-)
Ian Kent 7bcbae
Ian Kent 7bcbae
Ian Kent 7bcbae
diff --git a/CHANGELOG b/CHANGELOG
Ian Kent 7bcbae
index 460bd27..c9be73e 100644
Ian Kent 7bcbae
--- a/CHANGELOG
Ian Kent 7bcbae
+++ b/CHANGELOG
Ian Kent 7bcbae
@@ -21,6 +21,7 @@
Ian Kent 7bcbae
 - fix submount offset delete.
Ian Kent 7bcbae
 - fix init script status return.
Ian Kent 7bcbae
 - fix use get_proximity() without libtirpc.
Ian Kent 7bcbae
+- don't use dirent d_type to filter out files in scandir()
Ian Kent 7bcbae
 
Ian Kent 7bcbae
 25/07/2012 autofs-5.0.7
Ian Kent 7bcbae
 =======================
Ian Kent 7bcbae
diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c
Ian Kent 7bcbae
index 658cc29..33901c0 100644
Ian Kent 7bcbae
--- a/modules/lookup_dir.c
Ian Kent 7bcbae
+++ b/modules/lookup_dir.c
Ian Kent 7bcbae
@@ -103,10 +103,6 @@ static int acceptable_dirent_p(const struct dirent *e)
Ian Kent 7bcbae
 {
Ian Kent 7bcbae
   size_t namesz;
Ian Kent 7bcbae
 
Ian Kent 7bcbae
-
Ian Kent 7bcbae
-  if (!(e->d_type == DT_REG || e->d_type == DT_LNK))
Ian Kent 7bcbae
-	  return 0;
Ian Kent 7bcbae
-
Ian Kent 7bcbae
   namesz = strlen(e->d_name);
Ian Kent 7bcbae
   if (!namesz)
Ian Kent 7bcbae
 	  return 0;