s3/smbd: Fix error code for unsupported SET_INFO requests
authorJustin Maggard via samba-technical <samba-technical@lists.samba.org>
Tue, 9 Jan 2018 20:04:16 +0000 (12:04 -0800)
committerJeremy Allison <jra@samba.org>
Sat, 13 Jan 2018 06:25:42 +0000 (07:25 +0100)
FileValidDataLengthInformation and FileShortNameInformation are both
valid FileInfoClasses that we don't support.  According to [MS-SMB2]
3.3.5.21.1, we should be returning STATUS_NOT_SUPPORTED instead of
NT_STATUS_INVALID_LEVEL for these.

Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jan 13 07:25:42 CET 2018 on sn-devel-144

source3/smbd/trans2.c

index dbad71be3b759ef8109f9f5da21f60d5e942e36d..512918efc899615d88d873d113ea953450724ec7 100644 (file)
@@ -8541,6 +8541,11 @@ NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn,
                        break;
                }
 
+               /* [MS-SMB2] 3.3.5.21.1 states we MUST fail with STATUS_NOT_SUPPORTED. */
+               case SMB_FILE_VALID_DATA_LENGTH_INFORMATION:
+               case SMB_FILE_SHORT_NAME_INFORMATION:
+                       return NT_STATUS_NOT_SUPPORTED;
+
                /*
                 * CIFS UNIX extensions.
                 */