summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-08 15:43:11 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-08 15:43:11 +0100
commitbfab6ab14bd2ba69fde8bbe32f56f308010c8ea7 (patch)
tree4edbacab40c67bb5d9d6bebe66a22949349cbf9a /source3/smbd
parent8dbeca6e9d06d573adebe8d9c5114b24d8782e43 (diff)
parent62c91987d902d4dfe27023ff2ec2fb73e602105b (diff)
downloadsamba-bfab6ab14bd2ba69fde8bbe32f56f308010c8ea7.tar.gz
samba-bfab6ab14bd2ba69fde8bbe32f56f308010c8ea7.tar.bz2
samba-bfab6ab14bd2ba69fde8bbe32f56f308010c8ea7.zip
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit ea36c3add588061cf338deabb2d8952f2213a8bd)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/aio.c2
-rw-r--r--source3/smbd/dir.c4
-rw-r--r--source3/smbd/dosmode.c2
-rw-r--r--source3/smbd/fileio.c12
-rw-r--r--source3/smbd/nttrans.c5
-rw-r--r--source3/smbd/open.c22
-rw-r--r--source3/smbd/oplock_linux.c4
-rw-r--r--source3/smbd/posix_acls.c32
-rw-r--r--source3/smbd/reply.c14
-rw-r--r--source3/smbd/trans2.c14
-rw-r--r--source3/smbd/vfs.c16
11 files changed, 62 insertions, 65 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index bc1761b0fd..c8175f77ac 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -746,7 +746,7 @@ void cancel_aio_by_fsp(files_struct *fsp)
/* Don't delete the aio_extra record as we may have
completed and don't yet know it. Just do the
aio_cancel call and return. */
- SMB_VFS_AIO_CANCEL(fsp,fsp->fh->fd, &aio_ex->acb);
+ SMB_VFS_AIO_CANCEL(fsp, &aio_ex->acb);
aio_ex->fsp = NULL; /* fsp will be closed when we
* return. */
}
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index ccf91fe57d..ab6e12f20f 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -948,7 +948,7 @@ static bool user_can_read_file(connection_struct *conn, char *name, SMB_STRUCT_S
}
/* Get NT ACL -allocated in main loop talloc context. No free needed here. */
- status = SMB_VFS_FGET_NT_ACL(fsp, fsp->fh->fd,
+ status = SMB_VFS_FGET_NT_ACL(fsp,
(OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION), &psd);
close_file(fsp, NORMAL_CLOSE);
@@ -1007,7 +1007,7 @@ static bool user_can_write_file(connection_struct *conn, char *name, SMB_STRUCT_
}
/* Get NT ACL -allocated in main loop talloc context. No free needed here. */
- status = SMB_VFS_FGET_NT_ACL(fsp, fsp->fh->fd,
+ status = SMB_VFS_FGET_NT_ACL(fsp,
(OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION), &psd);
close_file(fsp, NORMAL_CLOSE);
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index a96f80ee0e..d3813f9b41 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -538,7 +538,7 @@ int file_set_dosmode(connection_struct *conn, const char *fname,
if (!NT_STATUS_IS_OK(open_file_fchmod(conn,fname,st,&fsp)))
return -1;
become_root();
- ret = SMB_VFS_FCHMOD(fsp, fsp->fh->fd, unixmode);
+ ret = SMB_VFS_FCHMOD(fsp, unixmode);
unbecome_root();
close_file_fchmod(fsp);
if (!newfile) {
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 8037510d80..8cea4989f5 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -77,7 +77,7 @@ ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
#ifdef DMF_FIX
int numretries = 3;
tryagain:
- readret = SMB_VFS_PREAD(fsp,fsp->fh->fd,data,n,pos);
+ readret = SMB_VFS_PREAD(fsp,data,n,pos);
if (readret == -1) {
if ((errno == EAGAIN) && numretries) {
@@ -89,7 +89,7 @@ tryagain:
return -1;
}
#else /* NO DMF fix. */
- readret = SMB_VFS_PREAD(fsp,fsp->fh->fd,data,n,pos);
+ readret = SMB_VFS_PREAD(fsp,data,n,pos);
if (readret == -1) {
return -1;
@@ -184,7 +184,7 @@ static int wcp_file_size_change(files_struct *fsp)
write_cache *wcp = fsp->wcp;
wcp->file_size = wcp->offset + wcp->data_size;
- ret = SMB_VFS_FTRUNCATE(fsp, fsp->fh->fd, wcp->file_size);
+ ret = SMB_VFS_FTRUNCATE(fsp, wcp->file_size);
if (ret == -1) {
DEBUG(0,("wcp_file_size_change (%s): ftruncate of size %.0f error %s\n",
fsp->fsp_name, (double)wcp->file_size, strerror(errno) ));
@@ -229,7 +229,7 @@ ssize_t write_file(struct smb_request *req,
SMB_STRUCT_STAT st;
fsp->modified = True;
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd,&st) == 0) {
+ if (SMB_VFS_FSTAT(fsp, &st) == 0) {
int dosmode = dos_mode(fsp->conn,fsp->fsp_name,&st);
if ((lp_store_dos_attributes(SNUM(fsp->conn)) ||
MAP_ARCHIVE(fsp->conn)) &&
@@ -879,7 +879,7 @@ NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_throug
if (ret == -1) {
return map_nt_error_from_unix(errno);
}
- ret = SMB_VFS_FSYNC(fsp,fsp->fh->fd);
+ ret = SMB_VFS_FSYNC(fsp);
if (ret == -1) {
return map_nt_error_from_unix(errno);
}
@@ -896,6 +896,6 @@ int fsp_stat(files_struct *fsp, SMB_STRUCT_STAT *pst)
if (fsp->fh->fd == -1) {
return SMB_VFS_STAT(fsp->conn, fsp->fsp_name, pst);
} else {
- return SMB_VFS_FSTAT(fsp,fsp->fh->fd, pst);
+ return SMB_VFS_FSTAT(fsp, pst);
}
}
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index a51f3afd82..ae64c06215 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -769,8 +769,7 @@ static NTSTATUS set_sd(files_struct *fsp, uint8 *data, uint32 sd_len,
}
if (fsp->fh->fd != -1) {
- status = SMB_VFS_FSET_NT_ACL(fsp, fsp->fh->fd,
- security_info_sent, psd);
+ status = SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd);
}
else {
status = SMB_VFS_SET_NT_ACL(fsp, fsp->fsp_name,
@@ -1643,7 +1642,7 @@ static void call_nt_transact_query_security_desc(connection_struct *conn,
} else {
if (fsp->fh->fd != -1) {
status = SMB_VFS_FGET_NT_ACL(
- fsp, fsp->fh->fd, security_info_wanted, &psd);
+ fsp, security_info_wanted, &psd);
}
else {
status = SMB_VFS_GET_NT_ACL(
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index f178102fdd..4abe017380 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -102,7 +102,7 @@ static void change_file_owner_to_parent(connection_struct *conn,
}
become_root();
- ret = SMB_VFS_FCHOWN(fsp, fsp->fh->fd, parent_st.st_uid, (gid_t)-1);
+ ret = SMB_VFS_FCHOWN(fsp, parent_st.st_uid, (gid_t)-1);
unbecome_root();
if (ret == -1) {
DEBUG(0,("change_file_owner_to_parent: failed to fchown "
@@ -342,7 +342,7 @@ static NTSTATUS open_file(files_struct *fsp,
if (fsp->fh->fd == -1) {
ret = SMB_VFS_STAT(conn, path, psbuf);
} else {
- ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,psbuf);
+ ret = SMB_VFS_FSTAT(fsp, psbuf);
/* If we have an fd, this stat should succeed. */
if (ret == -1) {
DEBUG(0,("Error doing fstat on open file %s "
@@ -1764,7 +1764,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
the kernel refuses the operations then the kernel is wrong.
note that GPFS supports it as well - jmcd */
- ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, fsp->fh->fd, share_access);
+ ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access);
if(ret_flock == -1 ){
TALLOC_FREE(lck);
@@ -1789,8 +1789,8 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
* We are modifing the file after open - update the stat
* struct..
*/
- if ((SMB_VFS_FTRUNCATE(fsp,fsp->fh->fd,0) == -1) ||
- (SMB_VFS_FSTAT(fsp,fsp->fh->fd,psbuf)==-1)) {
+ if ((SMB_VFS_FTRUNCATE(fsp, 0) == -1) ||
+ (SMB_VFS_FSTAT(fsp, psbuf)==-1)) {
status = map_nt_error_from_unix(errno);
TALLOC_FREE(lck);
fd_close(fsp);
@@ -1887,7 +1887,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
int saved_errno = errno; /* We might get ENOSYS in the next
* call.. */
- if (SMB_VFS_FCHMOD_ACL(fsp, fsp->fh->fd, unx_mode) == -1 &&
+ if (SMB_VFS_FCHMOD_ACL(fsp, unx_mode) == -1 &&
errno == ENOSYS) {
errno = saved_errno; /* Ignore ENOSYS */
}
@@ -1901,8 +1901,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
{
int saved_errno = errno; /* We might get ENOSYS in the
* next call.. */
- ret = SMB_VFS_FCHMOD_ACL(fsp, fsp->fh->fd,
- new_unx_mode);
+ ret = SMB_VFS_FCHMOD_ACL(fsp, new_unx_mode);
if (ret == -1 && errno == ENOSYS) {
errno = saved_errno; /* Ignore ENOSYS */
@@ -1915,7 +1914,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));
@@ -2621,8 +2620,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
fsp->access_mask = FILE_GENERIC_ALL;
- status = SMB_VFS_FSET_NT_ACL(
- fsp, fsp->fh->fd, sec_info_sent, sd);
+ status = SMB_VFS_FSET_NT_ACL(fsp, sec_info_sent, sd);
fsp->access_mask = saved_access_mask;
@@ -2676,7 +2674,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
*psbuf = sbuf;
}
else {
- SMB_VFS_FSTAT(fsp, fsp->fh->fd, psbuf);
+ SMB_VFS_FSTAT(fsp, psbuf);
}
}
return NT_STATUS_OK;
diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c
index 086f105b89..05021b6c74 100644
--- a/source3/smbd/oplock_linux.c
+++ b/source3/smbd/oplock_linux.c
@@ -164,7 +164,7 @@ static files_struct *linux_oplock_receive_message(fd_set *fds)
static bool linux_set_kernel_oplock(files_struct *fsp, int oplock_type)
{
- if ( SMB_VFS_LINUX_SETLEASE(fsp,fsp->fh->fd, F_WRLCK) == -1) {
+ if ( SMB_VFS_LINUX_SETLEASE(fsp, F_WRLCK) == -1) {
DEBUG(3,("linux_set_kernel_oplock: Refused oplock on file %s, "
"fd = %d, file_id = %s. (%s)\n",
fsp->fsp_name, fsp->fh->fd,
@@ -202,7 +202,7 @@ static void linux_release_kernel_oplock(files_struct *fsp)
/*
* Remove the kernel oplock on this file.
*/
- if ( SMB_VFS_LINUX_SETLEASE(fsp,fsp->fh->fd, F_UNLCK) == -1) {
+ if ( SMB_VFS_LINUX_SETLEASE(fsp, F_UNLCK) == -1) {
if (DEBUGLVL(0)) {
dbgtext("linux_release_kernel_oplock: Error when "
"removing kernel oplock on file " );
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 2810b5e587..5f18615f66 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -229,7 +229,7 @@ static void store_inheritance_attributes(files_struct *fsp, canon_ace *file_ace_
if (!pai_protected && num_inherited_entries(file_ace_list) == 0 && num_inherited_entries(dir_ace_list) == 0) {
/* Instead just remove the attribute if it exists. */
if (fsp->fh->fd != -1)
- SMB_VFS_FREMOVEXATTR(fsp, fsp->fh->fd, SAMBA_POSIX_INHERITANCE_EA_NAME);
+ SMB_VFS_FREMOVEXATTR(fsp, SAMBA_POSIX_INHERITANCE_EA_NAME);
else
SMB_VFS_REMOVEXATTR(fsp->conn, fsp->fsp_name, SAMBA_POSIX_INHERITANCE_EA_NAME);
return;
@@ -238,7 +238,7 @@ static void store_inheritance_attributes(files_struct *fsp, canon_ace *file_ace_
pai_buf = create_pai_buf(file_ace_list, dir_ace_list, pai_protected, &store_size);
if (fsp->fh->fd != -1)
- ret = SMB_VFS_FSETXATTR(fsp, fsp->fh->fd, SAMBA_POSIX_INHERITANCE_EA_NAME,
+ ret = SMB_VFS_FSETXATTR(fsp, SAMBA_POSIX_INHERITANCE_EA_NAME,
pai_buf, store_size, 0);
else
ret = SMB_VFS_SETXATTR(fsp->conn,fsp->fsp_name, SAMBA_POSIX_INHERITANCE_EA_NAME,
@@ -445,7 +445,7 @@ static struct pai_val *fload_inherited_info(files_struct *fsp)
do {
if (fsp->fh->fd != -1)
- ret = SMB_VFS_FGETXATTR(fsp, fsp->fh->fd, SAMBA_POSIX_INHERITANCE_EA_NAME,
+ ret = SMB_VFS_FGETXATTR(fsp, SAMBA_POSIX_INHERITANCE_EA_NAME,
pai_buf, pai_buf_size);
else
ret = SMB_VFS_GETXATTR(fsp->conn,fsp->fsp_name,SAMBA_POSIX_INHERITANCE_EA_NAME,
@@ -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;
@@ -3080,12 +3080,12 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
}
/* Get the stat struct for the owner info. */
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) != 0) {
+ if(SMB_VFS_FSTAT(fsp, &sbuf) != 0) {
return map_nt_error_from_unix(errno);
}
/* Get the ACL from the fd. */
- posix_acl = SMB_VFS_SYS_ACL_GET_FD(fsp, fsp->fh->fd);
+ posix_acl = SMB_VFS_SYS_ACL_GET_FD(fsp);
pal = fload_inherited_info(fsp);
@@ -3194,7 +3194,7 @@ int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid)
become_root();
/* Keep the current file gid the same. */
- ret = SMB_VFS_FCHOWN(fsp, fsp->fh->fd, uid, (gid_t)-1);
+ ret = SMB_VFS_FCHOWN(fsp, uid, (gid_t)-1);
unbecome_root();
close_file_fchmod(fsp);
@@ -3429,7 +3429,7 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
if(SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf) != 0)
return map_nt_error_from_unix(errno);
} else {
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) != 0)
+ if(SMB_VFS_FSTAT(fsp, &sbuf) != 0)
return map_nt_error_from_unix(errno);
}
@@ -3479,7 +3479,7 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
if(fsp->fh->fd == -1)
ret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name, &sbuf);
else
- ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf);
+ ret = SMB_VFS_FSTAT(fsp, &sbuf);
if(ret != 0)
return map_nt_error_from_unix(errno);
@@ -3802,19 +3802,19 @@ int inherit_access_acl(connection_struct *conn, const char *inherit_from_dir,
and set the mask to rwx. Needed to preserve complex ACLs set by NT.
****************************************************************************/
-int fchmod_acl(files_struct *fsp, int fd, mode_t mode)
+int fchmod_acl(files_struct *fsp, mode_t mode)
{
connection_struct *conn = fsp->conn;
SMB_ACL_T posix_acl = NULL;
int ret = -1;
- if ((posix_acl = SMB_VFS_SYS_ACL_GET_FD(fsp, fd)) == NULL)
+ if ((posix_acl = SMB_VFS_SYS_ACL_GET_FD(fsp)) == NULL)
return -1;
if ((ret = chmod_acl_internals(conn, posix_acl, mode)) == -1)
goto done;
- ret = SMB_VFS_SYS_ACL_SET_FD(fsp, fd, posix_acl);
+ ret = SMB_VFS_SYS_ACL_SET_FD(fsp, posix_acl);
done:
@@ -4099,7 +4099,7 @@ static bool remove_posix_acl(connection_struct *conn, files_struct *fsp, const c
/* Get the current file ACL. */
if (fsp && fsp->fh->fd != -1) {
- file_acl = SMB_VFS_SYS_ACL_GET_FD(fsp, fsp->fh->fd);
+ file_acl = SMB_VFS_SYS_ACL_GET_FD(fsp);
} else {
file_acl = SMB_VFS_SYS_ACL_GET_FILE( conn, fname, SMB_ACL_TYPE_ACCESS);
}
@@ -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);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index d5e683ca3c..27f380a627 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2835,7 +2835,7 @@ void reply_readbraw(struct smb_request *req)
return;
}
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd,&st) == 0) {
+ if (SMB_VFS_FSTAT(fsp, &st) == 0) {
size = st.st_size;
}
@@ -3096,7 +3096,7 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
SMB_STRUCT_STAT sbuf;
ssize_t nread = -1;
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf) == -1) {
+ if(SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
reply_unixerror(req, ERRDOS, ERRnoaccess);
return;
}
@@ -4091,12 +4091,12 @@ void reply_lseek(struct smb_request *req)
}
if (umode == SEEK_END) {
- if((res = SMB_VFS_LSEEK(fsp,fsp->fh->fd,startpos,umode)) == -1) {
+ if((res = SMB_VFS_LSEEK(fsp,startpos,umode)) == -1) {
if(errno == EINVAL) {
SMB_OFF_T current_pos = startpos;
SMB_STRUCT_STAT sbuf;
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf) == -1) {
+ if(SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
reply_unixerror(req, ERRDOS,
ERRnoaccess);
END_PROFILE(SMBlseek);
@@ -4105,7 +4105,7 @@ void reply_lseek(struct smb_request *req)
current_pos += sbuf.st_size;
if(current_pos < 0)
- res = SMB_VFS_LSEEK(fsp,fsp->fh->fd,0,SEEK_SET);
+ res = SMB_VFS_LSEEK(fsp,0,SEEK_SET);
}
}
@@ -5485,7 +5485,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
/* Ensure we have a valid stat struct for the source. */
if (fsp->fh->fd != -1) {
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) == -1) {
+ if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
return map_nt_error_from_unix(errno);
}
} else {
@@ -6052,7 +6052,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
}
if ((ofun&3) == 1) {
- if(SMB_VFS_LSEEK(fsp2,fsp2->fh->fd,0,SEEK_END) == -1) {
+ if(SMB_VFS_LSEEK(fsp2,0,SEEK_END) == -1) {
DEBUG(0,("copy_file: error - vfs lseek returned error %s\n", strerror(errno) ));
/*
* Stop the copy from occurring.
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index c3b5f9fa2f..485513c734 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -130,7 +130,7 @@ static bool get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn, files_str
}
if (fsp && fsp->fh->fd != -1) {
- sizeret = SMB_VFS_FGETXATTR(fsp, fsp->fh->fd, ea_name, val, attr_size);
+ sizeret = SMB_VFS_FGETXATTR(fsp, ea_name, val, attr_size);
} else {
sizeret = SMB_VFS_GETXATTR(conn, fname, ea_name, val, attr_size);
}
@@ -187,7 +187,7 @@ static struct ea_list *get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_str
}
if (fsp && fsp->fh->fd != -1) {
- sizeret = SMB_VFS_FLISTXATTR(fsp, fsp->fh->fd, ea_namelist, ea_namelist_size);
+ sizeret = SMB_VFS_FLISTXATTR(fsp, ea_namelist, ea_namelist_size);
} else {
sizeret = SMB_VFS_LISTXATTR(conn, fname, ea_namelist, ea_namelist_size);
}
@@ -355,7 +355,7 @@ NTSTATUS set_ea(connection_struct *conn, files_struct *fsp, const char *fname, s
if (fsp && (fsp->fh->fd != -1)) {
DEBUG(10,("set_ea: deleting ea name %s on file %s by file descriptor.\n",
unix_ea_name, fsp->fsp_name));
- ret = SMB_VFS_FREMOVEXATTR(fsp, fsp->fh->fd, unix_ea_name);
+ ret = SMB_VFS_FREMOVEXATTR(fsp, unix_ea_name);
} else {
DEBUG(10,("set_ea: deleting ea name %s on file %s.\n",
unix_ea_name, fname));
@@ -373,7 +373,7 @@ NTSTATUS set_ea(connection_struct *conn, files_struct *fsp, const char *fname, s
if (fsp && (fsp->fh->fd != -1)) {
DEBUG(10,("set_ea: setting ea name %s on file %s by file descriptor.\n",
unix_ea_name, fsp->fsp_name));
- ret = SMB_VFS_FSETXATTR(fsp, fsp->fh->fd, unix_ea_name,
+ ret = SMB_VFS_FSETXATTR(fsp, unix_ea_name,
ea_list->ea.value.data, ea_list->ea.value.length, 0);
} else {
DEBUG(10,("set_ea: setting ea name %s on file %s.\n",
@@ -3663,7 +3663,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
return;
}
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) != 0) {
+ if (SMB_VFS_FSTAT(fsp, &sbuf) != 0) {
DEBUG(3,("fstat of fnum %d failed (%s)\n", fsp->fnum, strerror(errno)));
reply_unixerror(req, ERRDOS, ERRbadfid);
return;
@@ -4305,7 +4305,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
uint16 num_def_acls = 0;
if (fsp && !fsp->is_directory && (fsp->fh->fd != -1)) {
- file_acl = SMB_VFS_SYS_ACL_GET_FD(fsp, fsp->fh->fd);
+ file_acl = SMB_VFS_SYS_ACL_GET_FD(fsp);
} else {
file_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, fname, SMB_ACL_TYPE_ACCESS);
}
@@ -6346,7 +6346,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
return;
}
- if (SMB_VFS_FSTAT(fsp, fsp->fh->fd, &sbuf) != 0) {
+ if (SMB_VFS_FSTAT(fsp, &sbuf) != 0) {
DEBUG(3,("call_trans2setfilepathinfo: fstat of fnum %d failed (%s)\n",fsp->fnum, strerror(errno)));
reply_unixerror(req, ERRDOS, ERRbadfid);
return;
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index ed0406211d..9a5e0aff60 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -411,7 +411,7 @@ ssize_t vfs_pread_data(files_struct *fsp, char *buf,
while (total < byte_count)
{
- ssize_t ret = SMB_VFS_PREAD(fsp, fsp->fh->fd, buf + total,
+ ssize_t ret = SMB_VFS_PREAD(fsp, buf + total,
byte_count - total, offset + total);
if (ret == 0) return total;
@@ -485,8 +485,8 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
}
while (total < N) {
- ret = SMB_VFS_PWRITE(fsp, fsp->fh->fd, buffer + total,
- N - total, offset + total);
+ ret = SMB_VFS_PWRITE(fsp, buffer + total, N - total,
+ offset + total);
if (ret == -1)
return -1;
@@ -525,7 +525,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
return -1;
}
- ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,&st);
+ ret = SMB_VFS_FSTAT(fsp, &st);
if (ret == -1)
return ret;
@@ -539,7 +539,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
fsp->fsp_name, (double)st.st_size ));
flush_write_cache(fsp, SIZECHANGE_FLUSH);
- if ((ret = SMB_VFS_FTRUNCATE(fsp, fsp->fh->fd, (SMB_OFF_T)len)) != -1) {
+ if ((ret = SMB_VFS_FTRUNCATE(fsp, (SMB_OFF_T)len)) != -1) {
set_filelen_write_cache(fsp, len);
}
return ret;
@@ -581,7 +581,7 @@ int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len)
release_level_2_oplocks_on_change(fsp);
DEBUG(10,("vfs_set_filelen: ftruncate %s to len %.0f\n", fsp->fsp_name, (double)len));
flush_write_cache(fsp, SIZECHANGE_FLUSH);
- if ((ret = SMB_VFS_FTRUNCATE(fsp, fsp->fh->fd, len)) != -1) {
+ if ((ret = SMB_VFS_FTRUNCATE(fsp, len)) != -1) {
set_filelen_write_cache(fsp, len);
notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_SIZE
@@ -612,7 +612,7 @@ int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
ssize_t pwrite_ret;
release_level_2_oplocks_on_change(fsp);
- ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,&st);
+ ret = SMB_VFS_FSTAT(fsp, &st);
if (ret == -1) {
return ret;
}
@@ -641,7 +641,7 @@ int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
while (total < num_to_write) {
size_t curr_write_size = MIN(SPARSE_BUF_WRITE_SIZE, (num_to_write - total));
- pwrite_ret = SMB_VFS_PWRITE(fsp, fsp->fh->fd, sparse_buf, curr_write_size, offset + total);
+ pwrite_ret = SMB_VFS_PWRITE(fsp, sparse_buf, curr_write_size, offset + total);
if (pwrite_ret == -1) {
DEBUG(10,("vfs_fill_sparse: SMB_VFS_PWRITE for file %s failed with error %s\n",
fsp->fsp_name, strerror(errno) ));