tcpdump mailing list archives

Broken behavior in savefile.c


From: Joshua Blanton <jblanton () masaka cs ohiou edu>
Date: Mon, 27 Sep 2004 20:17:58 -0400

Hello,

I am one of the many bug fixers/maintainers of tcptrace (tcptrace.org).
In libpcap/savefile.c, it appears that a bug was introduced in CVS
revision 1.69.  The code was patched to close file handles if the file
isn't really in the libpcap format - however, it also closes stdin
(which was opened by the calling program).  This seems like incorrect
behavior to me, and in fact causes tcptrace to be unable to test for any
other file formats after pcap_open_offline() is called (which we call to
check and see if a file is in libpcap format).

Attached is a patch that should fix this behavior; unfortunately, there
are enough buggy implementations around that we will have to work around
this issue...  I'm not sure that this patch is necessarily the Right Way
to solve this problem - I just copied and pasted the test that you used
to check for stdin...  One could also check to see if the file handle is
stdin.

--jtb

-- 
Those who beat their swords into plowshares usually end up plowing for
those who didn't.
        -- Ben Franklin

Attachment: libpcap_savefile.patch
Description:

Attachment: _bin
Description:


Current thread: