1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

Remove redundant parameter fd from SMB_VFS_FCHMOD().

Michael
(This used to be commit a54d5604da)
This commit is contained in:
Michael Adam
2008-01-07 13:44:37 +01:00
parent 87a684f7fc
commit e614dec27f
12 changed files with 26 additions and 25 deletions

View File

@ -201,9 +201,9 @@ static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
return vfswrap_chmod(NULL, path, mode);
}
static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
return vfswrap_fchmod(NULL, fsp, fd, mode);
return vfswrap_fchmod(NULL, fsp, mode);
}
static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)

View File

@ -194,9 +194,9 @@ static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
return SMB_VFS_NEXT_CHMOD(handle, path, mode);
}
static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
return SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode);
return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
}
static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)

View File

@ -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);

View File

@ -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)))

View File

@ -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,

View File

@ -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;

View File

@ -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,

View File

@ -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);

View File

@ -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 */

View File

@ -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) {

View File

@ -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));

View File

@ -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;
}