prevent infinite loop with recurse option enabled?

Chris Watt cnww at
Mon Nov 5 21:23:05 GMT 2001

I'm not sure how helpful this will be, but here goes:

AFAIK SMB (and thus anything using it) is totally unaware of the idea of
circularly linked filesystems because they don't happen in Windows (unless
your FS is screwed. Incidentally this is also the reason I blithely assume
that you're talking about Samba servers rather than Windows boxes. Complain
if I'm wrong). I don't know of any way you could deal with this at the
client side, short of checksumming the directory contents, and even that
would be potentially harmful (no way to tell for sure that it is a repeat
directory and not just a very similar one).

What I know of that can be done is rather less elegant than a clean
client-side solution would be, but if you don't really depend on following
any symbolic links in the search process, you can work around the problem
by duplicating every share in your smb.conf file (changing the name in a
consistent way, like adding "search_" at the beginning) and then in the new
share definitions set 
browsable = no
writable = no
guest only = yes
follow symlinks = no

Respectively these will prevent the share from showing up in browse lists,
force it to be read only, not require authentication for read access
(meaning you don't need to have your script spit real passwords around over
the network) and prevent the Samba server from following symbolic links for
the client. Unless you've been hard linking directories this should solve
the recursion depth problem. Of course if you've got large numbers of
servers/shares the cure may be worse than the disease.
I think it should be possible using the fancy machine-name-specific include
features in smb.conf to have appropriate options come on just for specific
clients (i.e. the machine that runs the search program), but I've never
tried this. I'm sure some of the guru's can say if and how it could be done.

At 05:49 PM 11/5/01 -0500, Justin Yackoski wrote:

>Is there any current way to set a depth limit, or even better, just 
>simply prevent visiting a directory twice (I've heard that wget hashes 


Clinical Psychologist: Someone who tries to figure out whether an 
infant has more fun in infancy than an adult has in adultery.

More information about the samba mailing list