[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Aug 22 19:18:02 UTC 2019


The branch, master has been updated
       via  6a8bc6b5490 s3: VFS: Complete the replacement of SMB_VFS_MKNOD() -> SMB_VFS_MKNODAT().
       via  e37580f45a5 s3: VFS: vfs_time_audit. Remove mknod_fn(). No longer used.
       via  569865d4a21 s3: VFS: vfs_full_audit. Remove mknod_fn(). No longer used.
       via  42d6d9cf4ee s3: VFS: vfs_unityed_media. Remove mknod_fn(). No longer used.
       via  5132e78c95c s3: VFS: vfs_syncops. Remove mknod_fn(). No longer used.
       via  9ba187a5fc8 s3: VFS: vfs_snapper. Remove mknod_fn(). No longer used.
       via  b3fa9ccfdd4 s3: VFS: vfs_shadow_copy2. Remove mknod_fn(). No longer used.
       via  331cfa1100c s3: VFS: vfs_media_harmony. Remove mknod_fn(). No longer used.
       via  50880f3d4a3 s3: VFS: vfs_glusterfs. Remove mknod_fn(). No longer used.
       via  c15c9eb31f2 s3: VFS: vfs_ceph_snapshots. Remove mknod_fn(). No longer used.
       via  0e701ce3152 s3: VFS: vfs_ceph. Remove mknod_fn(). No longer used.
       via  0d606ef6c4c s3: VFS: vfs_cap. Remove mknod_fn(). No longer used.
       via  7237517c8b4 s3: smbd: Make smb_unix_mknod() call SMB_VFS_MKNODAT() instead of SMB_VFS_MKNOD()
       via  74127f56753 s3: torture: Change cmd_mknod to call SMB_VFS_MKNODAT().
       via  a9099618eb6 s3: VFS: vfs_time_audit. Implement mknodat().
       via  6db33e35a86 s3: VFS: vfs_full_audit. Implement mknodat().
       via  5f115eca926 s3: VFS: vfs_unityed_media. Implement mknodat().
       via  a07ce6ead61 s3: VFS: vfs_syncops. Implement mknodat().
       via  4ce3cd31004 s3: VFS: vfs_snapper. Implement mknodat().
       via  1aead2fe251 s3: VFS: vfs_shadow_copy2. Implement mknodat().
       via  574d76c03f6 s3: VFS: vfs_media_harmony. Implement mknodat().
       via  b32f345f14a s3: VFS: vfs_glusterfs. Implement mknodat().
       via  a1c06667d6e 3: VFS: vfs_ceph_snapshots. Implement mknodat().
       via  2aaadbdda12 s3: VFS: vfs_ceph. Implement mknodat().
       via  8b27087d9cf s3: VFS: vfs_cap. Implement mknodat().
       via  e2246876d1e s3: VFS: Add SMB_VFS_MKNODAT().
       via  e4c4af64fa7 s3: smbd: Add sys_mknodat() wrapper call.
       via  c68671bb949 s3: VFS: Remove extraneous enum/struct values for removed SMB_VFS_OP_LINK.
      from  ad24b7cf4dc s3:net: load registry shares too in 'net vfs stream2adouble'

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6a8bc6b549078a09276763f2196bf54c70d5de65
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 14:49:05 2019 -0700

    s3: VFS: Complete the replacement of SMB_VFS_MKNOD() -> SMB_VFS_MKNODAT().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Aug 22 19:17:07 UTC 2019 on sn-devel-184

commit e37580f45a557ad9f23a7220bd8edae8e6ce7bd5
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 14:44:20 2019 -0700

    s3: VFS: vfs_time_audit. Remove mknod_fn(). No longer used.
    
    NB, this will now fail smb_vfs_assert_all_fns()
    until we remove the mknod_fn() from the VFS definitions.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 569865d4a2143d07ef1afbb00df5289123257c35
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:57:58 2019 -0700

    s3: VFS: vfs_full_audit. Remove mknod_fn(). No longer used.
    
    NB, this will now fail smb_vfs_assert_all_fns()
    until we remove the mknod_fn() from the VFS definitions.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 42d6d9cf4ee8a3422bda4d4b7164415ce5bd96b5
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:55:37 2019 -0700

    s3: VFS: vfs_unityed_media. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 5132e78c95c8f81ffae55e348619f7ffe0e6698f
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:54:52 2019 -0700

    s3: VFS: vfs_syncops. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 9ba187a5fc8d8e180245ee5741728322ff581103
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:54:02 2019 -0700

    s3: VFS: vfs_snapper. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit b3fa9ccfdd4aacf13690060c5efbd606d26730f5
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:53:22 2019 -0700

    s3: VFS: vfs_shadow_copy2. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 331cfa1100cc5edfba7f00ba7876a2319d048f5a
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:52:04 2019 -0700

    s3: VFS: vfs_media_harmony. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 50880f3d4a34354f0dca7b01e35cdc187b0975f0
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:48:50 2019 -0700

    s3: VFS: vfs_glusterfs. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit c15c9eb31f239587f4b9cc44aa015709f572444a
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:47:54 2019 -0700

    s3: VFS: vfs_ceph_snapshots. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 0e701ce3152fb71bc0d7e3271602fef067be7bcd
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:45:52 2019 -0700

    s3: VFS: vfs_ceph. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 0d606ef6c4ce5948424c779fe951f6cbc2cae021
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 13:45:02 2019 -0700

    s3: VFS: vfs_cap. Remove mknod_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 7237517c8b46a578aa38da167e42b6619f3ae68c
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 12:15:01 2019 -0700

    s3: smbd: Make smb_unix_mknod() call SMB_VFS_MKNODAT() instead of SMB_VFS_MKNOD()
    
    Use conn->cwd_fsp as current fsp.
    
    No logic change for now.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 74127f5675381bdd8f77492321ee62080aa212de
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 12:11:44 2019 -0700

    s3: torture: Change cmd_mknod to call SMB_VFS_MKNODAT().
    
    Use conn->cwd_fsp as current fsp.
    
    No logic change for now.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit a9099618eb68b0a23b1260902b5df87428201a91
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 12:09:24 2019 -0700

    s3: VFS: vfs_time_audit. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 6db33e35a868511fc4f9c602978b71fc115aae0c
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 11:36:48 2019 -0700

    s3: VFS: vfs_full_audit. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 5f115eca9261a568e0a65164af211c6be254e8b0
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 11:08:27 2019 -0700

    s3: VFS: vfs_unityed_media. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit a07ce6ead61b7fce545d151bb2ae34ccfda17bc5
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 11:06:17 2019 -0700

    s3: VFS: vfs_syncops. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 4ce3cd31004f42296f7672301c4230842d483044
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 11:03:41 2019 -0700

    s3: VFS: vfs_snapper. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 1aead2fe2516c237fb128ef03c4ad309c928f846
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 20 16:57:24 2019 -0700

    s3: VFS: vfs_shadow_copy2. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 574d76c03f637df06918a56999945105c406900e
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 20 16:55:55 2019 -0700

    s3: VFS: vfs_media_harmony. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit b32f345f14a79287280e877072da2a42c95ab24d
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 20 16:54:05 2019 -0700

    s3: VFS: vfs_glusterfs. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit a1c06667d6e2653801a34aae6a5f2dd952a86ae2
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 20 16:52:36 2019 -0700

    3: VFS: vfs_ceph_snapshots. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 2aaadbdda12628258d6bd41b0277758d338cb6a2
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 20 16:50:57 2019 -0700

    s3: VFS: vfs_ceph. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 8b27087d9cfbaf9e74538ed2d987531a7ae44d67
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 20 16:33:57 2019 -0700

    s3: VFS: vfs_cap. Implement mknodat().
    
    Currently identical to mknod().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit e2246876d1ebdde2eaa2bd635e8907f1671b4159
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 20 16:31:00 2019 -0700

    s3: VFS: Add SMB_VFS_MKNODAT().
    
    Currently identical to SMB_VFS_MKNOD().
    
    Next, add to all VFS modules that implement
    mknod and eventually remove mknod.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit e4c4af64fa7fde3ff116390182628235a2fb7185
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 20 16:28:18 2019 -0700

    s3: smbd: Add sys_mknodat() wrapper call.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit c68671bb949159de77170d8b73883171c50c9d96
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 21 14:38:03 2019 -0700

    s3: VFS: Remove extraneous enum/struct values for removed SMB_VFS_OP_LINK.
    
    Forgot this in removal of SMB_VFS_LINK() patch previously pushed.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 examples/VFS/skel_opaque.c            |  5 +++--
 examples/VFS/skel_transparent.c       | 11 ++++++++---
 source3/include/proto.h               |  1 +
 source3/include/smbprofile.h          |  2 +-
 source3/include/vfs.h                 | 16 ++++++++++------
 source3/include/vfs_macros.h          |  8 ++++----
 source3/lib/system.c                  | 15 +++++++++++++++
 source3/modules/vfs_cap.c             | 11 ++++++++---
 source3/modules/vfs_ceph.c            | 10 ++++++----
 source3/modules/vfs_ceph_snapshots.c  | 11 ++++++++---
 source3/modules/vfs_default.c         | 18 +++++++++++++-----
 source3/modules/vfs_full_audit.c      | 19 +++++++++++--------
 source3/modules/vfs_glusterfs.c       | 10 ++++++----
 source3/modules/vfs_media_harmony.c   | 20 +++++++++++++++-----
 source3/modules/vfs_not_implemented.c | 11 ++++++-----
 source3/modules/vfs_shadow_copy2.c    | 17 +++++++++++------
 source3/modules/vfs_snapper.c         | 11 ++++++++---
 source3/modules/vfs_syncops.c         | 14 ++++++++++----
 source3/modules/vfs_time_audit.c      | 14 +++++++++-----
 source3/modules/vfs_unityed_media.c   | 25 +++++++++++++++++--------
 source3/smbd/trans2.c                 |  9 ++++++++-
 source3/smbd/vfs.c                    | 11 ++++++++---
 source3/torture/cmd_vfs.c             | 10 +++++++++-
 source3/wscript                       |  2 +-
 24 files changed, 196 insertions(+), 85 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 8de97e85147..48d8e3df7f6 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -484,7 +484,8 @@ static int skel_linkat(vfs_handle_struct *handle,
 	return -1;
 }
 
-static int skel_mknod(vfs_handle_struct *handle,
+static int skel_mknodat(vfs_handle_struct *handle,
+			files_struct *dirfsp,
 			const struct smb_filename *smb_fname,
 			mode_t mode,
 			SMB_DEV_T dev)
@@ -1090,7 +1091,7 @@ static struct vfs_fn_pointers skel_opaque_fns = {
 	.symlink_fn = skel_symlink,
 	.readlink_fn = skel_vfs_readlink,
 	.linkat_fn = skel_linkat,
-	.mknod_fn = skel_mknod,
+	.mknodat_fn = skel_mknodat,
 	.realpath_fn = skel_realpath,
 	.chflags_fn = skel_chflags,
 	.file_id_create_fn = skel_file_id_create,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 015f72c1549..ab43118ce37 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -586,12 +586,17 @@ static int skel_linkat(vfs_handle_struct *handle,
 			flags);
 }
 
-static int skel_mknod(vfs_handle_struct *handle,
+static int skel_mknodat(vfs_handle_struct *handle,
+			files_struct *dirfsp,
 			const struct smb_filename *smb_fname,
 			mode_t mode,
 			SMB_DEV_T dev)
 {
-	return SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev);
+	return SMB_VFS_NEXT_MKNODAT(handle,
+			dirfsp,
+			smb_fname,
+			mode,
+			dev);
 }
 
 static struct smb_filename *skel_realpath(vfs_handle_struct *handle,
@@ -1361,7 +1366,7 @@ static struct vfs_fn_pointers skel_transparent_fns = {
 	.symlink_fn = skel_symlink,
 	.readlink_fn = skel_vfs_readlink,
 	.linkat_fn = skel_linkat,
-	.mknod_fn = skel_mknod,
+	.mknodat_fn = skel_mknodat,
 	.realpath_fn = skel_realpath,
 	.chflags_fn = skel_chflags,
 	.file_id_create_fn = skel_file_id_create,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index e3ed2b8e4cb..17ea54fc4fe 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -234,6 +234,7 @@ int sys_fallocate(int fd, uint32_t mode, off_t offset, off_t len);
 void kernel_flock(int fd, uint32_t share_mode, uint32_t access_mask);
 DIR *sys_fdopendir(int fd);
 int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
+int sys_mknodat(int dirfd, const char *path, mode_t mode, SMB_DEV_T dev);
 char *sys_getwd(void);
 void set_effective_capability(enum smbd_capability capability);
 void drop_effective_capability(enum smbd_capability capability);
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index 4568b19bfda..048ce8504cd 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -85,7 +85,7 @@ struct tevent_context;
 	SMBPROFILE_STATS_BASIC(syscall_readlink) \
 	SMBPROFILE_STATS_BASIC(syscall_symlink) \
 	SMBPROFILE_STATS_BASIC(syscall_linkat) \
-	SMBPROFILE_STATS_BASIC(syscall_mknod) \
+	SMBPROFILE_STATS_BASIC(syscall_mknodat) \
 	SMBPROFILE_STATS_BASIC(syscall_realpath) \
 	SMBPROFILE_STATS_BASIC(syscall_get_quota) \
 	SMBPROFILE_STATS_BASIC(syscall_set_quota) \
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index c91b4a3789a..3463b574e5b 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -274,6 +274,7 @@
 /* Version 42 - Make "lease" a const* in create_file_fn */
 /* Version 42 - Move SMB_VFS_RENAME -> SMB_VFS_RENAMEAT */
 /* Version 42 - Move SMB_VFS_LINK -> SMB_VFS_LINKAT. */
+/* Version 42 - Move SMB_VFS_MKNOD -> SMB_VFS_MKDNODAT. */
 
 #define SMB_VFS_INTERFACE_VERSION 42
 
@@ -806,7 +807,8 @@ struct vfs_fn_pointers {
 				struct files_struct *dstfsp,
 				const struct smb_filename *new_smb_fname,
 				int flags);
-	int (*mknod_fn)(struct vfs_handle_struct *handle,
+	int (*mknodat_fn)(struct vfs_handle_struct *handle,
+				struct files_struct *dirfsp,
 				const struct smb_filename *smb_fname,
 				mode_t mode,
 				SMB_DEV_T dev);
@@ -1338,7 +1340,8 @@ int smb_vfs_call_linkat(struct vfs_handle_struct *handle,
 			struct files_struct *dstfsp,
 			const struct smb_filename *new_smb_fname,
 			int flags);
-int smb_vfs_call_mknod(struct vfs_handle_struct *handle,
+int smb_vfs_call_mknodat(struct vfs_handle_struct *handle,
+			struct files_struct *dirfsp,
 			const struct smb_filename *smb_fname,
 			mode_t mode,
 			SMB_DEV_T dev);
@@ -1767,10 +1770,11 @@ int vfs_not_implemented_linkat(vfs_handle_struct *handle,
 			struct files_struct *dstfsp,
 			const struct smb_filename *new_smb_fname,
 			int flags);
-int vfs_not_implemented_mknod(vfs_handle_struct *handle,
-			      const struct smb_filename *smb_fname,
-			      mode_t mode,
-			      SMB_DEV_T dev);
+int vfs_not_implemented_mknodat(vfs_handle_struct *handle,
+			struct files_struct *dirfsp,
+			const struct smb_filename *smb_fname,
+			mode_t mode,
+			SMB_DEV_T dev);
 struct smb_filename *vfs_not_implemented_realpath(vfs_handle_struct *handle,
 						  TALLOC_CTX *ctx,
 						  const struct smb_filename *smb_fname);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 1a90c74d775..0f317ecbe31 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -311,10 +311,10 @@
 #define SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldpath, dstfsp, newpath, flags) \
 	smb_vfs_call_linkat((handle)->next, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
 
-#define SMB_VFS_MKNOD(conn, smb_fname, mode, dev) \
-	smb_vfs_call_mknod((conn)->vfs_handles, (smb_fname), (mode), (dev))
-#define SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev) \
-	smb_vfs_call_mknod((handle)->next, (smb_fname), (mode), (dev))
+#define SMB_VFS_MKNODAT(conn, dirfsp, smb_fname, mode, dev) \
+	smb_vfs_call_mknodat((conn)->vfs_handles, (dirfsp), (smb_fname), (mode), (dev))
+#define SMB_VFS_NEXT_MKNODAT(handle, dirfsp, smb_fname, mode, dev) \
+	smb_vfs_call_mknodat((handle)->next, (dirfsp), (smb_fname), (mode), (dev))
 
 #define SMB_VFS_REALPATH(conn, ctx, smb_fname) \
 	smb_vfs_call_realpath((conn)->vfs_handles, (ctx), (smb_fname))
diff --git a/source3/lib/system.c b/source3/lib/system.c
index a67388e436a..251c02bb1ee 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -590,6 +590,21 @@ int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev)
 #endif
 }
 
+/*******************************************************************
+ A mknodat() wrapper.
+********************************************************************/
+
+int sys_mknodat(int dirfd, const char *path, mode_t mode, SMB_DEV_T dev)
+{
+#if defined(HAVE_MKNODAT)
+	return mknodat(dirfd, path, mode, dev);
+#else
+	/* No mknod system call. */
+	errno = ENOSYS;
+	return -1;
+#endif
+}
+
 /*******************************************************************
  System wrapper for getwd. Always returns MALLOC'ed memory, or NULL
  on error (malloc fail usually).
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index 05c5426919c..4a5992f8af6 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -645,7 +645,8 @@ static int cap_linkat(vfs_handle_struct *handle,
 	return ret;
 }
 
-static int cap_mknod(vfs_handle_struct *handle,
+static int cap_mknodat(vfs_handle_struct *handle,
+		files_struct *dirfsp,
 		const struct smb_filename *smb_fname,
 		mode_t mode,
 		SMB_DEV_T dev)
@@ -669,7 +670,11 @@ static int cap_mknod(vfs_handle_struct *handle,
 		errno = ENOMEM;
 		return -1;
 	}
-	ret = SMB_VFS_NEXT_MKNOD(handle, cap_smb_fname, mode, dev);
+	ret = SMB_VFS_NEXT_MKNODAT(handle,
+			dirfsp,
+			cap_smb_fname,
+			mode,
+			dev);
 	if (ret == -1) {
 		saved_errno = errno;
 	}
@@ -1035,7 +1040,7 @@ static struct vfs_fn_pointers vfs_cap_fns = {
 	.symlink_fn = cap_symlink,
 	.readlink_fn = cap_readlink,
 	.linkat_fn = cap_linkat,
-	.mknod_fn = cap_mknod,
+	.mknodat_fn = cap_mknodat,
 	.realpath_fn = cap_realpath,
 	.sys_acl_get_file_fn = cap_sys_acl_get_file,
 	.sys_acl_set_file_fn = cap_sys_acl_set_file,
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 93d5801136d..4ccadae0e5c 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -1178,15 +1178,17 @@ static int cephwrap_linkat(struct vfs_handle_struct *handle,
 	WRAP_RETURN(result);
 }
 
-static int cephwrap_mknod(struct vfs_handle_struct *handle,
+static int cephwrap_mknodat(struct vfs_handle_struct *handle,
+		files_struct *dirfsp,
 		const struct smb_filename *smb_fname,
 		mode_t mode,
 		SMB_DEV_T dev)
 {
 	int result = -1;
-	DBG_DEBUG("[CEPH] mknod(%p, %s)\n", handle, smb_fname->base_name);
+	DBG_DEBUG("[CEPH] mknodat(%p, %s)\n", handle, smb_fname->base_name);
+	SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
 	result = ceph_mknod(handle->data, smb_fname->base_name, mode, dev);
-	DBG_DEBUG("[CEPH] mknod(...) = %d\n", result);
+	DBG_DEBUG("[CEPH] mknodat(...) = %d\n", result);
 	WRAP_RETURN(result);
 }
 
@@ -1459,7 +1461,7 @@ static struct vfs_fn_pointers ceph_fns = {
 	.symlink_fn = cephwrap_symlink,
 	.readlink_fn = cephwrap_readlink,
 	.linkat_fn = cephwrap_linkat,
-	.mknod_fn = cephwrap_mknod,
+	.mknodat_fn = cephwrap_mknodat,
 	.realpath_fn = cephwrap_realpath,
 	.chflags_fn = cephwrap_chflags,
 	.get_real_filename_fn = cephwrap_get_real_filename,
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index 2911907adb0..ff412ee9a6c 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -1135,7 +1135,8 @@ static int ceph_snap_gmt_readlink(vfs_handle_struct *handle,
 	return ret;
 }
 
-static int ceph_snap_gmt_mknod(vfs_handle_struct *handle,
+static int ceph_snap_gmt_mknodat(vfs_handle_struct *handle,
+			files_struct *dirfsp,
 			const struct smb_filename *csmb_fname,
 			mode_t mode,
 			SMB_DEV_T dev)
@@ -1154,7 +1155,11 @@ static int ceph_snap_gmt_mknod(vfs_handle_struct *handle,
 		errno = EROFS;
 		return -1;
 	}
-	return SMB_VFS_NEXT_MKNOD(handle, csmb_fname, mode, dev);
+	return SMB_VFS_NEXT_MKNODAT(handle,
+			dirfsp,
+			csmb_fname,
+			mode,
+			dev);
 }
 
 static struct smb_filename *ceph_snap_gmt_realpath(vfs_handle_struct *handle,
@@ -1620,7 +1625,7 @@ static struct vfs_fn_pointers ceph_snap_fns = {
 	.chdir_fn = ceph_snap_gmt_chdir,
 	.ntimes_fn = ceph_snap_gmt_ntimes,
 	.readlink_fn = ceph_snap_gmt_readlink,
-	.mknod_fn = ceph_snap_gmt_mknod,
+	.mknodat_fn = ceph_snap_gmt_mknodat,
 	.realpath_fn = ceph_snap_gmt_realpath,
 	.get_nt_acl_fn = ceph_snap_gmt_get_nt_acl,
 	.fget_nt_acl_fn = ceph_snap_gmt_fget_nt_acl,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 6de217eca9c..51928fd0b04 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2687,16 +2687,24 @@ static int vfswrap_linkat(vfs_handle_struct *handle,
 	return result;
 }
 
-static int vfswrap_mknod(vfs_handle_struct *handle,
+static int vfswrap_mknodat(vfs_handle_struct *handle,
+			files_struct *dirfsp,
 			const struct smb_filename *smb_fname,
 			mode_t mode,
 			SMB_DEV_T dev)
 {
 	int result;
 
-	START_PROFILE(syscall_mknod);
-	result = sys_mknod(smb_fname->base_name, mode, dev);
-	END_PROFILE(syscall_mknod);
+	START_PROFILE(syscall_mknodat);
+
+	SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
+	result = sys_mknodat(dirfsp->fh->fd,
+			smb_fname->base_name,
+			mode,
+			dev);
+
+	END_PROFILE(syscall_mknodat);
 	return result;
 }
 
@@ -3480,7 +3488,7 @@ static struct vfs_fn_pointers vfs_default_fns = {
 	.symlink_fn = vfswrap_symlink,
 	.readlink_fn = vfswrap_readlink,
 	.linkat_fn = vfswrap_linkat,
-	.mknod_fn = vfswrap_mknod,
+	.mknodat_fn = vfswrap_mknodat,
 	.realpath_fn = vfswrap_realpath,
 	.chflags_fn = vfswrap_chflags,
 	.file_id_create_fn = vfswrap_file_id_create,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 836d4de8b4e..4bf3c483722 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -153,9 +153,8 @@ typedef enum _vfs_op_type {
 	SMB_VFS_OP_GETLOCK,
 	SMB_VFS_OP_SYMLINK,
 	SMB_VFS_OP_READLINK,
-	SMB_VFS_OP_LINK,
 	SMB_VFS_OP_LINKAT,
-	SMB_VFS_OP_MKNOD,
+	SMB_VFS_OP_MKNODAT,
 	SMB_VFS_OP_REALPATH,
 	SMB_VFS_OP_CHFLAGS,
 	SMB_VFS_OP_FILE_ID_CREATE,
@@ -297,9 +296,8 @@ static struct {
 	{ SMB_VFS_OP_GETLOCK,	"getlock" },
 	{ SMB_VFS_OP_SYMLINK,	"symlink" },
 	{ SMB_VFS_OP_READLINK,	"readlink" },
-	{ SMB_VFS_OP_LINK,	"link" },
 	{ SMB_VFS_OP_LINKAT,	"linkat" },
-	{ SMB_VFS_OP_MKNOD,	"mknod" },
+	{ SMB_VFS_OP_MKNODAT,	"mknodat" },
 	{ SMB_VFS_OP_REALPATH,	"realpath" },
 	{ SMB_VFS_OP_CHFLAGS,	"chflags" },
 	{ SMB_VFS_OP_FILE_ID_CREATE,	"file_id_create" },
@@ -1778,16 +1776,21 @@ static int smb_full_audit_linkat(vfs_handle_struct *handle,
 	return result;
 }
 
-static int smb_full_audit_mknod(vfs_handle_struct *handle,
+static int smb_full_audit_mknodat(vfs_handle_struct *handle,
+			files_struct *dirfsp,
 			const struct smb_filename *smb_fname,
 			mode_t mode,
 			SMB_DEV_T dev)
 {
 	int result;
 
-	result = SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev);
+	result = SMB_VFS_NEXT_MKNODAT(handle,
+				dirfsp,
+				smb_fname,
+				mode,
+				dev);
 
-	do_log(SMB_VFS_OP_MKNOD, (result >= 0), handle, "%s",
+	do_log(SMB_VFS_OP_MKNODAT, (result >= 0), handle, "%s",
 		smb_fname->base_name);
 
 	return result;
@@ -2887,7 +2890,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
 	.symlink_fn = smb_full_audit_symlink,
 	.readlink_fn = smb_full_audit_readlink,
 	.linkat_fn = smb_full_audit_linkat,
-	.mknod_fn = smb_full_audit_mknod,
+	.mknodat_fn = smb_full_audit_mknodat,
 	.realpath_fn = smb_full_audit_realpath,
 	.chflags_fn = smb_full_audit_chflags,
 	.file_id_create_fn = smb_full_audit_file_id_create,
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 09299bc70c5..389b03a0e08 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -1683,16 +1683,18 @@ static int vfs_gluster_linkat(struct vfs_handle_struct *handle,
 	return ret;
 }
 
-static int vfs_gluster_mknod(struct vfs_handle_struct *handle,
+static int vfs_gluster_mknodat(struct vfs_handle_struct *handle,
+				files_struct *dirfsp,
 				const struct smb_filename *smb_fname,
 				mode_t mode,
 				SMB_DEV_T dev)
 {
 	int ret;
 
-	START_PROFILE(syscall_mknod);
+	START_PROFILE(syscall_mknodat);
+	SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
 	ret = glfs_mknod(handle->data, smb_fname->base_name, mode, dev);
-	END_PROFILE(syscall_mknod);
+	END_PROFILE(syscall_mknodat);
 
 	return ret;
 }
@@ -1905,7 +1907,7 @@ static struct vfs_fn_pointers glusterfs_fns = {
 	.symlink_fn = vfs_gluster_symlink,
 	.readlink_fn = vfs_gluster_readlink,
 	.linkat_fn = vfs_gluster_linkat,
-	.mknod_fn = vfs_gluster_mknod,
+	.mknodat_fn = vfs_gluster_mknodat,
 	.realpath_fn = vfs_gluster_realpath,
 	.chflags_fn = vfs_gluster_chflags,
 	.file_id_create_fn = NULL,
diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c
index d6a8de2d2cc..1b1a6606056 100644
--- a/source3/modules/vfs_media_harmony.c
+++ b/source3/modules/vfs_media_harmony.c
@@ -1837,7 +1837,8 @@ out:
  * Success: return 0
  * Failure: set errno, return -1
  */
-static int mh_mknod(vfs_handle_struct *handle,
+static int mh_mknodat(vfs_handle_struct *handle,
+		files_struct *dirfsp,
 		const struct smb_filename *smb_fname,
 		mode_t mode,
 		SMB_DEV_T dev)
@@ -1846,9 +1847,13 @@ static int mh_mknod(vfs_handle_struct *handle,
 	struct smb_filename *clientFname = NULL;
 	TALLOC_CTX *ctx;
 
-	DEBUG(MH_INFO_DEBUG, ("Entering mh_mknod\n"));
+	DEBUG(MH_INFO_DEBUG, ("Entering mh_mknodat\n"));
 	if (!is_in_media_files(smb_fname->base_name)) {
-		status = SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev);
+		status = SMB_VFS_NEXT_MKNODAT(handle,
+				dirfsp,
+				smb_fname,
+				mode,
+				dev);
 		goto out;
 	}
 
@@ -1860,7 +1865,12 @@ static int mh_mknod(vfs_handle_struct *handle,
 		goto err;
 	}
 
-	status = SMB_VFS_NEXT_MKNOD(handle, clientFname, mode, dev);
+	status = SMB_VFS_NEXT_MKNODAT(handle,
+			dirfsp,
+			clientFname,
+			mode,
+			dev);
+
 err:
 	TALLOC_FREE(clientFname);
 out:
@@ -2314,7 +2324,7 @@ static struct vfs_fn_pointers vfs_mh_fns = {
 	.symlink_fn = mh_symlink,
 	.readlink_fn = mh_readlink,
 	.linkat_fn = mh_linkat,
-	.mknod_fn = mh_mknod,
+	.mknodat_fn = mh_mknodat,
 	.realpath_fn = mh_realpath,
 	.chflags_fn = mh_chflags,
 	.streaminfo_fn = mh_streaminfo,
diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c
index 9a6847e83e0..02d36ecbaa4 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -482,10 +482,11 @@ int vfs_not_implemented_linkat(vfs_handle_struct *handle,
 	return -1;
 }
 
-int vfs_not_implemented_mknod(vfs_handle_struct *handle,
-			      const struct smb_filename *smb_fname,
-			      mode_t mode,
-			      SMB_DEV_T dev)
+int vfs_not_implemented_mknodat(vfs_handle_struct *handle,
+			files_struct *dirfsp,
+			const struct smb_filename *smb_fname,
+			mode_t mode,
+			SMB_DEV_T dev)
 {
 	errno = ENOSYS;
 	return -1;
@@ -1094,7 +1095,7 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
 	.symlink_fn = vfs_not_implemented_symlink,
 	.readlink_fn = vfs_not_implemented_vfs_readlink,
 	.linkat_fn = vfs_not_implemented_linkat,
-	.mknod_fn = vfs_not_implemented_mknod,
+	.mknodat_fn = vfs_not_implemented_mknodat,
 	.realpath_fn = vfs_not_implemented_realpath,
 	.chflags_fn = vfs_not_implemented_chflags,
 	.file_id_create_fn = vfs_not_implemented_file_id_create,
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c


-- 
Samba Shared Repository



More information about the samba-cvs mailing list