summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/VFS/skel_opaque.c4
-rw-r--r--examples/VFS/skel_transparent.c4
-rw-r--r--source/include/vfs.h3
-rw-r--r--source/include/vfs_macros.h6
-rw-r--r--source/modules/vfs_default.c4
-rw-r--r--source/modules/vfs_full_audit.c6
-rw-r--r--source/smbd/open.c2
-rw-r--r--source/smbd/posix_acls.c2
-rw-r--r--source/torture/cmd_vfs.c2
9 files changed, 17 insertions, 16 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index ac3ee6bd23c..185694f6fa0 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -211,9 +211,9 @@ static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, g
return vfswrap_chown(NULL, path, uid, gid);
}
-static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid)
+static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
{
- return vfswrap_fchown(NULL, fsp, fd, uid, gid);
+ return vfswrap_fchown(NULL, fsp, uid, gid);
}
static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 0cae3794454..d4af67db513 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -204,9 +204,9 @@ static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, g
return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
}
-static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid)
+static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
{
- return SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid);
+ return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
}
static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
diff --git a/source/include/vfs.h b/source/include/vfs.h
index 95e863b6904..88975302b28 100644
--- a/source/include/vfs.h
+++ b/source/include/vfs.h
@@ -85,6 +85,7 @@
/* Leave at 22 - not yet released. Remove parameter fd from fsync. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from fstat. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from fchmod. - obnox */
+/* Leave at 22 - not yet released. Remove parameter fd from fchown. - obnox */
#define SMB_VFS_INTERFACE_VERSION 22
@@ -291,7 +292,7 @@ struct vfs_ops {
int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode);
int (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode);
int (*chown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid);
- int (*fchown)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uid_t uid, gid_t gid);
+ int (*fchown)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid);
int (*lchown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid);
int (*chdir)(struct vfs_handle_struct *handle, const char *path);
char *(*getwd)(struct vfs_handle_struct *handle, char *buf);
diff --git a/source/include/vfs_macros.h b/source/include/vfs_macros.h
index 74fb802f395..366481039e4 100644
--- a/source/include/vfs_macros.h
+++ b/source/include/vfs_macros.h
@@ -64,7 +64,7 @@
#define SMB_VFS_CHMOD(conn, path, mode) ((conn)->vfs.ops.chmod((conn)->vfs.handles.chmod, (path), (mode)))
#define SMB_VFS_FCHMOD(fsp, mode) ((fsp)->conn->vfs.ops.fchmod((fsp)->conn->vfs.handles.fchmod, (fsp), (mode)))
#define SMB_VFS_CHOWN(conn, path, uid, gid) ((conn)->vfs.ops.chown((conn)->vfs.handles.chown, (path), (uid), (gid)))
-#define SMB_VFS_FCHOWN(fsp, fd, uid, gid) ((fsp)->conn->vfs.ops.fchown((fsp)->conn->vfs.handles.fchown, (fsp), (fd), (uid), (gid)))
+#define SMB_VFS_FCHOWN(fsp, uid, gid) ((fsp)->conn->vfs.ops.fchown((fsp)->conn->vfs.handles.fchown, (fsp), (uid), (gid)))
#define SMB_VFS_LCHOWN(conn, path, uid, gid) ((conn)->vfs.ops.lchown((conn)->vfs.handles.lchown, (path), (uid), (gid)))
#define SMB_VFS_CHDIR(conn, path) ((conn)->vfs.ops.chdir((conn)->vfs.handles.chdir, (path)))
#define SMB_VFS_GETWD(conn, buf) ((conn)->vfs.ops.getwd((conn)->vfs.handles.getwd, (buf)))
@@ -183,7 +183,7 @@
#define SMB_VFS_OPAQUE_CHMOD(conn, path, mode) ((conn)->vfs_opaque.ops.chmod((conn)->vfs_opaque.handles.chmod, (path), (mode)))
#define SMB_VFS_OPAQUE_FCHMOD(fsp, mode) ((fsp)->conn->vfs_opaque.ops.fchmod((fsp)->conn->vfs_opaque.handles.fchmod, (fsp), (mode)))
#define SMB_VFS_OPAQUE_CHOWN(conn, path, uid, gid) ((conn)->vfs_opaque.ops.chown((conn)->vfs_opaque.handles.chown, (path), (uid), (gid)))
-#define SMB_VFS_OPAQUE_FCHOWN(fsp, fd, uid, gid) ((fsp)->conn->vfs_opaque.ops.fchown((fsp)->conn->vfs_opaque.handles.fchown, (fsp), (fd), (uid), (gid)))
+#define SMB_VFS_OPAQUE_FCHOWN(fsp, uid, gid) ((fsp)->conn->vfs_opaque.ops.fchown((fsp)->conn->vfs_opaque.handles.fchown, (fsp), (uid), (gid)))
#define SMB_VFS_OPAQUE_LCHOWN(conn, path, uid, gid) ((conn)->vfs_opaque.ops.lchown((conn)->vfs_opaque.handles.lchown, (path), (uid), (gid)))
#define SMB_VFS_OPAQUE_CHDIR(conn, path) ((conn)->vfs_opaque.ops.chdir((conn)->vfs_opaque.handles.chdir, (path)))
#define SMB_VFS_OPAQUE_GETWD(conn, buf) ((conn)->vfs_opaque.ops.getwd((conn)->vfs_opaque.handles.getwd, (buf)))
@@ -303,7 +303,7 @@
#define SMB_VFS_NEXT_CHMOD(handle, path, mode) ((handle)->vfs_next.ops.chmod((handle)->vfs_next.handles.chmod, (path), (mode)))
#define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) ((handle)->vfs_next.ops.fchmod((handle)->vfs_next.handles.fchmod, (fsp), (mode)))
#define SMB_VFS_NEXT_CHOWN(handle, path, uid, gid) ((handle)->vfs_next.ops.chown((handle)->vfs_next.handles.chown, (path), (uid), (gid)))
-#define SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid) ((handle)->vfs_next.ops.fchown((handle)->vfs_next.handles.fchown, (fsp), (fd), (uid), (gid)))
+#define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) ((handle)->vfs_next.ops.fchown((handle)->vfs_next.handles.fchown, (fsp), (uid), (gid)))
#define SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid) ((handle)->vfs_next.ops.lchown((handle)->vfs_next.handles.lchown, (path), (uid), (gid)))
#define SMB_VFS_NEXT_CHDIR(handle, path) ((handle)->vfs_next.ops.chdir((handle)->vfs_next.handles.chdir, (path)))
#define SMB_VFS_NEXT_GETWD(handle, buf) ((handle)->vfs_next.ops.getwd((handle)->vfs_next.handles.getwd, (buf)))
diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c
index d296b5bd5b8..f66f77cd47e 100644
--- a/source/modules/vfs_default.c
+++ b/source/modules/vfs_default.c
@@ -592,13 +592,13 @@ static int vfswrap_chown(vfs_handle_struct *handle, const char *path, uid_t uid,
return result;
}
-static int vfswrap_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid)
+static int vfswrap_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
{
#ifdef HAVE_FCHOWN
int result;
START_PROFILE(syscall_fchown);
- result = fchown(fd, uid, gid);
+ result = fchown(fsp->fh->fd, uid, gid);
END_PROFILE(syscall_fchown);
return result;
#else
diff --git a/source/modules/vfs_full_audit.c b/source/modules/vfs_full_audit.c
index fee65ba53f1..f7796adba00 100644
--- a/source/modules/vfs_full_audit.c
+++ b/source/modules/vfs_full_audit.c
@@ -148,7 +148,7 @@ static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp,
mode_t mode);
static int smb_full_audit_chown(vfs_handle_struct *handle,
const char *path, uid_t uid, gid_t gid);
-static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp,
uid_t uid, gid_t gid);
static int smb_full_audit_lchown(vfs_handle_struct *handle,
const char *path, uid_t uid, gid_t gid);
@@ -1290,12 +1290,12 @@ static int smb_full_audit_chown(vfs_handle_struct *handle,
return result;
}
-static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp,
uid_t uid, gid_t gid)
{
int result;
- result = SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid);
+ result = SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
do_log(SMB_VFS_OP_FCHOWN, (result >= 0), handle, "%s|%ld|%ld",
fsp->fsp_name, (long int)uid, (long int)gid);
diff --git a/source/smbd/open.c b/source/smbd/open.c
index c7b053d5313..036e3e12a2d 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -102,7 +102,7 @@ static void change_file_owner_to_parent(connection_struct *conn,
}
become_root();
- ret = SMB_VFS_FCHOWN(fsp, fsp->fh->fd, parent_st.st_uid, (gid_t)-1);
+ ret = SMB_VFS_FCHOWN(fsp, parent_st.st_uid, (gid_t)-1);
unbecome_root();
if (ret == -1) {
DEBUG(0,("change_file_owner_to_parent: failed to fchown "
diff --git a/source/smbd/posix_acls.c b/source/smbd/posix_acls.c
index f11aa69e08a..1aa30019233 100644
--- a/source/smbd/posix_acls.c
+++ b/source/smbd/posix_acls.c
@@ -3194,7 +3194,7 @@ int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid)
become_root();
/* Keep the current file gid the same. */
- ret = SMB_VFS_FCHOWN(fsp, fsp->fh->fd, uid, (gid_t)-1);
+ ret = SMB_VFS_FCHOWN(fsp, uid, (gid_t)-1);
unbecome_root();
close_file_fchmod(fsp);
diff --git a/source/torture/cmd_vfs.c b/source/torture/cmd_vfs.c
index 1a042ba3b07..3947c3dd3c0 100644
--- a/source/torture/cmd_vfs.c
+++ b/source/torture/cmd_vfs.c
@@ -758,7 +758,7 @@ static NTSTATUS cmd_fchown(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
printf("fchown: error=%d (invalid file descriptor)\n", EBADF);
return NT_STATUS_OK;
}
- if (SMB_VFS_FCHOWN(vfs->files[fd], fd, uid, gid) == -1) {
+ if (SMB_VFS_FCHOWN(vfs->files[fd], uid, gid) == -1) {
printf("fchown error=%d (%s)\n", errno, strerror(errno));
return NT_STATUS_UNSUCCESSFUL;
}