Windows Search Protocol for samba share

Jean-Daniel FISCHER jeandaniel.fischer at gmail.com
Thu Apr 11 15:47:54 MDT 2013


Hi everyone,

I have switch from SMB to SMB2. In SMB2 when WIN8 client tried to open the
WSP associated named pipe, it sends an IOCTL request with a control op code
of 0x00110018 (FSCTL_PIPE_WAIT). According to MS-SMB2 specification the
correct response is a message with op code 0x00110018 (FSCTL_PIPE_WAIT).

Going across samba code, the treatment goes to the
function smb2_ioctl_named_pipe into smb2_ioct_named_pipe.c. The function
code does not implement specific for this control op code.

I want to add needed code, here is few questions :
Function parameters are :
uint32_t ctl_code,
struct tevent_context *ev,
struct tevent_req *req,
struct smbd_smb2_ioctl_state *state
How to specified the response content ? Is there any function that will
build SMB2 Header  so I will just have to specified the control op code ?
Do I need to build the entire content ?
Any documentation on this ?

Best regards,

Jean-Daniel FISCHER


2013/3/27 Jean-Daniel FISCHER <jeandaniel.fischer at gmail.com>

> Hi,
>
> With the log, I managed to trace the SMBTrans call on the pipe
> <\PIPE\MsFteWds> to the function  "named_pipe" in ipc.c. It appears that
> the function is checking the named pipe name against a specific list
> (LANMAN, WKSSVC, SRVSVC, WINREG, SAMR and LSARPC). If the pipe is not in
> this list it return NT_STATUS_NOT_SUPPORTED.
>
> I will look into developping a patch that solve my problem.
>
> The function code :
> static void named_pipe(connection_struct *conn, uint64_t vuid,
>        struct smb_request *req,
>        const char *name, uint16 *setup,
>        char *data, char *params,
>        int suwcnt, int tdscnt,int tpscnt,
>        int msrcnt, int mdrcnt, int mprcnt)
> {
> DEBUG(3,("named pipe command on <%s> name\n", name));
>
> if (strequal(name,"LANMAN")) {
>  api_reply(conn, vuid, req,
>   data, params,
>   tdscnt, tpscnt,
>   mdrcnt, mprcnt);
> return;
> }
>
> if (strequal(name,"WKSSVC") ||
>     strequal(name,"SRVSVC") ||
>     strequal(name,"WINREG") ||
>     strequal(name,"SAMR") ||
>     strequal(name,"LSARPC")) {
>
> DEBUG(4,("named pipe command from Win95 (wow!)\n"));
>
> api_fd_reply(conn, vuid, req,
>      setup, (uint8_t *)data, params,
>      suwcnt, tdscnt, tpscnt,
>      mdrcnt, mprcnt);
> return;
>  }
>
> if (strlen(name) < 1) {
> api_fd_reply(conn, vuid, req,
>      setup, (uint8_t *)data,
>      params, suwcnt, tdscnt,
>      tpscnt, mdrcnt, mprcnt);
>  return;
> }
>
> if (setup)
>  DEBUG(3,("unknown named pipe: setup 0x%X setup1=%d\n",
>  (int)setup[0],(int)setup[1]));
>
> reply_nterror(req, NT_STATUS_NOT_SUPPORTED);
> return;
> }
>
> Best regards,
>
> Jean-Daniel FSICHER
>
> 2013/3/25 Volker Lendecke <Volker.Lendecke at sernet.de>
>
>> On Sat, Mar 23, 2013 at 04:03:39PM +0100, Jean-Daniel FISCHER wrote:
>> > Hi,
>> >
>> > @Alexander: Thanks for sharing your experience. I hope, I can manage to
>> > find some work around with the help out here :)
>> >
>> > I joined the wireshark capture, the smbd full log and my smb.conf.
>> >
>> > For reference: HYPERION is the Windows 8 client and GAIA is the
>> standalone
>> > server that host samba.
>> >
>> > Best regards,
>> >
>> > Jean-Daniel FISCHER
>> >
>> > PS: this time with reasonable size for log file ;)
>>
>> Sorry, but neither the log file nor the wireshark capture
>> contain the open attempt. Log files may be large, but they
>> are required to debug this issue.
>>
>> With best regards,
>>
>> Volker Lendecke
>>
>> --
>> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
>> phone: +49-551-370000-0, fax: +49-551-370000-9
>> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
>> http://www.sernet.de, mailto:kontakt at sernet.de
>>
>
>


More information about the samba-technical mailing list