Blame SOURCES/wireshark-1.10.x-disable-warning-dialog.patch

ead5f6
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
ead5f6
index 82cff80..0137c3b 100644
ead5f6
--- a/ui/gtk/main.c
ead5f6
+++ b/ui/gtk/main.c
dbc6ab
@@ -2043,50 +2043,6 @@ read_configuration_files(char **gdp_path, char **dp_path)
ead5f6
   return prefs_p;
ead5f6
 }
ead5f6
 
ead5f6
-/*  Check if there's something important to tell the user during startup.
ead5f6
- *  We want to do this *after* showing the main window so that any windows
ead5f6
- *  we pop up will be above the main window.
ead5f6
- */
ead5f6
-static void
ead5f6
-#ifdef _WIN32
ead5f6
-check_and_warn_user_startup(gchar *cf_name)
ead5f6
-#else
ead5f6
-check_and_warn_user_startup(gchar *cf_name _U_)
ead5f6
-#endif
ead5f6
-{
ead5f6
-  gchar               *cur_user, *cur_group;
ead5f6
-  gpointer             priv_warning_dialog;
ead5f6
-
ead5f6
-  /* Tell the user not to run as root. */
ead5f6
-  if (running_with_special_privs() && recent.privs_warn_if_elevated) {
ead5f6
-    cur_user = get_cur_username();
ead5f6
-    cur_group = get_cur_groupname();
ead5f6
-    priv_warning_dialog = simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
ead5f6
-      "Running as user \"%s\" and group \"%s\".\n"
ead5f6
-      "This could be dangerous.\n\n"
ead5f6
-      "If you're running Wireshark this way in order to perform live capture, "
ead5f6
-      "you may want to be aware that there is a better way documented at\n"
ead5f6
-      "http://wiki.wireshark.org/CaptureSetup/CapturePrivileges", cur_user, cur_group);
ead5f6
-    g_free(cur_user);
ead5f6
-    g_free(cur_group);
ead5f6
-    simple_dialog_check_set(priv_warning_dialog, "Don't show this message again.");
ead5f6
-    simple_dialog_set_cb(priv_warning_dialog, priv_warning_dialog_cb, NULL);
ead5f6
-  }
ead5f6
-
ead5f6
-#ifdef _WIN32
ead5f6
-  /* Warn the user if npf.sys isn't loaded. */
ead5f6
-  if (!get_stdin_capture() && !cf_name && !npf_sys_is_running() && recent.privs_warn_if_no_npf && get_os_major_version() >= 6) {
ead5f6
-    priv_warning_dialog = simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
ead5f6
-      "The NPF driver isn't running.  You may have trouble\n"
ead5f6
-      "capturing or listing interfaces.");
ead5f6
-    simple_dialog_check_set(priv_warning_dialog, "Don't show this message again.");
ead5f6
-    simple_dialog_set_cb(priv_warning_dialog, npf_warning_dialog_cb, NULL);
ead5f6
-  }
ead5f6
-#endif
ead5f6
-
ead5f6
-}
ead5f6
-
ead5f6
-
ead5f6
 /* And now our feature presentation... [ fade to music ] */
ead5f6
 int
ead5f6
 main(int argc, char *argv[])
dbc6ab
@@ -3039,7 +2995,6 @@ main(int argc, char *argv[])
ead5f6
      up on top of us. */
ead5f6
   if (cf_name) {
ead5f6
     show_main_window(TRUE);
ead5f6
-    check_and_warn_user_startup(cf_name);
ead5f6
     if (rfilter != NULL) {
ead5f6
       if (!dfilter_compile(rfilter, &rfcode)) {
ead5f6
         bad_dfilter_alert_box(top_level, rfilter);
dbc6ab
@@ -3117,7 +3072,6 @@ main(int argc, char *argv[])
ead5f6
           dfilter_free(rfcode);
ead5f6
         cfile.rfcode = NULL;
ead5f6
         show_main_window(FALSE);
ead5f6
-        /* Don't call check_and_warn_user_startup(): we did it above */
ead5f6
         main_set_for_capture_in_progress(FALSE);
ead5f6
         set_capture_if_dialog_for_capture_in_progress(FALSE);
ead5f6
       }
dbc6ab
@@ -3134,7 +3088,6 @@ main(int argc, char *argv[])
ead5f6
       }
ead5f6
       /* "-k" was specified; start a capture. */
ead5f6
       show_main_window(FALSE);
ead5f6
-      check_and_warn_user_startup(cf_name);
ead5f6
 
ead5f6
       /* If no user interfaces were specified on the command line,
ead5f6
          copy the list of selected interfaces to the set of interfaces
dbc6ab
@@ -3152,7 +3105,6 @@ main(int argc, char *argv[])
ead5f6
       }
ead5f6
     } else {
ead5f6
       show_main_window(FALSE);
ead5f6
-      check_and_warn_user_startup(cf_name);
ead5f6
       main_set_for_capture_in_progress(FALSE);
ead5f6
       set_capture_if_dialog_for_capture_in_progress(FALSE);
ead5f6
     }
dbc6ab
@@ -3163,7 +3115,6 @@ main(int argc, char *argv[])
ead5f6
     }
ead5f6
 #else /* HAVE_LIBPCAP */
ead5f6
     show_main_window(FALSE);
ead5f6
-    check_and_warn_user_startup(cf_name);
ead5f6
     main_set_for_capture_in_progress(FALSE);
ead5f6
     set_capture_if_dialog_for_capture_in_progress(FALSE);
ead5f6
 #endif /* HAVE_LIBPCAP */