r51158 - in /attic/libgksu/debian: ./ patches/

rbalint at users.alioth.debian.org rbalint at users.alioth.debian.org
Sun Sep 25 15:02:14 UTC 2016


Author: rbalint
Date: Sun Sep 25 15:02:14 2016
New Revision: 51158

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=51158
Log:
Merge changes from Ubuntu

Added:
    attic/libgksu/debian/patches/13_startup_notification.diff
    attic/libgksu/debian/patches/14_polish_startup.diff
    attic/libgksu/debian/patches/18_g_markup_escape_text_for_command.patch
    attic/libgksu/debian/patches/20_better_usleep.patch
    attic/libgksu/debian/patches/22_sudo_keep_env.patch
    attic/libgksu/debian/patches/26_restore_stderr_output.patch
    attic/libgksu/debian/patches/27_sudo_wrong_pwd_check.patch
    attic/libgksu/debian/patches/29_check_newline.patch
Modified:
    attic/libgksu/debian/changelog
    attic/libgksu/debian/libgksu2-0.postinst
    attic/libgksu/debian/patches/series

Modified: attic/libgksu/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/changelog?rev=51158&op=diff
==============================================================================
--- attic/libgksu/debian/changelog	[utf-8] (original)
+++ attic/libgksu/debian/changelog	[utf-8] Sun Sep 25 15:02:14 2016
@@ -2,6 +2,30 @@
 
   * Pass configure flags properly
   * Set gksu-run-helper's location using configure instead of moving it later
