had to create a table referencing the incoming DCE/RPC context_id to an
authorLuke Leighton <lkcl@samba.org>
Mon, 6 Mar 2000 08:16:09 +0000 (08:16 +0000)
committerLuke Leighton <lkcl@samba.org>
Mon, 6 Mar 2000 08:16:09 +0000 (08:16 +0000)
internal context id.

also fixing issues where i had earlier removed POL_HND_SIZE #define.

source/Makefile.in
source/rpc_server/srv_pipe_netsec.c
source/rpc_server/srv_pipe_noauth.c
source/rpc_server/srv_pipe_ntlmssp.c
source/rpc_server/srv_pipe_srv.c
source/samrd/srv_samr_als_tdb.c
source/svcctld/srv_svcctl_nt.c

index 11aeccead22f6b3d1ff37ef5bde4e5866bd3426c..1956e2aa21d48a5b88b3b9a4eeb9e9c0d61f7584 100644 (file)
@@ -179,8 +179,7 @@ LIBSMB_OBJ = libsmb/clientgen.o \
                 rpc_parse/parse_net.o \
                 rpc_parse/parse_ntlmssp.o rpc_parse/parse_prs.o \
                  rpc_parse/parse_vuid.o \
-           lib/vuser.o lib/vuser_db.o \
-                rpc_parse/parse_misc.o
+           lib/vuser.o lib/vuser_db.o
 
 RPC_SRVUTIL_OBJ = rpc_server/srv_pipe_srv.o \
                rpc_server/srv_pipe_noauth.o
@@ -201,13 +200,11 @@ RPC_PARSE_OBJ1 = rpc_parse/parse_lsa.o \
                rpc_parse/parse_brs.o
 
 RPC_PARSE_OBJ2 = rpc_parse/parse_rpc.o \
+                rpc_parse/parse_misc.o \
                 rpc_parse/parse_netsec.o \
                rpc_parse/parse_sec.o \
                lib/msrpc-client.o 
 
-#              lib/msrpc_use.o
-#              lib/msrpc-agent.o
-
 RPC_PARSE_OBJ = $(RPC_PARSE_OBJ1) $(RPC_PARSE_OBJ2)
 
 RPC_CLIENT_OBJ = \
@@ -440,7 +437,7 @@ NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
             nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o
 
 NMBD_OBJ = $(NMBD_OBJ1) 
-NMBD_LIBS = $(SMBLIB) $(NMBLIB) $(SAMBALIB) $(UBIQXLIB)
+NMBD_LIBS = $(SMBLIB) $(NMBLIB) $(SAMBALIB) $(UBIQXLIB) $(RPC_PARSE_OBJ2)
 
 SWAT_OBJ = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
            web/swat.o libsmb/passchange.o $(LOCKING_OBJ) \
@@ -604,7 +601,7 @@ SMBWRAPPER_OBJ = smbwrapper/smbw.o smbwrapper/wrapped.o \
                smbwrapper/realcalls.o smbwrapper/shared.o
 
 CLIENT_OBJ = client/client.o client/clitar.o
-CLIENT_LIBS = $(SMBLIB) $(NMBLIB) $(SAMBALIB)
+CLIENT_LIBS = $(SMBLIB) $(NMBLIB) $(SAMBALIB) $(RPC_PARSE_OBJ2)
 
 MOUNT_OBJ = client/smbmount.o client/clientutil.o \
               $(RPC_PARSE_OBJ2)
@@ -620,8 +617,6 @@ NMB_AGENT_OBJ = utils/nmb-agent.o \
 
 NMBLOOKUP_OBJ = utils/nmblookup.o
 
-#$(RPC_PARSE_OBJ2)
-
 DEBUG2HTML_OBJ = utils/debug2html.o 
 
 SMB_AGENT_OBJ = utils/smb-agent.o  \
@@ -633,8 +628,7 @@ SMBTORTURE_OBJ = utils/torture.o
 
 SMBFILTER_OBJ = utils/smbfilter.o \
                  rpc_parse/parse_creds.o \
-                rpc_parse/parse_ntlmssp.o rpc_parse/parse_prs.o \
-                rpc_parse/parse_misc.o
+                rpc_parse/parse_ntlmssp.o rpc_parse/parse_prs.o
 
 PROTO_OBJ =  $(LIB_OBJ) $(LIBNMB_OBJ) $(PARAM_OBJ) \
                $(MSRPCD_OBJ) $(SVCCTLD_OBJ1) $(WINREGD_OBJ1) \
