[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Oct 15 20:08:02 UTC 2019


The branch, master has been updated
       via  b01169ff321 s3: VFS: Complete the removal of SMB_VFS_CHOWN()
       via  e2863a7e395 s3: VFS: vfs_full_audit: Remove chown_fn(). No longer used.
       via  bd807d4684b s3: VFS: vfs_time_audit: Remove chown_fn(). No longer used.
       via  ce63e83a6af s3: VFS: vfs_cap: Remove chown_fn().
       via  04e70da30b2 s3: VFS: vfs_snapper: Remove chown_fn().
       via  1516e9e2859 s3: VFS: vfs_shadow_copy2: Remove chown_fn().
       via  3e2c2fdf027 s3: VFS: vfs_media_harmony: Remove chown_fn().
       via  3e8f319606b s3: VFS: vfs_glusterfs: Remove chown_fn().
       via  3a853a1d3b5 s3: VFS: vfs_fruit: Remove chown_fn().
       via  774b8f9ffb2 s3: VFS: vfs_fake_acls: Remove chown_fn().
       via  3f8f7979759 s3: VFS: vfs_ceph_snapshots: Remove chown_fn().
       via  95a6505e1bc s3: VFS: vfs_ceph: Remove chown_fn().
       via  48335c1f690 s3: VFS: vfs_catia: Remove chown_fn().
       via  2eca6d5b955 s3: VFS: vfs_cap: Remove chown_fn().
       via  177f15ebb9e s3: torture: Remove cmd_chown() - can be replicated by cmd_open()->cmd_fchown().
       via  634a4d13e19 s3: pysmbd: Change py_smbd_chown() to use SMB_VFS_FCHOWN() internally.
       via  99bfdb6e819 s3: smbd: Remove vfs_chown_fsp().
       via  2dbc68e2c02 s3: smbd: set_nt_acl(). Now we know we always have a valid file handle, always use VFS_FCHOWN.
      from  c16cc9a7ef3 audit_logging: Don't spam the logs if dsdb_event is not found

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


- Log -----------------------------------------------------------------
commit b01169ff32188939752c064e2eb803f57a837522
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:35:37 2019 -0700

    s3: VFS: Complete the removal of SMB_VFS_CHOWN()
    
    No longer used anywhere.
    
    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): Tue Oct 15 20:07:51 UTC 2019 on sn-devel-184

commit e2863a7e395bc5b73f8d9ef7bca7c21f20c7eeb3
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:30:42 2019 -0700

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

commit bd807d4684b48047ab2241602bb46af38a9d0f33
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:29:30 2019 -0700

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

commit ce63e83a6af38a0ac5e353a0cfd6c6cc1d2daa13
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:28:38 2019 -0700

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

commit 04e70da30b2166a5cfc73484cb156c66d4e1faf5
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:27:36 2019 -0700

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

commit 1516e9e2859bb33bec5e829c1ca9011c2563d801
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:26:59 2019 -0700

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

commit 3e2c2fdf0271e48538d8004ef03aac7e9d6eec3f
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:26:12 2019 -0700

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

commit 3e8f319606b898b803c1368154c87ee41dc2c78b
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:25:31 2019 -0700

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

commit 3a853a1d3b5b6c8d82a7887b35fd383bab0c6c1b
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:24:46 2019 -0700

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

commit 774b8f9ffb287c6011518caf341fed4538bc8eb5
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:24:00 2019 -0700

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

commit 3f8f797975931854e485fbf649b75897f0d6f775
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:23:15 2019 -0700

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

commit 95a6505e1bcbe89d0d39286668b04b948b1bed4f
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:22:35 2019 -0700

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

commit 48335c1f69076ffa7bdbca99a5025f61148506fd
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:21:51 2019 -0700

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

commit 2eca6d5b9551bd387e809fc77e496a2dc2c1595a
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:20:02 2019 -0700

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