+  * Merge patches from Ubuntu:
+    - 13_startup_notification.diff
+       make startup-notification work more reliable
+    - 14_polish_startup.diff:
+       improve startup notification message (sent upstream)
+    - 18_g_markup_escape_text_for_command.patch:
+       fix missing g_markup_escape when commands are displayed
+       (sent upstream)
+    - 20_better_usleep.patch:
+       add small usleep() to avoid race condition when the hostname can not
+       be resolved (sent upstream)
+    - 22_sudo_keep_env.patch:
+       if gksudo -k is used, pass the -E option to sudo to preserve the
+       environment if we're allowed to do so (sent upstream)
+    - 26_restore_stderr_output.patch:
+       output stderr from the sudo child (as pre-lucid versions did).
+       (Closes: #564188)
+    - 27_sudo_wrong_pwd_check.patch: Be more careful when checking the
+       "wrong password" output, there might be a new prompt before.
+       (Closes: 597020)
+    - 29_check_newline.patch:
+       Check if buffer is really a single newline before discarding it.
+    - Remove call to update-gconf-defaults and use dpkg-trigger to set
+      sudo-mode
 
   [ Helmut Grohne ]
   * Fix FTCBFS: Add 24_cross.patch (Closes: #837605)

Modified: attic/libgksu/debian/libgksu2-0.postinst
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/libgksu2-0.postinst?rev=51158&op=diff
==============================================================================
--- attic/libgksu/debian/libgksu2-0.postinst	[utf-8] (original)
+++ attic/libgksu/debian/libgksu2-0.postinst	[utf-8] Sun Sep 25 15:02:14 2016
@@ -18,6 +18,4 @@
     ln -fs /etc/alternatives/libgksu-gconf-defaults /usr/share/gconf/defaults/10_libgksu
 fi
 
-if which update-gconf-defaults >/dev/null 2>&1; then
-    update-gconf-defaults
-fi
+dpkg-trigger /usr/share/gconf/defaults

Added: attic/libgksu/debian/patches/13_startup_notification.diff
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/13_startup_notification.diff?rev=51158&op=file
==============================================================================
--- attic/libgksu/debian/patches/13_startup_notification.diff	(added)
+++ attic/libgksu/debian/patches/13_startup_notification.diff	[utf-8] Sun Sep 25 15:02:14 2016
@@ -0,0 +1,21 @@
+--- a/libgksu/libgksu.c
++++ b/libgksu/libgksu.c
+@@ -1789,7 +1789,17 @@
+ gksu_context_launch_initiate (GksuContext *context)
+ {
+   gchar *sid = NULL;
+-  guint32 launch_time = gdk_x11_display_get_user_time (gdk_display_get_default ());
++  // guint32 launch_time = gdk_x11_display_get_user_time(GDK_DISPLAY());
++  // ^---- does not work reliable and reports absurdly large launch times 
++  //       for me
++  // *cry* we create a fake-window, realize it to get the
++  // current server time. there must be a simpler way,
++  // but I don't know it!
++  GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
++  gtk_widget_realize(win);
++  gtk_widget_add_events (GTK_WIDGET (win), GDK_PROPERTY_CHANGE_MASK);
++  guint32 launch_time = gdk_x11_get_server_time(win->window);
++
+   static gboolean initiated = FALSE;
+ 
+   if (!initiated)

Added: attic/libgksu/debian/patches/14_polish_startup.diff
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/14_polish_startup.diff?rev=51158&op=file
==============================================================================
--- attic/libgksu/debian/patches/14_polish_startup.diff	(added)
+++ attic/libgksu/debian/patches/14_polish_startup.diff	[utf-8] Sun Sep 25 15:02:14 2016
@@ -0,0 +1,17 @@
+=== modified file 'libgksu/libgksu.c'
+--- a/libgksu/libgksu.c
++++ b/libgksu/libgksu.c
+@@ -1385,6 +1385,13 @@
+ 			       NULL, NULL);
+   context->sn_context = sn_launcher_context_new (sn_display, gdk_screen_get_number (gdk_display_get_default_screen (gdk_display_get_default ())));
+   sn_launcher_context_set_description (context->sn_context, _("Granting Rights"));
++  if (context->sudo_mode)
++  {
++    sn_launcher_context_set_description (context->sn_context,
++		                      _("Starting Administrative Application"));
++    sn_launcher_context_set_icon_name (context->sn_context, 
++		                       "applications-system");
++  }
+   sn_launcher_context_set_name (context->sn_context, g_get_prgname ());
+ }
+ 

Added: attic/libgksu/debian/patches/18_g_markup_escape_text_for_command.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/18_g_markup_escape_text_for_command.patch?rev=51158&op=file
==============================================================================
--- attic/libgksu/debian/patches/18_g_markup_escape_text_for_command.patch	(added)
+++ attic/libgksu/debian/patches/18_g_markup_escape_text_for_command.patch	[utf-8] Sun Sep 25 15:02:14 2016
@@ -0,0 +1,18 @@
+=== modified file 'libgksu/libgksu.c'
+--- a/libgksu/libgksu.c
++++ b/libgksu/libgksu.c
+@@ -994,12 +994,12 @@
+ 				     "The application '%s' lets you "
+ 				     "modify essential parts of your "
+ 				     "system."),
+-				   command);
++				   g_markup_escape_text(command, -1));
+ 	  else
+ 	    msg = g_strdup_printf (_("<b><big>Enter your password to run "
+ 				     "the application '%s' as user %s"
+ 				     "</big></b>"),
+-				   command, context->user);
++				   g_markup_escape_text(command, -1), context->user);
+ 	}
+       else
+ 	{

Added: attic/libgksu/debian/patches/20_better_usleep.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/20_better_usleep.patch?rev=51158&op=file
==============================================================================
--- attic/libgksu/debian/patches/20_better_usleep.patch	(added)
+++ attic/libgksu/debian/patches/20_better_usleep.patch	[utf-8] Sun Sep 25 15:02:14 2016
@@ -0,0 +1,30 @@
+--- a/libgksu/libgksu.c
++++ b/libgksu/libgksu.c
+@@ -2906,9 +2906,13 @@
+       /* Try hard to find the prompt; it may happen that we're
+        * seeing sudo's lecture, or that some pam module is spitting
+        * debugging stuff at the screen
++       *
++       * we wait up to 5sec for the prompt to appear, but we also
++       * break once the process_name changed
+        */
+-      for (counter = 0; counter < 50; counter++)
++      for (counter = 0; counter < 1000; counter++)
+ 	{
++	  char *procname;
+ 	  if (strncmp (buffer, "GNOME_SUDO_PASS", 15) == 0)
+ 	    break;
+ 
+@@ -2921,7 +2925,11 @@
+ 	  if (context->debug)
+ 	    fprintf (stderr, "buffer: -%s-\n", buffer);
+ 
+-	  usleep(1000);
++ 	  // we wait here  bit but break when the process name changes
++ 	  usleep(5000);
++ 	  procname = get_process_name (pid);
++ 	  if(!g_str_has_suffix(procname,"sudo"))
++ 	     break;
+ 	}
+ 
+       if (context->debug)

Added: attic/libgksu/debian/patches/22_sudo_keep_env.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/22_sudo_keep_env.patch?rev=51158&op=file
==============================================================================
--- attic/libgksu/debian/patches/22_sudo_keep_env.patch	(added)
+++ attic/libgksu/debian/patches/22_sudo_keep_env.patch	[utf-8] Sun Sep 25 15:02:14 2016
@@ -0,0 +1,15 @@
+--- a/libgksu/libgksu.c
++++ b/libgksu/libgksu.c
+@@ -2704,6 +2704,12 @@
+       cmd[argcount] = g_strdup("-H");
+       argcount++;
+     }
++  else
++    {
++      /* Preserve the environment, if sudo will let us */
++      cmd[argcount] = g_strdup("-E");
++      argcount++;
++    }
+ 
+   /* Make sudo read from stdin */
+   cmd[argcount] = g_strdup("-S");

