Error status correction in OpenById path.

Kenny Dinh kdinh at peaxy.net
Thu Apr 30 12:11:30 MDT 2015


Attached are wireshark traces for correct case and in-correct case.  In the
correct case, the server returned STATUS_NOT_SUPPORTED.  In the incorrect
case (SMB), STATUS_OBJECT_NAME_INVALID is returned.

SMB protocol does not specified what exact value file name length has to be
when FILE_OPEN_BY_FILE_ID is specified.  The only thing I can think of is
verify that the actual length of the file name is smaller than the
specified file name length, when FILE_OPEN_BY_FILE_ID is specified.



On Thu, Apr 30, 2015 at 10:33 AM, Jeremy Allison <jra at samba.org> wrote:

> On Mon, Apr 27, 2015 at 06:03:14PM -0700, Kenny Dinh wrote:
> > Hi all,
> >
> > We were running IFSTest's "FileOpenByIDTest".  The test expects Samba to
> > return STATUS_NOT_SUPPORTED but Samba was returning
> > STATUS_OBJECT_NAME_INVALID.  The incorrect error code came from a check
> at
> > "smbd_smb2_request_process_create" in source3\smbd\smb2_create.c
> >
> > if (strlen(in_name_string) != in_name_string_size) {
> > return smbd_smb2_request_error(smb2req, NT_STATUS_OBJECT_NAME_INVALID);
> > }
> >
> > In the case of FILE_OPEN_BY_FILE_ID, the file name length specified in
> the
> > SMB request is larger than the actual length of the file name (of the
> > parent directory).  My thought is that the file name length validation is
> > not applicable to OpenById.
> >
> > Could someone verify if the attached patch is valid and should be pulled
> > upstream?
>
> Can you send me a wireshark trace of this operation running ?
>
> It would really help to determine where we should change
> the error code and why.
>
> Cheers,
>
>         Jeremy.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openbyID_correct.pcapng
Type: application/octet-stream
Size: 4304 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150430/4a6b30f9/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openbyID_invalid.pcapng
Type: application/octet-stream
Size: 5356 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150430/4a6b30f9/attachment-0001.obj>


More information about the samba-technical mailing list