diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-08-18 04:17:38 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-08-18 04:17:38 +0000 |
commit | df490a7085f382fbf4867fe9811af2653af91c17 (patch) | |
tree | a92c1601d9398fedcf8cdde8585a1acdfbb17e74 /file.h | |
parent | bc3c8c0641c3422133de1444fd214d223fb2ee80 (diff) | |
download | wireshark-df490a7085f382fbf4867fe9811af2653af91c17.tar.gz wireshark-df490a7085f382fbf4867fe9811af2653af91c17.tar.bz2 wireshark-df490a7085f382fbf4867fe9811af2653af91c17.zip |
Add to Wiretap the ability to write capture files; for now, it can only
write them in "libpcap" format, but the mechanism can have other formats
added.
When creating the temporary file for a capture, use "create_tempfile()",
to close a security hole opened by the fact that "tempnam()" creates a
temporary file, but doesn't open it, and we open the file with the name
it gives us - somebody could remove the file and plant a link to some
file, and, if as may well be the case when Ethereal is capturing
packets, it's running as "root", that means we write a capture on top of
that file.... (The aforementioned changes to Wiretap let you open a
capture file for writing given an file descriptor, "fdopen()"-style,
which this change requires.)
svn path=/trunk/; revision=509
Diffstat (limited to 'file.h')
-rw-r--r-- | file.h | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,7 +1,7 @@ /* file.h * Definitions for file structures and routines * - * $Id: file.h,v 1.36 1999/08/15 19:18:46 guy Exp $ + * $Id: file.h,v 1.37 1999/08/18 04:17:28 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -55,7 +55,7 @@ typedef struct _capture_file { gchar *filename; /* filename */ long f_len; /* File length */ guint16 cd_t; /* Capture data type */ - const gchar *cd_t_desc;/* Description of that data type */ + const gchar *cd_t_desc; /* Description of that data type */ guint32 vers; /* Version. For tcpdump minor is appended to major */ guint32 count; /* Packet count */ gfloat unfiltered_count; /* used for dfilter progress bar */ @@ -65,6 +65,7 @@ typedef struct _capture_file { guint32 snap; /* Captured packet length */ gchar *iface; /* Interface */ gchar *save_file; /* File that user saved capture to */ + int save_file_fd; /* File descriptor for saved file */ gint user_saved;/* Was capture file saved by user yet? */ wtap *wth; /* Wiretap session */ dfilter *rfcode; /* Compiled read filter program */ @@ -114,6 +115,3 @@ char *file_read_error_message(int); char *file_write_error_message(int); #endif /* file.h */ - - - |