summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/vfs.h3
-rw-r--r--source3/include/vfs_macros.h6
-rw-r--r--source3/modules/vfs_audit.c6
-rw-r--r--source3/modules/vfs_default.c6
-rw-r--r--source3/modules/vfs_extd_audit.c6
-rw-r--r--source3/modules/vfs_full_audit.c6
-rw-r--r--source3/modules/vfs_gpfs.c4
-rw-r--r--source3/smbd/dosmode.c2
-rw-r--r--source3/smbd/open.c2
-rw-r--r--source3/torture/cmd_vfs.c2
10 files changed, 22 insertions, 21 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index f4422e4fa9..95e863b690 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -84,6 +84,7 @@
/* Leave at 22 - not yet released. Remove parameter fd from lseek. - obnox */
/* 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 */
#define SMB_VFS_INTERFACE_VERSION 22
@@ -288,7 +289,7 @@ struct vfs_ops {
int (*lstat)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf);
int (*unlink)(struct vfs_handle_struct *handle, const char *path);
int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode);
- int (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, 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 (*lchown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 693d464f10..74fb802f39 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -62,7 +62,7 @@
#define SMB_VFS_LSTAT(conn, path, sbuf) ((conn)->vfs.ops.lstat((conn)->vfs.handles.lstat, (path), (sbuf)))
#define SMB_VFS_UNLINK(conn, path) ((conn)->vfs.ops.unlink((conn)->vfs.handles.unlink, (path)))
#define SMB_VFS_CHMOD(conn, path, mode) ((conn)->vfs.ops.chmod((conn)->vfs.handles.chmod, (path), (mode)))
-#define SMB_VFS_FCHMOD(fsp, fd, mode) ((fsp)->conn->vfs.ops.fchmod((fsp)->conn->vfs.handles.fchmod, (fsp), (fd), (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_LCHOWN(conn, path, uid, gid) ((conn)->vfs.ops.lchown((conn)->vfs.handles.lchown, (path), (uid), (gid)))
@@ -181,7 +181,7 @@
#define SMB_VFS_OPAQUE_LSTAT(conn, path, sbuf) ((conn)->vfs_opaque.ops.lstat((conn)->vfs_opaque.handles.lstat, (path), (sbuf)))
#define SMB_VFS_OPAQUE_UNLINK(conn, path) ((conn)->vfs_opaque.ops.unlink((conn)->vfs_opaque.handles.unlink, (path)))
#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, fd, mode) ((fsp)->conn->vfs_opaque.ops.fchmod((fsp)->conn->vfs_opaque.handles.fchmod, (fsp), (fd), (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_LCHOWN(conn, path, uid, gid) ((conn)->vfs_opaque.ops.lchown((conn)->vfs_opaque.handles.lchown, (path), (uid), (gid)))
@@ -301,7 +301,7 @@
#define SMB_VFS_NEXT_LSTAT(handle, path, sbuf) ((handle)->vfs_next.ops.lstat((handle)->vfs_next.handles.lstat, (path), (sbuf)))
#define SMB_VFS_NEXT_UNLINK(handle, path) ((handle)->vfs_next.ops.unlink((handle)->vfs_next.handles.unlink, (path)))
#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, fd, mode) ((handle)->vfs_next.ops.fchmod((handle)->vfs_next.handles.fchmod, (fsp), (fd), (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_LCHOWN(handle, path, uid, gid) ((handle)->vfs_next.ops.lchown((handle)->vfs_next.handles.lchown, (path), (uid), (gid)))
diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c
index 91993a47d7..27e7f998ab 100644
--- a/source3/modules/vfs_audit.c
+++ b/source3/modules/vfs_audit.c
@@ -39,7 +39,7 @@ static int audit_rename(vfs_handle_struct *handle, const char *oldname, const ch
static int audit_unlink(vfs_handle_struct *handle, const char *path);
static int audit_chmod(vfs_handle_struct *handle, const char *path, mode_t mode);
static int audit_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode);
-static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode);
+static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode);
static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode);
/* VFS operations */
@@ -268,11 +268,11 @@ static int audit_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t m
return result;
}
-static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
int result;
- result = SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode);
+ result = SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
syslog(audit_syslog_priority(handle), "fchmod %s mode 0x%x %s%s\n",
fsp->fsp_name, mode,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index dd3f4ba2cd..d296b5bd5b 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -549,7 +549,7 @@ static int vfswrap_chmod(vfs_handle_struct *handle, const char *path, mode_t mo
return result;
}
-static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
int result;
@@ -563,7 +563,7 @@ static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd,
{
int saved_errno = errno; /* We might get ENOSYS */
- if ((result = SMB_VFS_FCHMOD_ACL(fsp, fd, mode)) == 0) {
+ if ((result = SMB_VFS_FCHMOD_ACL(fsp, fsp->fh->fd, mode)) == 0) {
END_PROFILE(syscall_fchmod);
return result;
}
@@ -572,7 +572,7 @@ static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd,
}
#if defined(HAVE_FCHMOD)
- result = fchmod(fd, mode);
+ result = fchmod(fsp->fh->fd, mode);
#else
result = -1;
errno = ENOSYS;
diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c
index 552c64016e..f9b03731e7 100644
--- a/source3/modules/vfs_extd_audit.c
+++ b/source3/modules/vfs_extd_audit.c
@@ -42,7 +42,7 @@ static int audit_rename(vfs_handle_struct *handle, const char *oldname, const ch
static int audit_unlink(vfs_handle_struct *handle, const char *path);
static int audit_chmod(vfs_handle_struct *handle, const char *path, mode_t mode);
static int audit_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode);
-static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode);
+static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode);
static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode);
/* VFS operations */
@@ -310,11 +310,11 @@ static int audit_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t m
return result;
}
-static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
int result;
- result = SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode);
+ result = SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
syslog(audit_syslog_priority(handle), "fchmod %s mode 0x%x %s%s\n",
fsp->fsp_name, mode,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 7464bf80b3..fee65ba53f 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -144,7 +144,7 @@ static int smb_full_audit_unlink(vfs_handle_struct *handle,
const char *path);
static int smb_full_audit_chmod(vfs_handle_struct *handle,
const char *path, mode_t mode);
-static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd,
+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);
@@ -1264,12 +1264,12 @@ static int smb_full_audit_chmod(vfs_handle_struct *handle,
return result;
}
-static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp,
mode_t mode)
{
int result;
- result = SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode);
+ result = SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
do_log(SMB_VFS_OP_FCHMOD, (result >= 0), handle,
"%s|%o", fsp->fsp_name, mode);
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 500a6ee772..832dcbfcad 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -642,7 +642,7 @@ static int vfs_gpfs_chmod(vfs_handle_struct *handle, const char *path, mode_t mo
return SMB_VFS_NEXT_CHMOD(handle, path, mode);
}
-static int vfs_gpfs_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int vfs_gpfs_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
SMB_STRUCT_STAT st;
if (SMB_VFS_NEXT_FSTAT(handle, fsp, &st) != 0) {
@@ -652,7 +652,7 @@ static int vfs_gpfs_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd,
if ((st.st_mode & ~S_IFMT) == mode) {
return 0;
}
- return SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode);
+ return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
}
/* VFS operations structure */
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index a96f80ee0e..d3813f9b41 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -538,7 +538,7 @@ int file_set_dosmode(connection_struct *conn, const char *fname,
if (!NT_STATUS_IS_OK(open_file_fchmod(conn,fname,st,&fsp)))
return -1;
become_root();
- ret = SMB_VFS_FCHMOD(fsp, fsp->fh->fd, unixmode);
+ ret = SMB_VFS_FCHMOD(fsp, unixmode);
unbecome_root();
close_file_fchmod(fsp);
if (!newfile) {
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index d870374835..c7b053d531 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1915,7 +1915,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
}
if ((ret == -1) &&
- (SMB_VFS_FCHMOD(fsp, fsp->fh->fd, new_unx_mode) == -1))
+ (SMB_VFS_FCHMOD(fsp, new_unx_mode) == -1))
DEBUG(5, ("open_file_ntcreate: failed to reset "
"attributes of file %s to 0%o\n",
fname, (unsigned int)new_unx_mode));
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 7c8d070e06..1a042ba3b0 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -706,7 +706,7 @@ static NTSTATUS cmd_fchmod(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
return NT_STATUS_OK;
}
- if (SMB_VFS_FCHMOD(vfs->files[fd], fd, mode) == -1) {
+ if (SMB_VFS_FCHMOD(vfs->files[fd], mode) == -1) {
printf("fchmod: error=%d (%s)\n", errno, strerror(errno));
return NT_STATUS_UNSUCCESSFUL;
}