pastebin - collaborative debugging tool
rovema.kpaste.net RSS


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

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