commit 177f15ebb9e29a4cc6843a300f3da0ba7530332d
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:18:32 2019 -0700

    s3: torture: Remove cmd_chown() - can be replicated by cmd_open()->cmd_fchown().
    
    Last user of SMB_VFS_CHOWN() in the codebase.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 634a4d13e197e01ae509c88bd6c6487008a86f71
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 10 14:14:13 2019 -0700

    s3: pysmbd: Change py_smbd_chown() to use SMB_VFS_FCHOWN() internally.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 99bfdb6e81925760af2a6e89fc6ac55768c88b78
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Oct 8 13:46:02 2019 -0700

    s3: smbd: Remove vfs_chown_fsp().
    
    No longer used. This gets rid of another case
    where we were playing directory changing games
    that are eliminated by just using a file handle.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 2dbc68e2c0212e3e14f304e359d4d0b1ab514ce2
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Oct 8 13:45:45 2019 -0700

    s3: smbd: set_nt_acl(). Now we know we always have a valid file handle, always use VFS_FCHOWN.
    
    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            |  10 ---
 examples/VFS/skel_transparent.c       |   9 ---
 source3/include/smbprofile.h          |   1 -
 source3/include/vfs.h                 |  13 +---
 source3/include/vfs_macros.h          |   5 --
 source3/modules/vfs_cap.c             |  35 ---------
 source3/modules/vfs_catia.c           |  39 ----------
 source3/modules/vfs_ceph.c            |  13 ----
 source3/modules/vfs_ceph_snapshots.c  |  23 ------
 source3/modules/vfs_default.c         |  14 ----
 source3/modules/vfs_fake_acls.c       |  41 -----------
 source3/modules/vfs_fruit.c           |  47 ------------
 source3/modules/vfs_full_audit.c      |  18 -----
 source3/modules/vfs_glusterfs.c       |  15 ----
 source3/modules/vfs_media_harmony.c   |  35 ---------
 source3/modules/vfs_not_implemented.c |  10 ---
 source3/modules/vfs_shadow_copy2.c    |  22 ------
 source3/modules/vfs_snapper.c         |  22 ------
 source3/modules/vfs_time_audit.c      |  24 -------
 source3/modules/vfs_unityed_media.c   |  30 --------
 source3/smbd/posix_acls.c             |  19 +++--
 source3/smbd/proto.h                  |   1 -
 source3/smbd/pysmbd.c                 |  46 ++++++++----
 source3/smbd/vfs.c                    | 130 ----------------------------------
 source3/torture/cmd_vfs.c             |  33 ---------
 25 files changed, 48 insertions(+), 607 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 497ec90760e..4f0622bccc6 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -361,15 +361,6 @@ static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
 	return -1;
 }
 
-static int skel_chown(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
 		       uid_t uid, gid_t gid)
 {
@@ -1080,7 +1071,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
 	.unlinkat_fn = skel_unlinkat,
 	.chmod_fn = skel_chmod,
 	.fchmod_fn = skel_fchmod,
-	.chown_fn = skel_chown,
 	.fchown_fn = skel_fchown,
 	.lchown_fn = skel_lchown,
 	.chdir_fn = skel_chdir,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index c8277017565..fd19e433ba3 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -480,14 +480,6 @@ static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
 	return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
 }
 
