diff options
author | Volker Lendecke <vl@samba.org> | 2009-11-08 19:37:53 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-11-08 19:43:47 +0100 |
commit | 27847e8386a005b4369d99cad62215a113a0a0f9 (patch) | |
tree | fa94d2690f3b5f334f823ec266bb6aa1023b324d /source3 | |
parent | 47455b4d1adf2e01f0994005a6302ae32c012478 (diff) | |
download | samba-27847e8386a005b4369d99cad62215a113a0a0f9.tar.gz samba-27847e8386a005b4369d99cad62215a113a0a0f9.tar.bz2 samba-27847e8386a005b4369d99cad62215a113a0a0f9.zip |
Revert "s3: Consolidate getting the name out of a pipes_struct"
This reverts commit 9621306351cdb469ef393a6d8cbeea456bc4bd9f.
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_hnd.c | 5 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe.c | 44 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 49 |
4 files changed, 60 insertions, 39 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 3d62e505b3..a0355732e7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5836,7 +5836,6 @@ bool api_pipe_request(pipes_struct *p); pipes_struct *get_first_internal_pipe(void); pipes_struct *get_next_internal_pipe(pipes_struct *p); -const char *get_pipe_name_tos(struct pipes_struct *p); bool fsp_is_np(struct files_struct *fsp); NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c index 4233b6f0e6..695164679f 100644 --- a/source3/rpc_server/srv_lsa_hnd.c +++ b/source3/rpc_server/srv_lsa_hnd.c @@ -286,7 +286,8 @@ void close_policy_by_pipe(pipes_struct *p) SAFE_FREE(p->pipe_handles); DEBUG(10,("close_policy_by_pipe: deleted handle list for " - "pipe %s\n", get_pipe_name_tos(p))); + "pipe %s\n", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); } } @@ -328,7 +329,7 @@ void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd, if (p->pipe_handles->count > MAX_OPEN_POLS) { DEBUG(0, ("policy_handle_create: ERROR: too many handles (%d) " "on pipe %s.\n", (int)p->pipe_handles->count, - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); *pstatus = NT_STATUS_INSUFFICIENT_RESOURCES; return NULL; } diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 17cc13edf5..90eb4f96c3 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -647,7 +647,7 @@ static bool pipe_ntlmssp_verify_final(pipes_struct *p, DATA_BLOB *p_resp_blob) bool ret; DEBUG(5,("pipe_ntlmssp_verify_final: pipe %s checking user details\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); ZERO_STRUCT(reply); @@ -671,7 +671,8 @@ static bool pipe_ntlmssp_verify_final(pipes_struct *p, DATA_BLOB *p_resp_blob) if (!(a->ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_SIGN)) { DEBUG(0,("pipe_ntlmssp_verify_final: pipe %s : packet integrity requested " "but client declined signing.\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); return False; } } @@ -679,7 +680,8 @@ static bool pipe_ntlmssp_verify_final(pipes_struct *p, DATA_BLOB *p_resp_blob) if (!(a->ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_SEAL)) { DEBUG(0,("pipe_ntlmssp_verify_final: pipe %s : packet privacy requested " "but client declined sealing.\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); return False; } } @@ -994,7 +996,8 @@ static bool check_bind_req(struct pipes_struct *p, int i=0; struct pipe_rpc_fns *context_fns; - DEBUG(3,("check_bind_req for %s\n", get_pipe_name_tos(p))); + DEBUG(3,("check_bind_req for %s\n", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); /* we have to check all now since win2k introduced a new UUID on the lsaprpc pipe */ @@ -1606,7 +1609,8 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p) /* No rebinds on a bound pipe - use alter context. */ if (p->pipe_bound) { DEBUG(2,("api_pipe_bind_req: rejecting bind request on bound " - "pipe %s.\n", get_pipe_name_tos(p))); + "pipe %s.\n", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); return setup_bind_nak(p); } @@ -1689,7 +1693,8 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p) for (i = 0; i < rpc_lookup_size; i++) { if (strequal(rpc_lookup[i].pipe.clnt, - get_pipe_name_tos(p))) { + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))) { DEBUG(3, ("api_pipe_bind_req: \\PIPE\\%s -> \\PIPE\\%s\n", rpc_lookup[i].pipe.clnt, rpc_lookup[i].pipe.srv)); break; @@ -1698,8 +1703,11 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p) if (i == rpc_lookup_size) { DEBUG(0, ("module %s doesn't provide functions for " - "pipe %s!\n", get_pipe_name_tos(p), - get_pipe_name_tos(p))); + "pipe %s!\n", + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax), + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); goto err_exit; } } @@ -2356,7 +2364,8 @@ bool api_pipe_request(pipes_struct *p) changed_user = True; } - DEBUG(5, ("Requested \\PIPE\\%s\n", get_pipe_name_tos(p))); + DEBUG(5, ("Requested \\PIPE\\%s\n", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); /* get the set of RPC functions for this context */ @@ -2369,7 +2378,8 @@ bool api_pipe_request(pipes_struct *p) } else { DEBUG(0,("api_pipe_request: No rpc function table associated with context [%d] on pipe [%s]\n", - p->hdr_req.context_id, get_pipe_name_tos(p))); + p->hdr_req.context_id, + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); } if (changed_user) { @@ -2390,12 +2400,14 @@ static bool api_rpcTNP(pipes_struct *p, uint32 offset1, offset2; /* interpret the command */ - DEBUG(4,("api_rpcTNP: %s op 0x%x - ", get_pipe_name_tos(p), + DEBUG(4,("api_rpcTNP: %s op 0x%x - ", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax), p->hdr_req.opnum)); if (DEBUGLEVEL >= 50) { fstring name; - slprintf(name, sizeof(name)-1, "in_%s", get_pipe_name_tos(p)); + slprintf(name, sizeof(name)-1, "in_%s", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax)); prs_dump(name, p->hdr_req.opnum, &p->in_data.data); } @@ -2423,7 +2435,8 @@ static bool api_rpcTNP(pipes_struct *p, fn_num, api_rpc_cmds[fn_num].fn)); /* do the actual command */ if(!api_rpc_cmds[fn_num].fn(p)) { - DEBUG(0,("api_rpcTNP: %s: %s failed.\n", get_pipe_name_tos(p), + DEBUG(0,("api_rpcTNP: %s: %s failed.\n", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax), api_rpc_cmds[fn_num].name)); prs_mem_free(&p->out_data.rdata); return False; @@ -2447,13 +2460,14 @@ static bool api_rpcTNP(pipes_struct *p, prs_set_offset(&p->out_data.rdata, offset1); if (DEBUGLEVEL >= 50) { fstring name; - slprintf(name, sizeof(name)-1, "out_%s", get_pipe_name_tos(p)); + slprintf(name, sizeof(name)-1, "out_%s", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax)); prs_dump(name, p->hdr_req.opnum, &p->out_data.rdata); } prs_set_offset(&p->out_data.rdata, offset2); DEBUG(5,("api_rpcTNP: called %s successfully\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); /* Check for buffer underflow in rpc parsing */ diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index e7d94d70ec..254241c743 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -55,11 +55,6 @@ pipes_struct *get_next_internal_pipe(pipes_struct *p) return p->next; } -const char *get_pipe_name_tos(struct pipes_struct *p) -{ - return get_pipe_name_from_syntax(talloc_tos(), &p->syntax); -} - /**************************************************************************** Initialise an outgoing packet. ****************************************************************************/ @@ -182,7 +177,7 @@ static void set_incoming_fault(pipes_struct *p) p->in_data.pdu_received_len = 0; p->fault_state = True; DEBUG(10, ("set_incoming_fault: Setting fault state on pipe %s\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); } /**************************************************************************** @@ -349,8 +344,10 @@ static void free_pipe_context(pipes_struct *p) "%lu\n", (unsigned long)talloc_total_size(p->mem_ctx) )); talloc_free_children(p->mem_ctx); } else { - p->mem_ctx = talloc_init("pipe %s %p", get_pipe_name_tos(p), - p); + p->mem_ctx = talloc_init( + "pipe %s %p", get_pipe_name_from_syntax(talloc_tos(), + &p->syntax), + p); if (p->mem_ctx == NULL) { p->fault_state = True; } @@ -518,7 +515,7 @@ static void process_complete_pdu(pipes_struct *p) if(p->fault_state) { DEBUG(10,("process_complete_pdu: pipe %s in fault state.\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); set_incoming_fault(p); setup_fault_pdu(p, NT_STATUS(DCERPC_FAULT_OP_RNG_ERROR)); return; @@ -547,12 +544,14 @@ static void process_complete_pdu(pipes_struct *p) case DCERPC_PKT_PING: /* CL request - ignore... */ DEBUG(0,("process_complete_pdu: Error. Connectionless packet type %u received on pipe %s.\n", (unsigned int)p->hdr.pkt_type, - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); break; case DCERPC_PKT_RESPONSE: /* No responses here. */ DEBUG(0,("process_complete_pdu: Error. DCERPC_PKT_RESPONSE received from client on pipe %s.\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); break; case DCERPC_PKT_FAULT: @@ -565,7 +564,8 @@ static void process_complete_pdu(pipes_struct *p) case DCERPC_PKT_CANCEL_ACK: DEBUG(0,("process_complete_pdu: Error. Connectionless packet type %u received on pipe %s.\n", (unsigned int)p->hdr.pkt_type, - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); break; case DCERPC_PKT_BIND: @@ -581,7 +581,8 @@ static void process_complete_pdu(pipes_struct *p) case DCERPC_PKT_BIND_NAK: DEBUG(0,("process_complete_pdu: Error. DCERPC_PKT_BINDACK/DCERPC_PKT_BINDNACK packet type %u received on pipe %s.\n", (unsigned int)p->hdr.pkt_type, - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); break; @@ -596,7 +597,8 @@ static void process_complete_pdu(pipes_struct *p) case DCERPC_PKT_ALTER_RESP: DEBUG(0,("process_complete_pdu: Error. DCERPC_PKT_ALTER_RESP on pipe %s: Should only be server -> client.\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); break; case DCERPC_PKT_AUTH3: @@ -610,7 +612,8 @@ static void process_complete_pdu(pipes_struct *p) case DCERPC_PKT_SHUTDOWN: DEBUG(0,("process_complete_pdu: Error. DCERPC_PKT_SHUTDOWN on pipe %s: Should only be server -> client.\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); break; case DCERPC_PKT_CO_CANCEL: @@ -649,7 +652,8 @@ static void process_complete_pdu(pipes_struct *p) if (!reply) { DEBUG(3,("process_complete_pdu: DCE/RPC fault sent on " - "pipe %s\n", get_pipe_name_tos(p))); + "pipe %s\n", get_pipe_name_from_syntax(talloc_tos(), + &p->syntax))); set_incoming_fault(p); setup_fault_pdu(p, NT_STATUS(DCERPC_FAULT_OP_RNG_ERROR)); prs_mem_free(&rpc_in); @@ -804,7 +808,8 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_ return -1; } - DEBUG(6,(" name: %s len: %u\n", get_pipe_name_tos(p), + DEBUG(6,(" name: %s len: %u\n", + get_pipe_name_from_syntax(talloc_tos(), &p->syntax), (unsigned int)n)); /* @@ -821,7 +826,8 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_ if(n > RPC_MAX_PDU_FRAG_LEN) { DEBUG(5,("read_from_pipe: too large read (%u) requested on " "pipe %s. We can only service %d sized reads.\n", - (unsigned int)n, get_pipe_name_tos(p), + (unsigned int)n, + get_pipe_name_from_syntax(talloc_tos(), &p->syntax), RPC_MAX_PDU_FRAG_LEN )); n = RPC_MAX_PDU_FRAG_LEN; } @@ -842,7 +848,7 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_ DEBUG(10,("read_from_pipe: %s: current_pdu_len = %u, " "current_pdu_sent = %u returning %d bytes.\n", - get_pipe_name_tos(p), + get_pipe_name_from_syntax(talloc_tos(), &p->syntax), (unsigned int)prs_offset(&p->out_data.frag), (unsigned int)p->out_data.current_pdu_sent, (int)data_returned)); @@ -863,7 +869,8 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_ DEBUG(10,("read_from_pipe: %s: fault_state = %d : data_sent_length " "= %u, prs_offset(&p->out_data.rdata) = %u.\n", - get_pipe_name_tos(p), (int)p->fault_state, + get_pipe_name_from_syntax(talloc_tos(), &p->syntax), + (int)p->fault_state, (unsigned int)p->out_data.data_sent_length, (unsigned int)prs_offset(&p->out_data.rdata) )); @@ -884,7 +891,7 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_ if(!create_next_pdu(p)) { DEBUG(0,("read_from_pipe: %s: create_next_pdu failed.\n", - get_pipe_name_tos(p))); + get_pipe_name_from_syntax(talloc_tos(), &p->syntax))); return -1; } |