summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-10-09 16:27:49 +0200
committerVolker Lendecke <vl@samba.org>2008-10-13 19:32:38 +0200
commitc530009401f111bc62008a2a75cdad5b9d5ee7d1 (patch)
tree6390031d8b5372f7329bdecacf8f985ac0559b62 /source3/smbd
parentc3fedcddd5e79c60f5fcc0219752c27277a4d9f7 (diff)
downloadsamba-c530009401f111bc62008a2a75cdad5b9d5ee7d1.tar.gz
samba-c530009401f111bc62008a2a75cdad5b9d5ee7d1.tar.bz2
samba-c530009401f111bc62008a2a75cdad5b9d5ee7d1.zip
Pass struct smb_request to file_free
on the way to get rid of chain_fsp
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/close.c25
-rw-r--r--source3/smbd/dosmode.c4
-rw-r--r--source3/smbd/fake_file.c6
-rw-r--r--source3/smbd/files.c8
-rw-r--r--source3/smbd/nttrans.c6
-rw-r--r--source3/smbd/open.c52
-rw-r--r--source3/smbd/posix_acls.c4
-rw-r--r--source3/smbd/reply.c30
-rw-r--r--source3/smbd/trans2.c22
9 files changed, 80 insertions, 77 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 818b4c70a8..d4c531ab19 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -505,7 +505,8 @@ static NTSTATUS update_write_time_on_close(struct files_struct *fsp)
delete on close is done on normal and shutdown close.
****************************************************************************/
-static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_type)
+static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
+ enum file_close_type close_type)
{
NTSTATUS status = NT_STATUS_OK;
NTSTATUS saved_status1 = NT_STATUS_OK;
@@ -536,7 +537,7 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
if (fsp->print_file) {
print_fsp_end(fsp, close_type);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_OK;
}
@@ -585,7 +586,7 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
conn->num_files_open,
nt_errstr(status) ));
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -593,7 +594,8 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
Close a directory opened by an NT SMB call.
****************************************************************************/
-static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_type)
+static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
+ enum file_close_type close_type)
{
struct share_mode_lock *lck = 0;
bool delete_dir = False;
@@ -698,7 +700,7 @@ static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_ty
* Do the code common to files and directories.
*/
close_filestruct(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -706,17 +708,18 @@ static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_ty
Close a files_struct.
****************************************************************************/
-NTSTATUS close_file(files_struct *fsp, enum file_close_type close_type)
+NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
+ enum file_close_type close_type)
{
NTSTATUS status;
struct files_struct *base_fsp = fsp->base_fsp;
if(fsp->is_directory) {
- status = close_directory(fsp, close_type);
+ status = close_directory(req, fsp, close_type);
} else if (fsp->fake_file_handle != NULL) {
- status = close_fake_file(fsp);
+ status = close_fake_file(req, fsp);
} else {
- status = close_normal_file(fsp, close_type);
+ status = close_normal_file(req, fsp, close_type);
}
if ((base_fsp != NULL) && (close_type != SHUTDOWN_CLOSE)) {
@@ -731,7 +734,7 @@ NTSTATUS close_file(files_struct *fsp, enum file_close_type close_type)
*/
SMB_ASSERT(base_fsp->base_fsp == NULL);
- close_file(base_fsp, close_type);
+ close_file(req, base_fsp, close_type);
}
return status;
@@ -768,5 +771,5 @@ void msg_close_file(struct messaging_context *msg_ctx,
DEBUG(10,("msg_close_file: failed to find file.\n"));
return;
}
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
}
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index a5cca53bc7..784b36d9bd 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -285,7 +285,7 @@ static bool set_ea_dos_attribute(connection_struct *conn, const char *path, SMB_
ret = True;
}
unbecome_root();
- close_file_fchmod(fsp);
+ close_file_fchmod(NULL, fsp);
return ret;
}
DEBUG(10,("set_ea_dos_attribute: set EA %s on file %s\n", attrstr, path));
@@ -547,7 +547,7 @@ int file_set_dosmode(connection_struct *conn, const char *fname,
become_root();
ret = SMB_VFS_FCHMOD(fsp, unixmode);
unbecome_root();
- close_file_fchmod(fsp);
+ close_file_fchmod(NULL, fsp);
if (!newfile) {
notify_fname(conn, NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_ATTRIBUTES, fname);
diff --git a/source3/smbd/fake_file.c b/source3/smbd/fake_file.c
index 3887483507..58b09604c4 100644
--- a/source3/smbd/fake_file.c
+++ b/source3/smbd/fake_file.c
@@ -137,7 +137,7 @@ NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
fsp->fake_file_handle = init_fake_file_handle(fake_file_type);
if (fsp->fake_file_handle==NULL) {
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_NO_MEMORY;
}
@@ -146,8 +146,8 @@ NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
return NT_STATUS_OK;
}
-NTSTATUS close_fake_file(files_struct *fsp)
+NTSTATUS close_fake_file(struct smb_request *req, files_struct *fsp)
{
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_OK;
}
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 33c43356c6..d77ee76be7 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -145,7 +145,7 @@ void file_close_conn(connection_struct *conn)
for (fsp=Files;fsp;fsp=next) {
next = fsp->next;
if (fsp->conn == conn) {
- close_file(fsp,SHUTDOWN_CLOSE);
+ close_file(NULL, fsp, SHUTDOWN_CLOSE);
}
}
}
@@ -161,7 +161,7 @@ void file_close_pid(uint16 smbpid, int vuid)
for (fsp=Files;fsp;fsp=next) {
next = fsp->next;
if ((fsp->file_pid == smbpid) && (fsp->vuid == vuid)) {
- close_file(fsp,SHUTDOWN_CLOSE);
+ close_file(NULL, fsp, SHUTDOWN_CLOSE);
}
}
}
@@ -219,7 +219,7 @@ void file_close_user(int vuid)
for (fsp=Files;fsp;fsp=next) {
next=fsp->next;
if (fsp->vuid == vuid) {
- close_file(fsp,SHUTDOWN_CLOSE);
+ close_file(NULL, fsp, SHUTDOWN_CLOSE);
}
}
}
@@ -395,7 +395,7 @@ void file_sync_all(connection_struct *conn)
Free up a fsp.
****************************************************************************/
-void file_free(files_struct *fsp)
+void file_free(struct smb_request *req, files_struct *fsp)
{
DLIST_REMOVE(Files, fsp);
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index baa91e2955..6361f7949a 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1188,7 +1188,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
&info, &fsp2);
if (!NT_STATUS_IS_OK(status)) {
- close_file(fsp1,ERROR_CLOSE);
+ close_file(NULL, fsp1, ERROR_CLOSE);
return status;
}
@@ -1202,12 +1202,12 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
* Thus we don't look at the error return from the
* close of fsp1.
*/
- close_file(fsp1,NORMAL_CLOSE);
+ close_file(NULL, fsp1, NORMAL_CLOSE);
/* Ensure the modtime is set correctly on the destination file. */
set_close_write_time(fsp2, get_mtimespec(&sbuf1));
- status = close_file(fsp2,NORMAL_CLOSE);
+ status = close_file(NULL, fsp2, NORMAL_CLOSE);
/* Grrr. We have to do this as open_file_ntcreate adds aARCH when it
creates the file. This isn't the correct thing to do in the copy
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 0ae444b3d8..209ad4d587 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1465,7 +1465,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
fname, &old_write_time);
if (lck == NULL) {
- file_free(fsp);
+ file_free(req, fsp);
DEBUG(0, ("Could not get share mode lock\n"));
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1476,7 +1476,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
oplock_request)) {
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1496,7 +1496,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
oplock_request)) {
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
}
@@ -1504,7 +1504,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (NT_STATUS_EQUAL(status, NT_STATUS_DELETE_PENDING)) {
/* DELETE_PENDING is not deferred for a second */
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -1525,7 +1525,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
DEBUG(0, ("DOS open without an SMB "
"request!\n"));
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_INTERNAL_ERROR;
}
@@ -1540,7 +1540,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (fsp_dup) {
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
if (pinfo) {
*pinfo = FILE_WAS_OPENED;
}
@@ -1626,7 +1626,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
} else {
status = NT_STATUS_ACCESS_DENIED;
}
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -1664,7 +1664,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (lck != NULL) {
TALLOC_FREE(lck);
}
- file_free(fsp);
+ file_free(req, fsp);
return fsp_open;
}
@@ -1695,7 +1695,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
DEBUG(0, ("open_file_ntcreate: Could not get share "
"mode lock for %s\n", fname));
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1706,7 +1706,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1725,7 +1725,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
}
@@ -1734,7 +1734,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
struct deferred_open_record state;
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
state.delayed_for_oplocks = False;
state.id = id;
@@ -1776,7 +1776,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1802,7 +1802,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
status = map_nt_error_from_unix(errno);
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
}
@@ -1863,7 +1863,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
del_share_mode(lck, fsp);
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
/* Note that here we set the *inital* delete on close flag,
@@ -1977,7 +1977,7 @@ NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
*/
if (!NT_STATUS_IS_OK(status)) {
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -1989,10 +1989,10 @@ NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
Close the fchmod file fd - ensure no locks are lost.
****************************************************************************/
-NTSTATUS close_file_fchmod(files_struct *fsp)
+NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp)
{
NTSTATUS status = fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -2238,7 +2238,7 @@ NTSTATUS open_directory(connection_struct *conn,
if (lck == NULL) {
DEBUG(0, ("open_directory: Could not get share mode lock for %s\n", fname));
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -2248,7 +2248,7 @@ NTSTATUS open_directory(connection_struct *conn,
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -2261,7 +2261,7 @@ NTSTATUS open_directory(connection_struct *conn,
status = can_set_delete_on_close(fsp, True, 0);
if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_DIRECTORY_NOT_EMPTY)) {
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -2302,7 +2302,7 @@ NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, cons
&fsp);
if (NT_STATUS_IS_OK(status)) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
}
return status;
@@ -2512,7 +2512,7 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
DEBUG(10, ("Closing stream # %d, %s\n", i,
streams[i]->fsp_name));
- close_file(streams[i], NORMAL_CLOSE);
+ close_file(NULL, streams[i], NORMAL_CLOSE);
}
fail:
@@ -2843,11 +2843,11 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
DEBUG(10, ("create_file_unixpath: %s\n", nt_errstr(status)));
if (fsp != NULL) {
- close_file(fsp, ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
fsp = NULL;
}
if (base_fsp != NULL) {
- close_file(base_fsp, ERROR_CLOSE);
+ close_file(req, base_fsp, ERROR_CLOSE);
base_fsp = NULL;
}
return status;
@@ -3094,7 +3094,7 @@ NTSTATUS create_file(connection_struct *conn,
DEBUG(10, ("create_file: %s\n", nt_errstr(status)));
if (fsp != NULL) {
- close_file(fsp, ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
fsp = NULL;
}
return status;
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index c151e57e4c..f129506716 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3206,7 +3206,7 @@ int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid)
ret = SMB_VFS_FCHOWN(fsp, uid, (gid_t)-1);
unbecome_root();
- close_file_fchmod(fsp);
+ close_file_fchmod(NULL, fsp);
return ret;
}
@@ -3264,7 +3264,7 @@ NTSTATUS append_parent_acl(files_struct *fsp,
status = SMB_VFS_GET_NT_ACL(parent_fsp->conn, parent_fsp->fsp_name,
DACL_SECURITY_INFORMATION, &parent_sd );
- close_file(parent_fsp, NORMAL_CLOSE);
+ close_file(NULL, parent_fsp, NORMAL_CLOSE);
if (!NT_STATUS_IS_OK(status)) {
return status;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index fd37371ed0..0f38a4986f 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1687,7 +1687,7 @@ void reply_open(struct smb_request *req)
if (fattr & aDIR) {
DEBUG(3,("attempt to open a directory %s\n",fsp->fsp_name));
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_doserror(req, ERRDOS,ERRnoaccess);
END_PROFILE(SMBopen);
return;
@@ -1830,14 +1830,14 @@ void reply_open_and_X(struct smb_request *req)
if (((smb_action == FILE_WAS_CREATED) || (smb_action == FILE_WAS_OVERWRITTEN)) && allocation_size) {
fsp->initial_allocation_size = smb_roundup(fsp->conn, allocation_size);
if (vfs_allocate_file_space(fsp, fsp->initial_allocation_size) == -1) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_nterror(req, NT_STATUS_DISK_FULL);
END_PROFILE(SMBopenX);
return;
}
retval = vfs_set_filelen(fsp, (SMB_OFF_T)allocation_size);
if (retval < 0) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_nterror(req, NT_STATUS_DISK_FULL);
END_PROFILE(SMBopenX);
return;
@@ -1848,7 +1848,7 @@ void reply_open_and_X(struct smb_request *req)
fattr = dos_mode(conn,fsp->fsp_name,&sbuf);
mtime = sbuf.st_mtime;
if (fattr & aDIR) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_doserror(req, ERRDOS, ERRnoaccess);
END_PROFILE(SMBopenX);
return;
@@ -2363,11 +2363,11 @@ static NTSTATUS do_unlink(connection_struct *conn,
/* The set is across all open files on this dev/inode pair. */
if (!set_delete_on_close(fsp, True, &conn->server_info->utok)) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
return NT_STATUS_ACCESS_DENIED;
}
- return close_file(fsp,NORMAL_CLOSE);
+ return close_file(req, fsp, NORMAL_CLOSE);
}
/****************************************************************************
@@ -4285,7 +4285,7 @@ void reply_close(struct smb_request *req)
* Special case - close NT SMB directory handle.
*/
DEBUG(3,("close directory fnum=%d\n", fsp->fnum));
- status = close_file(fsp,NORMAL_CLOSE);
+ status = close_file(req, fsp, NORMAL_CLOSE);
} else {
time_t t;
/*
@@ -4309,7 +4309,7 @@ void reply_close(struct smb_request *req)
* a disk full error. If not then it was probably an I/O error.
*/
- status = close_file(fsp,NORMAL_CLOSE);
+ status = close_file(req, fsp, NORMAL_CLOSE);
}
if (!NT_STATUS_IS_OK(status)) {
@@ -4384,7 +4384,7 @@ void reply_writeclose(struct smb_request *req)
if (numtowrite) {
DEBUG(3,("reply_writeclose: zero length write doesn't close file %s\n",
fsp->fsp_name ));
- close_status = close_file(fsp,NORMAL_CLOSE);
+ close_status = close_file(req, fsp, NORMAL_CLOSE);
}
DEBUG(3,("writeclose fnum=%d num=%d wrote=%d (numopen=%d)\n",
@@ -4690,7 +4690,7 @@ void reply_printclose(struct smb_request *req)
DEBUG(3,("printclose fd=%d fnum=%d\n",
fsp->fh->fd,fsp->fnum));
- status = close_file(fsp,NORMAL_CLOSE);
+ status = close_file(req, fsp, NORMAL_CLOSE);
if(!NT_STATUS_IS_OK(status)) {
reply_nterror(req, status);
@@ -5785,7 +5785,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
last_component_dest,
attrs, replace_if_exists);
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
DEBUG(3, ("rename_internals: Error %s rename %s -> %s\n",
nt_errstr(status), directory,newname));
@@ -5889,7 +5889,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
status = rename_internals_fsp(conn, fsp, destname, dname,
attrs, replace_if_exists);
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("rename_internals_fsp returned %s for "
@@ -6104,7 +6104,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
TALLOC_FREE(dest);
if (!NT_STATUS_IS_OK(status)) {
- close_file(fsp1,ERROR_CLOSE);
+ close_file(NULL, fsp1, ERROR_CLOSE);
return status;
}
@@ -6123,7 +6123,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
ret = vfs_transfer_file(fsp1, fsp2, src_sbuf.st_size);
}
- close_file(fsp1,NORMAL_CLOSE);
+ close_file(NULL, fsp1, NORMAL_CLOSE);
/* Ensure the modtime is set correctly on the destination file. */
set_close_write_time(fsp2, get_mtimespec(&src_sbuf));
@@ -6134,7 +6134,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
* Thus we don't look at the error return from the
* close of fsp1.
*/
- status = close_file(fsp2,NORMAL_CLOSE);
+ status = close_file(NULL, fsp2, NORMAL_CLOSE);
if (!NT_STATUS_IS_OK(status)) {
return status;
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 850552eca6..a82c2920df 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1031,7 +1031,7 @@ static void call_trans2open(connection_struct *conn,
mtime = sbuf.st_mtime;
inode = sbuf.st_ino;
if (fattr & aDIR) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_doserror(req, ERRDOS,ERRnoaccess);
return;
}
@@ -5016,12 +5016,12 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
if (vfs_set_filelen(new_fsp, size) == -1) {
status = map_nt_error_from_unix(errno);
- close_file(new_fsp,NORMAL_CLOSE);
+ close_file(req, new_fsp,NORMAL_CLOSE);
return status;
}
trigger_write_time_update_immediate(new_fsp);
- close_file(new_fsp,NORMAL_CLOSE);
+ close_file(req, new_fsp,NORMAL_CLOSE);
return NT_STATUS_OK;
}
@@ -5771,7 +5771,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
if (allocation_size != get_file_size(*psbuf)) {
if (vfs_allocate_file_space(new_fsp, allocation_size) == -1) {
status = map_nt_error_from_unix(errno);
- close_file(new_fsp,NORMAL_CLOSE);
+ close_file(req, new_fsp, NORMAL_CLOSE);
return status;
}
}
@@ -5783,7 +5783,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
*/
trigger_write_time_update_immediate(new_fsp);
- close_file(new_fsp,NORMAL_CLOSE);
+ close_file(req, new_fsp, NORMAL_CLOSE);
return NT_STATUS_OK;
}
@@ -6196,7 +6196,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
&fsp);
if (NT_STATUS_IS_OK(status)) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
}
info_level_return = SVAL(pdata,16);
@@ -6389,7 +6389,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
/* Realloc the data size */
*ppdata = (char *)SMB_REALLOC(*ppdata,*pdata_return_size);
if (*ppdata == NULL) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
*pdata_return_size = 0;
return NT_STATUS_NO_MEMORY;
}
@@ -6507,7 +6507,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
if (lck == NULL) {
DEBUG(0, ("smb_posix_unlink: Could not get share mode "
"lock for file %s\n", fsp->fsp_name));
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
return NT_STATUS_INVALID_PARAMETER;
}
@@ -6523,7 +6523,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
continue;
}
/* Fail with sharing violation. */
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
TALLOC_FREE(lck);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -6540,12 +6540,12 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
psbuf);
if (!NT_STATUS_IS_OK(status)) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
TALLOC_FREE(lck);
return status;
}
TALLOC_FREE(lck);
- return close_file(fsp, NORMAL_CLOSE);
+ return close_file(req, fsp, NORMAL_CLOSE);
}
/****************************************************************************