]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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)
committerKarolin Seeger <kseeger@samba.org>
Wed, 12 Oct 2011 18:49:06 +0000 (20:49 +0200)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Sep  7 12:15:51 CEST 2011 on sn-devel-104
(cherry picked from commit 9bc4decc1cba701926fc8081c3903aac754a6f51)

source3/smbd/smb2_find.c

index 85e0126ac585aefbe3ce4a6a241cb42791db184c..4a49f2a7a47824ad0a781ed0d757bf02ed7a139c 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) {