From 177f15ebb9e29a4cc6843a300f3da0ba7530332d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 Oct 2019 14:18:32 -0700 Subject: [PATCH] s3: torture: Remove cmd_chown() - can be replicated by cmd_open()->cmd_fchown(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Last user of SMB_VFS_CHOWN() in the codebase. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- source3/torture/cmd_vfs.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 2408db1268c..be4990db3fc 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -946,38 +946,6 @@ static NTSTATUS cmd_fchmod(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, return NT_STATUS_OK; } -static NTSTATUS cmd_chown(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) -{ - struct smb_filename *smb_fname = NULL; - uid_t uid; - gid_t gid; - if (argc != 4) { - printf("Usage: chown \n"); - return NT_STATUS_OK; - } - - uid = atoi(argv[2]); - gid = atoi(argv[3]); - - smb_fname = synthetic_smb_fname(talloc_tos(), - argv[1], - NULL, - NULL, - ssf_flags()); - if (smb_fname == NULL) { - return NT_STATUS_NO_MEMORY; - } - - if (SMB_VFS_CHOWN(vfs->conn, smb_fname, uid, gid) == -1) { - printf("chown: error=%d (%s)\n", errno, strerror(errno)); - return NT_STATUS_UNSUCCESSFUL; - } - - printf("chown: ok\n"); - return NT_STATUS_OK; -} - - static NTSTATUS cmd_fchown(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) { uid_t uid; @@ -2006,7 +1974,6 @@ struct cmd_set vfs_commands[] = { { "unlink", cmd_pathfunc, "VFS unlink()", "unlink " }, { "chmod", cmd_chmod, "VFS chmod()", "chmod " }, { "fchmod", cmd_fchmod, "VFS fchmod()", "fchmod " }, - { "chown", cmd_chown, "VFS chown()", "chown " }, { "fchown", cmd_fchown, "VFS fchown()", "fchown " }, { "chdir", cmd_pathfunc, "VFS chdir()", "chdir " }, { "getwd", cmd_getwd, "VFS getwd()", "getwd" }, -- 2.47.3