From: Jeremy Allison Date: Tue, 15 Oct 2019 22:04:39 +0000 (-0700) Subject: s3: smbd: SMB1 UNIX extensions - only allow size change on regular file. X-Git-Tag: talloc-2.3.1~131 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8567d46bd7e371de83e4d1ee1592639eb6f0c06;p=thirdparty%2Fsamba.git s3: smbd: SMB1 UNIX extensions - only allow size change on regular file. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index bcff091f0ea..59821baeddf 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -8301,14 +8301,16 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, /* Deal with any size changes. */ - status = smb_set_file_size(conn, req, - fsp, - smb_fname, - &sbuf, - size, - false); - if (!NT_STATUS_IS_OK(status)) { - return status; + if (S_ISREG(sbuf.st_ex_mode)) { + status = smb_set_file_size(conn, req, + fsp, + smb_fname, + &sbuf, + size, + false); + if (!NT_STATUS_IS_OK(status)) { + return status; + } } /* Deal with any time changes. */