https://bugzilla.samba.org/show_bug.cgi?id=11240
Signed-off-by: Kenny Dinh <kdinh@peaxy.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
(cherry picked from commit
d68383e9638254d1b6805b3d3ea3e5e897908374)
ftruncate extend but ext2 can. */
result = ftruncate(fsp->fh->fd, len);
- if (result == 0)
- goto done;
/* According to W. R. Stevens advanced UNIX prog. Pure 4.3 BSD cannot
extend a file with ftruncate. Provide alternate implementation
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
+
+ /* We need to update the files_struct after successful ftruncate */
+ if (result == 0) {
+ goto done;
+ }
+
pst = &fsp->fsp_name->st;
#ifdef S_ISFIFO