summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-11-02 00:26:04 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-11-02 00:26:04 +0100
commitdccf1b2c9f1b17f6ad12da11626110fcd86cd07e (patch)
tree5719ec2ff8af0e5d1d6b5a6dffa8b38cbe46c459 /source4/librpc
parentd9cbf2b0d9fdd1373ea0a0d021df3230637e21ac (diff)
downloadsamba-dccf1b2c9f1b17f6ad12da11626110fcd86cd07e.tar.gz
samba-dccf1b2c9f1b17f6ad12da11626110fcd86cd07e.tar.bz2
samba-dccf1b2c9f1b17f6ad12da11626110fcd86cd07e.zip
Remove another use of global_loadparm.
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc.c8
-rw-r--r--source4/librpc/rpc/dcerpc.h14
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c3
-rw-r--r--source4/librpc/rpc/dcerpc_secondary.c3
-rw-r--r--source4/librpc/rpc/dcerpc_util.c7
5 files changed, 24 insertions, 11 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index bd8e60d4bd..042745d74d 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -1457,8 +1457,9 @@ _PUBLIC_ NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req)
ndr_err = call->ndr_pull(pull, NDR_OUT, r);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
status = ndr_map_error2ntstatus(ndr_err);
- dcerpc_log_packet(table, opnum, NDR_OUT,
- &response);
+ dcerpc_log_packet(p->conn->packet_log_dir,
+ table, opnum, NDR_OUT,
+ &response);
return status;
}
@@ -1467,7 +1468,8 @@ _PUBLIC_ NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req)
call->ndr_push, call->ndr_pull,
call->ndr_print);
if (!NT_STATUS_IS_OK(status)) {
- dcerpc_log_packet(table, opnum, NDR_OUT,
+ dcerpc_log_packet(p->conn->packet_log_dir,
+ table, opnum, NDR_OUT,
&response);
return status;
}
diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h
index cc8d3d1429..2f0a34d88d 100644
--- a/source4/librpc/rpc/dcerpc.h
+++ b/source4/librpc/rpc/dcerpc.h
@@ -61,6 +61,9 @@ struct dcerpc_connection {
struct event_context *event_ctx;
struct smb_iconv_convenience *iconv_convenience;
+ /** Directory in which to save ndrdump-parseable files */
+ const char *packet_log_dir;
+
bool dead;
bool free_skipped;
@@ -109,10 +112,10 @@ struct dcerpc_pipe {
struct dcerpc_connection *conn;
struct dcerpc_binding *binding;
- /* the last fault code from a DCERPC fault */
+ /** the last fault code from a DCERPC fault */
uint32_t last_fault_code;
- /* timeout for individual rpc requests, in seconds */
+ /** timeout for individual rpc requests, in seconds */
uint32_t request_timeout;
};
@@ -345,9 +348,10 @@ NTSTATUS dcerpc_secondary_auth_connection_recv(struct composite_context *c,
struct composite_context* dcerpc_secondary_connection_send(struct dcerpc_pipe *p,
struct dcerpc_binding *b);
-void dcerpc_log_packet(const struct ndr_interface_table *ndr,
- uint32_t opnum, uint32_t flags,
- DATA_BLOB *pkt);
+void dcerpc_log_packet(const char *lockdir,
+ const struct ndr_interface_table *ndr,
+ uint32_t opnum, uint32_t flags,
+ DATA_BLOB *pkt);
NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding, struct epm_tower *tower);
NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax);
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 0ec17295cb..cdfbb31c4a 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -744,6 +744,9 @@ _PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent
s->pipe = dcerpc_pipe_init(c, ev, lp_iconv_convenience(lp_ctx));
if (composite_nomem(s->pipe, c)) return c;
+ if (DEBUGLEVEL >= 10)
+ s->pipe->conn->packet_log_dir = lp_lockdir(lp_ctx);
+
/* store parameters in state structure */
s->binding = binding;
s->table = table;
diff --git a/source4/librpc/rpc/dcerpc_secondary.c b/source4/librpc/rpc/dcerpc_secondary.c
index b4d5d05b61..8ac235c67c 100644
--- a/source4/librpc/rpc/dcerpc_secondary.c
+++ b/source4/librpc/rpc/dcerpc_secondary.c
@@ -75,6 +75,9 @@ _PUBLIC_ struct composite_context* dcerpc_secondary_connection_send(struct dcerp
s->pipe2 = dcerpc_pipe_init(c, s->pipe->conn->event_ctx, s->pipe->conn->iconv_convenience);
if (composite_nomem(s->pipe2, c)) return c;
+ if (DEBUGLEVEL >= 10)
+ s->pipe2->conn->packet_log_dir = s->pipe->conn->packet_log_dir;
+
/* open second dcerpc pipe using the same transport as for primary pipe */
switch (s->pipe->conn->transport.transport) {
case NCACN_NP:
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 32646e85b0..ca6a785834 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -671,19 +671,20 @@ _PUBLIC_ NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
this triggers on a debug level of >= 10
*/
-_PUBLIC_ void dcerpc_log_packet(const struct ndr_interface_table *ndr,
+_PUBLIC_ void dcerpc_log_packet(const char *lockdir,
+ const struct ndr_interface_table *ndr,
uint32_t opnum, uint32_t flags,
DATA_BLOB *pkt)
{
const int num_examples = 20;
int i;
- if (DEBUGLEVEL < 10) return;
+ if (lockdir == NULL) return;
for (i=0;i<num_examples;i++) {
char *name=NULL;
asprintf(&name, "%s/rpclog/%s-%u.%d.%s",
- lp_lockdir(global_loadparm), ndr->name, opnum, i,
+ lockdir, ndr->name, opnum, i,
(flags&NDR_IN)?"in":"out");
if (name == NULL) {
return;