s3:smb2_server: return OBJECT_NAME_INVALID if the path is terminated in SMB2_FIND...
authorStefan Metzmacher <metze@samba.org>
Tue, 6 Sep 2011 12:14:52 +0000 (14:14 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 7 Sep 2011 10:15:51 +0000 (12:15 +0200)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Sep  7 12:15:51 CEST 2011 on sn-devel-104

source3/smbd/smb2_find.c

index 8bfb45b75ae9e8f055971cb8b0695dfb79394570..6c68810853e5eef543fa4ae1037f1d8bb283ea8f 100644 (file)
@@ -107,6 +107,14 @@ NTSTATUS smbd_smb2_request_process_find(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_ILLEGAL_CHARACTER);
        }
 
+       if (in_file_name_buffer.length == 0) {
+               in_file_name_string_size = 0;
+       }
+
+       if (strlen(in_file_name_string) != in_file_name_string_size) {
+               return smbd_smb2_request_error(req, NT_STATUS_OBJECT_NAME_INVALID);
+       }
+
        if (req->compat_chain_fsp) {
                /* skip check */
        } else if (in_file_id_persistent != in_file_id_volatile) {