home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / security / ylonen-ssh / ssh2-x11display-offset-configuration.patch < prev    next >
Text File  |  2000-06-09  |  2KB  |  71 lines

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