pastebin - collaborative debugging tool
rovema.kpaste.net RSS


Debian OpenSSH backport to Jessie
Posted by Anonymous on Fri 17th Feb 2023 12:18
raw | new post
view followups (newest first): Debian OpenSSH backport to Jessie by Anonymous

  1. #https://salsa.debian.org/ssh-team/openssh.git
  2. diff --git a/.gitattributes b/.gitattributes
  3. new file mode 100644
  4. index 0000000..204822d
  5. --- /dev/null
  6. +++ b/.gitattributes
  7. @@ -0,0 +1,6 @@
  8. +configure      -diff
  9. +aclocal.m4     -diff
  10. +config.guess   -diff
  11. +aclocal.m4     -diff
  12. +config.guess   -diff
  13. +config.sub     -diff
  14. diff --git a/contrib/gnome-ssh-askpass3.c b/contrib/gnome-ssh-askpass3.c
  15. index e1a0533..6a6d25c 100644
  16. --- a/contrib/gnome-ssh-askpass3.c
  17. +++ b/contrib/gnome-ssh-askpass3.c
  18. @@ -63,6 +63,22 @@
  19.  #include <gdk/gdkkeysyms.h>
  20.  
  21.  static void
  22. +report_failed_grab (GtkWidget *parent_window, const char *what)
  23. +{
  24. +       GtkWidget *err;
  25. +
  26. +       err = gtk_message_dialog_new(GTK_WINDOW(parent_window), 0,
  27. +           GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
  28. +           "Could not grab %s. A malicious client may be eavesdropping "
  29. +           "on your session.", what);
  30. +       gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
  31. +
  32. +       gtk_dialog_run(GTK_DIALOG(err));
  33. +
  34. +       gtk_widget_destroy(err);
  35. +}
  36. +
  37. +static void
  38.  ok_dialog(GtkWidget *entry, gpointer dialog)
  39.  {
  40.         g_return_if_fail(GTK_IS_DIALOG(dialog));
  41. @@ -137,12 +153,9 @@ passphrase_dialog(char *message, int prompt_type)
  42.         char *passphrase, *local;
  43.         int result, grab_tries, grab_server, grab_pointer;
  44.         int buttons, default_response;
  45. -       GtkWidget *parent_window, *dialog, *entry, *err;
  46. +       GtkWidget *parent_window, *dialog, *entry;
  47.         GdkGrabStatus status;
  48.         GdkColor fg, bg;
  49. -       GdkSeat *seat;
  50. -       GdkDisplay *display;
  51. -       GdkSeatCapabilities caps;
  52.         int fg_set = 0, bg_set = 0;
  53.  
  54.         grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
  55. @@ -213,30 +226,48 @@ passphrase_dialog(char *message, int prompt_type)
  56.                             G_CALLBACK(check_none), dialog);
  57.                 }
  58.         }
  59. +
  60.         /* Grab focus */
  61.         gtk_widget_show_now(dialog);
  62. -       display = gtk_widget_get_display(GTK_WIDGET(dialog));
  63. -       seat = gdk_display_get_default_seat(display);
  64. -       caps = GDK_SEAT_CAPABILITY_KEYBOARD;
  65. -       if (grab_pointer)
  66. -               caps |= GDK_SEAT_CAPABILITY_ALL_POINTING;
  67. -       if (grab_server)
  68. -               caps = GDK_SEAT_CAPABILITY_ALL;
  69. -       for (;;) {
  70. -               status = gdk_seat_grab(seat, gtk_widget_get_window(dialog),
  71. -                   caps, TRUE, NULL, NULL, NULL, NULL);
  72. +       if (grab_pointer) {
  73. +               for(;;) {
  74. +                       status = gdk_pointer_grab(
  75. +                           (gtk_widget_get_window(GTK_WIDGET(dialog))), TRUE,
  76. +                           0, NULL, NULL, GDK_CURRENT_TIME);
  77. +                       if (status == GDK_GRAB_SUCCESS)
  78. +                               break;
  79. +                       usleep(GRAB_WAIT * 1000);
  80. +                       if (++grab_tries > GRAB_TRIES) {
  81. +                               failed = "mouse";
  82. +                               goto nograb;
  83. +                       }
  84. +               }
  85. +       }
  86. +       for(;;) {
  87. +               status = gdk_keyboard_grab(
  88. +                   gtk_widget_get_window(GTK_WIDGET(dialog)), FALSE,
  89. +                   GDK_CURRENT_TIME);
  90.                 if (status == GDK_GRAB_SUCCESS)
  91.                         break;
  92.                 usleep(GRAB_WAIT * 1000);
  93. -               if (++grab_tries > GRAB_TRIES)
  94. -                       goto nograb;
  95. +               if (++grab_tries > GRAB_TRIES) {
  96. +                       failed = "keyboard";
  97. +                       goto nograbkb;
  98. +               }
  99. +       }
  100. +       if (grab_server) {
  101. +               gdk_x11_grab_server();
  102.         }
  103.  
  104.         result = gtk_dialog_run(GTK_DIALOG(dialog));
  105.  
  106.         /* Ungrab */
  107. -       gdk_seat_ungrab(seat);
  108. -       gdk_display_flush(display);
  109. +       if (grab_server)
  110. +               XUngrabServer(gdk_x11_get_default_xdisplay());
  111. +       if (grab_pointer)
  112. +               gdk_pointer_ungrab(GDK_CURRENT_TIME);
  113. +       gdk_keyboard_ungrab(GDK_CURRENT_TIME);
  114. +       gdk_flush();
  115.  
  116.         /* Report passphrase if user selected OK */
  117.         if (prompt_type == PROMPT_ENTRY) {
  118. @@ -264,16 +295,21 @@ passphrase_dialog(char *message, int prompt_type)
  119.                 return -1;
  120.         return 0;
  121.  
  122. + nograbkb:
  123. +       /*
  124. +        * At least one grab failed - ungrab what we got, and report
  125. +        * the failure to the user.  Note that XGrabServer() cannot
  126. +        * fail.
  127. +        */
  128. +       gdk_pointer_ungrab(GDK_CURRENT_TIME);
  129.   nograb:
  130. +       if (grab_server)
  131. +               XUngrabServer(gdk_x11_get_default_xdisplay());
  132.         gtk_widget_destroy(dialog);
  133. -       err = gtk_message_dialog_new(GTK_WINDOW(parent_window), 0,
  134. -           GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
  135. -           "Could not grab input. A malicious client may be eavesdropping "
  136. -           "on your session.");
  137. -       gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
  138. -       gtk_dialog_run(GTK_DIALOG(err));
  139. -       gtk_widget_destroy(err);
  140. -       return -1;
  141. +
  142. +       report_failed_grab(parent_window, failed);
  143. +
  144. +       return (-1);
  145.  }
  146.  
  147.  int
  148. @@ -284,6 +320,8 @@ main(int argc, char **argv)
  149.  
  150.         gtk_init(&argc, &argv);
  151.  
  152. +       gtk_window_set_default_icon_from_file ("/usr/share/pixmaps/ssh-askpass-gnome.png", NULL);
  153. +
  154.         if (argc > 1) {
  155.                 message = g_strjoinv(" ", argv + 1);
  156.         } else {
  157. diff --git a/debian/compat b/debian/compat
  158. new file mode 100644
  159. index 0000000..f599e28
  160. --- /dev/null
  161. +++ b/debian/compat
  162. @@ -0,0 +1 @@
  163. +10
  164. diff --git a/debian/control b/debian/control
  165. index f3ed979..efbfc0c 100644
  166. --- a/debian/control
  167. +++ b/debian/control
  168. @@ -2,18 +2,15 @@ Source: openssh
  169.  Section: net
  170.  Priority: standard
  171.  Maintainer: Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>
  172. -Build-Depends: debhelper (>= 13.1~),
  173. -               debhelper-compat (= 13),
  174. +Build-Depends: debhelper,
  175.                 dh-exec,
  176. -               dh-runit (>= 2.8.8),
  177.                 libaudit-dev [linux-any],
  178.                 libedit-dev,
  179. -               libfido2-dev (>= 1.5.0) [linux-any],
  180.                 libgtk-3-dev <!pkg.openssh.nognome>,
  181.                 libkrb5-dev | heimdal-dev,
  182.                 libpam0g-dev | libpam-dev,
  183.                 libselinux1-dev [linux-any],
  184. -               libssl-dev (>= 1.1.0g),
  185. +               libssl-dev ,
  186.                 libsystemd-dev [linux-any] | libelogind-dev [linux-any],
  187.                 libwrap0-dev | libwrap-dev,
  188.                 pkg-config,
  189. @@ -24,7 +21,6 @@ Uploaders: Colin Watson <cjwatson@debian.org>,
  190.  Homepage: https://www.openssh.com/
  191.  Vcs-Git: https://salsa.debian.org/ssh-team/openssh.git
  192.  Vcs-Browser: https://salsa.debian.org/ssh-team/openssh
  193. -Rules-Requires-Root: no
  194.  
  195.  Package: openssh-client
  196.  Architecture: any
  197. diff --git a/debian/rules b/debian/rules
  198. index 18b2bf3..2fcd3ab 100755
  199. --- a/debian/rules
  200. +++ b/debian/rules
  201. @@ -78,7 +78,7 @@ ifeq ($(DEB_HOST_ARCH_OS),linux)
  202.  confflags += --with-selinux
  203.  confflags += --with-audit=linux
  204.  confflags += --with-systemd
  205. -confflags += --with-security-key-builtin
  206. +#confflags += --with-security-key-builtin
  207.  endif
  208.  
  209.  # The deb build wants xauth; the udeb build doesn't.
  210. @@ -98,15 +98,15 @@ confflags += --with-cflags='$(cflags)'
  211.  confflags_udeb += --with-cflags='$(cflags_udeb)'
  212.  
  213.  # Linker flags.
  214. -confflags += --with-ldflags='$(strip -Wl,--as-needed $(LDFLAGS))'
  215. -confflags_udeb += --with-ldflags='-Wl,--as-needed'
  216. +#confflags += --with-ldflags='$(strip -Wl,--as-needed $(LDFLAGS))'
  217. +#confflags_udeb += --with-ldflags='-Wl,--as-needed'
  218.  
  219.  ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes) $(DEB_HOST_ARCH), yes i386)
  220.    BUILD_PACKAGES += -Nopenssh-tests
  221.  endif
  222.  
  223.  %:
  224. -       dh $@ --with=runit $(BUILD_PACKAGES)
  225. +       dh $@ $(BUILD_PACKAGES)
  226.  
  227.  override_dh_autoreconf-indep:

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at