Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
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 3 '13 at 19:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.