[PATCH] HEAD -- wrong behaviour with truncate and 1019 control

Alexander Bokovoy a.bokovoy at sam-solutions.net
Wed Mar 20 02:27:02 GMT 2002


Greetings!

Following patch fixes nasty bug when SMB client sents SET_FILE_INFORMATION
operation with info level 1019 to truncate file.

Index: trans2.c
===================================================================
RCS file: /cvsroot/samba/source/smbd/trans2.c,v
retrieving revision 1.210
diff -u -r1.210 trans2.c
--- trans2.c	5 Mar 2002 01:43:50 -0000	1.210
+++ trans2.c	20 Mar 2002 10:02:39 -0000
@@ -2159,7 +2159,7 @@
 					}
 					close_file(new_fsp,True);
 				} else {
-					ret = vfs_allocate_file_space(fsp, size);
+					ret = vfs_allocate_file_space(fsp, allocation_size);
 					if (vfs_fstat(fsp,fd,&new_sbuf) != 0) {
 						DEBUG(3,("fstat of fnum %d failed (%s)\n",fsp->fnum, strerror(errno)));
 						ret = -1;

-- 
/ Alexander Bokovoy
Software architect and analyst             // SaM-Solutions Ltd.
---
"In matters of principle, stand like a rock; in matters of taste, swim with 
the current."
-- Thomas Jefferson




More information about the samba-technical mailing list