The Samba-Bugzilla – Attachment 1912 Details for
Bug 3790
smbd ignores initial file size on TRANS2OPEN call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Initial EA fix
new2 (text/plain), 2.45 KB, created by
Marcel Müller
on 2006-05-20 07:58:44 UTC
(
hide
)
Description:
Initial EA fix
Filename:
MIME Type:
Creator:
Marcel Müller
Created:
2006-05-20 07:58:44 UTC
Size:
2.45 KB
patch
obsolete
>Index: smbd/trans2.c >=================================================================== >--- smbd/trans2.c (revision 15718) >+++ smbd/trans2.c (working copy) >@@ -727,7 +727,7 @@ > time_t open_time; > #endif > int open_ofun; >- int32 open_size; >+ uint32 open_size; > char *pname; > pstring fname; > SMB_OFF_T size=0; >@@ -860,14 +860,40 @@ > return(ERROR_DOS(ERRDOS,ERRnoaccess)); > } > >- if (total_data && smb_action == FILE_WAS_CREATED) { >+ /* Save the requested allocation size. */ >+ /* Allocate space for the file if a size hint is supplied */ >+ if ((smb_action == FILE_WAS_CREATED) || (smb_action == FILE_WAS_OVERWRITTEN)) { >+ SMB_BIG_UINT allocation_size = (SMB_BIG_UINT)open_size; >+ if (allocation_size && (allocation_size > (SMB_BIG_UINT)size)) { >+ fsp->initial_allocation_size = smb_roundup(fsp->conn, allocation_size); >+ if (fsp->is_directory) { >+ close_file(fsp,ERROR_CLOSE); >+ /* Can't set allocation size on a directory. */ >+ return ERROR_NT(NT_STATUS_ACCESS_DENIED); >+ } >+ if (vfs_allocate_file_space(fsp, fsp->initial_allocation_size) == -1) { >+ close_file(fsp,ERROR_CLOSE); >+ return ERROR_NT(NT_STATUS_DISK_FULL); >+ } >+ >+ /* Adjust size here to return the right size in the reply. >+ Windows does it this way. */ >+ size = fsp->initial_allocation_size; >+ >+ } else { >+ fsp->initial_allocation_size = smb_roundup(fsp->conn,(SMB_BIG_UINT)size) >; >+ } >+ } >+ >+ if (ea_list && (smb_action == FILE_WAS_CREATED || smb_action == FILE_WAS_OVERWRITTEN) >) { /* in case of create or overwrite only */ > status = set_ea(conn, fsp, fname, ea_list); > talloc_destroy(ctx); > if (!NT_STATUS_IS_OK(status)) { > close_file(fsp,ERROR_CLOSE); > return ERROR_NT(status); > } >- } >+ } else >+ talloc_destroy(ctx); > > /* Realloc the size of parameters and data we will return */ > *pparams = SMB_REALLOC(*pparams, 30);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 3790
:
1910
|
1911
| 1912