id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
3097	[patch] Recursive find file does not search recursively on samba share	bilbo	andrew_b	"When searching recursively a samba share, mc does not go into any subdirectories even if ""Find recursively"" is checked.

With a bit of debugging I found a cause:

In src/filemanager/file.c in function do_search, the algorithm executes mc_stat on a file (directory) and checks number of links. It assumes number of links minus 2 is number of subdirectories available for recursive search. While that assumption is valid on probably all linux filesystems, it is not valid on mounted samba shares. For these, number of links (as reported by stat or seen by 'ls -l') is not 1 for most files and 2+ for directories, but zero for all files and directories within the share (I guess that is how the kenrel samba module works ...). Therefore the optimization (that may limit the recursion) done by subdirs_left breaks the recursive search.

This error is in current master branch.

I am attaching a patch that fixes the issue (basically removes the subdirs_left optimization that is broken)

The patch seems not to have any side effects, the search works fine on ext4, vfat and samba share."	defect	closed	major	4.8.13	mc-core	master	fixed					merged	
