1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Remove redundant parameter fd from SMB_VFS_SYS_ACL_SET_FD().

Michael
This commit is contained in:
Michael Adam 2008-01-08 01:54:19 +01:00
parent 7b201c177b
commit 9296e93588
14 changed files with 48 additions and 47 deletions

View File

@ -93,6 +93,7 @@
/* Leave at 22 - not yet released. Remove parameter fd from getlock. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from sys_acl_get_fd. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from fchmod_acl. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from sys_acl_set_fd. - obnox */
@ -366,7 +367,7 @@ struct vfs_ops {
int (*sys_acl_set_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset);
int (*sys_acl_valid)(struct vfs_handle_struct *handle, SMB_ACL_T theacl );
int (*sys_acl_set_file)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
int (*sys_acl_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_ACL_T theacl);
int (*sys_acl_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl);
int (*sys_acl_delete_def_file)(struct vfs_handle_struct *handle, const char *path);
int (*sys_acl_get_perm)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
int (*sys_acl_free_text)(struct vfs_handle_struct *handle, char *text);

View File

@ -109,7 +109,7 @@
#define SMB_VFS_SYS_ACL_SET_PERMSET(conn, entry, permset) ((conn)->vfs.ops.sys_acl_set_permset((conn)->vfs.handles.sys_acl_set_permset, (entry), (permset)))
#define SMB_VFS_SYS_ACL_VALID(conn, theacl) ((conn)->vfs.ops.sys_acl_valid((conn)->vfs.handles.sys_acl_valid, (theacl)))
#define SMB_VFS_SYS_ACL_SET_FILE(conn, name, acltype, theacl) ((conn)->vfs.ops.sys_acl_set_file((conn)->vfs.handles.sys_acl_set_file, (name), (acltype), (theacl)))
#define SMB_VFS_SYS_ACL_SET_FD(fsp, fd, theacl) ((fsp)->conn->vfs.ops.sys_acl_set_fd((fsp)->conn->vfs.handles.sys_acl_set_fd, (fsp), (fd), (theacl)))
#define SMB_VFS_SYS_ACL_SET_FD(fsp, theacl) ((fsp)->conn->vfs.ops.sys_acl_set_fd((fsp)->conn->vfs.handles.sys_acl_set_fd, (fsp), (theacl)))
#define SMB_VFS_SYS_ACL_DELETE_DEF_FILE(conn, path) ((conn)->vfs.ops.sys_acl_delete_def_file((conn)->vfs.handles.sys_acl_delete_def_file, (path)))
#define SMB_VFS_SYS_ACL_GET_PERM(conn, permset, perm) ((conn)->vfs.ops.sys_acl_get_perm((conn)->vfs.handles.sys_acl_get_perm, (permset), (perm)))
#define SMB_VFS_SYS_ACL_FREE_TEXT(conn, text) ((conn)->vfs.ops.sys_acl_free_text((conn)->vfs.handles.sys_acl_free_text, (text)))
@ -228,7 +228,7 @@
#define SMB_VFS_OPAQUE_SYS_ACL_SET_PERMSET(conn, entry, permset) ((conn)->vfs_opaque.ops.sys_acl_set_permset((conn)->vfs_opaque.handles.sys_acl_set_permset, (entry), (permset)))
#define SMB_VFS_OPAQUE_SYS_ACL_VALID(conn, theacl) ((conn)->vfs_opaque.ops.sys_acl_valid((conn)->vfs_opaque.handles.sys_acl_valid, (theacl)))
#define SMB_VFS_OPAQUE_SYS_ACL_SET_FILE(conn, name, acltype, theacl) ((conn)->vfs_opaque.ops.sys_acl_set_file((conn)->vfs_opaque.handles.sys_acl_set_file, (name), (acltype), (theacl)))
#define SMB_VFS_OPAQUE_SYS_ACL_SET_FD(fsp, fd, theacl) ((fsp)->conn->vfs_opaque.ops.sys_acl_set_fd((fsp)->conn->vfs_opaque.handles.sys_acl_set_fd, (fsp), (fd), (theacl)))
#define SMB_VFS_OPAQUE_SYS_ACL_SET_FD(fsp, theacl) ((fsp)->conn->vfs_opaque.ops.sys_acl_set_fd((fsp)->conn->vfs_opaque.handles.sys_acl_set_fd, (fsp), (theacl)))
#define SMB_VFS_OPAQUE_SYS_ACL_DELETE_DEF_FILE(conn, path) ((conn)->vfs_opaque.ops.sys_acl_delete_def_file((conn)->vfs_opaque.handles.sys_acl_delete_def_file, (path)))
#define SMB_VFS_OPAQUE_SYS_ACL_GET_PERM(conn, permset, perm) ((conn)->vfs_opaque.ops.sys_acl_get_perm((conn)->vfs_opaque.handles.sys_acl_get_perm, (permset), (perm)))
#define SMB_VFS_OPAQUE_SYS_ACL_FREE_TEXT(conn, text) ((conn)->vfs_opaque.ops.sys_acl_free_text((conn)->vfs_opaque.handles.sys_acl_free_text, (text)))
@ -348,7 +348,7 @@
#define SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset) ((handle)->vfs_next.ops.sys_acl_set_permset((handle)->vfs_next.handles.sys_acl_set_permset, (entry), (permset)))
#define SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl) ((handle)->vfs_next.ops.sys_acl_valid((handle)->vfs_next.handles.sys_acl_valid, (theacl)))
#define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl) ((handle)->vfs_next.ops.sys_acl_set_file((handle)->vfs_next.handles.sys_acl_set_file, (name), (acltype), (theacl)))
#define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl) ((handle)->vfs_next.ops.sys_acl_set_fd((handle)->vfs_next.handles.sys_acl_set_fd, (fsp), (fd), (theacl)))
#define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl) ((handle)->vfs_next.ops.sys_acl_set_fd((handle)->vfs_next.handles.sys_acl_set_fd, (fsp), (theacl)))
#define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path) ((handle)->vfs_next.ops.sys_acl_delete_def_file((handle)->vfs_next.handles.sys_acl_delete_def_file, (path)))
#define SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm) ((handle)->vfs_next.ops.sys_acl_get_perm((handle)->vfs_next.handles.sys_acl_get_perm, (permset), (perm)))
#define SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text) ((handle)->vfs_next.ops.sys_acl_free_text((handle)->vfs_next.handles.sys_acl_free_text, (text)))

View File

@ -3,7 +3,7 @@
Samba system utilities for ACL support.
Copyright (C) Jeremy Allison 2000.
Copyright (C) Volker Lendecke 2006
Copyright (C) Michael Adam 2006
Copyright (C) Michael Adam 2006,2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -376,9 +376,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
}
int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T acl_d)
SMB_ACL_T acl_d)
{
return posixacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
return posixacl_sys_acl_set_fd(handle, fsp, acl_d);
}
int sys_acl_delete_def_file(vfs_handle_struct *handle,
@ -407,9 +407,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
}
int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T acl_d)
SMB_ACL_T acl_d)
{
return aixacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
return aixacl_sys_acl_set_fd(handle, fsp, acl_d);
}
int sys_acl_delete_def_file(vfs_handle_struct *handle,
@ -438,9 +438,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
}
int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T acl_d)
SMB_ACL_T acl_d)
{
return tru64acl_sys_acl_set_fd(handle, fsp, fd, acl_d);
return tru64acl_sys_acl_set_fd(handle, fsp, acl_d);
}
int sys_acl_delete_def_file(vfs_handle_struct *handle,
@ -469,9 +469,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
}
int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T acl_d)
SMB_ACL_T acl_d)
{
return solarisacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
return solarisacl_sys_acl_set_fd(handle, fsp, acl_d);
}
int sys_acl_delete_def_file(vfs_handle_struct *handle,
@ -500,9 +500,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
}
int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T acl_d)
SMB_ACL_T acl_d)
{
return hpuxacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
return hpuxacl_sys_acl_set_fd(handle, fsp, acl_d);
}
int sys_acl_delete_def_file(vfs_handle_struct *handle,
@ -531,9 +531,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
}
int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T acl_d)
SMB_ACL_T acl_d)
{
return irixacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
return irixacl_sys_acl_set_fd(handle, fsp, acl_d);
}
int sys_acl_delete_def_file(vfs_handle_struct *handle,
@ -577,7 +577,7 @@ int sys_acl_set_file(vfs_handle_struct *handle,
}
int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T acl_d)
SMB_ACL_T acl_d)
{
#ifdef ENOTSUP
errno = ENOTSUP;

View File

@ -153,7 +153,7 @@ int aixacl_sys_acl_set_file(vfs_handle_struct *handle,
int aixacl_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
struct acl *file_acl = NULL;
unsigned int rc;
@ -162,7 +162,7 @@ int aixacl_sys_acl_set_fd(vfs_handle_struct *handle,
if (!file_acl)
return -1;
rc = fchacl(fd,file_acl,file_acl->acl_len);
rc = fchacl(fsp->fh->fd,file_acl,file_acl->acl_len);
DEBUG(10,("errno is %d\n",errno));
DEBUG(10,("return code is %d\n",rc));
SAFE_FREE(file_acl);

View File

@ -448,7 +448,7 @@ int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle,
int aixjfs2_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
struct acl *acl_aixc;
acl_type_t acl_type_info;
@ -467,7 +467,7 @@ int aixjfs2_sys_acl_set_fd(vfs_handle_struct *handle,
return -1;
rc = aclx_fput(
fd,
fsp->fh->fd,
SET_ACL, /* set only the ACL, not mode bits */
acl_type_info,
acl_aixc,

View File

@ -1097,9 +1097,9 @@ static int vfswrap_sys_acl_set_file(vfs_handle_struct *handle, const char *name
return sys_acl_set_file(handle, name, acltype, theacl);
}
static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl)
static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
{
return sys_acl_set_fd(handle, fsp, fd, theacl);
return sys_acl_set_fd(handle, fsp, theacl);
}
static int vfswrap_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path)

View File

@ -250,7 +250,7 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
const char *name, SMB_ACL_TYPE_T acltype,
SMB_ACL_T theacl);
static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T theacl);
SMB_ACL_T theacl);
static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle,
const char *path);
static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle,
@ -1843,11 +1843,11 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
}
static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
int result;
result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl);
result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
do_log(SMB_VFS_OP_SYS_ACL_SET_FD, (result >= 0), handle,
"%s", fsp->fsp_name);

View File

@ -615,7 +615,7 @@ int gpfsacl_sys_acl_set_file(vfs_handle_struct *handle,
int gpfsacl_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
return gpfsacl_sys_acl_set_file(handle, fsp->fsp_name, SMB_ACL_TYPE_ACCESS, theacl);
}

View File

@ -1,7 +1,7 @@
/*
* Unix SMB/Netbios implementation.
* VFS module to get and set HP-UX ACLs
* Copyright (C) Michael Adam 2006
* Copyright (C) Michael Adam 2006,2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -306,14 +306,14 @@ int hpuxacl_sys_acl_set_file(vfs_handle_struct *handle,
*/
int hpuxacl_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
/*
* HPUX doesn't have the facl call. Fake it using the path.... JRA.
*/
/* For all I see, the info should already be in the fsp
* parameter, but get it again to be safe --- necessary? */
files_struct *file_struct_p = file_find_fd(fd);
files_struct *file_struct_p = file_find_fd(fsp->fh->fd);
if (file_struct_p == NULL) {
errno = EBADF;
return -1;

View File

@ -1,7 +1,7 @@
/*
Unix SMB/Netbios implementation.
VFS module to get and set irix acls
Copyright (C) Michael Adam 2006
Copyright (C) Michael Adam 2006,2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -49,7 +49,7 @@ int irixacl_sys_acl_set_file(vfs_handle_struct *handle,
int irixacl_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
errno = ENOTSUP;
return -1;

View File

@ -113,14 +113,14 @@ int posixacl_sys_acl_set_file(vfs_handle_struct *handle,
int posixacl_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
int res;
acl_t acl = smb_acl_to_posix(theacl);
if (acl == NULL) {
return -1;
}
res = acl_set_fd(fd, acl);
res = acl_set_fd(fsp->fh->fd, acl);
acl_free(acl);
return res;
}

View File

@ -1,7 +1,7 @@
/*
Unix SMB/Netbios implementation.
VFS module to get and set Solaris ACLs
Copyright (C) Michael Adam 2006
Copyright (C) Michael Adam 2006,2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -219,7 +219,7 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
*/
int solarisacl_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
SOLARIS_ACL_T solaris_acl = NULL;
SOLARIS_ACL_T default_acl = NULL;
@ -242,7 +242,7 @@ int solarisacl_sys_acl_set_fd(vfs_handle_struct *handle,
strerror(errno)));
goto done;
}
if (!solaris_acl_get_fd(fd, &default_acl, &default_count)) {
if (!solaris_acl_get_fd(fsp->fh->fd, &default_acl, &default_count)) {
DEBUG(10, ("error getting (default) acl from fd\n"));
goto done;
}
@ -258,7 +258,7 @@ int solarisacl_sys_acl_set_fd(vfs_handle_struct *handle,
goto done;
}
ret = facl(fd, SETACL, count, solaris_acl);
ret = facl(fsp->fh->fd, SETACL, count, solaris_acl);
if (ret != 0) {
DEBUG(10, ("call of facl failed (%s).\n", strerror(errno)));
}

View File

@ -1,7 +1,7 @@
/*
Unix SMB/Netbios implementation.
VFS module to get and set Tru64 acls
Copyright (C) Michael Adam 2006
Copyright (C) Michael Adam 2006,2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -128,14 +128,14 @@ fail:
int tru64acl_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
int fd, SMB_ACL_T theacl)
SMB_ACL_T theacl)
{
int res;
acl_t tru64_acl = smb_acl_to_tru64_acl(theacl);
if (tru64_acl == NULL) {
return -1;
}
res = acl_set_fd(fd, ACL_TYPE_ACCESS, tru64_acl);
res = acl_set_fd(fsp->fh->fd, ACL_TYPE_ACCESS, tru64_acl);
acl_free(tru64_acl);
return res;

View File

@ -2573,7 +2573,7 @@ static bool set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, bool defau
}
}
} else {
if (SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, the_acl) == -1) {
if (SMB_VFS_SYS_ACL_SET_FD(fsp, the_acl) == -1) {
/*
* Some systems allow all the above calls and only fail with no ACL support
* when attempting to apply the acl. HPUX with HFS is an example of this. JRA.
@ -2589,7 +2589,7 @@ static bool set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, bool defau
fsp->fsp_name ));
become_root();
sret = SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, the_acl);
sret = SMB_VFS_SYS_ACL_SET_FD(fsp, the_acl);
unbecome_root();
if (sret == 0) {
ret = True;
@ -3814,7 +3814,7 @@ int fchmod_acl(files_struct *fsp, mode_t mode)
if ((ret = chmod_acl_internals(conn, posix_acl, mode)) == -1)
goto done;
ret = SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, posix_acl);
ret = SMB_VFS_SYS_ACL_SET_FD(fsp, posix_acl);
done:
@ -4152,7 +4152,7 @@ static bool remove_posix_acl(connection_struct *conn, files_struct *fsp, const c
/* Set the new empty file ACL. */
if (fsp && fsp->fh->fd != -1) {
if (SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, new_file_acl) == -1) {
if (SMB_VFS_SYS_ACL_SET_FD(fsp, new_file_acl) == -1) {
DEBUG(5,("remove_posix_acl: acl_set_file failed on %s (%s)\n",
fname, strerror(errno) ));
goto done;
@ -4199,7 +4199,7 @@ bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *
if (fsp && fsp->fh->fd != -1) {
/* The preferred way - use an open fd. */
if (SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, file_acl) == -1) {
if (SMB_VFS_SYS_ACL_SET_FD(fsp, file_acl) == -1) {
DEBUG(5,("set_unix_posix_acl: acl_set_file failed on %s (%s)\n",
fname, strerror(errno) ));
SMB_VFS_SYS_ACL_FREE_ACL(conn, file_acl);