The Samba-Bugzilla – Attachment 3828 Details for
Bug 5990
strict allocate should be checked before ftruncate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Replacement patch
look (text/plain), 885 bytes, created by
Jeremy Allison
on 2008-12-24 17:18:20 UTC
(
hide
)
Description:
Replacement patch
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2008-12-24 17:18:20 UTC
Size:
885 bytes
patch
obsolete
>diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c >index 09ad3cb..d306b0f 100644 >--- a/source/modules/vfs_default.c >+++ b/source/modules/vfs_default.c >@@ -714,6 +714,20 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs > if (st.st_size > len) > return sys_ftruncate(fsp->fh->fd, len); > >+ /* available disk space is enough or not? */ >+ if (lp_strict_allocate(SNUM(fsp->conn))){ >+ SMB_BIG_UINT space_avail; >+ SMB_BIG_UINT bsize,dfree,dsize; >+ >+ space_avail = get_dfree_info(fsp->conn,fsp->fsp_name,false,&bsize,&dfree,&dsize); >+ /* space_avail is 1k blocks */ >+ if (space_avail == (SMB_BIG_UINT)-1 || >+ ((SMB_BIG_UINT)space_to_write/1024 > space_avail) ) { >+ errno = ENOSPC; >+ return -1; >+ } >+ } >+ > /* Write out the real space on disk. */ > if (SMB_VFS_LSEEK(fsp, st.st_size, SEEK_SET) != st.st_size) > return -1;
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 5990
:
3826
| 3828