svn commit: lorikeet r247 - in trunk/ethereal/ndrdump: .
tpot at samba.org
tpot at samba.org
Wed Mar 16 06:30:53 GMT 2005
Author: tpot
Date: 2005-03-16 06:30:52 +0000 (Wed, 16 Mar 2005)
New Revision: 247
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=247
Log:
Call ndrdump with uuid of rpc packet instead of hardcoding it to "samr".
Ignore the SIGPIPE signal to avoid crashing ethereal when the ndrdump
ethereal is not found.
Modified:
trunk/ethereal/ndrdump/ndrdump.c
Changeset:
Modified: trunk/ethereal/ndrdump/ndrdump.c
===================================================================
--- trunk/ethereal/ndrdump/ndrdump.c 2005-03-13 02:57:35 UTC (rev 246)
+++ trunk/ethereal/ndrdump/ndrdump.c 2005-03-16 06:30:52 UTC (rev 247)
@@ -59,7 +59,15 @@
int read_pipe[2], write_pipe[2];
pid_t child_pid;
int status;
+ char uuid[37];
+ sprintf(uuid, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ dcv->uuid.Data1, dcv->uuid.Data2, dcv->uuid.Data3,
+ dcv->uuid.Data4[0], dcv->uuid.Data4[1],
+ dcv->uuid.Data4[2], dcv->uuid.Data4[3],
+ dcv->uuid.Data4[4], dcv->uuid.Data4[5],
+ dcv->uuid.Data4[6], dcv->uuid.Data4[7]);
+
/* Create pipe to ndrdump */
if (pipe(read_pipe) == -1 || pipe(write_pipe) == -1) {
@@ -88,7 +96,7 @@
char *opnum;
asprintf(&opnum, "%d", dcv->opnum);
- execlp("ndrdump", "ndrdump", "samr", opnum,
+ execlp("ndrdump", "ndrdump", uuid, opnum,
(di->ptype == PDU_REQ) ? "in" : "out", NULL);
exit(1);
}
@@ -169,4 +177,12 @@
proto_register_subtree_array(ett, array_length(ett));
proto_register_field_array(proto_dcerpc_samr, hf, array_length(hf));
+
+ /* TODO: ethereal doesn't do anything with SIGPIPE at the
+ moment but it's probably a bad idea to ignore this signal
+ for the entire application. Sometimes (e.g if ndrdump executable
+ not found in path) the read() call from the ndrdump pipe
+ raises a SIGPIPE. */
+
+ signal(SIGPIPE, SIG_IGN);
}
More information about the samba-cvs
mailing list