diff options
author | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-04-15 06:58:30 +0000 |
---|---|---|
committer | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-04-15 06:58:30 +0000 |
commit | 2330875ef28ea0377298948f9f5990623d1976d8 (patch) | |
tree | 2cfbdc793e919197c79b66bea1bf35adfc01a866 /net-analyzer/gnome-nettool/files | |
parent | Add new plugins to 9999, thanks to 0xd34df00d (diff) | |
download | gentoo-2-2330875ef28ea0377298948f9f5990623d1976d8.tar.gz gentoo-2-2330875ef28ea0377298948f9f5990623d1976d8.tar.bz2 gentoo-2-2330875ef28ea0377298948f9f5990623d1976d8.zip |
Bump, adds support for nmap and iputils. Fix launching utilities in /sbin and /usr/sbin. Drop old.
(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer/gnome-nettool/files')
-rw-r--r-- | net-analyzer/gnome-nettool/files/gnome-nettool-3.2.0-extra-path.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/net-analyzer/gnome-nettool/files/gnome-nettool-3.2.0-extra-path.patch b/net-analyzer/gnome-nettool/files/gnome-nettool-3.2.0-extra-path.patch new file mode 100644 index 000000000000..657543e7eee3 --- /dev/null +++ b/net-analyzer/gnome-nettool/files/gnome-nettool-3.2.0-extra-path.patch @@ -0,0 +1,82 @@ +From 0bdac5ac8142cbb86297cfb25e611d21d97e6a42 Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev <tetromino@gentoo.org> +Date: Sun, 15 Apr 2012 02:15:14 -0400 +Subject: [PATCH] utils: append EXTRA_PATH to user's path for + util_find_program_in_path() + +Normal users generally do not have /sbin or /usr/sbin in their paths, +and as a result, without EXTRA_PATH, util_find_program_in_path() fails +to find certain tools on some distros. + +https://bugzilla.gnome.org/show_bug.cgi?id=674126 +--- + src/utils.c | 14 +++++++++++--- + 1 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/src/utils.c b/src/utils.c +index a97217f..eef3cbe 100644 +--- a/src/utils.c ++++ b/src/utils.c +@@ -31,6 +31,8 @@ + #include <string.h> + #include <glib/gi18n.h> + ++#define EXTRA_PATH "/sbin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:/usr/ucb" ++ + #if (GLIB_MINOR_VERSION < 2) + + gint +@@ -63,13 +65,14 @@ my_strchrnul (const gchar *str, gchar c) + } + + /* Based on g_find_program_in_path, stolen from glib/gutils.c +- * It allow to ask in a specific PATH, if fail then as in the user PATH. ++ * It allow to ask in a specific PATH, if fail then as in the user PATH with ++ * EXTRA_PATH appended. + */ + gchar * + util_find_program_in_path (const gchar * program, const gchar * path) + { + const gchar *p; +- gchar *name, *freeme; ++ gchar *name, *freeme, *user_path = NULL; + size_t len; + size_t pathlen; + +@@ -92,6 +95,10 @@ util_find_program_in_path (const gchar * program, const gchar * path) + if (path == NULL) { + path = "/bin:/usr/bin:."; + } ++ ++ /* /sbin and /usr/sbin might not be in the user's path */ ++ user_path = g_strconcat (path, ":", EXTRA_PATH, NULL); ++ path = user_path; + } + + len = strlen (program) + 1; +@@ -124,12 +131,14 @@ util_find_program_in_path (const gchar * program, const gchar * path) + gchar *ret; + ret = g_strdup (startp); + g_free (freeme); ++ g_free (user_path); + return ret; + } + } + while (*p++ != '\0'); + + g_free (freeme); ++ g_free (user_path); + + return NULL; + } +@@ -202,7 +211,6 @@ util_tree_model_to_string (GtkTreeView *treeview) + return result; + } + +-#define EXTRA_PATH "/sbin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:/usr/ucb" + /* + * Find a program in PATH and EXTRA_PATH. If fail, show a dialog box. + * Returns the abosulet path and program. +-- +1.7.8.5 + |