diff --git a/AUTHORS b/AUTHORS index 83c8eb86e2..9b91ca929f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -276,6 +276,11 @@ Doug Nazar { LDAP support } +Andreas Sikkema { + Fixes to SMB dissector + Fixes to capture file handling on Win32 +} + Alain Magloire was kind enough to give his permission to use his version of snprintf.c. diff --git a/doc/ethereal.pod.template b/doc/ethereal.pod.template index d90722d46c..917809544e 100644 --- a/doc/ethereal.pod.template +++ b/doc/ethereal.pod.template @@ -837,6 +837,7 @@ B. Jochen Friedrich Paul Welchinski Doug Nazar + Andreas Sikkema Alain Magloire was kind enough to give his permission to use his version of snprintf.c. diff --git a/file.c b/file.c index 00ddc6d8df..32dbcb62cc 100644 --- a/file.c +++ b/file.c @@ -1,7 +1,7 @@ /* file.c * File I/O routines * - * $Id: file.c,v 1.172 2000/03/26 07:03:52 sharpe Exp $ + * $Id: file.c,v 1.173 2000/03/28 08:11:43 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1410,6 +1410,7 @@ save_cap_file(char *fname, capture_file *cf, gboolean save_filtered, /* The file being saved is a temporary file from a live capture, so it doesn't need to stay around under that name; first, try renaming the capture buffer file to the new name. */ +#ifndef WIN32 if (rename(cf->filename, fname) == 0) { /* That succeeded - there's no need to copy the source file. */ from_filename = NULL; @@ -1434,13 +1435,16 @@ save_cap_file(char *fname, capture_file *cf, gboolean save_filtered, goto done; } } +#else + do_copy = TRUE; + from_filename = cf->filename; +#endif } else { /* It's a permanent file, so we should copy it, and not remove the original. */ do_copy = TRUE; from_filename = cf->filename; } - /* Copy the file, if we haven't moved it. */ if (do_copy) { /* Copy the raw bytes of the file. */ @@ -1452,7 +1456,12 @@ save_cap_file(char *fname, capture_file *cf, gboolean save_filtered, goto done; } - to_fd = creat(fname, 0644); + /* Use open() instead of creat() so that we can pass the O_BINARY + flag, which is relevant on Win32; it appears that "creat()" + may open the file in text mode, not binary mode, but we want + to copy the raw bytes of the file, so we need the output file + to be open in binary mode. */ + to_fd = open(fname, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); if (to_fd < 0) { err = errno; simple_dialog(ESD_TYPE_WARN, NULL,