summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2004-07-11 19:33:03 +0000
committerMartin Schlemmer <azarah@gentoo.org>2004-07-11 19:33:03 +0000
commit9224b99b89ab28e8061c527c5d215f23143c7251 (patch)
tree24de98598b52c416561e24e4f91c0f9d13987f84 /app-admin/gnome-system-tools/files
parent"New package, submitted by Colin Macdonald <cbm@sfu.ca> #55473" (diff)
downloadhistorical-9224b99b89ab28e8061c527c5d215f23143c7251.tar.gz
historical-9224b99b89ab28e8061c527c5d215f23143c7251.tar.bz2
historical-9224b99b89ab28e8061c527c5d215f23143c7251.zip
Fix http://bugs.gnome.org/show_bug.cgi?id=147362; basically a 'hang' if the
user have passwd-less su privs.
Diffstat (limited to 'app-admin/gnome-system-tools/files')
-rw-r--r--app-admin/gnome-system-tools/files/digest-gnome-system-tools-0.34.0-r11
-rw-r--r--app-admin/gnome-system-tools/files/gnome-system-tools-0.34.0-fix-nopasswd-auth.patch97
2 files changed, 98 insertions, 0 deletions
diff --git a/app-admin/gnome-system-tools/files/digest-gnome-system-tools-0.34.0-r1 b/app-admin/gnome-system-tools/files/digest-gnome-system-tools-0.34.0-r1
new file mode 100644
index 000000000000..51e083767478
--- /dev/null
+++ b/app-admin/gnome-system-tools/files/digest-gnome-system-tools-0.34.0-r1
@@ -0,0 +1 @@
+MD5 0cd6ad61cb86cce72b86fce3e439fd17 gnome-system-tools-0.34.0.tar.bz2 1891817
diff --git a/app-admin/gnome-system-tools/files/gnome-system-tools-0.34.0-fix-nopasswd-auth.patch b/app-admin/gnome-system-tools/files/gnome-system-tools-0.34.0-fix-nopasswd-auth.patch
new file mode 100644
index 000000000000..f02f26ec89ed
--- /dev/null
+++ b/app-admin/gnome-system-tools/files/gnome-system-tools-0.34.0-fix-nopasswd-auth.patch
@@ -0,0 +1,97 @@
+--- gnome-system-tools-0.34.0/backends/general.pl.in 2004-07-05 17:08:11.752058480 +0200
++++ gnome-system-tools-0.34.0.az/backends/general.pl.in 2004-07-05 17:08:32.256941264 +0200
+@@ -323,6 +323,22 @@
+ {
+ my ($name, $version, $description, $directives, @args) = @_;
+ my (%tool, $arg);
++ my @iargs = @_;
++ my $i;
++
++ # used to sync with gst_auth_write_password() - it checks for
++ # "Backend Init" and then writes a CR
++ while ($arg = shift (@iargs))
++ {
++ if ($arg eq "--pw-prompt") {
++ print "Backend Init";
++ do {
++ $i = <STDIN>;
++ } while ($1 != "\n");
++ goto end_pw_prompt_loop;
++ }
++ }
++end_pw_prompt_loop:
+
+ # print a CR for synchronysm with the frontend
+ print "\n";
+@@ -369,7 +385,7 @@
+ $tool{"do_report"} = $gst_do_report = 1;
+ &gst_report_set_threshold (99);
+ }
+- else
++ elsif ($arg ne "--pw-prompt")
+ {
+ print STDERR "Error: Unrecognized option '$arg'.\n\n";
+ &gst_print_usage (\%tool, 1);
+--- gnome-system-tools-0.34.0/src/common/gst-auth.c 2004-07-05 17:08:02.965394256 +0200
++++ gnome-system-tools-0.34.0.az/src/common/gst-auth.c 2004-07-05 17:08:25.608951912 +0200
+@@ -158,25 +158,34 @@
+ gst_auth_write_password (GstTool *tool, gchar *pwd)
+ {
+ gchar *answer = "yes\n";
+- gboolean cont = FALSE;
++ gboolean cont = FALSE, authed = FALSE;
+ gchar *str;
+
+ /* read all the su or ssh output and flush the descriptors */
+ while (!cont) {
+- str = gst_tool_read_from_backend (tool, "assword:", "/no)?", NULL);
++ str = gst_tool_read_from_backend (tool, "assword:", "/no)?", "ackend Init", NULL);
+
+ /* FIXME: hope that someday we can get rid of this ssh output string parsing */
+ if (g_strrstr (g_ascii_strup (str, -1), "AUTHENTICITY") != NULL) {
+ /* it's the "add to known hosts list" ssh's message, just answer "yes" */
+ gst_tool_write_to_backend (tool, answer);
+ } else if (g_strrstr (g_ascii_strup (str, -1), "PASSWORD") != NULL) {
++ authed = TRUE;
++ gst_tool_write_to_backend (tool, pwd);
++
++ /* we pass --pw-prompt to the backend when we try to auth with su or
++ * ssh - it then prints "Backend Init" to allow us to sync with it
++ * in case the user can su/ssh without a password (pam module in the
++ * case of su, or DSA key in the case of ssh */
++ } else if (g_strrstr (g_ascii_strup (str, -1), "BACKEND INIT") != NULL) {
++ /* we need to write '\n' to the backend, as it will wait for a CR
++ * before it continues (if --pw-prompt was passed to it) */
++ gst_tool_write_to_backend (tool, "\n");
+ cont = TRUE;
+ }
+
+ g_free (str);
+ }
+-
+- gst_tool_write_to_backend (tool, pwd);
+ }
+
+ static GladeXML *
+@@ -336,7 +345,9 @@
+ g_string_append (command, "`pkg-config --variable=backenddir system-tools-backends`");
+ g_string_append (command, "/");
+ g_string_append (command, tool->script_name);
+- g_string_append (command, " --report");
++ /* --pw-prompt is for gst_auth_write_password() to be able to sync
++ * with the backends */
++ g_string_append (command, " --pw-prompt --report");
+
+ if (tool->current_platform) {
+ g_string_append (command, " --platform ");
+@@ -364,7 +375,9 @@
+ command = g_string_new (NULL);
+ gst_auth_save_locale (command);
+ command = g_string_append (command, tool->script_path);
+- command = g_string_append (command, " --report");
++ /* --pw-prompt is for gst_auth_write_password() to be able to sync
++ * with the backends */
++ command = g_string_append (command, " --pw-prompt --report");
+
+ if (tool->current_platform) {
+ g_string_append (command, " --platform ");