Re: using auto.master.d

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 10, 2013 at 6:51 PM, Chuck Lever <chuck.lever@xxxxxxxxxx> wrote:
> Hi-
>
> I've tried a few times adding a foo.autofs file to /etc/auto.master.d on my Fedora 16 and EL6-based systems.  The automounter never seems to find or use the file.  What am I doing wrong?

Hello,

(I just realized all the other emails we exchanged didn't include the mailing
list on CC).

Anyway, we figured out the problem. When /etc is on an XFS file system,
dirent->d_type will always be equal to DT_UNKNOWN and all files in
/etc/auto.masted.d/ will be filtered out / ignored. In my opinion we can
just remove this check. Please consider the patch below for inclusion.

Thanks,
Leonardo

Do not use dirent->d_type to filter out files in scandir()

The "d_type" field of a dirent structure is not filled in by all
file systems (XFS being one example), so we can't rely on it to
check file types.

Index: autofs/modules/lookup_dir.c
===================================================================
--- autofs.orig/modules/lookup_dir.c
+++ autofs/modules/lookup_dir.c
@@ -103,10 +103,6 @@ static int acceptable_dirent_p(const str
 {
   size_t namesz;

-
-  if (!(e->d_type == DT_REG || e->d_type == DT_LNK))
-	  return 0;
-
   namesz = strlen(e->d_name);
   if (!namesz)
 	  return 0;
--
To unsubscribe from this list: send the line "unsubscribe autofs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux