summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/nfs4_acls.c2
-rw-r--r--source3/modules/vfs_afsacl.c6
-rw-r--r--source3/modules/vfs_aixacl.c13
-rw-r--r--source3/modules/vfs_aixacl2.c11
-rw-r--r--source3/modules/vfs_audit.c12
-rw-r--r--source3/modules/vfs_cacheprime.c5
-rw-r--r--source3/modules/vfs_cap.c12
-rw-r--r--source3/modules/vfs_commit.c8
-rw-r--r--source3/modules/vfs_default.c136
-rw-r--r--source3/modules/vfs_extd_audit.c12
-rw-r--r--source3/modules/vfs_fake_perms.c4
-rw-r--r--source3/modules/vfs_full_audit.c138
-rw-r--r--source3/modules/vfs_gpfs.c25
-rw-r--r--source3/modules/vfs_hpuxacl.c11
-rw-r--r--source3/modules/vfs_irixacl.c7
-rw-r--r--source3/modules/vfs_posixacl.c9
-rw-r--r--source3/modules/vfs_prealloc.c3
-rw-r--r--source3/modules/vfs_readahead.c11
-rw-r--r--source3/modules/vfs_solarisacl.c13
-rw-r--r--source3/modules/vfs_tru64acl.c11
-rw-r--r--source3/modules/vfs_zfsacl.c4
21 files changed, 218 insertions, 235 deletions
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 6d2972d8ed..52d3983fff 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -185,7 +185,7 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, SMB_STRUCT_STAT *psbuf)
if (fsp->is_directory || fsp->fh->fd == -1) {
return smbacl4_GetFileOwner(fsp->conn, fsp->fsp_name, psbuf);
}
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd, psbuf) != 0)
+ if (SMB_VFS_FSTAT(fsp, psbuf) != 0)
{
DEBUG(8, ("SMB_VFS_FSTAT failed with error %s\n",
strerror(errno)));
diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c
index a14a117229..e35bfabb8c 100644
--- a/source3/modules/vfs_afsacl.c
+++ b/source3/modules/vfs_afsacl.c
@@ -684,7 +684,7 @@ static size_t afs_fto_nt_acl(struct afs_acl *afs_acl,
security_info, ppdesc);
}
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) != 0) {
+ if(SMB_VFS_FSTAT(fsp, &sbuf) != 0) {
return 0;
}
@@ -993,7 +993,7 @@ static NTSTATUS afs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
static NTSTATUS afsacl_fget_nt_acl(struct vfs_handle_struct *handle,
struct files_struct *fsp,
- int fd, uint32 security_info,
+ uint32 security_info,
struct security_descriptor **ppdesc)
{
struct afs_acl acl;
@@ -1039,7 +1039,7 @@ static NTSTATUS afsacl_get_nt_acl(struct vfs_handle_struct *handle,
NTSTATUS afsacl_fset_nt_acl(vfs_handle_struct *handle,
files_struct *fsp,
- int fd, uint32 security_info_sent,
+ uint32 security_info_sent,
SEC_DESC *psd)
{
return afs_set_nt_acl(handle, fsp, security_info_sent, psd);
diff --git a/source3/modules/vfs_aixacl.c b/source3/modules/vfs_aixacl.c
index a60470ffc9..726a7f485e 100644
--- a/source3/modules/vfs_aixacl.c
+++ b/source3/modules/vfs_aixacl.c
@@ -80,8 +80,7 @@ SMB_ACL_T aixacl_sys_acl_get_file(vfs_handle_struct *handle,
}
SMB_ACL_T aixacl_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
struct acl *file_acl = (struct acl *)NULL;
@@ -93,7 +92,7 @@ SMB_ACL_T aixacl_sys_acl_get_fd(vfs_handle_struct *handle,
/* Get the acl using fstatacl */
DEBUG(10,("Entering AIX sys_acl_get_fd\n"));
- DEBUG(10,("fd is %d\n",fd));
+ DEBUG(10,("fd is %d\n",fsp->fh->fd));
file_acl = (struct acl *)SMB_MALLOC(BUFSIZ);
if(file_acl == NULL) {
@@ -104,7 +103,7 @@ SMB_ACL_T aixacl_sys_acl_get_fd(vfs_handle_struct *handle,
memset(file_acl,0,BUFSIZ);
- rc = fstatacl(fd,0,file_acl,BUFSIZ);
+ rc = fstatacl(fsp->fh->fd,0,file_acl,BUFSIZ);
if( (rc == -1) && (errno == ENOSPC)) {
struct acl *new_acl = SMB_MALLOC(file_acl->acl_len + sizeof(struct acl));
if( new_acl == NULL) {
@@ -113,7 +112,7 @@ SMB_ACL_T aixacl_sys_acl_get_fd(vfs_handle_struct *handle,
return NULL;
}
file_acl = new_acl;
- rc = fstatacl(fd,0,file_acl,file_acl->acl_len + sizeof(struct acl));
+ rc = fstatacl(fsp->fh->fd,0,file_acl,file_acl->acl_len + sizeof(struct acl));
if( rc == -1) {
DEBUG(0,("fstatacl returned %d with errno %d\n",rc,errno));
SAFE_FREE(file_acl);
@@ -154,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;
@@ -163,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);
diff --git a/source3/modules/vfs_aixacl2.c b/source3/modules/vfs_aixacl2.c
index d28efa55c6..996adbbdfe 100644
--- a/source3/modules/vfs_aixacl2.c
+++ b/source3/modules/vfs_aixacl2.c
@@ -159,7 +159,7 @@ static bool aixjfs2_get_nfs4_acl(const char *name,
}
static NTSTATUS aixjfs2_fget_nt_acl(vfs_handle_struct *handle,
- files_struct *fsp, int fd, uint32 security_info,
+ files_struct *fsp, uint32 security_info,
SEC_DESC **ppdesc)
{
SMB4ACL_T *pacl = NULL;
@@ -258,8 +258,7 @@ SMB_ACL_T aixjfs2_sys_acl_get_file(vfs_handle_struct *handle,
}
SMB_ACL_T aixjfs2_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
acl_type_t aixjfs2_type;
aixjfs2_type.u64 = ACL_AIXC;
@@ -399,7 +398,7 @@ static NTSTATUS aixjfs2_set_nt_acl_common(files_struct *fsp, uint32 security_inf
return result;
}
-NTSTATUS aixjfs2_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd)
+NTSTATUS aixjfs2_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
{
return aixjfs2_set_nt_acl_common(fsp, security_info_sent, psd);
}
@@ -449,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;
@@ -468,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,
diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c
index 91993a47d7..a63bf4f672 100644
--- a/source3/modules/vfs_audit.c
+++ b/source3/modules/vfs_audit.c
@@ -39,8 +39,8 @@ 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_acl(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, 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,
@@ -282,11 +282,11 @@ static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mo
return result;
}
-static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
int result;
- result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode);
+ result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n",
fsp->fsp_name, mode,
diff --git a/source3/modules/vfs_cacheprime.c b/source3/modules/vfs_cacheprime.c
index 9574087d9d..6eb74e66ed 100644
--- a/source3/modules/vfs_cacheprime.c
+++ b/source3/modules/vfs_cacheprime.c
@@ -160,16 +160,15 @@ static ssize_t cprime_read(
static ssize_t cprime_pread(
vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
void * data,
size_t count,
SMB_OFF_T offset)
{
if (g_readbuf) {
- prime_cache(handle, fsp, fd, offset, count);
+ prime_cache(handle, fsp, fsp->fh->fd, offset, count);
}
- return SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, count, offset);
+ return SMB_VFS_NEXT_PREAD(handle, fsp, data, count, offset);
}
static vfs_op_tuple cprime_ops [] =
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index f99891cb32..2f2d6a7182 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -363,7 +363,7 @@ size)
return SMB_VFS_NEXT_LGETXATTR(handle, cappath, capname, value, size);
}
-static ssize_t cap_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *path, void *value, size_t size)
+static ssize_t cap_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path, void *value, size_t size)
{
char *cappath = capencode(talloc_tos(), path);
@@ -371,7 +371,7 @@ static ssize_t cap_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp
errno = ENOMEM;
return -1;
}
- return SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, cappath, value, size);
+ return SMB_VFS_NEXT_FGETXATTR(handle, fsp, cappath, value, size);
}
static ssize_t cap_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
@@ -420,7 +420,7 @@ static int cap_lremovexattr(vfs_handle_struct *handle, const char *path, const c
return SMB_VFS_NEXT_LREMOVEXATTR(handle, cappath, capname);
}
-static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *path)
+static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path)
{
char *cappath = capencode(talloc_tos(), path);
@@ -428,7 +428,7 @@ static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,
errno = ENOMEM;
return -1;
}
- return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, cappath);
+ return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, cappath);
}
static int cap_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
@@ -455,7 +455,7 @@ static int cap_lsetxattr(vfs_handle_struct *handle, const char *path, const char
return SMB_VFS_NEXT_LSETXATTR(handle, cappath, capname, value, size, flags);
}
-static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *path, const void *value, size_t size, int flags)
+static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path, const void *value, size_t size, int flags)
{
char *cappath = capencode(talloc_tos(), path);
@@ -463,7 +463,7 @@ static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int
errno = ENOMEM;
return -1;
}
- return SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, cappath, value, size, flags);
+ return SMB_VFS_NEXT_FSETXATTR(handle, fsp, cappath, value, size, flags);
}
/* VFS operations structure */
diff --git a/source3/modules/vfs_commit.c b/source3/modules/vfs_commit.c
index d7d81924f1..fe7324122f 100644
--- a/source3/modules/vfs_commit.c
+++ b/source3/modules/vfs_commit.c
@@ -217,7 +217,7 @@ static int commit_open(
/* EOF commit modes require us to know the initial file size. */
if (c && (c->on_eof != EOF_NONE)) {
SMB_STRUCT_STAT st;
- if (SMB_VFS_FSTAT(fsp, fd, &st) == -1) {
+ if (SMB_VFS_FSTAT(fsp, &st) == -1) {
return -1;
}
c->eof = st.st_size;
@@ -248,14 +248,13 @@ static ssize_t commit_write(
static ssize_t commit_pwrite(
vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
void * data,
size_t count,
SMB_OFF_T offset)
{
ssize_t ret;
- ret = SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, count, offset);
+ ret = SMB_VFS_NEXT_PWRITE(handle, fsp, data, count, offset);
if (ret > 0) {
if (commit(handle, fsp, offset, ret) == -1) {
return -1;
@@ -278,12 +277,11 @@ static int commit_close(
static int commit_ftruncate(
vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
SMB_OFF_T len)
{
int result;
- result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, len);
+ result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len);
if (result == 0) {
struct commit_info *c;
if ((c = VFS_FETCH_FSP_EXTENSION(handle, fsp))) {
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 17b183600a..97138bdacf 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -218,19 +218,19 @@ static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, int fd
return result;
}
-static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data,
+static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void *data,
size_t n, SMB_OFF_T offset)
{
ssize_t result;
#if defined(HAVE_PREAD) || defined(HAVE_PREAD64)
START_PROFILE_BYTES(syscall_pread, n);
- result = sys_pread(fd, data, n, offset);
+ result = sys_pread(fsp->fh->fd, data, n, offset);
END_PROFILE(syscall_pread);
if (result == -1 && errno == ESPIPE) {
/* Maintain the fiction that pipes can be seeked (sought?) on. */
- result = SMB_VFS_READ(fsp, fd, data, n);
+ result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n);
fsp->fh->pos = 0;
}
@@ -238,23 +238,23 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, int f
SMB_OFF_T curr;
int lerrno;
- curr = SMB_VFS_LSEEK(fsp, fd, 0, SEEK_CUR);
+ curr = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
if (curr == -1 && errno == ESPIPE) {
/* Maintain the fiction that pipes can be seeked (sought?) on. */
- result = SMB_VFS_READ(fsp, fd, data, n);
+ result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n);
fsp->fh->pos = 0;
return result;
}
- if (SMB_VFS_LSEEK(fsp, fd, offset, SEEK_SET) == -1) {
+ if (SMB_VFS_LSEEK(fsp, offset, SEEK_SET) == -1) {
return -1;
}
errno = 0;
- result = SMB_VFS_READ(fsp, fd, data, n);
+ result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n);
lerrno = errno;
- SMB_VFS_LSEEK(fsp, fd, curr, SEEK_SET);
+ SMB_VFS_LSEEK(fsp, curr, SEEK_SET);
errno = lerrno;
#endif /* HAVE_PREAD */
@@ -272,38 +272,38 @@ static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, int f
return result;
}
-static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data,
+static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data,
size_t n, SMB_OFF_T offset)
{
ssize_t result;
#if defined(HAVE_PWRITE) || defined(HAVE_PRWITE64)
START_PROFILE_BYTES(syscall_pwrite, n);
- result = sys_pwrite(fd, data, n, offset);
+ result = sys_pwrite(fsp->fh->fd, data, n, offset);
END_PROFILE(syscall_pwrite);
if (result == -1 && errno == ESPIPE) {
/* Maintain the fiction that pipes can be sought on. */
- result = SMB_VFS_WRITE(fsp, fd, data, n);
+ result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n);
}
#else /* HAVE_PWRITE */
SMB_OFF_T curr;
int lerrno;
- curr = SMB_VFS_LSEEK(fsp, fd, 0, SEEK_CUR);
+ curr = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
if (curr == -1) {
return -1;
}
- if (SMB_VFS_LSEEK(fsp, fd, offset, SEEK_SET) == -1) {
+ if (SMB_VFS_LSEEK(fsp, offset, SEEK_SET) == -1) {
return -1;
}
- result = SMB_VFS_WRITE(fsp, fd, data, n);
+ result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n);
lerrno = errno;
- SMB_VFS_LSEEK(fsp, fd, curr, SEEK_SET);
+ SMB_VFS_LSEEK(fsp, curr, SEEK_SET);
errno = lerrno;
#endif /* HAVE_PWRITE */
@@ -311,15 +311,15 @@ static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, int
return result;
}
-static SMB_OFF_T vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence)
+static SMB_OFF_T vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
{
SMB_OFF_T result = 0;
START_PROFILE(syscall_lseek);
/* Cope with 'stat' file opens. */
- if (filedes != -1)
- result = sys_lseek(filedes, offset, whence);
+ if (fsp->fh->fd != -1)
+ result = sys_lseek(fsp->fh->fd, offset, whence);
/*
* We want to maintain the fiction that we can seek
@@ -467,13 +467,13 @@ static int vfswrap_rename(vfs_handle_struct *handle, const char *oldname, const
return result;
}
-static int vfswrap_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int vfswrap_fsync(vfs_handle_struct *handle, files_struct *fsp)
{
#ifdef HAVE_FSYNC
int result;
START_PROFILE(syscall_fsync);
- result = fsync(fd);
+ result = fsync(fsp->fh->fd);
END_PROFILE(syscall_fsync);
return result;
#else
@@ -491,12 +491,12 @@ static int vfswrap_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUC
return result;
}
-static int vfswrap_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int vfswrap_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
{
int result;
START_PROFILE(syscall_fstat);
- result = sys_fstat(fd, sbuf);
+ result = sys_fstat(fsp->fh->fd, sbuf);
END_PROFILE(syscall_fstat);
return result;
}
@@ -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, 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;
@@ -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
@@ -674,17 +674,17 @@ static int vfswrap_ntimes(vfs_handle_struct *handle, const char *path, const str
allocate is set.
**********************************************************************/
-static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len)
+static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len)
{
SMB_STRUCT_STAT st;
- SMB_OFF_T currpos = SMB_VFS_LSEEK(fsp, fd, 0, SEEK_CUR);
+ SMB_OFF_T currpos = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
unsigned char zero_space[4096];
SMB_OFF_T space_to_write;
if (currpos == -1)
return -1;
- if (SMB_VFS_FSTAT(fsp, fd, &st) == -1)
+ if (SMB_VFS_FSTAT(fsp, &st) == -1)
return -1;
space_to_write = len - st.st_size;
@@ -699,10 +699,10 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
/* Shrink - just ftruncate. */
if (st.st_size > len)
- return sys_ftruncate(fd, len);
+ return sys_ftruncate(fsp->fh->fd, len);
/* Write out the real space on disk. */
- if (SMB_VFS_LSEEK(fsp, fd, st.st_size, SEEK_SET) != st.st_size)
+ if (SMB_VFS_LSEEK(fsp, st.st_size, SEEK_SET) != st.st_size)
return -1;
space_to_write = len - st.st_size;
@@ -720,13 +720,13 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
}
/* Seek to where we were */
- if (SMB_VFS_LSEEK(fsp, fd, currpos, SEEK_SET) != currpos)
+ if (SMB_VFS_LSEEK(fsp, currpos, SEEK_SET) != currpos)
return -1;
return 0;
}
-static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len)
+static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len)
{
int result = -1;
SMB_STRUCT_STAT st;
@@ -736,7 +736,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
START_PROFILE(syscall_ftruncate);
if (lp_strict_allocate(SNUM(fsp->conn))) {
- result = strict_allocate_ftruncate(handle, fsp, fd, len);
+ result = strict_allocate_ftruncate(handle, fsp, len);
END_PROFILE(syscall_ftruncate);
return result;
}
@@ -747,14 +747,14 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
expansion and some that don't! On Linux fat can't do
ftruncate extend but ext2 can. */
- result = sys_ftruncate(fd, len);
+ result = sys_ftruncate(fsp->fh->fd, len);
if (result == 0)
goto done;
/* According to W. R. Stevens advanced UNIX prog. Pure 4.3 BSD cannot
extend a file with ftruncate. Provide alternate implementation
for this */
- currpos = SMB_VFS_LSEEK(fsp, fd, 0, SEEK_CUR);
+ currpos = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
if (currpos == -1) {
goto done;
}
@@ -763,7 +763,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
size in which case the ftruncate above should have
succeeded or shorter, in which case seek to len - 1 and
write 1 byte of zero */
- if (SMB_VFS_FSTAT(fsp, fd, &st) == -1) {
+ if (SMB_VFS_FSTAT(fsp, &st) == -1) {
goto done;
}
@@ -784,14 +784,14 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
goto done;
}
- if (SMB_VFS_LSEEK(fsp, fd, len-1, SEEK_SET) != len -1)
+ if (SMB_VFS_LSEEK(fsp, len-1, SEEK_SET) != len -1)
goto done;
- if (SMB_VFS_WRITE(fsp, fd, &c, 1)!=1)
+ if (SMB_VFS_WRITE(fsp, fsp->fh->fd, &c, 1)!=1)
goto done;
/* Seek to where we were */
- if (SMB_VFS_LSEEK(fsp, fd, currpos, SEEK_SET) != currpos)
+ if (SMB_VFS_LSEEK(fsp, currpos, SEEK_SET) != currpos)
goto done;
result = 0;
@@ -801,36 +801,36 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
return result;
}
-static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
{
bool result;
START_PROFILE(syscall_fcntl_lock);
- result = fcntl_lock(fd, op, offset, count, type);
+ result = fcntl_lock(fsp->fh->fd, op, offset, count, type);
END_PROFILE(syscall_fcntl_lock);
return result;
}
-static int vfswrap_kernel_flock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int vfswrap_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
uint32 share_mode)
{
START_PROFILE(syscall_kernel_flock);
- kernel_flock(fd, share_mode);
+ kernel_flock(fsp->fh->fd, share_mode);
END_PROFILE(syscall_kernel_flock);
return 0;
}
-static bool vfswrap_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+static bool vfswrap_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
{
bool result;
START_PROFILE(syscall_fcntl_getlock);
- result = fcntl_getlock(fd, poffset, pcount, ptype, ppid);
+ result = fcntl_getlock(fsp->fh->fd, poffset, pcount, ptype, ppid);
END_PROFILE(syscall_fcntl_getlock);
return result;
}
-static int vfswrap_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int vfswrap_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
int leasetype)
{
int result = -1;
@@ -839,11 +839,11 @@ static int vfswrap_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
#ifdef HAVE_KERNEL_OPLOCKS_LINUX
/* first set the signal handler */
- if(linux_set_lease_sighandler(fd) == -1) {
+ if(linux_set_lease_sighandler(fsp->fh->fd) == -1) {
return -1;
}
- result = linux_setlease(fd, leasetype);
+ result = linux_setlease(fsp->fh->fd, leasetype);
#else
errno = ENOSYS;
#endif
@@ -944,7 +944,7 @@ static struct file_id vfswrap_file_id_create(struct vfs_handle_struct *handle, S
}
static NTSTATUS vfswrap_fget_nt_acl(vfs_handle_struct *handle,
- files_struct *fsp, int fd,
+ files_struct *fsp,
uint32 security_info, SEC_DESC **ppdesc)
{
NTSTATUS result;
@@ -967,7 +967,7 @@ static NTSTATUS vfswrap_get_nt_acl(vfs_handle_struct *handle,
return result;
}
-static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd)
+static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
{
NTSTATUS result;
@@ -1002,7 +1002,7 @@ static int vfswrap_chmod_acl(vfs_handle_struct *handle, const char *name, mode_
#endif
}
-static int vfswrap_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int vfswrap_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
#ifdef HAVE_NO_ACL
errno = ENOSYS;
@@ -1011,7 +1011,7 @@ static int vfswrap_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int
int result;
START_PROFILE(fchmod_acl);
- result = fchmod_acl(fsp, fd, mode);
+ result = fchmod_acl(fsp, mode);
END_PROFILE(fchmod_acl);
return result;
#endif
@@ -1042,9 +1042,9 @@ static SMB_ACL_T vfswrap_sys_acl_get_file(vfs_handle_struct *handle, const char
return sys_acl_get_file(handle, path_p, type);
}
-static SMB_ACL_T vfswrap_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static SMB_ACL_T vfswrap_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
{
- return sys_acl_get_fd(handle, fsp, fd);
+ return sys_acl_get_fd(handle, fsp);
}
static int vfswrap_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset)
@@ -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)
@@ -1141,9 +1141,9 @@ static ssize_t vfswrap_lgetxattr(struct vfs_handle_struct *handle,const char *pa
return sys_lgetxattr(path, name, value, size);
}
-static ssize_t vfswrap_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size)
+static ssize_t vfswrap_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
{
- return sys_fgetxattr(fd, name, value, size);
+ return sys_fgetxattr(fsp->fh->fd, name, value, size);
}
static ssize_t vfswrap_listxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size)
@@ -1156,9 +1156,9 @@ ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, c
return sys_llistxattr(path, list, size);
}
-ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size)
+ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
{
- return sys_flistxattr(fd, list, size);
+ return sys_flistxattr(fsp->fh->fd, list, size);
}
static int vfswrap_removexattr(struct vfs_handle_struct *handle, const char *path, const char *name)
@@ -1171,9 +1171,9 @@ static int vfswrap_lremovexattr(struct vfs_handle_struct *handle, const char *pa
return sys_lremovexattr(path, name);
}
-static int vfswrap_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name)
+static int vfswrap_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
{
- return sys_fremovexattr(fd, name);
+ return sys_fremovexattr(fsp->fh->fd, name);
}
static int vfswrap_setxattr(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
@@ -1186,9 +1186,9 @@ static int vfswrap_lsetxattr(struct vfs_handle_struct *handle, const char *path,
return sys_lsetxattr(path, name, value, size, flags);
}
-static int vfswrap_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, const void *value, size_t size, int flags)
+static int vfswrap_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
{
- return sys_fsetxattr(fd, name, value, size, flags);
+ return sys_fsetxattr(fsp->fh->fd, name, value, size, flags);
}
static int vfswrap_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
@@ -1206,9 +1206,9 @@ static ssize_t vfswrap_aio_return(struct vfs_handle_struct *handle, struct files
return sys_aio_return(aiocb);
}
-static int vfswrap_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb)
+static int vfswrap_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
- return sys_aio_cancel(fd, aiocb);
+ return sys_aio_cancel(fsp->fh->fd, aiocb);
}
static int vfswrap_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c
index 552c64016e..a21e281e2c 100644
--- a/source3/modules/vfs_extd_audit.c
+++ b/source3/modules/vfs_extd_audit.c
@@ -42,8 +42,8 @@ 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_acl(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, 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,
@@ -328,11 +328,11 @@ static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mo
return result;
}
-static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
int result;
- result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode);
+ result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n",
fsp->fsp_name, mode,
diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c
index 8157f05d52..ddad0008a7 100644
--- a/source3/modules/vfs_fake_perms.c
+++ b/source3/modules/vfs_fake_perms.c
@@ -46,11 +46,11 @@ static int fake_perms_stat(vfs_handle_struct *handle, const char *fname, SMB_STR
return ret;
}
-static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
{
int ret = -1;
- ret = SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf);
+ ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
if (ret == 0) {
if (S_ISDIR(sbuf->st_mode)) {
sbuf->st_mode = S_IFDIR | S_IRWXU;
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index f6b6e85837..95fdc17d56 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -115,14 +115,14 @@ static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, in
static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
int fd, void *data, size_t n);
static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp,
- int fd, void *data, size_t n, SMB_OFF_T offset);
+ void *data, size_t n, SMB_OFF_T offset);
static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp,
int fd, const void *data, size_t n);
static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
- int fd, const void *data, size_t n,
+ const void *data, size_t n,
SMB_OFF_T offset);
static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp,
- int filedes, SMB_OFF_T offset, int whence);
+ SMB_OFF_T offset, int whence);
static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
files_struct *fsp, int fromfd,
const DATA_BLOB *hdr, SMB_OFF_T offset,
@@ -133,10 +133,10 @@ static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
size_t n);
static int smb_full_audit_rename(vfs_handle_struct *handle,
const char *oldname, const char *newname);
-static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd);
+static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp);
static int smb_full_audit_stat(vfs_handle_struct *handle,
const char *fname, SMB_STRUCT_STAT *sbuf);
-static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf);
static int smb_full_audit_lstat(vfs_handle_struct *handle,
const char *path, SMB_STRUCT_STAT *sbuf);
@@ -144,11 +144,11 @@ 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);
-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);
@@ -159,15 +159,15 @@ static char *smb_full_audit_getwd(vfs_handle_struct *handle,
static int smb_full_audit_ntimes(vfs_handle_struct *handle,
const char *path, const struct timespec ts[2]);
static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
- int fd, SMB_OFF_T len);
-static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+ SMB_OFF_T len);
+static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd,
+ struct files_struct *fsp,
uint32 share_mode);
static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
- int fd, int leasetype);
-static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+ int leasetype);
+static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp,
SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
static int smb_full_audit_symlink(vfs_handle_struct *handle,
const char *oldpath, const char *newpath);
@@ -191,13 +191,13 @@ static int smb_full_audit_chflags(vfs_handle_struct *handle,
static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle,
SMB_DEV_T dev, SMB_INO_T inode);
static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
- int fd, uint32 security_info,
+ uint32 security_info,
SEC_DESC **ppdesc);
static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
const char *name, uint32 security_info,
SEC_DESC **ppdesc);
static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
- int fd, uint32 security_info_sent,
+ uint32 security_info_sent,
SEC_DESC *psd);
static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
const char *name, uint32 security_info_sent,
@@ -205,7 +205,7 @@ static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struc
static int smb_full_audit_chmod_acl(vfs_handle_struct *handle,
const char *path, mode_t mode);
static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
- int fd, mode_t mode);
+ mode_t mode);
static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle,
SMB_ACL_T theacl, int entry_id,
SMB_ACL_ENTRY_T *entry_p);
@@ -221,8 +221,7 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
const char *path_p,
SMB_ACL_TYPE_T type);
static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd);
+ files_struct *fsp);
static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle,
SMB_ACL_PERMSET_T permset);
static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle,
@@ -251,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,
@@ -271,14 +270,14 @@ static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle,
const char *path, const char *name,
void *value, size_t size);
static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd,
+ struct files_struct *fsp,
const char *name, void *value, size_t size);
static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle,
const char *path, char *list, size_t size);
static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle,
const char *path, char *list, size_t size);
static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd, char *list,
+ struct files_struct *fsp, char *list,
size_t size);
static int smb_full_audit_removexattr(struct vfs_handle_struct *handle,
const char *path,
@@ -287,7 +286,7 @@ static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle,
const char *path,
const char *name);
static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd,
+ struct files_struct *fsp,
const char *name);
static int smb_full_audit_setxattr(struct vfs_handle_struct *handle,
const char *path,
@@ -298,13 +297,13 @@ static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle,
const char *name, const void *value, size_t size,
int flags);
static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd, const char *name,
+ struct files_struct *fsp, const char *name,
const void *value, size_t size, int flags);
static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
static int smb_full_audit_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
-static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb);
+static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
static int smb_full_audit_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
static int smb_full_audit_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb);
static int smb_full_audit_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts);
@@ -451,7 +450,7 @@ static vfs_op_tuple audit_op_tuples[] = {
SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE,
SMB_VFS_LAYER_LOGGER},
- {SMB_VFS_OP(smb_full_audit_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD,
+{SMB_VFS_OP(smb_full_audit_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD,
SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_sys_acl_clear_perms), SMB_VFS_OP_SYS_ACL_CLEAR_PERMS,
SMB_VFS_LAYER_LOGGER},
@@ -1100,11 +1099,11 @@ static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
}
static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp,
- int fd, void *data, size_t n, SMB_OFF_T offset)
+ void *data, size_t n, SMB_OFF_T offset)
{
ssize_t result;
- result = SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, offset);
+ result = SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
do_log(SMB_VFS_OP_PREAD, (result >= 0), handle, "%s", fsp->fsp_name);
@@ -1124,12 +1123,12 @@ static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp
}
static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
- int fd, const void *data, size_t n,
+ const void *data, size_t n,
SMB_OFF_T offset)
{
ssize_t result;
- result = SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset);
+ result = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
do_log(SMB_VFS_OP_PWRITE, (result >= 0), handle, "%s", fsp->fsp_name);
@@ -1137,11 +1136,11 @@ static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fs
}
static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp,
- int filedes, SMB_OFF_T offset, int whence)
+ SMB_OFF_T offset, int whence)
{
ssize_t result;
- result = SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence);
+ result = SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
do_log(SMB_VFS_OP_LSEEK, (result != (ssize_t)-1), handle,
"%s", fsp->fsp_name);
@@ -1193,11 +1192,11 @@ static int smb_full_audit_rename(vfs_handle_struct *handle,
return result;
}
-static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp)
{
int result;
- result = SMB_VFS_NEXT_FSYNC(handle, fsp, fd);
+ result = SMB_VFS_NEXT_FSYNC(handle, fsp);
do_log(SMB_VFS_OP_FSYNC, (result >= 0), handle, "%s", fsp->fsp_name);
@@ -1216,12 +1215,12 @@ static int smb_full_audit_stat(vfs_handle_struct *handle,
return result;
}
-static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf)
{
int result;
- result = SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf);
+ result = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
do_log(SMB_VFS_OP_FSTAT, (result >= 0), handle, "%s", fsp->fsp_name);
@@ -1264,12 +1263,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);
@@ -1290,12 +1289,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);
@@ -1353,11 +1352,11 @@ static int smb_full_audit_ntimes(vfs_handle_struct *handle,
}
static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
- int fd, SMB_OFF_T len)
+ SMB_OFF_T len)
{
int result;
- result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, len);
+ result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len);
do_log(SMB_VFS_OP_FTRUNCATE, (result >= 0), handle,
"%s", fsp->fsp_name);
@@ -1365,12 +1364,12 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp
return result;
}
-static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
{
bool result;
- result = SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type);
+ result = SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
do_log(SMB_VFS_OP_LOCK, result, handle, "%s", fsp->fsp_name);
@@ -1378,12 +1377,12 @@ static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, in
}
static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd,
+ struct files_struct *fsp,
uint32 share_mode)
{
int result;
- result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, fd, share_mode);
+ result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode);
do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s",
fsp->fsp_name);
@@ -1392,11 +1391,11 @@ static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
}
static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
- int fd, int leasetype)
+ int leasetype)
{
int result;
- result = SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, fd, leasetype);
+ result = SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
do_log(SMB_VFS_OP_LINUX_SETLEASE, (result >= 0), handle, "%s",
fsp->fsp_name);
@@ -1404,12 +1403,12 @@ static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct
return result;
}
-static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp,
SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
{
bool result;
- result = SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid);
+ result = SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
do_log(SMB_VFS_OP_GETLOCK, result, handle, "%s", fsp->fsp_name);
@@ -1525,13 +1524,12 @@ static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *ha
}
static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
- int fd, uint32 security_info,
+ uint32 security_info,
SEC_DESC **ppdesc)
{
NTSTATUS result;
- result = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info,
- ppdesc);
+ result = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
do_log(SMB_VFS_OP_FGET_NT_ACL, NT_STATUS_IS_OK(result), handle,
"%s", fsp->fsp_name);
@@ -1556,13 +1554,12 @@ static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle,
}
static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
- int fd, uint32 security_info_sent,
+ uint32 security_info_sent,
SEC_DESC *psd)
{
NTSTATUS result;
- result = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent,
- psd);
+ result = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
do_log(SMB_VFS_OP_FSET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name);
@@ -1597,11 +1594,11 @@ static int smb_full_audit_chmod_acl(vfs_handle_struct *handle,
}
static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
- int fd, mode_t mode)
+ mode_t mode)
{
int result;
- result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode);
+ result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
do_log(SMB_VFS_OP_FCHMOD_ACL, (result >= 0), handle,
"%s|%o", fsp->fsp_name, mode);
@@ -1686,11 +1683,11 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
}
static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp, int fd)
+ files_struct *fsp)
{
SMB_ACL_T result;
- result = SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd);
+ result = SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
do_log(SMB_VFS_OP_SYS_ACL_GET_FD, (result != NULL), handle,
"%s", fsp->fsp_name);
@@ -1846,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);
@@ -1959,12 +1956,12 @@ static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle,
}
static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd,
+ struct files_struct *fsp,
const char *name, void *value, size_t size)
{
ssize_t result;
- result = SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, name, value, size);
+ result = SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
do_log(SMB_VFS_OP_FGETXATTR, (result >= 0), handle,
"%s|%s", fsp->fsp_name, name);
@@ -1997,12 +1994,12 @@ static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle,
}
static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd, char *list,
+ struct files_struct *fsp, char *list,
size_t size)
{
ssize_t result;
- result = SMB_VFS_NEXT_FLISTXATTR(handle, fsp, fd, list, size);
+ result = SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
do_log(SMB_VFS_OP_FLISTXATTR, (result >= 0), handle,
"%s", fsp->fsp_name);
@@ -2039,12 +2036,12 @@ static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle,
}
static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd,
+ struct files_struct *fsp,
const char *name)
{
int result;
- result = SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, name);
+ result = SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
do_log(SMB_VFS_OP_FREMOVEXATTR, (result >= 0), handle,
"%s|%s", fsp->fsp_name, name);
@@ -2085,13 +2082,12 @@ static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle,
}
static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, int fd, const char *name,
+ struct files_struct *fsp, const char *name,
const void *value, size_t size, int flags)
{
int result;
- result = SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, name, value, size,
- flags);
+ result = SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
do_log(SMB_VFS_OP_FSETXATTR, (result >= 0), handle,
"%s|%s", fsp->fsp_name, name);
@@ -2132,11 +2128,11 @@ static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struc
return result;
}
-static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb)
+static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
int result;
- result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb);
+ result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
do_log(SMB_VFS_OP_AIO_CANCEL, (result >= 0), handle,
"%s", fsp->fsp_name);
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 24ca3d5e42..bcf61f3bc7 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -33,7 +33,7 @@
static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
- int fd, uint32 share_mode)
+ uint32 share_mode)
{
START_PROFILE(syscall_kernel_flock);
@@ -52,21 +52,21 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
}
static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
- int fd, int leasetype)
+ int leasetype)
{
int ret;
START_PROFILE(syscall_linux_setlease);
- if ( linux_set_lease_sighandler(fd) == -1)
+ if ( linux_set_lease_sighandler(fsp->fh->fd) == -1)
return -1;
- ret = set_gpfs_lease(fd,leasetype);
+ ret = set_gpfs_lease(fsp->fh->fd,leasetype);
if ( ret < 0 ) {
/* This must have come from GPFS not being available */
/* or some other error, hence call the default */
- ret = linux_setlease(fd, leasetype);
+ ret = linux_setlease(fsp->fh->fd, leasetype);
}
END_PROFILE(syscall_linux_setlease);
@@ -227,7 +227,7 @@ static int gpfs_get_nfs4_acl(const char *fname, SMB4ACL_T **ppacl)
}
static NTSTATUS gpfsacl_fget_nt_acl(vfs_handle_struct *handle,
- files_struct *fsp, int fd, uint32 security_info,
+ files_struct *fsp, uint32 security_info,
SEC_DESC **ppdesc)
{
SMB4ACL_T *pacl = NULL;
@@ -363,7 +363,7 @@ static NTSTATUS gpfsacl_set_nt_acl_internal(files_struct *fsp, uint32 security_i
return result;
}
-static NTSTATUS gpfsacl_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd)
+static NTSTATUS gpfsacl_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
{
return gpfsacl_set_nt_acl_internal(fsp, security_info_sent, psd);
}
@@ -501,8 +501,7 @@ SMB_ACL_T gpfsacl_sys_acl_get_file(vfs_handle_struct *handle,
}
SMB_ACL_T gpfsacl_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
return gpfsacl_get_posix_acl(fsp->fsp_name, GPFS_ACL_TYPE_ACCESS);
}
@@ -616,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);
}
@@ -642,17 +641,17 @@ 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, fd, &st) != 0) {
+ if (SMB_VFS_NEXT_FSTAT(handle, fsp, &st) != 0) {
return -1;
}
/* avoid chmod() if possible, to preserve acls */
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/modules/vfs_hpuxacl.c b/source3/modules/vfs_hpuxacl.c
index edce161c19..e101886450 100644
--- a/source3/modules/vfs_hpuxacl.c
+++ b/source3/modules/vfs_hpuxacl.c
@@ -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
@@ -182,15 +182,14 @@ SMB_ACL_T hpuxacl_sys_acl_get_file(vfs_handle_struct *handle,
* get the access ACL of a file referred to by a fd
*/
SMB_ACL_T hpuxacl_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
/*
* 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 NULL;
@@ -307,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;
diff --git a/source3/modules/vfs_irixacl.c b/source3/modules/vfs_irixacl.c
index dab6deb747..6484e8f3eb 100644
--- a/source3/modules/vfs_irixacl.c
+++ b/source3/modules/vfs_irixacl.c
@@ -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
@@ -32,8 +32,7 @@ SMB_ACL_T irixacl_sys_acl_get_file(vfs_handle_struct *handle,
}
SMB_ACL_T irixacl_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
errno = ENOTSUP;
return NULL;
@@ -50,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;
diff --git a/source3/modules/vfs_posixacl.c b/source3/modules/vfs_posixacl.c
index fb0c0bc8e9..21fb2ada31 100644
--- a/source3/modules/vfs_posixacl.c
+++ b/source3/modules/vfs_posixacl.c
@@ -63,11 +63,10 @@ SMB_ACL_T posixacl_sys_acl_get_file(vfs_handle_struct *handle,
}
SMB_ACL_T posixacl_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
struct smb_acl_t *result;
- acl_t acl = acl_get_fd(fd);
+ acl_t acl = acl_get_fd(fsp->fh->fd);
if (acl == NULL) {
return NULL;
@@ -114,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;
}
diff --git a/source3/modules/vfs_prealloc.c b/source3/modules/vfs_prealloc.c
index cebf3a3933..2d64bc0184 100644
--- a/source3/modules/vfs_prealloc.c
+++ b/source3/modules/vfs_prealloc.c
@@ -184,11 +184,10 @@ normal_open:
static int prealloc_ftruncate(vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
SMB_OFF_T offset)
{
SMB_OFF_T *psize;
- int ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset);
+ int ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
/* Maintain the allocated space even in the face of truncates. */
if ((psize = VFS_FETCH_FSP_EXTENSION(handle, fsp))) {
diff --git a/source3/modules/vfs_readahead.c b/source3/modules/vfs_readahead.c
index 8fdd6168fe..b3642d558f 100644
--- a/source3/modules/vfs_readahead.c
+++ b/source3/modules/vfs_readahead.c
@@ -80,7 +80,6 @@ static ssize_t readahead_sendfile(struct vfs_handle_struct *handle,
static ssize_t readahead_pread(vfs_handle_struct *handle,
files_struct *fsp,
- int fd,
void *data,
size_t count,
SMB_OFF_T offset)
@@ -89,16 +88,16 @@ static ssize_t readahead_pread(vfs_handle_struct *handle,
if ( offset % rhd->off_bound == 0) {
#if defined(HAVE_LINUX_READAHEAD)
- int err = readahead(fd, offset, (size_t)rhd->len);
+ int err = readahead(fsp->fh->fd, offset, (size_t)rhd->len);
DEBUG(10,("readahead_pread: readahead on fd %u, offset %llu, len %u returned %d\n",
- (unsigned int)fd,
+ (unsigned int)fsp->fh->fd,
(unsigned long long)offset,
(unsigned int)rhd->len,
err ));
#elif defined(HAVE_POSIX_FADVISE)
- int err = posix_fadvise(fd, offset, (off_t)rhd->len, POSIX_FADV_WILLNEED);
+ int err = posix_fadvise(fsp->fh->fd, offset, (off_t)rhd->len, POSIX_FADV_WILLNEED);
DEBUG(10,("readahead_pread: posix_fadvise on fd %u, offset %llu, len %u returned %d\n",
- (unsigned int)fd,
+ (unsigned int)fsp->fh->fd,
(unsigned long long)offset,
(unsigned int)rhd->len,
err ));
@@ -109,7 +108,7 @@ static ssize_t readahead_pread(vfs_handle_struct *handle,
}
#endif
}
- return SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, count, offset);
+ return SMB_VFS_NEXT_PREAD(handle, fsp, data, count, offset);
}
/*******************************************************************
diff --git a/source3/modules/vfs_solarisacl.c b/source3/modules/vfs_solarisacl.c
index cda243f8c1..7bdfe8465b 100644
--- a/source3/modules/vfs_solarisacl.c
+++ b/source3/modules/vfs_solarisacl.c
@@ -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
@@ -100,8 +100,7 @@ SMB_ACL_T solarisacl_sys_acl_get_file(vfs_handle_struct *handle,
* get the access ACL of a file referred to by a fd
*/
SMB_ACL_T solarisacl_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
SMB_ACL_T result = NULL;
int count;
@@ -109,7 +108,7 @@ SMB_ACL_T solarisacl_sys_acl_get_fd(vfs_handle_struct *handle,
DEBUG(10, ("entering solarisacl_sys_acl_get_fd.\n"));
- if (!solaris_acl_get_fd(fd, &solaris_acl, &count)) {
+ if (!solaris_acl_get_fd(fsp->fh->fd, &solaris_acl, &count)) {
goto done;
}
/*
@@ -219,7 +218,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 +241,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 +257,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)));
}
diff --git a/source3/modules/vfs_tru64acl.c b/source3/modules/vfs_tru64acl.c
index 43cae0f826..b23a7ddcfa 100644
--- a/source3/modules/vfs_tru64acl.c
+++ b/source3/modules/vfs_tru64acl.c
@@ -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
@@ -67,11 +67,10 @@ SMB_ACL_T tru64acl_sys_acl_get_file(vfs_handle_struct *handle,
}
SMB_ACL_T tru64acl_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
struct smb_acl_t *result;
- acl_t tru64_acl = acl_get_fd(fd, ACL_TYPE_ACCESS);
+ acl_t tru64_acl = acl_get_fd(fsp->fh->fd, ACL_TYPE_ACCESS);
if (tru64_acl == NULL) {
return NULL;
@@ -129,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;
diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c
index 060d64cffb..ce2e28771f 100644
--- a/source3/modules/vfs_zfsacl.c
+++ b/source3/modules/vfs_zfsacl.c
@@ -174,7 +174,7 @@ static NTSTATUS zfs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle,
struct files_struct *fsp,
- int fd, uint32 security_info,
+ uint32 security_info,
struct security_descriptor **ppdesc)
{
SMB4ACL_T *pacl;
@@ -206,7 +206,7 @@ static NTSTATUS zfsacl_get_nt_acl(struct vfs_handle_struct *handle,
static NTSTATUS zfsacl_fset_nt_acl(vfs_handle_struct *handle,
files_struct *fsp,
- int fd, uint32 security_info_sent,
+ uint32 security_info_sent,
SEC_DESC *psd)
{
return zfs_set_nt_acl(handle, fsp, security_info_sent, psd);