r24123: add file_id_create() to some vfs modules
authorStefan Metzmacher <metze@samba.org>
Thu, 2 Aug 2007 09:19:04 +0000 (09:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:29:09 +0000 (12:29 -0500)
metze
(This used to be commit 0bc5a9cd0136f8512e963a30b6e7b009667fb0bf)

examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/modules/vfs_full_audit.c

index 6a5b34f3afdbde9abaaca9f29240012ddd545c1d..173644f3d16f168d7b4f7585fe779fc02a4921c3 100644 (file)
@@ -280,6 +280,15 @@ static int skel_chflags(vfs_handle_struct *handle,  const char *path, uint flags
        return -1;
 }
 
+static struct file_id skel_file_id_create(vfs_handle_struct *handle,
+                                         SMB_DEV_T dev, SMB_INO_T inode)
+{
+       struct file_id id_zero;
+       ZERO_STRUCT(id_zero);
+       errno = ENOSYS;
+       return id_zero;
+}
+
 static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
        int fd, uint32 security_info, SEC_DESC **ppdesc)
 {
@@ -618,8 +627,7 @@ static vfs_op_tuple skel_op_tuples[] = {
        {SMB_VFS_OP(skel_realpath),                     SMB_VFS_OP_REALPATH,            SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_notify_watch),                 SMB_VFS_OP_NOTIFY_WATCH,        SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_chflags),                      SMB_VFS_OP_CHFLAGS,             SMB_VFS_LAYER_OPAQUE},
-
-
+       {SMB_VFS_OP(skel_file_id_create),               SMB_VFS_OP_FILE_ID_CREATE,      SMB_VFS_LAYER_OPAQUE},
 
        /* NT File ACL operations */
 
index 0a74cfc95d90bacd21b0ab589d02a87f289fd691..411dc31c6a55c20eed9b58d74918035fa20c22d5 100644 (file)
@@ -273,6 +273,12 @@ static int skel_chflags(vfs_handle_struct *handle,  const char *path, uint flags
        return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
 }
 
+static struct file_id skel_file_id_create(vfs_handle_struct *handle,
+                                         SMB_DEV_T dev, SMB_INO_T inode)
+{
+       return SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode);
+}
+
 static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
        int fd, uint32 security_info, SEC_DESC **ppdesc)
 {
@@ -579,6 +585,7 @@ static vfs_op_tuple skel_op_tuples[] = {
        {SMB_VFS_OP(skel_realpath),                     SMB_VFS_OP_REALPATH,            SMB_VFS_LAYER_TRANSPARENT},
        {SMB_VFS_OP(skel_notify_watch),                 SMB_VFS_OP_NOTIFY_WATCH,        SMB_VFS_LAYER_TRANSPARENT},
        {SMB_VFS_OP(skel_chflags),                      SMB_VFS_OP_CHFLAGS,             SMB_VFS_LAYER_TRANSPARENT},
+       {SMB_VFS_OP(skel_file_id_create),               SMB_VFS_OP_FILE_ID_CREATE,      SMB_VFS_LAYER_TRANSPARENT},
 
        /* NT File ACL operations */
 
index 65748db36f1873016f9a143ae52b4e43b86a39d2..47646e248f9ddc3001ca6ca1fde6ca9762957a40 100644 (file)
@@ -184,6 +184,8 @@ static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle,
                        void *private_data, void *handle_p);
 static int smb_full_audit_chflags(vfs_handle_struct *handle,
                            const char *path, uint flags);
+static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle,
+                                                   SMB_DEV_T dev, SMB_INO_T inode);
 static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                                int fd, uint32 security_info,
                                SEC_DESC **ppdesc);
@@ -413,6 +415,8 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_chflags),    SMB_VFS_OP_CHFLAGS,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_file_id_create),     SMB_VFS_OP_FILE_ID_CREATE,
+        SMB_VFS_LAYER_LOGGER},
 
        /* NT ACL operations. */
 
@@ -579,6 +583,7 @@ static struct {
        { SMB_VFS_OP_REALPATH,  "realpath" },
        { SMB_VFS_OP_NOTIFY_WATCH, "notify_watch" },
        { SMB_VFS_OP_CHFLAGS,   "chflags" },
+       { SMB_VFS_OP_FILE_ID_CREATE,    "file_id_create" },
        { 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" },
@@ -1466,6 +1471,23 @@ static int smb_full_audit_chflags(vfs_handle_struct *handle,
        return result;
 }
 
+static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle,
+                                                   SMB_DEV_T dev, SMB_INO_T inode)
+{
+       struct file_id id_zero;
+       struct file_id result;
+
+       ZERO_STRUCT(id_zero);
+
+       result = SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode);
+
+       do_log(SMB_VFS_OP_FILE_ID_CREATE,
+              !file_id_equal(&id_zero, &result),
+              handle, "%s", file_id_static_string(&result));
+
+       return result;
+}
+
 static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                                int fd, uint32 security_info,
                                SEC_DESC **ppdesc)