0

I would like to create a Samba share that filters the contents of a directory based on a series of regular expression matches against file names. For example, I would like the share to allow access to only files with an .xml extension, effectively ignoring any filenames that don't match the regex.

Are there any Samba VFS modules that provide this functionality?

mlambie
  • 1,201
  • 2
  • 16
  • 22

1 Answers1

0

I don't know of anything automatic for this. But you can use a combination of the find command and ln to create a directory full of symlinks to the files you want. This 'shadow' directory would be what you share in Samba.

Obviously, this needs to be kept updated, but it wouldn't be too hard to have a cron job add missing links for new files. For removing old files, you could even alias the rm and move commands to shell scripts that remove the symlinks if necessary before removing the original file.

See here for one way to create the directory.

AngerClown
  • 320
  • 1
  • 3
  • That's the kind of solution I was trying to avoid by using a VFS module. If I can't have Samba maintain the file list then I will need to do it myself. – mlambie Feb 03 '13 at 19:03