Fix bug 6012: Add "get_real_filename" to full_audit
authorVolker Lendecke <vl@samba.org>
Mon, 5 Jan 2009 11:58:23 +0000 (12:58 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 5 Jan 2009 12:09:31 +0000 (13:09 +0100)
Thanks to Hodur <coil93@gmail.com> for testing!

Volker

source3/modules/vfs_full_audit.c

index 7970bf264460852b677f67a6772b7529bec52ce9..3615c3978b4e1057b558ddf231ab5d2202165613 100644 (file)
@@ -211,6 +211,11 @@ static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle,
                                          TALLOC_CTX *mem_ctx,
                                          unsigned int *pnum_streams,
                                          struct stream_struct **pstreams);
+static int smb_full_audit_get_real_filename(struct vfs_handle_struct *handle,
+                                           const char *path,
+                                           const char *name,
+                                           TALLOC_CTX *mem_ctx,
+                                           char **found_name);
 static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                                uint32 security_info,
                                SEC_DESC **ppdesc);
@@ -444,6 +449,8 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_streaminfo), SMB_VFS_OP_STREAMINFO,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_get_real_filename), SMB_VFS_OP_GET_REAL_FILENAME,
+        SMB_VFS_LAYER_LOGGER},
 
        /* NT ACL operations. */
 
@@ -612,6 +619,7 @@ static struct {
        { SMB_VFS_OP_CHFLAGS,   "chflags" },
        { SMB_VFS_OP_FILE_ID_CREATE,    "file_id_create" },
        { SMB_VFS_OP_STREAMINFO,        "streaminfo" },
+       { SMB_VFS_OP_GET_REAL_FILENAME, "get_real_filename" },
        { SMB_VFS_OP_FGET_NT_ACL,       "fget_nt_acl" },
        { SMB_VFS_OP_GET_NT_ACL,        "get_nt_acl" },
        { SMB_VFS_OP_FSET_NT_ACL,       "fset_nt_acl" },
@@ -1615,6 +1623,23 @@ static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle,
        return result;
 }
 
+static int smb_full_audit_get_real_filename(struct vfs_handle_struct *handle,
+                                           const char *path,
+                                           const char *name,
+                                           TALLOC_CTX *mem_ctx,
+                                           char **found_name)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name, mem_ctx,
+                                               found_name);
+
+       do_log(SMB_VFS_OP_GET_REAL_FILENAME, (result == 0), handle,
+              "%s/%s->%s", path, name, (result == 0) ? "" : *found_name);
+
+       return result;
+}
+
 static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                                uint32 security_info,
                                SEC_DESC **ppdesc)