directory path info in vfs readdir

Philip de Nier philip.denier at rd.bbc.co.uk
Thu Apr 6 10:12:59 GMT 2006


Is there a reliable way to get information about the directory path within 
the VFS 'readdir' function?

I tried using 'connection_struct::dir_path' but found that it sometimes has 
the wrong directory path. The example trace shown below, taken from a 
modified full audit, shows that the second 'opendir' followed by 
'readdir'  wrongly has the directory path ('dirpath='...) of the previous 
'opendir':

smbd_mh_full_audit: opendir|ok|ADir
smbd_mh_full_audit: readdir|ok|result=.|dirpath=ADir
smbd_mh_full_audit: telldir|ok|
smbd_mh_full_audit: readdir|ok|result=..|dirpath=ADir
smbd_mh_full_audit: telldir|ok|
...
smbd_mh_full_audit: readdir|ok|
smbd_mh_full_audit: closedir|ok|
...
smbd_mh_full_audit: opendir|ok|.
smbd_mh_full_audit: readdir|ok|result=.|dirpath=ADir
smbd_mh_full_audit: telldir|ok|
smbd_mh_full_audit: readdir|ok|result=..|dirpath=ADir
smbd_mh_full_audit: telldir|ok|
...

I want to have the directory path information when processing a 'readdir' 
call so that I can skip certain files that occur in certain directory 
paths. Should I be able to rely on 'connection_struct::dir_path' to give me 
this information?

The smbd version is 3.0.13-1.1-SUSE, on Suse 9.3, Linux 2.6.11.4-21.7-smp.

Thanks,
Philip



More information about the samba-technical mailing list