Added: attic/libgksu/debian/patches/26_restore_stderr_output.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/26_restore_stderr_output.patch?rev=51158&op=file
==============================================================================
--- attic/libgksu/debian/patches/26_restore_stderr_output.patch	(added)
+++ attic/libgksu/debian/patches/26_restore_stderr_output.patch	[utf-8] Sun Sep 25 15:02:14 2016
@@ -0,0 +1,25 @@
+--- a/libgksu/libgksu.c
++++ b/libgksu/libgksu.c
+@@ -3046,9 +3046,6 @@
+ #ifdef SUDO_FORKPTY
+       if (error)
+         close(fdpty);
+-#else
+-      if (error)
+-        fclose(infile);
+ #endif
+ 
+       cmdline = g_strdup("sudo");
+@@ -3067,6 +3064,12 @@
+       if (context->sn_context)
+ 	gksu_context_launch_complete (context);
+ 
++      while (read (parent_pipe[0], buffer, 255) > 0)
++	{
++	  fprintf (stderr, "%s", buffer);
++	  bzero(buffer, 256);
++	}
++
+       /* if the process is still active waitpid() on it */
+       if (pid_exited != pid)
+ 	waitpid(pid, &status, 0);

Added: attic/libgksu/debian/patches/27_sudo_wrong_pwd_check.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/27_sudo_wrong_pwd_check.patch?rev=51158&op=file
==============================================================================
--- attic/libgksu/debian/patches/27_sudo_wrong_pwd_check.patch	(added)
+++ attic/libgksu/debian/patches/27_sudo_wrong_pwd_check.patch	[utf-8] Sun Sep 25 15:02:14 2016
@@ -0,0 +1,15 @@
+Description: Be more careful when checking the "wrong password" output, there might be a new prompt before.
+Author: Martin Pitt <martin.pitt at ubuntu.com>
+Bug-Ubuntu: https://launchpad.net/bugs/298217 
+
+--- a/libgksu/libgksu.c
++++ b/libgksu/libgksu.c
+@@ -3022,7 +3022,7 @@
+ 	  fprintf (stderr, "%s", buffer);
+ 	}
+ 
+-      if (g_str_has_prefix (buffer, "Sorry, try again."))
++      if (g_str_has_prefix (buffer, "Sorry, try again.") || g_str_has_prefix (buffer, "GNOME_SUDO_PASSSorry, try again."))
+ 	g_set_error (error, gksu_quark, GKSU_ERROR_WRONGPASS,
+ 		     _("Wrong password."));
+       else

Added: attic/libgksu/debian/patches/29_check_newline.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/29_check_newline.patch?rev=51158&op=file
==============================================================================
--- attic/libgksu/debian/patches/29_check_newline.patch	(added)
+++ attic/libgksu/debian/patches/29_check_newline.patch	[utf-8] Sun Sep 25 15:02:14 2016
@@ -0,0 +1,33 @@
+## Description: Checks if buffer contains only newline before discarding it
+## Origin/Author: Torsten Spindler (Canonical)
+## Bug: http://pad.lv/298217
+diff -Nur -x '*.orig' -x '*~' libgksu-2.0.13~pre1//libgksu/libgksu.c libgksu-2.0.13~pre1.new//libgksu/libgksu.c
+--- libgksu-2.0.13~pre1//libgksu/libgksu.c	2011-09-13 09:43:51.723178003 +0200
++++ libgksu-2.0.13~pre1.new//libgksu/libgksu.c	2011-09-13 09:46:16.603182354 +0200
+@@ -2980,16 +2980,22 @@
+ 	  /* ignore the first newline that comes right after sudo receives
+ 	     the password */
+ 	  fgets (buffer, 255, fdfile);
+-	  /* this is the status we are interested in */
+-	  fgets (buffer, 255, fdfile);
++          if (!strcmp (buffer, "\n")) 
++            {
++	      /* this is the status we are interested in */
++	      fgets (buffer, 255, fdfile);
++            }
+ #else
+           fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & ~O_NONBLOCK);
+ 
+ 	  /* ignore the first newline that comes right after sudo receives
+ 	     the password */
+ 	  fgets (buffer, 255, infile);
+-	  /* this is the status we are interested in */
+-	  fgets (buffer, 255, infile);
++          if (!strcmp (buffer, "\n")) 
++            {
++	      /* this is the status we are interested in */
++	      fgets (buffer, 255, infile);
++            }
+ #endif
+ 	}
+       else

Modified: attic/libgksu/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/attic/libgksu/debian/patches/series?rev=51158&op=diff
==============================================================================
--- attic/libgksu/debian/patches/series	[utf-8] (original)
+++ attic/libgksu/debian/patches/series	[utf-8] Sun Sep 25 15:02:14 2016
@@ -4,6 +4,14 @@
 04_automake.patch
 05_ja.patch
 06_unguarded_child_stderr.patch
+13_startup_notification.diff
+14_polish_startup.diff
+18_g_markup_escape_text_for_command.patch
+20_better_usleep.patch
+22_sudo_keep_env.patch
 23_correct_colormap_get.patch
 24_cross.patch
+26_restore_stderr_output.patch
+27_sudo_wrong_pwd_check.patch
+29_check_newline.patch
 99_intltool.patch




More information about the pkg-gnome-commits mailing list