aboutsummaryrefslogtreecommitdiffstats
path: root/epan/filesystem.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-19When reporting "sorry, *this* packet can't be written to a file of thatGuy Harris1-4/+0
type" when writing out a capture file (i.e., writing a per-packet-encapsulation capture to a file type that supports it but doesn't support one of the packet's encapsulations), report the packet number and, when doing this in a merge operation, report the file from which it came. When reporting "sorry, that file can't be written to a file of that type, period", show the file type rather than the input file link-layer type that causes the problem. (We could show both. We could be *really* ambitious and iterate through all possible file types and show the ones that will or at least might work....) file_write_error_message() is documented as handling only UNIX-style errnos, and libwireshark should be usable without libwiretap, so leave it up to its callers to handle Wiretap errors such as WTAP_ERR_SHORT_WRITE. Clean up indentation. svn path=/trunk/; revision=39949
2011-10-09Check for NULL pointer in file_exists().Stig Bjørlykke1-0/+4
svn path=/trunk/; revision=39318
2011-09-21Fix ex "modeline" so it works;Bill Meier1-1194/+1194
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748 Convert '4 space tabs' to spaces; svn path=/trunk/; revision=39078
2011-09-01If we're running from the build directory, check the WIRESHARK_SRC_DIRGuy Harris1-1/+25
environment variable, and, if it's set, use it rather than the build directory as the data file directory. This is to handle out-of-source-tree builds. svn path=/trunk/; revision=38832
2011-07-11More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versionsGerald Combs1-15/+0
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and reassemble_cleanup() since they were only used for older GLib versions which didn't support GSlices. Assume we always support the "matches" operator. svn path=/trunk/; revision=37978
2011-06-28Replace all strerror() with g_strerror().Stig Bjørlykke1-4/+4
Remove our local strerror implementation. Mark strerror as locale unsafe API. This fixes bug 5715. svn path=/trunk/; revision=37812
2011-04-10Rename ws_stat to ws_stat64, and make it take a pointer to a ws_statb64Guy Harris1-17/+17
as an argument, along the lines of ws_fstat64, and, on Windows, make it use _wstati64, to handle 64-bit file sizes. svn path=/trunk/; revision=36547
2011-03-29Don't put a 65536 byte variable on the stack: instead, malloc/free it.Jeff Morriss1-15/+19
Coverity 760-761. svn path=/trunk/; revision=36404
2011-03-23Fixed second parameter to create_persconffile_profile.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=36291
2011-03-23Ensure we create the "Default" personal configuration files directory beforeStig Bjørlykke1-0/+7
creating a new profile. This fixes a bug when trying to create a new profile from a newly installed wireshark with no saved preferences. svn path=/trunk/; revision=36290
2011-02-26Added functionality for handling global profiles.Stig Bjørlykke1-6/+67
Global profiles can be installed in a "profiles" directory in the Global configuration directory, and a global profile will be copied to the users profiles on first time usage. svn path=/trunk/; revision=36077
2011-01-30Fix various instances of "unreachable code".Bill Meier1-1/+1
svn path=/trunk/; revision=35713
2010-12-07Move getenv_utf8() to wsutil.Jeff Morriss1-36/+0
svn path=/trunk/; revision=35148
2010-11-22Use g_path_get_dirname in init_progfile_dir on Windows. Leave theGerald Combs1-29/+6
non-Windows code alone since it needs to check for a libtool-ized path. svn path=/trunk/; revision=35012
2010-10-01Add a new right-click popup menu for the statusbar profiles for easy functionsStig Bjørlykke1-0/+6
to create new, copy, delete and rename configuration profiles. svn path=/trunk/; revision=34312
2010-08-25Add ws_load_library and ws_module_open, which respectively callGerald Combs1-1/+1
LoadLibrary and g_module_open only for the program directory and system directory on Windows. Use them to replace a bunch of LoadLibrary and g_module_open calls. Use the extension ".dll" for all the DLLs that we load. Add comments about DLL loading in Python. svn path=/trunk/; revision=33924
2010-08-10From Cal Turney:Anders Broman1-1/+1
Remember folder of capture selected from Welcome screen file dialog. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5038 svn path=/trunk/; revision=33758
2010-06-16Handle WTAP_ERR_SHORT_WRITE in file_write_error_message().Guy Harris1-0/+4
In eo_save_entry(), don't assume you can write the entire object in a single write call - if the object is big enough (which would require a 64-bit address space), and you're not lucky enough to be running on UN*X (which means LP64, so size_t and ssize_t are big enough for the entire object), you can't. svn path=/trunk/; revision=33231
2010-03-02Squelch some compiler warnings, clean up indentation, clean up aGuy Harris1-22/+24
comment. svn path=/trunk/; revision=32076
2009-12-21Small rewrite for glib < 2.14 to make it work more than once.Stig Bjørlykke1-6/+7
svn path=/trunk/; revision=31340
2009-12-21Make copy_persconffile_profile work with glib < 2.14.Stig Bjørlykke1-2/+18
svn path=/trunk/; revision=31339
2009-12-21Added Copy Profile functionality.Stig Bjørlykke1-0/+52
svn path=/trunk/; revision=31335
2009-10-23Load lua scripts in the plugins directory, both global and personal.Stig Bjørlykke1-3/+13
List loaded lua scripts in Help->About->Plugins. svn path=/trunk/; revision=30675
2009-10-05GetModuleFileName expects the size of the passed buffer to be expressed in ↵Kovarththanan Rajaratnam1-1/+1
TCHAR. We currently pass the size expressed in bytes. In other words, we incorrectly state that the buffer is twice as big as it really is. svn path=/trunk/; revision=30344
2009-06-01Fixed a typo in a comment.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=28566
2009-05-29python binding for wireshark (first commit)Sebastien Tandel1-0/+96
* ability to write dissectors with python for wireshark. documentation (http://wiki.wireshark.org/Python) svn path=/trunk/; revision=28529
2009-03-22Sigh.Guy Harris1-14/+18
dladdr() in GNU libc isn't available (<dlfcn.h> doesn't define Dl_info) unless _GNU_SOURCE is defined. In addition, it's not guaranteed to return anything more useful than argv[0]; just in case that changes at some point in the future, however, we still use it, we just run it through the same machinery that we run argv[0] through. (On Mac OS X, for example, the path of the executable is handed to the run-time linker by the kernel, so it *is* useful there.) svn path=/trunk/; revision=27821
2009-03-22Change the signature of init_progfile_dir() so the casting of theGuy Harris1-2/+2
function pointer (to main) to an argument to dladdr() is done in init_progfile_dir() rather than its callers. svn path=/trunk/; revision=27814
2009-03-22In Solaris, the second argument to dladdr() is just a void *, not aGuy Harris1-1/+1
const void *. svn path=/trunk/; revision=27813
2009-03-22Attempt to use dladdr() to get the pathname of the executable image ifGuy Harris1-2/+29
it's available and works. svn path=/trunk/; revision=27812
2009-03-13From Jakub Zawadzki (bug 3331):Stig Bjørlykke1-10/+3
g_free() is NULL safe, so we don't need check against it. svn path=/trunk/; revision=27718
2009-02-15Add a routine to report write errors to the list of failure-reportingGuy Harris1-1/+73
routines handled by epan/report_err.c. Move copy_binary_file() in file.c to epan/filesystem.c, and rename it to copy_file_binary_mode() (to clarify that it *can* copy text files; arguably, *all* files are "binary" unless you're on, say, an IBM 1401 :-)). Have it use the report_err.c routines, so it works in console-mode programs. Clean up some comments while we're at it. svn path=/trunk/; revision=27456
2009-01-20Fix some indentationBill Meier1-10/+10
svn path=/trunk/; revision=27280
2008-12-20Umm, no. g_strdup() != g_strdup_printf(); the first argument to theGuy Harris1-1/+1
*former* should always be a format string, but the *only* argument to the latter is a string to duplicate. svn path=/trunk/; revision=27066
2008-12-20From babi: Fix three overflows (bugs 3150 and 3151).Gerald Combs1-1/+1
From me: Use a #define for the RTP analysis field name lengths. svn path=/trunk/; revision=27064
2008-10-31Fix some "format not a string literal and no format arguments" warnings.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=26649
2008-10-27ETH -> WS updates.Gerald Combs1-2/+2
svn path=/trunk/; revision=26570
2008-09-02Fix a few Emacs "file variables" to have "safe" values.Bill Meier1-1/+1
That is: indent-tabs-mode: tabs --> indent-tabs-mode: t Also: fix a typo: set-tabs-mode --> indent-tabs-mode svn path=/trunk/; revision=26113
2008-06-30Move privileges.c and unicode-utils.c from epan to wsutil (so things likeJeff Morriss1-2/+2
capinfos and dumpcap don't need to depend on libwireshark nor directly pull in those modules). Because capinfos and editcap were only being linked with privileges.c if we had plugins, this allows those programs to be linked when someone is compiling --without-plugins. svn path=/trunk/; revision=25640
2008-06-23Rename an argument to avoid collisions with a global variable name, asGuy Harris1-5/+5
noted by John Smith. Fix indentation. svn path=/trunk/; revision=25547
2008-05-22Move the file utility functions from wiretap to libwsutil so thatJeff Morriss1-24/+24
libwireshark (and the plugins using those functions) do not depend on wiretap on Windows. While doing that, rename the eth_* functions to ws_*. svn path=/trunk/; revision=25354
2008-04-07- Remove GLIB1 codeStephen Fisher1-1/+1
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION - Remove ws_strsplit files because we no longer need to borrow GLIB2's g_strsplit code for the no longer supported GLIB1 builds svn path=/trunk/; revision=24829
2008-03-15Check in the OS X packaging patch from bug 2341, since I've hadGerald Combs1-136/+165
confirmation that the OS X package works on at least one system other than my laptop. svn path=/trunk/; revision=24640
2008-02-26get_datafile_path() and get_persconffile_path() return malloc'd memory. ↵Jeff Morriss1-3/+9
Note that in the comments. svn path=/trunk/; revision=24476
2008-02-03Ups, fix a typo from last checkin.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=24259
2008-02-03More rewrite of prohibited APIs (sprintf, strcpy, strcat).Stig Bjørlykke1-13/+5
svn path=/trunk/; revision=24258
2008-01-27Do not change profile if directory creation failed, and change to defaultStig Bjørlykke1-5/+8
profile if existing profile was deleted. svn path=/trunk/; revision=24208
2008-01-24Always return a valid profile name from get_profile_name().Stig Bjørlykke1-3/+7
svn path=/trunk/; revision=24175
2008-01-15Include dirent.h if we have it (to fix glib-1 compile: it needed DIR).Jeff Morriss1-11/+15
svn path=/trunk/; revision=24100
2008-01-14This patch adds support for configuration profiles, which can be used toStig Bjørlykke1-7/+169
configure and use more than one set of preferences and configuration files. This can be found in the "Configuration Profiles..." menu item from the Edit menu, or by pressing Shift-Ctrl-A. It's also possible to start wireshark and tshark with a named profile by using the "-C ProfileName" option. A new status pane in the main window will show the current profile. The configuration files currently stored in the Profiles are: - Preferences - Capture Filters - Display Filters - Coloring Rules - Disabled Protocols - User Accessible Tables The recent data are by design not added to the profile. Planned future enhancements: - make a more convenient function to switch between profiles - add a "clone profile" button to copy an existing profile - make the profiles list active and accept return as OK - save users "Decode as" in the profile - make new, clone and deletion of profiles more secure - make some of the recent values available in the profile This patch also fixes: - setting default status pane sizes - a bug setting status pane for packets when not having main lower pane. svn path=/trunk/; revision=24089