index 00aaab0fbd37feb2d9b1bc8ebb6bac671b1d8efa..529c71b269879752b7e9f39578cc30ceee2edf2c 100644 (file)
@@ -85,7 +85,7 @@ static BOOL api_netsec_create_pdu(rpcsrv_struct * l, uint32 data_start,
 
        hdr_resp.alloc_hint = data_end - data_start;    /* calculate remaining data to be sent */
        hdr_resp.cancel_count = 0x0;
-       hdr_resp.context_id = 0x0;
+       hdr_resp.context_id = l->hdr_req.context_id;
        hdr_resp.reserved = 0x0;
 
        DEBUG(10, ("alloc_hint: %d\n", hdr_resp.alloc_hint));
index e998a0874add29dcfef4f3fc466b9ab6142a7c54..d9629ae99b798f47b715fc326a3a6fdb179ed2ef 100644 (file)
@@ -69,7 +69,7 @@ static BOOL api_noauth_create_pdu(rpcsrv_struct * l, uint32 data_start,
 
        hdr_resp.alloc_hint = data_end - data_start;    /* calculate remaining data to be sent */
        hdr_resp.cancel_count = 0x0;
-       hdr_resp.context_id = 0x0;
+       hdr_resp.context_id = l->hdr_req.context_id;
        hdr_resp.reserved = 0x0;
 
        DEBUG(10, ("alloc_hint: %d\n", hdr_resp.alloc_hint));
@@ -156,8 +156,17 @@ static BOOL api_noauth_auth_gen(rpcsrv_struct * l, prs_struct * resp,
 
 static BOOL api_noauth_auth_chk(rpcsrv_struct * l, enum RPC_PKT_TYPE pkt_type)
 {
+       extern uint16 ctx_id_table[65536];
+       const vuser_key *key = get_sec_ctx();
        l->auth_validated = True;
 
+       if (key == NULL)
+       {
+               return False;
+       }
+
+       ctx_id_table[l->hdr_rb.context_id] = key->vuid;
+
        return True;
 }
 
index a93c1d174c1bc083db3f7c88d2df77018bf23c1c..0daa7bc2314228991321ca27a9309fe1563908e5 100644 (file)
@@ -113,7 +113,7 @@ static BOOL api_ntlmssp_create_pdu(rpcsrv_struct * l, uint32 data_start,
 
        hdr_resp.alloc_hint = data_end - data_start;    /* calculate remaining data to be sent */
        hdr_resp.cancel_count = 0x0;
-       hdr_resp.context_id = 0x0;
+       hdr_resp.context_id = l->hdr_req.context_id;
        hdr_resp.reserved = 0x0;
 
        DEBUG(10, ("alloc_hint: %d\n", hdr_resp.alloc_hint));
index a9165e6f6a8d1d93c2190d573d6a714757ee6d3f..8eb9f9fc88996fdae94dd200e33a3727fa839ff0 100644 (file)
@@ -28,6 +28,8 @@
 
 extern int DEBUGLEVEL;
 
+uint16 ctx_id_table[65536];
+
 /*******************************************************************
 turns a DCE/RPC response stream into a DCE/RPC reply
 ********************************************************************/
@@ -250,7 +252,7 @@ static BOOL srv_pipe_bind_and_alt_req(rpcsrv_struct * l,
        BOOL ret;
 
        prs_struct rhdr;
-       uint32 assoc_gid = l->key.pid;
+       uint32 assoc_gid;
 
        l->auth = NULL;
 
@@ -308,7 +310,7 @@ static BOOL srv_pipe_bind_and_alt_req(rpcsrv_struct * l,
 
        if (assoc_gid == 0)
        {
-               assoc_gid = 0x1;
+               assoc_gid = getpid();
        }
 
        if (l->auth != NULL)
@@ -581,11 +583,7 @@ static BOOL rpc_redir_local(rpcsrv_struct * l, prs_struct * req,
                                                           &l->data_i, 0);
                                if (reply)
                                {
-                                       if (l->hdr_req.context_id != 0)
-                                       {
-                                               key.vuid =
-                                                       l->hdr_req.context_id;
-                                       }
+                                       key.vuid = ctx_id_table[l->hdr_req.context_id];
                                        reply = become_vuser(&key) ||
                                                become_guest();
 
index beec1f5cad71faf1109d332b0ebac1d0c29c9810..934133f3056382e9b1bfa561c34a0995a2220c8b 100644 (file)
@@ -334,7 +334,7 @@ uint32 _samr_create_dom_alias(const POLICY_HND *domain_pol,
        TDB_CONTEXT *dom_tdb = NULL;
        TDB_CONTEXT *tdb_grp = NULL;
 
-       bzero(alias_pol, POL_HND_SIZE);
+       ZERO_STRUCTP(alias_pol);
 
        /* find the policy handle.  open a policy on it. */
        if (find_policy_by_hnd(get_global_hnd_cache(), domain_pol) == -1)
index 128f6fe39d3bb3723e0af1fb75e33ef2e475c82a..4dae346929a18a6a3906c88122f699d208191c7c 100644 (file)
@@ -84,12 +84,6 @@ uint32 _svc_close(POLICY_HND *pol)
                return NT_STATUS_OBJECT_NAME_INVALID;
        }
 
-       /* strikerXXXX Luke, is this line below needed, or does close_policy_hnd()
-       * take care of this? */
-
-       /* set up the REG unknown_1 response */
-       bzero(pol->data, POL_HND_SIZE);
-
        return NT_STATUS_NOPROBLEMO;
 }