home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / security / ylonen-ssh / ssh2-X11DisplayOffset.patch < prev   
Text File  |  2000-06-01  |  2KB  |  70 lines

  1. Archived from http://marc.theaimsgroup.com/?l=secure-shell&m=94904735600815&w=2
  2.  
  3. List: secure-shell
  4. Subject: X11DisplayOffset in SSH 2 (patch)
  5. From: Kjetil Torgrim Homme <kjetilho@ifi.uio.no>
  6. Date: 2000-01-28 6:46:45
  7.  
  8. (I'm not on the list.)
  9.  
  10. The default offset of 10 in SSH is too low on one of our servers.  In
  11. SSH 1 the offset can be defined in /etc/ssh_config, but the keyword
  12. disappeared in SSH 2.  Here's a patch to put it back in:
  13.  
  14.  
  15. Kjetil T.
  16.  
  17. --- ./apps/ssh/sshchx11.c.orig  Fri Jan 28 07:18:37 2000
  18. +++ ./apps/ssh/sshchx11.c       Fri Jan 28 07:23:01 2000
  19. @@ -473,7 +473,8 @@
  20.  
  21.  
  22.    /* Open the first available display, starting at number 10. */
  23. -  for (display_number = 10; display_number < X11_MAX_DISPLAYS;
  24. +  for (display_number = session->common->config->x11displayoffset;
  25. +       display_number < X11_MAX_DISPLAYS;
  26.         display_number++)
  27.      {
  28.        /* Format a port number for the display. */
  29. --- ./apps/ssh/sshconfig.c.orig Thu Jan 27 21:44:00 2000
  30. +++ ./apps/ssh/sshconfig.c      Fri Jan 28 07:20:39 2000
  31. @@ -174,6 +174,7 @@
  32.  
  33.    config->forward_agent = TRUE;
  34.    config->forward_x11 = TRUE;
  35. +  config->x11displayoffset = 10;
  36.    config->password_authentication = -1;
  37.    config->rhosts_authentication = TRUE;
  38.    config->rhosts_pubkey_authentication = TRUE;
  39. @@ -457,6 +458,20 @@
  40.    if (strcmp(var, "forwardx11") == 0)
  41.      {
  42.        config->forward_x11 = bool;
  43. +      return FALSE;
  44. +    }
  45. +
  46. +  if (strcmp(var, "x11displayoffset") == 0)
  47. +    {
  48. +      if (num >= 0 && num < 1000)
  49. +       {
  50. +         config->x11displayoffset = num;
  51. +       }
  52. +      else
  53. +        {
  54. +          ssh_warning("Ignoring illegal X11 display offset %s", val);
  55. +          return TRUE;
  56. +        }
  57.        return FALSE;
  58.      }
  59.  
  60. --- ./apps/ssh/sshconfig.h.orig Thu Jan 27 21:50:27 2000
  61. +++ ./apps/ssh/sshconfig.h      Fri Jan 28 05:45:19 2000
  62. @@ -86,6 +86,7 @@
  63.  
  64.    Boolean forward_agent;    
  65.    Boolean forward_x11;
  66. +  int x11displayoffset;
  67.    Boolean password_authentication;
  68.    Boolean rhosts_authentication;
  69.    Boolean rhosts_pubkey_authentication;
  70.