summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-05 03:14:40 +0000
committerJeremy Allison <jra@samba.org>1998-09-05 03:14:40 +0000
commit98f524bde4801bd0b013a6bc79c5552ef62b59f8 (patch)
tree1c42d63977a2a82aa87228ecf1d57742ac8f6fb0 /source3/smbd/open.c
parent1546ccfd24a712973c82fcd2064d3c48381f1360 (diff)
downloadsamba-98f524bde4801bd0b013a6bc79c5552ef62b59f8.tar.gz
samba-98f524bde4801bd0b013a6bc79c5552ef62b59f8.tar.bz2
samba-98f524bde4801bd0b013a6bc79c5552ef62b59f8.zip
Bugfix for leak in reference counted file struct.
Added "nt smb support" parameter to allow NT SMB's to be turned off. Jeremy. (This used to be commit 63f65f5027d5022153fa2757b49c56829db1725b)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 45d919187f..a72469f2b2 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -170,13 +170,10 @@ int fd_attempt_close(file_fd_struct *fd_ptr)
close(fd_ptr->fd_readonly);
if(fd_ptr->fd_writeonly != -1)
close(fd_ptr->fd_writeonly);
- fd_ptr->fd = -1;
- fd_ptr->fd_readonly = -1;
- fd_ptr->fd_writeonly = -1;
- fd_ptr->real_open_flags = -1;
- fd_ptr->dev = (SMB_DEV_T)-1;
- fd_ptr->inode = (SMB_INO_T)-1;
- fd_ptr->uid_cache_count = 0;
+ /*
+ * Delete this fd_ptr.
+ */
+ fd_ptr_free(fd_ptr);
} else {
fd_remove_from_uid_cache(fd_ptr, (uid_t)current_user.uid);
}
@@ -457,10 +454,9 @@ static void open_file(files_struct *fsp,connection_struct *conn,
if (p) *p = 0;
if (sys_disk_free(dname,&dum1,&dum2,&dum3) <
lp_minprintspace(SNUM(conn))) {
- fd_attempt_close(fd_ptr);
- fsp->fd_ptr = 0;
- if(fd_ptr->ref_count == 0)
+ if(fd_attempt_close(fd_ptr) == 0)
dos_unlink(fname);
+ fsp->fd_ptr = 0;
errno = ENOSPC;
return;
}