Ticket #13611: ssh-x11-percent_expand.diff

File ssh-x11-percent_expand.diff, 3.0 KB (added by skymoo (Adam Mercer), 16 years ago)

apply Apples patch for X11 forward on Leopard, also fix "percent_expand: NULL replacement" issue

  • net/openssh/files/patch-pwdup.diff

    === added directory 'net/openssh/files'
    === added file 'net/openssh/files/patch-pwdup.diff'
     
     1Index: ssh.c
     2===================================================================
     3RCS file: /cvs/src/usr.bin/ssh/ssh.c,v
     4retrieving revision 1.305
     5diff -u -p -r1.305 ssh.c
     6--- ssh.c       29 Oct 2007 06:54:50 -0000      1.305
     7+++ ssh.c       3 Nov 2007 00:32:14 -0000
     8@@ -1239,6 +1239,7 @@ load_public_identity_files(void)
     9 #endif /* SMARTCARD */
     10        if ((pw = getpwuid(original_real_uid)) == NULL)
     11                fatal("load_public_identity_files: getpwuid failed");
     12+       pw = pwcopy(pw);
     13        if (gethostname(thishost, sizeof(thishost)) == -1)
     14                fatal("load_public_identity_files: gethostname: %s",
     15                    strerror(errno));
     16@@ -1256,6 +1257,7 @@ load_public_identity_files(void)
     17                options.identity_files[i] = filename;
     18                options.identity_keys[i] = public;
     19        }
     20+       pwfree(pw);
     21 }
     22 
     23 static void
     24Index: misc.c
     25===================================================================
     26RCS file: /cvs/src/usr.bin/ssh/misc.c,v
     27retrieving revision 1.65
     28diff -u -p -r1.65 misc.c
     29--- misc.c      23 Nov 2006 01:35:11 -0000      1.65
     30+++ misc.c      3 Nov 2007 00:32:14 -0000
     31@@ -197,6 +197,28 @@ pwcopy(struct passwd *pw)
     32        return copy;
     33 }
     34 
     35+void
     36+pwfree(struct passwd *pw)
     37+{
     38+#define PW_CLEAR_FREE(f) \
     39+       do { \
     40+               if (pw->f != NULL) { \
     41+                       bzero(pw->f, strlen(pw->f)); \
     42+                       xfree(pw->f); \
     43+               } \
     44+       } while (0)
     45+
     46+       PW_CLEAR_FREE(pw_name);
     47+       PW_CLEAR_FREE(pw_passwd);
     48+       PW_CLEAR_FREE(pw_gecos);
     49+       PW_CLEAR_FREE(pw_class);
     50+       PW_CLEAR_FREE(pw_dir);
     51+       PW_CLEAR_FREE(pw_shell);
     52+       bzero(pw, sizeof(*pw));
     53+       xfree(pw);
     54+#undef PW_CLEAR_FREE
     55+}
     56+
     57 /*
     58  * Convert ASCII string to TCP/IP port number.
     59  * Port must be >0 and <=65535.
     60Index: misc.h
     61===================================================================
     62RCS file: /cvs/src/usr.bin/ssh/misc.h,v
     63retrieving revision 1.36
     64diff -u -p -r1.36 misc.h
     65--- misc.h      18 Aug 2006 10:27:16 -0000      1.36
     66+++ misc.h      3 Nov 2007 00:32:14 -0000
     67@@ -35,6 +35,7 @@ char  *tohex(const void *, size_t);
     68 void    sanitise_stdfd(void);
     69 
     70 struct passwd *pwcopy(struct passwd *);
     71+void    pwfree(struct passwd *);
     72 
     73 typedef struct arglist arglist;
     74 struct arglist {
  • net/openssh/Portfile

    === modified file 'net/openssh/Portfile'
     
    9595  configure.compiler    gcc-4.0
    9696}
    9797
     98platform darwin 9 {
     99  patch_sites-append   http://www.opensource.apple.com/darwinsource/10.5/OpenSSH-87/patches/
     100  patchfiles-append    DVG-5142987_launchd_DISPLAY_for_X11.patch \
     101                       patch-pwdup.diff
     102  checksums-append     DVG-5142987_launchd_DISPLAY_for_X11.patch md5 e188ebbba95c4cde61e0e1b2edc9f992 \
     103                           sha1 62735c5bfbbe1fa41433993435ded7767cc5f1f9 \
     104                           rmd160 eb5262f554583f4925f6f91f6a6d0034c70098ad
     105}
     106
    98107startupitem.create  yes
    99108startupitem.name    OpenSSH
    100109startupitem.start \