summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--color_filters.c4
-rw-r--r--disabled_protos.c4
-rw-r--r--epan/addr_resolv.c10
-rw-r--r--epan/dissectors/packet-radius.c2
-rw-r--r--epan/dissectors/packet-xml.c2
-rw-r--r--epan/filesystem.c33
-rw-r--r--epan/filesystem.h9
-rw-r--r--epan/oids.c10
-rw-r--r--epan/prefs.c4
-rw-r--r--epan/uat.c2
-rw-r--r--epan/wslua/init_wslua.c4
-rw-r--r--epan/wslua/wslua_util.c4
-rw-r--r--filters.c6
-rw-r--r--ui/gtk/about_dlg.c2
-rw-r--r--ui/gtk/decode_as_dlg.c4
-rw-r--r--ui/gtk/main.c2
-rw-r--r--ui/qt/main.cpp2
-rw-r--r--ui/recent.c14
-rw-r--r--update.c2
19 files changed, 42 insertions, 78 deletions
diff --git a/color_filters.c b/color_filters.c
index 3ee290b7de..b960be5b38 100644
--- a/color_filters.c
+++ b/color_filters.c
@@ -628,7 +628,7 @@ read_users_filters(GSList **cfl)
gboolean ret;
/* decide what file to open (from dfilter code) */
- path = get_persconffile_path("colorfilters", TRUE, FALSE);
+ path = get_persconffile_path("colorfilters", TRUE);
if ((f = ws_fopen(path, "r")) == NULL) {
if (errno != ENOENT) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
@@ -753,7 +753,7 @@ color_filters_write(GSList *cfl)
return FALSE;
}
- path = get_persconffile_path("colorfilters", TRUE, TRUE);
+ path = get_persconffile_path("colorfilters", TRUE);
if ((f = ws_fopen(path, "w+")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Could not open\n%s\nfor writing: %s.",
diff --git a/disabled_protos.c b/disabled_protos.c
index b85f1ed770..56b2622692 100644
--- a/disabled_protos.c
+++ b/disabled_protos.c
@@ -128,7 +128,7 @@ read_disabled_protos_list(char **gpath_return, int *gopen_errno_return,
}
/* Construct the pathname of the user's disabled protocols file. */
- ff_path = get_persconffile_path(PROTOCOLS_FILE_NAME, TRUE, FALSE);
+ ff_path = get_persconffile_path(PROTOCOLS_FILE_NAME, TRUE);
/* If we already have a list of protocols, discard it. */
discard_existing_list (&disabled_protos);
@@ -336,7 +336,7 @@ save_disabled_protos_list(char **pref_path_return, int *errno_return)
*pref_path_return = NULL; /* assume no error */
- ff_path = get_persconffile_path(PROTOCOLS_FILE_NAME, TRUE, TRUE);
+ ff_path = get_persconffile_path(PROTOCOLS_FILE_NAME, TRUE);
/* Write to "XXX.new", and rename if that succeeds.
That means we don't trash the file if we fail to write it out
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index c75b6f0ea3..f27c73cd85 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -582,7 +582,7 @@ initialize_services(void)
/* set personal services path */
if (g_pservices_path == NULL)
- g_pservices_path = get_persconffile_path(ENAME_SERVICES, FALSE, FALSE);
+ g_pservices_path = get_persconffile_path(ENAME_SERVICES, FALSE);
parse_services_file(g_pservices_path);
@@ -1483,7 +1483,7 @@ initialize_ethers(void)
* with it. It's used in get_ethbyname() and get_ethbyaddr()
*/
if (g_pethers_path == NULL)
- g_pethers_path = get_persconffile_path(ENAME_ETHERS, FALSE, FALSE);
+ g_pethers_path = get_persconffile_path(ENAME_ETHERS, FALSE);
/* manuf hash table initialization */
@@ -1893,7 +1893,7 @@ initialize_ipxnets(void)
* with it. It's used in get_ipxnetbyname() and get_ipxnetbyaddr()
*/
if (g_pipxnets_path == NULL)
- g_pipxnets_path = get_persconffile_path(ENAME_IPXNETS, FALSE, FALSE);
+ g_pipxnets_path = get_persconffile_path(ENAME_IPXNETS, FALSE);
ipxnet_resolution_initialized = TRUE;
} /* initialize_ipxnets */
@@ -2369,7 +2369,7 @@ subnet_name_lookup_init(void)
subnet_length_entries[i].mask = get_subnet_mask(length);
}
- subnetspath = get_persconffile_path(ENAME_SUBNETS, FALSE, FALSE);
+ subnetspath = get_persconffile_path(ENAME_SUBNETS, FALSE);
if (!read_subnets_file(subnetspath) && errno != ENOENT) {
report_open_failure(subnetspath, errno, FALSE);
}
@@ -2473,7 +2473,7 @@ host_name_lookup_init(void) {
* Load the user's hosts file, if they have one.
*/
if(!gbl_resolv_flags.load_hosts_file_from_profile_only){
- hostspath = get_persconffile_path(ENAME_HOSTS, TRUE, FALSE);
+ hostspath = get_persconffile_path(ENAME_HOSTS, TRUE);
if (!read_hosts_file(hostspath) && errno != ENOENT) {
report_open_failure(hostspath, errno, FALSE);
}
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index 7e3502a279..d62601dcf7 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -1996,7 +1996,7 @@ static void register_radius_fields(const char* unused _U_) {
g_array_append_vals(ri.hf, base_hf, array_length(base_hf));
g_array_append_vals(ri.ett, base_ett, array_length(base_ett));
- dir = get_persconffile_path("radius", FALSE, FALSE);
+ dir = get_persconffile_path("radius", FALSE);
if (test_for_directory(dir) != EISDIR) {
/* Although dir isn't a directory it may still use memory */
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index 0a1ef30a52..313ccb5340 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -1283,7 +1283,7 @@ static void init_xml_names(void)
xmlpi_xml_ns->elements = NULL;
- dirname = get_persconffile_path("dtds", FALSE, FALSE);
+ dirname = get_persconffile_path("dtds", FALSE);
if (test_for_directory(dirname) != EISDIR) {
/* Although dir isn't a directory it may still use memory */
diff --git a/epan/filesystem.c b/epan/filesystem.c
index afd1b06003..b68b4f4bc8 100644
--- a/epan/filesystem.c
+++ b/epan/filesystem.c
@@ -1462,17 +1462,9 @@ get_home_dir(void)
* caller is done with it.
*/
char *
-get_persconffile_path(const char *filename, gboolean from_profile, gboolean for_writing
-#ifndef _WIN32
- _U_
-#endif
-)
+get_persconffile_path(const char *filename, gboolean from_profile)
{
char *path;
-#ifdef _WIN32
- ws_statb64 s_buf;
- char *old_path;
-#endif
if (do_store_persconffiles && from_profile && !g_hash_table_lookup (profile_files, filename)) {
/* Store filenames so we know which filenames belongs to a configuration profile */
g_hash_table_insert (profile_files, g_strdup(filename), g_strdup(filename));
@@ -1485,27 +1477,6 @@ get_persconffile_path(const char *filename, gboolean from_profile, gboolean for_
path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s",
get_persconffile_dir(NULL), filename);
}
-#ifdef _WIN32
- if (!for_writing) {
- if (ws_stat64(path, &s_buf) != 0 && errno == ENOENT) {
- /*
- * OK, it's not in the personal configuration file
- * directory; is it in the ".wireshark" subdirectory
- * of their home directory?
- */
- old_path = g_strdup_printf(
- "%s" G_DIR_SEPARATOR_S ".wireshark" G_DIR_SEPARATOR_S "%s",
- get_home_dir(), filename);
- if (ws_stat64(old_path, &s_buf) == 0) {
- /*
- * OK, it exists; return it instead.
- */
- g_free(path);
- path = old_path;
- }
- }
- }
-#endif
return path;
}
@@ -1587,7 +1558,7 @@ get_datafile_path(const char *filename)
char *
get_plugins_pers_dir(void)
{
- return get_persconffile_path(PLUGINS_DIR_NAME, FALSE, FALSE);
+ return get_persconffile_path(PLUGINS_DIR_NAME, FALSE);
}
/* Delete a file */
diff --git a/epan/filesystem.h b/epan/filesystem.h
index a972712af4..6b76bab4fc 100644
--- a/epan/filesystem.h
+++ b/epan/filesystem.h
@@ -191,17 +191,10 @@ WS_DLL_PUBLIC int create_persconffile_dir(char **pf_dir_path_return);
* file name. If using configuration profiles this directory will be
* used if "from_profile" is TRUE.
*
- * On Win32, if "for_writing" is FALSE, we check whether the file exists
- * and, if not, construct a path name relative to the ".wireshark"
- * subdirectory of the user's home directory, and check whether that
- * exists; if it does, we return that, so that configuration files
- * from earlier versions can be read.
- *
* The returned file name was g_malloc()'d so it must be g_free()d when the
* caller is done with it.
*/
-WS_DLL_PUBLIC char *get_persconffile_path(const char *filename, gboolean from_profile,
- gboolean for_writing);
+WS_DLL_PUBLIC char *get_persconffile_path(const char *filename, gboolean from_profile);
/*
* Get the (default) directory in which personal data is stored.
diff --git a/epan/oids.c b/epan/oids.c
index 2f7ca68ddc..183841a40d 100644
--- a/epan/oids.c
+++ b/epan/oids.c
@@ -802,15 +802,15 @@ void oid_pref_init(module_t *nameres)
#else
prefs_register_static_text_preference(nameres, "load_smi_modules_static",
- "Enable OID resolution: N/A",
+ "Enable OID resolution: N/A",
"Support for OID resolution was not compiled into this version of Wireshark");
prefs_register_static_text_preference(nameres, "suppress_smi_errors_static",
- "Suppress SMI errors: N/A",
+ "Suppress SMI errors: N/A",
"Support for OID resolution was not compiled into this version of Wireshark");
prefs_register_static_text_preference(nameres, "smi_module_path",
- "SMI (MIB and PIB) modules and paths: N/A",
+ "SMI (MIB and PIB) modules and paths: N/A",
"Support for OID resolution was not compiled into this version of Wireshark");
#endif
}
@@ -1173,7 +1173,7 @@ oid_get_default_mib_path(void) {
guint i;
path_str = g_string_new("");
-
+
if (!load_smi_modules) {
D(1,("OID resolution not enabled"));
return path_str->str;
@@ -1184,7 +1184,7 @@ oid_get_default_mib_path(void) {
g_string_append_printf(path_str, "%s;", path);
g_free (path);
- path = get_persconffile_path("snmp\\mibs", FALSE, FALSE);
+ path = get_persconffile_path("snmp\\mibs", FALSE);
g_string_append_printf(path_str, "%s", path);
g_free (path);
#else
diff --git a/epan/prefs.c b/epan/prefs.c
index 367dad0622..3cf09eeb0a 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -2936,7 +2936,7 @@ read_prefs(int *gpf_errno_return, int *gpf_read_errno_return,
}
/* Construct the pathname of the user's preferences file. */
- pf_path = get_persconffile_path(PF_NAME, TRUE, FALSE);
+ pf_path = get_persconffile_path(PF_NAME, TRUE);
/* Read the user's preferences file, if it exists. */
*pf_path_return = NULL;
@@ -4439,7 +4439,7 @@ write_prefs(char **pf_path_return)
*/
if (pf_path_return != NULL) {
- pf_path = get_persconffile_path(PF_NAME, TRUE, TRUE);
+ pf_path = get_persconffile_path(PF_NAME, TRUE);
if ((pf = ws_fopen(pf_path, "w")) == NULL) {
*pf_path_return = pf_path;
return errno;
diff --git a/epan/uat.c b/epan/uat.c
index 2f05fb621f..f1abbb6ccb 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -168,7 +168,7 @@ gchar* uat_get_actual_filename(uat_t* uat, gboolean for_writing) {
gchar *pers_fname = NULL;
if (! uat->from_global) {
- pers_fname = get_persconffile_path(uat->filename, uat->from_profile, for_writing);
+ pers_fname = get_persconffile_path(uat->filename, uat->from_profile);
}
if ((! for_writing ) && (! file_exists(pers_fname) )) {
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c
index 286d91bfe5..ad23c1ecb0 100644
--- a/epan/wslua/init_wslua.c
+++ b/epan/wslua/init_wslua.c
@@ -337,7 +337,7 @@ int wslua_init(register_cb cb, gpointer client_data) {
G_LOG_LEVEL_MESSAGE|
G_LOG_LEVEL_INFO|
G_LOG_LEVEL_DEBUG),
- ops ? ops->logger : basic_logger,
+ ops ? ops->logger : basic_logger,
NULL);
if (!L) {
@@ -396,7 +396,7 @@ int wslua_init(register_cb cb, gpointer client_data) {
/* if we are indeed superuser run user scripts only if told to do so */
if ( (!started_with_special_privs()) || run_anyway ) {
- filename = get_persconffile_path("init.lua", FALSE, FALSE);
+ filename = get_persconffile_path("init.lua", FALSE);
if ((file_exists(filename))) {
lua_load_script(filename);
diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c
index 575277b5e7..073dea08b4 100644
--- a/epan/wslua/wslua_util.c
+++ b/epan/wslua/wslua_util.c
@@ -189,7 +189,7 @@ static char* wslua_get_actual_filename(const char* fname) {
return g_strdup(fname_clean);
}
- filename = get_persconffile_path(fname_clean,FALSE,FALSE);
+ filename = get_persconffile_path(fname_clean,FALSE);
if ( file_exists(filename) ) {
return filename;
@@ -252,7 +252,7 @@ WSLUA_FUNCTION wslua_dofile(lua_State* L) {
WSLUA_FUNCTION wslua_persconffile_path(lua_State* L) {
#define WSLUA_OPTARG_persconffile_path_FILENAME 1 /* A filename */
const char *fname = luaL_optstring(L, WSLUA_OPTARG_persconffile_path_FILENAME,"");
- char* filename = get_persconffile_path(fname,FALSE,FALSE);
+ char* filename = get_persconffile_path(fname,FALSE);
lua_pushstring(L,filename);
g_free(filename);
diff --git a/filters.c b/filters.c
index 8ec3bdcd75..5fb5ac4991 100644
--- a/filters.c
+++ b/filters.c
@@ -143,7 +143,7 @@ read_filter_list(filter_list_type_t list_type, char **pref_path_return,
}
/* try to open personal "cfilters"/"dfilters" file */
- ff_path = get_persconffile_path(ff_name, TRUE, FALSE);
+ ff_path = get_persconffile_path(ff_name, TRUE);
if ((ff = ws_fopen(ff_path, "r")) == NULL) {
/*
* Did that fail because the file didn't exist?
@@ -166,7 +166,7 @@ read_filter_list(filter_list_type_t list_type, char **pref_path_return,
* a particular list.
*/
g_free(ff_path);
- ff_path = get_persconffile_path(FILTER_FILE_NAME, FALSE, FALSE);
+ ff_path = get_persconffile_path(FILTER_FILE_NAME, FALSE);
if ((ff = ws_fopen(ff_path, "r")) == NULL) {
/*
* Did that fail because the file didn't exist?
@@ -488,7 +488,7 @@ save_filter_list(filter_list_type_t list_type, char **pref_path_return,
return;
}
- ff_path = get_persconffile_path(ff_name, TRUE, TRUE);
+ ff_path = get_persconffile_path(ff_name, TRUE);
/* Write to "XXX.new", and rename if that succeeds.
That means we don't trash the file if we fail to write it out
diff --git a/ui/gtk/about_dlg.c b/ui/gtk/about_dlg.c
index 71aa50f116..3a0dbdfdc3 100644
--- a/ui/gtk/about_dlg.c
+++ b/ui/gtk/about_dlg.c
@@ -420,7 +420,7 @@ about_folders_page_new(void)
g_free(path);
/* pers conf */
- path = get_persconffile_path("", FALSE, FALSE);
+ path = get_persconffile_path("", FALSE);
about_folders_row(table, "Personal configuration", path,
"\"dfilters\", \"preferences\", \"ethers\", ...");
g_free(path);
diff --git a/ui/gtk/decode_as_dlg.c b/ui/gtk/decode_as_dlg.c
index 6750a9c60c..e772099bb9 100644
--- a/ui/gtk/decode_as_dlg.c
+++ b/ui/gtk/decode_as_dlg.c
@@ -686,7 +686,7 @@ decode_show_save_cb (GtkWidget *win _U_, gpointer user_data _U_)
return;
}
- daf_path = get_persconffile_path(DECODE_AS_ENTRIES_FILE_NAME, TRUE, TRUE);
+ daf_path = get_persconffile_path(DECODE_AS_ENTRIES_FILE_NAME, TRUE);
if ((daf = ws_fopen(daf_path, "w")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't open decode_as_entries file\n\"%s\": %s.", daf_path,
@@ -2221,7 +2221,7 @@ void load_decode_as_entries(void)
decode_clear_all(FALSE);
}
- daf_path = get_persconffile_path(DECODE_AS_ENTRIES_FILE_NAME, TRUE, FALSE);
+ daf_path = get_persconffile_path(DECODE_AS_ENTRIES_FILE_NAME, TRUE);
if ((daf = ws_fopen(daf_path, "r")) != NULL) {
read_prefs_file(daf_path, daf, read_set_decode_as_entries, NULL);
fclose(daf);
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 3bab40df69..4467c52d29 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -2944,7 +2944,7 @@ main(int argc, char *argv[])
#else
gtk_rc_parse(rc_file);
g_free(rc_file);
- rc_file = get_persconffile_path(RC_FILE, FALSE, FALSE);
+ rc_file = get_persconffile_path(RC_FILE, FALSE);
gtk_rc_parse(rc_file);
#endif
g_free(rc_file);
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index eddb9ebf93..6197bc89c1 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -1006,7 +1006,7 @@ int main(int argc, char *argv[])
// #else
// gtk_rc_parse(rc_file);
// g_free(rc_file);
-// rc_file = get_persconffile_path(RC_FILE, FALSE, FALSE);
+// rc_file = get_persconffile_path(RC_FILE, FALSE);
// gtk_rc_parse(rc_file);
// #endif
// g_free(rc_file);
diff --git a/ui/recent.c b/ui/recent.c
index 6772565b42..db1881e585 100644
--- a/ui/recent.c
+++ b/ui/recent.c
@@ -310,7 +310,7 @@ write_recent(void)
return FALSE;
}
- rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE, TRUE);
+ rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE);
if ((rf = ws_fopen(rf_path, "w")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't open recent file\n\"%s\": %s.", rf_path,
@@ -433,7 +433,7 @@ write_profile_recent(void)
return FALSE;
}
- rf_path = get_persconffile_path(RECENT_FILE_NAME, TRUE, TRUE);
+ rf_path = get_persconffile_path(RECENT_FILE_NAME, TRUE);
if ((rf = ws_fopen(rf_path, "w")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't open recent file\n\"%s\": %s.", rf_path,
@@ -952,7 +952,7 @@ recent_read_static(char **rf_path_return, int *rf_errno_return)
recent.gui_fileopen_remembered_dir = NULL;
/* Construct the pathname of the user's recent common file. */
- rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE, FALSE);
+ rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE);
/* Read the user's recent common file, if it exists. */
*rf_path_return = NULL;
@@ -1017,7 +1017,7 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
}
/* Construct the pathname of the user's profile recent file. */
- rf_path = get_persconffile_path(RECENT_FILE_NAME, TRUE, FALSE);
+ rf_path = get_persconffile_path(RECENT_FILE_NAME, TRUE);
/* Read the user's recent file, if it exists. */
*rf_path_return = NULL;
@@ -1034,7 +1034,7 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
* know what's supposed to happen at this point.
* ToDo: Determine if the "recent common file" should be read at this point
*/
- rf_common_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE, FALSE);
+ rf_common_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE);
if (!file_exists(rf_common_path)) {
/* Read older common settings from recent file */
rf = ws_fopen(rf_path, "r");
@@ -1064,11 +1064,11 @@ recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
/* Construct the pathname of the user's recent common file. */
- rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE, FALSE);
+ rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE);
if (!file_exists (rf_path)) {
/* Recent common file does not exist, read from default recent */
g_free (rf_path);
- rf_path = get_persconffile_path(RECENT_FILE_NAME, FALSE, FALSE);
+ rf_path = get_persconffile_path(RECENT_FILE_NAME, FALSE);
}
/* Read the user's recent file, if it exists. */
diff --git a/update.c b/update.c
index 3163f24f42..13bb7adfbe 100644
--- a/update.c
+++ b/update.c
@@ -301,7 +301,7 @@ update_check(gboolean interactive)
/* build update file name */
/* XXX - using the personal path, use temp dir instead? */
- local_file = get_persconffile_path("wsupdate", FALSE, TRUE /*for_writing*/);
+ local_file = get_persconffile_path("wsupdate", FALSE);
if(local_file == NULL) {
g_warning("Couldn't create output path!");
return;