Question about VFS sample - audit

Ó¢ì¿ ÓÚ yingweiyu at
Sat Feb 16 12:26:01 GMT 2002


I am new to this maillist and I have a question towards the VFS in Samba. I 
am trying to update the audit.c by syslog the name of directories from 
readdir(). I have added the following codes to audit.c:

(1) in vfs_init():
     I inserted line: ops->readdir = audit_readdir;

(2) I created the function audit_readdir as follows:

struct dirent *audit_readdir(connection_struct *conn, DIR *dirp)
        char *dirname=NULL;
        struct dirent *result;
        int i;
        int l;

        result = default_vfs_ops.readdir(conn, dirp);

	//copy directory name into variable dirname
        dirname = alloca((l + 1) * sizeof(char));

        syslog(SYSLOG_PRIORITY, "reading dir %s\n", dirname);
        return result;

When I run this module, the directory names can be sysloged correctly when 
typing "ls". However, it prompts the error in smbclient:

smb: \>ls
code 0 listing \*
read_socket_with_timeout: timeout read. read error = Broken pipe.
Error in dskattr: code 0
smb: \> Broken pipe

and then, system quit smbclient. Could anyone help me to see what happens 
there and how to solve this problem?

Thanks a lot!


Join the world’s largest e-mail service with MSN Hotmail.

More information about the samba-technical mailing list