From f83f2cd4fa3a610a92b17ac8006390cdd1f7ca94 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 29 Jun 2001 01:58:48 +0000 Subject: Win9x weirdness. When setting the named pipe handle state on a Unicode server, Win9x only sends \PIPE instead of \PIPE\. Looks suspiciously like an off-by one bug in the Win9x dce/rpc pipe code. (This used to be commit b4a9079833c261705e18fdcaab752cb5292a078f) --- source3/smbd/ipc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index efad2d27c0..eb6ccb4fce 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -492,10 +492,18 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int (name[strlen(local_machine)+1] == '\\')) name_offset = strlen(local_machine)+1; - if (strncmp(&name[name_offset],"\\PIPE\\",strlen("\\PIPE\\")) == 0) { + if (strnequal(&name[name_offset], "\\PIPE", strlen("\\PIPE"))) { + name_offset += strlen("\\PIPE"); + + /* Win9x weirdness. When talking to a unicode server Win9x + only sends \PIPE instead of \PIPE\ */ + + if (name[name_offset] == '\\') + name_offset++; + DEBUG(5,("calling named_pipe\n")); outsize = named_pipe(conn,vuid,outbuf, - name+name_offset+strlen("\\PIPE\\"),setup,data,params, + name+name_offset,setup,data,params, suwcnt,tdscnt,tpscnt,msrcnt,mdrcnt,mprcnt); } else { DEBUG(3,("invalid pipe name\n")); -- cgit