]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: SMB1 UNIX extensions - only allow size change on regular file.
authorJeremy Allison <jra@samba.org>
Tue, 15 Oct 2019 22:04:39 +0000 (15:04 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 6 Nov 2019 18:08:40 +0000 (18:08 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/trans2.c

index bcff091f0ea546631ccf67e976683e9e8f7a63cf..59821baeddf95ee9eb2c246a0ee1f37e5b6f965f 100644 (file)
@@ -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. */