diff --git a/epan/color_filters.c b/epan/color_filters.c index ded32c7dfc..9efbdb22a2 100644 --- a/epan/color_filters.c +++ b/epan/color_filters.c @@ -807,7 +807,7 @@ write_filters_file(GSList *cfl, FILE *f, gboolean only_selected) data.f = f; data.only_selected = only_selected; - fprintf(f,"# DO NOT EDIT THIS FILE! It was created by Wireshark\n"); + fprintf(f,"# This file was created by %s. Edit with care.\n", get_configuration_namespace()); g_slist_foreach(cfl, write_filter, &data); return TRUE; } diff --git a/epan/decode_as.c b/epan/decode_as.c index bb1d9a932f..bc51bfc48f 100644 --- a/epan/decode_as.c +++ b/epan/decode_as.c @@ -412,11 +412,12 @@ save_decode_as_entries(gchar** err) return -1; } - fputs("# \"Decode As\" entries file for Wireshark " VERSION ".\n" + fprintf(da_file, "# \"Decode As\" entries file for %s " VERSION ".\n" "#\n" "# This file is regenerated each time \"Decode As\" preferences\n" - "# are saved within Wireshark. Making manual changes should be safe,\n" - "# however.\n", da_file); + "# are saved within %s. Making manual changes should be safe,\n" + "# however.\n", + get_configuration_namespace(), get_configuration_namespace()); dissector_all_tables_foreach_changed(decode_as_write_entry, &decode_as_rows_list); diff --git a/packaging/debian/libwsutil0.symbols b/packaging/debian/libwsutil0.symbols index f9f90a7b53..f9b4ccf172 100644 --- a/packaging/debian/libwsutil0.symbols +++ b/packaging/debian/libwsutil0.symbols @@ -82,6 +82,7 @@ libwsutil.so.0 libwsutil0 #MINVER# free_features@Base 3.7.0 free_progdirs@Base 2.3.0 get_basename@Base 1.12.0~rc1 + get_configuration_namespace@Base 3.7.0 get_copyright_info@Base 1.99.0 get_cur_groupname@Base 1.10.0 get_cur_username@Base 1.10.0 diff --git a/resources/share/logwolf/colorfilters b/resources/share/logwolf/colorfilters index 129e833dfc..b819740747 100644 --- a/resources/share/logwolf/colorfilters +++ b/resources/share/logwolf/colorfilters @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE! It was created by Wireshark -@Errors@ct.error@[42148,0,0][65535,64764,40092] +# This file was created by Logwolf. Edit with care. +@Errors@ct.error@[4626,10023,11822][63479,34695,34695] @State Modifying Event@ct.readonly == "false"@[61423,50372,39578][0,0,0] @Administrative Activity@cloudtrail and not (ct.name ~ "^Describe.*" or ct.name ~ "^List.*" or ct.name ~ "^(Batch|)Get.*")@[61423,50372,39578][0,0,0] diff --git a/ui/recent.c b/ui/recent.c index d3d5d5ec52..5f1f713a2e 100644 --- a/ui/recent.c +++ b/ui/recent.c @@ -674,14 +674,16 @@ write_recent(void) } g_free(rf_path); - fputs("# Common recent settings file for Wireshark " VERSION ".\n" + fprintf(rf, "# Common recent settings file for %s " VERSION ".\n" "#\n" - "# This file is regenerated each time Wireshark is quit\n" + "# This file is regenerated each time %s is quit\n" "# and when changing configuration profile.\n" "# So be careful, if you want to make manual changes here.\n" "\n" "######## Recent capture files (latest last), cannot be altered through command line ########\n" - "\n", rf); + "\n", + get_configuration_namespace(), get_configuration_namespace()); + menu_recent_file_write_all(rf); @@ -816,12 +818,13 @@ write_profile_recent(void) } g_free(rf_path); - fputs("# Recent settings file for Wireshark " VERSION ".\n" + fprintf(rf, "# Recent settings file for %s " VERSION ".\n" "#\n" - "# This file is regenerated each time Wireshark is quit\n" + "# This file is regenerated each time %s is quit\n" "# and when changing configuration profile.\n" "# So be careful, if you want to make manual changes here.\n" - "\n", rf); + "\n", + get_configuration_namespace(), get_configuration_namespace()); write_recent_boolean(rf, "Main Toolbar show (hide)", RECENT_KEY_MAIN_TOOLBAR_SHOW, diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 217cd8a68a..b152cd19e8 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -54,6 +54,8 @@ /* * Application configuration namespace. Used to construct configuration * paths and environment variables. + * XXX We might want to use the term "application flavor" instead, with + * "packet" and "log" flavors. */ enum configuration_namespace_e { CONFIGURATION_NAMESPACE_UNINITIALIZED, @@ -62,6 +64,7 @@ enum configuration_namespace_e { }; enum configuration_namespace_e configuration_namespace = CONFIGURATION_NAMESPACE_UNINITIALIZED; +#define CONFIGURATION_NAMESPACE_PROPER (configuration_namespace == CONFIGURATION_NAMESPACE_WIRESHARK ? "Wireshark" : "Logwolf") #define CONFIGURATION_NAMESPACE_LOWER (configuration_namespace == CONFIGURATION_NAMESPACE_WIRESHARK ? "wireshark" : "logwolf") #define CONFIGURATION_ENVIRONMENT_VARIABLE(suffix) (configuration_namespace == CONFIGURATION_NAMESPACE_WIRESHARK ? "WIRESHARK_" suffix : "LOGWOLF_" suffix) @@ -297,8 +300,13 @@ set_configuration_namespace(const char *namespace_name) ws_error("Unknown configuration namespace %s", namespace_name); } - ws_debug("Using configuration namespace %s.", - configuration_namespace == CONFIGURATION_NAMESPACE_WIRESHARK ? "Wireshark" : "Logwolf"); + ws_debug("Using configuration namespace %s.", CONFIGURATION_NAMESPACE_PROPER); +} + +const char * +get_configuration_namespace(void) +{ + return CONFIGURATION_NAMESPACE_PROPER; } #ifndef _WIN32 @@ -1330,7 +1338,7 @@ get_persconffile_dir_no_profile(void) * is an inaccessible network drive. */ env = g_getenv("APPDATA"); - const char *persconf_namespace = configuration_namespace == CONFIGURATION_NAMESPACE_WIRESHARK ? "Wireshark" : "Logwolf"; + const char *persconf_namespace = CONFIGURATION_NAMESPACE_PROPER; if (env != NULL) { /* * Concatenate %APPDATA% with "\Wireshark" or "\Logwolf". diff --git a/wsutil/filesystem.h b/wsutil/filesystem.h index 8d276f3d99..9c8432f813 100644 --- a/wsutil/filesystem.h +++ b/wsutil/filesystem.h @@ -39,6 +39,12 @@ extern "C" { */ WS_DLL_PUBLIC char *configuration_init(const char *arg0, const char *namespace_name); +/** + * Get the configuration namespace name. + * @return The namespace name. One of "Wireshark" or "Logwolf". + */ +WS_DLL_PUBLIC const char *get_configuration_namespace(void); + /* * Get the directory in which the program resides. */