From 906d3bda2656c7d88cc02940f6d50fd98eb189ed Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 28 Mar 2002 01:00:31 +0000 Subject: Ensure that setting file length can return disk full on failure. Jeremy. (This used to be commit 14e2beca9b8fa1c8d893013f52f42b2721a82758) --- source3/smbd/trans2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/smbd/trans2.c') diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 5d0ee08f42..aca7e47d48 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2279,6 +2279,8 @@ static int call_trans2setfilepathinfo(connection_struct *conn, if(size != sbuf.st_size) { + int ret; + DEBUG(10,("call_trans2setfilepathinfo: file %s : setting new size to %.0f\n", fname, (double)size )); @@ -2304,11 +2306,14 @@ static int call_trans2setfilepathinfo(connection_struct *conn, if (new_fsp == NULL) return(UNIXERROR(ERRDOS,ERRbadpath)); - vfs_set_filelen(new_fsp, size); + ret = vfs_set_filelen(new_fsp, size); close_file(new_fsp,True); } else { - vfs_set_filelen(fsp, size); + ret = vfs_set_filelen(fsp, size); } + + if (ret == -1) + return (UNIXERROR(ERRHRD,ERRdiskfull)); } SSVAL(params,0,0); -- cgit