* path = /tmp
* vfs objects = full_audit
* full_audit:prefix = %u|%I
- * full_audit:success = open opendir
+ * full_audit:success = open opendir create_file
* full_audit:failure = all
*
* vfs op can be "all" which means log all operations.
* vfs op can be "none" which means no logging.
*
* This leads to syslog entries of the form:
- * smbd_audit: nobody|192.168.234.1|opendir|ok|.
- * smbd_audit: nobody|192.168.234.1|open|fail (File not found)|r|x.txt
+ * smbd_audit: nobody|192.168.234.1|opendir|ok|/tmp
+ * smbd_audit: nobody|192.168.234.1|create_file|fail (No such file or directory)|0x1|file|open|/ts/doesNotExist
+ * smbd_audit: nobody|192.168.234.1|open|ok|w|/tmp/file.txt
+ * smbd_audit: nobody|192.168.234.1|create_file|ok|0x3|file|open|/tmp/file.txt
*
* where "nobody" is the connected username and "192.168.234.1" is the
* client's IP address.
/* Don't have a reasonable notion of failure here */
- do_log(SMB_VFS_OP_DISK_FREE, True, handle, "%s", smb_fname->base_name);
+ do_log(SMB_VFS_OP_DISK_FREE,
+ True,
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_GET_QUOTA(handle, smb_fname, qtype, id, qt);
- do_log(SMB_VFS_OP_GET_QUOTA, (result >= 0), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_GET_QUOTA,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
- do_log(SMB_VFS_OP_OPENDIR, (result != NULL), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_OPENDIR,
+ (result != NULL),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
smb_fname,
mode);
- do_log(SMB_VFS_OP_MKDIRAT, (result >= 0), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_MKDIRAT,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
- do_log(SMB_VFS_OP_RMDIR, (result >= 0), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_RMDIR,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
- do_log(SMB_VFS_OP_CHMOD, (result >= 0), handle, "%s|%o",
- smb_fname->base_name,
- mode);
+ do_log(SMB_VFS_OP_CHMOD,
+ (result >= 0),
+ handle,
+ "%s|%o",
+ smb_fname_str_do_log(handle->conn, smb_fname),
+ mode);
return result;
}
result = SMB_VFS_NEXT_CHDIR(handle, smb_fname);
- do_log(SMB_VFS_OP_CHDIR, (result >= 0), handle, "chdir|%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_CHDIR,
+ (result >= 0),
+ handle,
+ "chdir|%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
dirfsp,
new_smb_fname);
- do_log(SMB_VFS_OP_SYMLINKAT, (result >= 0), handle,
- "%s|%s", link_contents, new_smb_fname->base_name);
+ do_log(SMB_VFS_OP_SYMLINKAT,
+ (result >= 0),
+ handle,
+ "%s|%s",
+ link_contents,
+ smb_fname_str_do_log(handle->conn, new_smb_fname));
return result;
}
buf,
bufsiz);
- do_log(SMB_VFS_OP_READLINKAT, (result >= 0), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_READLINKAT,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
new_smb_fname,
flags);
- do_log(SMB_VFS_OP_LINKAT, (result >= 0), handle,
- "%s|%s", old_smb_fname->base_name, new_smb_fname->base_name);
+ do_log(SMB_VFS_OP_LINKAT,
+ (result >= 0),
+ handle,
+ "%s|%s",
+ smb_fname_str_do_log(handle->conn, old_smb_fname),
+ smb_fname_str_do_log(handle->conn, new_smb_fname));
return result;
}
mode,
dev);
- do_log(SMB_VFS_OP_MKNODAT, (result >= 0), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_MKNODAT,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result_fname = SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname);
- do_log(SMB_VFS_OP_REALPATH, (result_fname != NULL), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_REALPATH,
+ (result_fname != NULL),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result_fname;
}
result = SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags);
- do_log(SMB_VFS_OP_CHFLAGS, (result != 0), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_CHFLAGS,
+ (result != 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
pnum_streams, pstreams);
- do_log(SMB_VFS_OP_STREAMINFO, NT_STATUS_IS_OK(result), handle,
- "%s", smb_fname->base_name);
+ do_log(SMB_VFS_OP_STREAMINFO,
+ NT_STATUS_IS_OK(result),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_CONNECTPATH(handle, smb_fname);
- do_log(SMB_VFS_OP_CONNECTPATH, result != NULL, handle,
- "%s", smb_fname->base_name);
+ do_log(SMB_VFS_OP_CONNECTPATH,
+ result != NULL,
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
type, mem_ctx);
- do_log(SMB_VFS_OP_SYS_ACL_GET_FILE, (result != NULL), handle,
- "%s", smb_fname->base_name);
+ do_log(SMB_VFS_OP_SYS_ACL_GET_FILE,
+ (result != NULL),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname,
mem_ctx, blob_description, blob);
- do_log(SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE, (result >= 0), handle,
- "%s", smb_fname->base_name);
+ do_log(SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname, acltype,
theacl);
- do_log(SMB_VFS_OP_SYS_ACL_SET_FILE, (result >= 0), handle,
- "%s", smb_fname->base_name);
+ do_log(SMB_VFS_OP_SYS_ACL_SET_FILE,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, smb_fname);
- do_log(SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, (result >= 0), handle,
- "%s", smb_fname->base_name);
+ do_log(SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_GETXATTR(handle, smb_fname, name, value, size);
- do_log(SMB_VFS_OP_GETXATTR, (result >= 0), handle,
- "%s|%s", smb_fname->base_name, name);
+ do_log(SMB_VFS_OP_GETXATTR,
+ (result >= 0),
+ handle,
+ "%s|%s",
+ smb_fname_str_do_log(handle->conn, smb_fname),
+ name);
return result;
}
result = SMB_VFS_NEXT_LISTXATTR(handle, smb_fname, list, size);
- do_log(SMB_VFS_OP_LISTXATTR, (result >= 0), handle, "%s",
- smb_fname->base_name);
+ do_log(SMB_VFS_OP_LISTXATTR,
+ (result >= 0),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, smb_fname));
return result;
}
result = SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, name);
- do_log(SMB_VFS_OP_REMOVEXATTR, (result >= 0), handle,
- "%s|%s", smb_fname->base_name, name);
+ do_log(SMB_VFS_OP_REMOVEXATTR,
+ (result >= 0),
+ handle,
+ "%s|%s",
+ smb_fname_str_do_log(handle->conn, smb_fname),
+ name);
return result;
}
result = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value, size,
flags);
- do_log(SMB_VFS_OP_SETXATTR, (result >= 0), handle,
- "%s|%s", smb_fname->base_name, name);
+ do_log(SMB_VFS_OP_SETXATTR,
+ (result >= 0),
+ handle,
+ "%s|%s",
+ smb_fname_str_do_log(handle->conn, smb_fname),
+ name);
return result;
}