diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-24 13:15:34 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-24 13:15:34 +0000 |
commit | a12f04753348e6d52df1f9a2359794deacfc9007 (patch) | |
tree | 1b4afcd5c0819d7486504510b6681644101c7ebe /source3/pipentlsa.c | |
parent | abb255cfe674a39c6a42f5083af9c5facdbcca05 (diff) | |
download | samba-a12f04753348e6d52df1f9a2359794deacfc9007.tar.gz samba-a12f04753348e6d52df1f9a2359794deacfc9007.tar.bz2 samba-a12f04753348e6d52df1f9a2359794deacfc9007.zip |
nterr.c :
added a structure that wraps nt errors as strings and enums, so we
can do a smb_nt_error() function.
Makefile ntclient.c :
added ntclient.c, broken out nt domain stuff into a separate file.
getting fed up of compile-times and size of client.c.
fixed the do_lsa_req_chal() function. made it read the response,
and return the challenge credentials received from the server.
next stop: do_lsa_auth_2().
client.c :
removed nt domain logon functions into a separate file.
pipenetlog.c pipentlsa.c pipesrvsvc.c smbparse.c :
i'd broken the offsets of the RPC_HDR while trying to sort out the
nt client code. fixed it again. added some robustness stuff.
util.c :
the unistrn2() function was null-terminating the string at one
character too many.
(This used to be commit 39cec7f698c4461aee05cfbb213879fbd486117d)
Diffstat (limited to 'source3/pipentlsa.c')
-rw-r--r-- | source3/pipentlsa.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/source3/pipentlsa.c b/source3/pipentlsa.c index 69a8030f53..4a65b54543 100644 --- a/source3/pipentlsa.c +++ b/source3/pipentlsa.c @@ -300,36 +300,32 @@ BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, char **rdata,char **rparam, int *rdata_len,int *rparam_len) { - int pkttype; - uint32 call_id; - uint16 opnum; + RPC_HDR hdr; if (data == NULL) { - DEBUG(2, ("api_ntLsarpcTNP: NULL data parameter\n")); + DEBUG(2,("api_ntLsarpcTNP: NULL data received\n")); return False; } - /* really should decode these using an RPC_HDR structure */ - pkttype = CVAL(data, 2); - call_id = CVAL(data, 12); - opnum = SVAL(data, 22); + smb_io_rpc_hdr(True, &hdr, data, data, 4, 0); - if (pkttype == RPC_BIND) /* RPC BIND */ + if (hdr.pkt_type == RPC_BIND) /* RPC BIND */ { - DEBUG(4,("netlogon rpc bind %x\n",pkttype)); + DEBUG(4,("lsarpc rpc bind %x\n", hdr.pkt_type)); LsarpcTNP1(data,rdata,rdata_len); return True; } - DEBUG(4,("ntlsa TransactNamedPipe op %x\n",opnum)); - switch (opnum) + DEBUG(4,("lsarpc TransactNamedPipe op %x\n",hdr.cancel_count)); + + switch (hdr.cancel_count) { case LSA_OPENPOLICY: { DEBUG(3,("LSA_OPENPOLICY\n")); api_lsa_open_policy(param, data, rdata, rdata_len); - create_rpc_reply(call_id, *rdata, *rdata_len); + create_rpc_reply(hdr.call_id, *rdata, *rdata_len); break; } @@ -338,7 +334,7 @@ BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, DEBUG(3,("LSA_QUERYINFOPOLICY\n")); api_lsa_query_info(param, data, rdata, rdata_len); - create_rpc_reply(call_id, *rdata, *rdata_len); + create_rpc_reply(hdr.call_id, *rdata, *rdata_len); break; } @@ -406,7 +402,7 @@ BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, { DEBUG(3,("LSA_OPENSECRET\n")); api_lsa_lookup_sids(param, data, rdata, rdata_len); - create_rpc_reply(call_id, *rdata, *rdata_len); + create_rpc_reply(hdr.call_id, *rdata, *rdata_len); break; } @@ -414,13 +410,13 @@ BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, { DEBUG(3,("LSA_LOOKUPNAMES\n")); api_lsa_lookup_names(param, data, rdata, rdata_len); - create_rpc_reply(call_id, *rdata, *rdata_len); + create_rpc_reply(hdr.call_id, *rdata, *rdata_len); break; } default: { - DEBUG(4, ("NTLSARPC, unknown code: %lx\n", opnum)); + DEBUG(4, ("NTLSARPC, unknown code: %lx\n", hdr.cancel_count)); break; } } |