-static int skel_chown(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid)
-{
-	return SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid);
-}
-
 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
 		       uid_t uid, gid_t gid)
 {
@@ -1377,7 +1369,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
 	.unlinkat_fn = skel_unlinkat,
 	.chmod_fn = skel_chmod,
 	.fchmod_fn = skel_fchmod,
-	.chown_fn = skel_chown,
 	.fchown_fn = skel_fchown,
 	.lchown_fn = skel_lchown,
 	.chdir_fn = skel_chdir,
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index 41621c4e862..a003a1d9df0 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -69,7 +69,6 @@ struct tevent_context;
 	SMBPROFILE_STATS_BASIC(syscall_unlinkat) \
 	SMBPROFILE_STATS_BASIC(syscall_chmod) \
 	SMBPROFILE_STATS_BASIC(syscall_fchmod) \
-	SMBPROFILE_STATS_BASIC(syscall_chown) \
 	SMBPROFILE_STATS_BASIC(syscall_fchown) \
 	SMBPROFILE_STATS_BASIC(syscall_lchown) \
 	SMBPROFILE_STATS_BASIC(syscall_chdir) \
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 5ea4f805817..802eb8d0292 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -285,6 +285,7 @@
 /* Version 42 - Add SMB_VFS_FCNTL */
 /* Version 42 - Remove SMB_VFS_RMDIR.
 		Use SMB_VFS_UNLINKAT(.., AT_REMOVEDIR) instead. */
+/* Version 42 - Remove SMB_VFS_CHOWN */
 
 #define SMB_VFS_INTERFACE_VERSION 42
 
@@ -786,10 +787,6 @@ struct vfs_fn_pointers {
 			const struct smb_filename *smb_fname,
 			mode_t mode);
 	int (*fchmod_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode);
-	int (*chown_fn)(struct vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid);
 	int (*fchown_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid);
 	int (*lchown_fn)(struct vfs_handle_struct *handle,
 			const struct smb_filename *smb_fname,
@@ -1316,10 +1313,6 @@ int smb_vfs_call_chmod(struct vfs_handle_struct *handle,
 			mode_t mode);
 int smb_vfs_call_fchmod(struct vfs_handle_struct *handle,
 			struct files_struct *fsp, mode_t mode);
-int smb_vfs_call_chown(struct vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid);
 int smb_vfs_call_fchown(struct vfs_handle_struct *handle,
 			struct files_struct *fsp, uid_t uid, gid_t gid);
 int smb_vfs_call_lchown(struct vfs_handle_struct *handle,
@@ -1755,10 +1748,6 @@ int vfs_not_implemented_chmod(vfs_handle_struct *handle,
 			      mode_t mode);
 int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp,
 			       mode_t mode);
-int vfs_not_implemented_chown(vfs_handle_struct *handle,
-			      const struct smb_filename *smb_fname,
-			      uid_t uid,
-			      gid_t gid);
 int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp,
 			       uid_t uid, gid_t gid);
 int vfs_not_implemented_lchown(vfs_handle_struct *handle,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 95cf4cf3088..6a7cbf2275d 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -231,11 +231,6 @@
 #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \
 	smb_vfs_call_fchmod((handle)->next, (fsp), (mode))
 
-#define SMB_VFS_CHOWN(conn, smb_fname, uid, gid) \
-	smb_vfs_call_chown((conn)->vfs_handles, (smb_fname), (uid), (gid))
-#define SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid) \
-	smb_vfs_call_chown((handle)->next, (smb_fname), (uid), (gid))
-
 #define SMB_VFS_FCHOWN(fsp, uid, gid) \
 	smb_vfs_call_fchown((fsp)->conn->vfs_handles, (fsp), (uid), (gid))
 #define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) \
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index 21465c4f91d..f1ec5807b49 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -358,40 +358,6 @@ static int cap_chmod(vfs_handle_struct *handle,
 	return ret;
 }
 
-static int cap_chown(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid)
-{
-	struct smb_filename *cap_smb_fname = NULL;
-	char *cappath = capencode(talloc_tos(), smb_fname->base_name);
-	int ret;
-	int saved_errno;
-
-	if (!cappath) {
-		errno = ENOMEM;
-		return -1;
-	}
-
-	cap_smb_fname = synthetic_smb_fname(talloc_tos(),
-					cappath,
-					NULL,
-					NULL,
-					smb_fname->flags);
-	if (cap_smb_fname == NULL) {
-		TALLOC_FREE(cappath);
-		errno = ENOMEM;
-		return -1;
-	}
-
-	ret = SMB_VFS_NEXT_CHOWN(handle, cap_smb_fname, uid, gid);
-	saved_errno = errno;
-	TALLOC_FREE(cappath);
-	TALLOC_FREE(cap_smb_fname);
-	errno = saved_errno;
-	return ret;
-}
-
 static int cap_lchown(vfs_handle_struct *handle,
 			const struct smb_filename *smb_fname,
 			uid_t uid,
@@ -1022,7 +988,6 @@ static struct vfs_fn_pointers vfs_cap_fns = {
 	.lstat_fn = cap_lstat,
 	.unlinkat_fn = cap_unlinkat,
 	.chmod_fn = cap_chmod,
-	.chown_fn = cap_chown,
 	.lchown_fn = cap_lchown,
 	.chdir_fn = cap_chdir,
 	.ntimes_fn = cap_ntimes,
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index db70060ee2b..3880f16b10c 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -712,44 +712,6 @@ static int catia_unlinkat(vfs_handle_struct *handle,
 	return ret;
 }
 
-static int catia_chown(vfs_handle_struct *handle,
-		       const struct smb_filename *smb_fname,
-		       uid_t uid,
-		       gid_t gid)
-{
-	char *name = NULL;
-	NTSTATUS status;
-	int ret;
-	int saved_errno;
-	struct smb_filename *catia_smb_fname = NULL;
-
-	status = catia_string_replace_allocate(handle->conn,
-					smb_fname->base_name,
-					&name,
-					vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		return -1;
-	}
-	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
-					name,
-					NULL,
-					&smb_fname->st,
-					smb_fname->flags);
-	if (catia_smb_fname == NULL) {
-		TALLOC_FREE(name);
-		errno = ENOMEM;
-		return -1;
-	}
-
-	ret = SMB_VFS_NEXT_CHOWN(handle, catia_smb_fname, uid, gid);
-	saved_errno = errno;
-	TALLOC_FREE(name);
-	TALLOC_FREE(catia_smb_fname);
-	errno = saved_errno;
-	return ret;
-}
-
 static int catia_lchown(vfs_handle_struct *handle,
 			const struct smb_filename *smb_fname,
 			uid_t uid,
@@ -2429,7 +2391,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
 	.unlinkat_fn = catia_unlinkat,
 	.chmod_fn = catia_chmod,
 	.fchmod_fn = catia_fchmod,
-	.chown_fn = catia_chown,
 	.fchown_fn = catia_fchown,
 	.lchown_fn = catia_lchown,
 	.chdir_fn = catia_chdir,
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 6295d032d10..8864b424008 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -972,18 +972,6 @@ static int cephwrap_fchmod(struct vfs_handle_struct *handle, files_struct *fsp,
 	WRAP_RETURN(result);
 }
 
-static int cephwrap_chown(struct vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid)
-{
-	int result;
-	DBG_DEBUG("[CEPH] chown(%p, %s, %d, %d)\n", handle, smb_fname->base_name, uid, gid);
-	result = ceph_chown(handle->data, smb_fname->base_name, uid, gid);
-	DBG_DEBUG("[CEPH] chown(...) = %d\n", result);
-	WRAP_RETURN(result);
-}
-
 static int cephwrap_fchown(struct vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
 {
 	int result;
@@ -1455,7 +1443,6 @@ static struct vfs_fn_pointers ceph_fns = {
 	.unlinkat_fn = cephwrap_unlinkat,
 	.chmod_fn = cephwrap_chmod,
 	.fchmod_fn = cephwrap_fchmod,
-	.chown_fn = cephwrap_chown,
 	.fchown_fn = cephwrap_fchown,
 	.lchown_fn = cephwrap_lchown,
 	.chdir_fn = cephwrap_chdir,
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index 680716fcf98..ce364ae83dc 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -1018,28 +1018,6 @@ static int ceph_snap_gmt_chmod(vfs_handle_struct *handle,
 	return SMB_VFS_NEXT_CHMOD(handle, csmb_fname, mode);
 }
 
-static int ceph_snap_gmt_chown(vfs_handle_struct *handle,
-			const struct smb_filename *csmb_fname,
-			uid_t uid,
-			gid_t gid)
-{
-	time_t timestamp = 0;
-	int ret;
-
-	ret = ceph_snap_gmt_strip_snapshot(handle,
-					csmb_fname->base_name,
-					&timestamp, NULL, 0);
-	if (ret < 0) {
-		errno = -ret;
-		return -1;
-	}
-	if (timestamp != 0) {
-		errno = EROFS;
-		return -1;
-	}
-	return SMB_VFS_NEXT_CHOWN(handle, csmb_fname, uid, gid);
-}
-
 static int ceph_snap_gmt_chdir(vfs_handle_struct *handle,
 			const struct smb_filename *csmb_fname)
 {
@@ -1623,7 +1601,6 @@ static struct vfs_fn_pointers ceph_snap_fns = {
 	.open_fn = ceph_snap_gmt_open,
 	.unlinkat_fn = ceph_snap_gmt_unlinkat,
 	.chmod_fn = ceph_snap_gmt_chmod,
-	.chown_fn = ceph_snap_gmt_chown,
 	.chdir_fn = ceph_snap_gmt_chdir,
 	.ntimes_fn = ceph_snap_gmt_ntimes,
 	.readlinkat_fn = ceph_snap_gmt_readlinkat,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 13d849c5084..421772da377 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2245,19 +2245,6 @@ static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t m
 	return result;
 }
 
-static int vfswrap_chown(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid)
-{
-	int result;
-
-	START_PROFILE(syscall_chown);
-	result = chown(smb_fname->base_name, uid, gid);
-	END_PROFILE(syscall_chown);
-	return result;
-}
-
 static int vfswrap_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
 {
 #ifdef HAVE_FCHOWN
@@ -3529,7 +3516,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
 	.unlinkat_fn = vfswrap_unlinkat,
 	.chmod_fn = vfswrap_chmod,
 	.fchmod_fn = vfswrap_fchmod,
-	.chown_fn = vfswrap_chown,
 	.fchown_fn = vfswrap_fchown,
 	.lchown_fn = vfswrap_lchown,
 	.chdir_fn = vfswrap_chdir,
diff --git a/source3/modules/vfs_fake_acls.c b/source3/modules/vfs_fake_acls.c
index ba94c8db06f..d8385954364 100644
--- a/source3/modules/vfs_fake_acls.c
+++ b/source3/modules/vfs_fake_acls.c
@@ -405,46 +405,6 @@ static int fake_acls_sys_acl_delete_def_file(vfs_handle_struct *handle,
 	return ret;
 }
 
-static int fake_acls_chown(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid)
-{
-	int ret;
-	uint8_t id_buf[4];
-	if (uid != -1) {
-		uid_t current_uid = get_current_uid(handle->conn);
-
-		if (current_uid != 0 && current_uid != uid) {
-			return EACCES;
-		}
-
-		SIVAL(id_buf, 0, uid);
-		ret = SMB_VFS_NEXT_SETXATTR(handle,
-				smb_fname,
-				FAKE_UID,
-				id_buf,
-				sizeof(id_buf),
-				0);
-		if (ret != 0) {
-			return ret;
-		}
-	}
-	if (gid != -1) {
-		SIVAL(id_buf, 0, gid);
-		ret = SMB_VFS_NEXT_SETXATTR(handle,
-				smb_fname,
-				FAKE_GID,
-				id_buf,
-				sizeof(id_buf),
-				0);
-		if (ret != 0) {
-			return ret;
-		}
-	}
-	return 0;
-}
-
 static int fake_acls_lchown(vfs_handle_struct *handle,
 			const struct smb_filename *smb_fname,
 			uid_t uid,
@@ -761,7 +721,6 @@ static struct vfs_fn_pointers vfs_fake_acls_fns = {
 	.sys_acl_set_file_fn = fake_acls_sys_acl_set_file,
 	.sys_acl_set_fd_fn = fake_acls_sys_acl_set_fd,
 	.sys_acl_delete_def_file_fn = fake_acls_sys_acl_delete_def_file,
-	.chown_fn = fake_acls_chown,
 	.lchown_fn = fake_acls_lchown,
 	.fchown_fn = fake_acls_fchown,
 	
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index cce87aa13d8..02aaa34da88 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -2079,52 +2079,6 @@ static int fruit_chmod(vfs_handle_struct *handle,
 	return rc;
 }
 
-static int fruit_chown(vfs_handle_struct *handle,
-		       const struct smb_filename *smb_fname,
-		       uid_t uid,
-		       gid_t gid)
-{
-	int rc = -1;
-	struct fruit_config_data *config = NULL;
-	struct smb_filename *adp_smb_fname = NULL;
-
-	rc = SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid);
-	if (rc != 0) {
-		return rc;
-	}
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data, return -1);
-
-	if (config->rsrc != FRUIT_RSRC_ADFILE) {
-		return 0;
-	}
-
-	if (!VALID_STAT(smb_fname->st)) {
-		return 0;
-	}
-
-	if (!S_ISREG(smb_fname->st.st_ex_mode)) {
-		return 0;
-	}
-
-	rc = adouble_path(talloc_tos(), smb_fname, &adp_smb_fname);
-	if (rc != 0) {
-		goto done;
-	}
-
-	DEBUG(10, ("fruit_chown: %s\n", adp_smb_fname->base_name));
-
-	rc = SMB_VFS_NEXT_CHOWN(handle, adp_smb_fname, uid, gid);
-	if (errno == ENOENT) {
-		rc = 0;
-	}
-
- done:
-	TALLOC_FREE(adp_smb_fname);
-	return rc;
-}
-
 static int fruit_rmdir_internal(struct vfs_handle_struct *handle,
 			struct files_struct *dirfsp,
 			const struct smb_filename *smb_fname)
@@ -5148,7 +5102,6 @@ static struct vfs_fn_pointers vfs_fruit_fns = {
 
 	/* File operations */
 	.chmod_fn = fruit_chmod,
-	.chown_fn = fruit_chown,
 	.unlinkat_fn = fruit_unlinkat,
 	.renameat_fn = fruit_renameat,
 	.open_fn = fruit_open,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 3c337a2e62b..a13c4da419b 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -140,7 +140,6 @@ typedef enum _vfs_op_type {
 	SMB_VFS_OP_UNLINKAT,
 	SMB_VFS_OP_CHMOD,
 	SMB_VFS_OP_FCHMOD,
-	SMB_VFS_OP_CHOWN,
 	SMB_VFS_OP_FCHOWN,
 	SMB_VFS_OP_LCHOWN,
 	SMB_VFS_OP_CHDIR,
@@ -283,7 +282,6 @@ static struct {
 	{ SMB_VFS_OP_UNLINKAT,	"unlinkat" },
 	{ SMB_VFS_OP_CHMOD,	"chmod" },
 	{ SMB_VFS_OP_FCHMOD,	"fchmod" },
-	{ SMB_VFS_OP_CHOWN,	"chown" },
 	{ SMB_VFS_OP_FCHOWN,	"fchown" },
 	{ SMB_VFS_OP_LCHOWN,	"lchown" },
 	{ SMB_VFS_OP_CHDIR,	"chdir" },
@@ -1546,21 +1544,6 @@ static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp,
 	return result;
 }
 
-static int smb_full_audit_chown(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			uid_t uid,
-			gid_t gid)
-{
-	int result;
-
-	result = SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid);
-
-	do_log(SMB_VFS_OP_CHOWN, (result >= 0), handle, "%s|%ld|%ld",


-- 
Samba Shared Repository



More information about the samba-cvs mailing list