diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-29 19:05:34 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-29 19:05:34 +0000 |
commit | 520878fd1f440a7313cedb4827bdc81454d94d20 (patch) | |
tree | c189025afdeb3d7d4bd3d20eabfbb2b36dbb5cc2 /source3/ntclientpipe.c | |
parent | 26f5e4f25cdfe41d77662224ec942cfffbb5a6fe (diff) | |
download | samba-520878fd1f440a7313cedb4827bdc81454d94d20.tar.gz samba-520878fd1f440a7313cedb4827bdc81454d94d20.tar.bz2 samba-520878fd1f440a7313cedb4827bdc81454d94d20.zip |
ipc.c ntclientpipe.c:
response to Bind Acknowledgment needs a lookup table for the PIPE string
(secondary address in RPC_HDR_BA structure).
smbparse.c util.c :
interesting problem, i think caused by us typecasting a uint16* buffer
to char*. found on a SPARC.
(This used to be commit 420408ee83902faa6cf871f26e93ad5efb483727)
Diffstat (limited to 'source3/ntclientpipe.c')
-rw-r--r-- | source3/ntclientpipe.c | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/source3/ntclientpipe.c b/source3/ntclientpipe.c index 6a4fa59f80..80991cea51 100644 --- a/source3/ntclientpipe.c +++ b/source3/ntclientpipe.c @@ -85,6 +85,17 @@ uint16 open_rpc_pipe(char *inbuf, char *outbuf, char *rname, int Client, int cnu return fnum; } +struct +{ + char *client; + char *server; +} pipe_names [] = +{ + { PIPE_LSARPC , PIPE_LSASS }, + { PIPE_NETLOGON, PIPE_NETLOGON }, + { NULL , NULL } +}; + /**************************************************************************** do an rpc bind ****************************************************************************/ @@ -140,6 +151,7 @@ BOOL bind_rpc_pipe(char *pipe_name, uint16 fnum, uint32 call_id, RPC_HDR_BA hdr_ba; int hdr_len; int pkt_len; + int i = 0; DEBUG(5, ("cli_call_api: return OK\n")); @@ -172,10 +184,35 @@ BOOL bind_rpc_pipe(char *pipe_name, uint16 fnum, uint32 call_id, } #endif - if (p && (strcmp(pipe_name, hdr_ba.addr.str) != 0)) + while (p && (pipe_names[i].server != NULL)) + { + DEBUG(6,("bind_rpc_pipe: searching pipe name: client:%s server:%s\n", + pipe_names[i].client, pipe_names[i].server)); + + if ((strcmp(pipe_name , pipe_names[i].client) == 0)) + { + if (strcmp(hdr_ba.addr.str, pipe_names[i].server) == 0) + { + DEBUG(5,("bind_rpc_pipe: server pipe_name found: %s\n", + pipe_names[i].server)); + break; + } + else + { + DEBUG(2,("bind_rpc_pipe: pipe_name %s != expected pipe %s\n", + pipe_names[i].server, hdr_ba.addr.str)); + p = NULL; + } + } + else + { + i++; + } + } + + if (p && pipe_names[i].server == NULL) { - DEBUG(2,("bind_rpc_pipe: pipe_name %s != expected pipe %s\n", - pipe_name, hdr_ba.addr.str)); + DEBUG(2,("bind_rpc_pipe: pipe name %s unsupported\n", hdr_ba.addr.str)); p = NULL; } |