directory path info in vfs readdir
Jeremy Allison
jra at samba.org
Thu Apr 6 15:42:47 GMT 2006
On Thu, Apr 06, 2006 at 11:12:59AM +0100, Philip de Nier wrote:
> 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.
This code has changed since that release. I'd suggest using the latest
version and seeing if the problem still occurs.
Jeremy.
More information about the samba-technical
mailing list