[32161] trunk/dports/net/openssh

ram at macports.org ram at macports.org
Tue Dec 18 08:05:48 PST 2007


Revision: 32161
          http://trac.macosforge.org/projects/macports/changeset/32161
Author:   ram at macports.org
Date:     2007-12-18 08:05:46 -0800 (Tue, 18 Dec 2007)

Log Message:
-----------
fix X11 forwarding (with Apples patch) and "percent_expand: NULL
replacement" issue (with proposed upstream fix, taken from
https://bugzilla.mindrot.org/show_bug.cgi?id=1377) on Leopard - closes
#13046, #13611

Modified Paths:
--------------
    trunk/dports/net/openssh/Portfile

Added Paths:
-----------
    trunk/dports/net/openssh/files/
    trunk/dports/net/openssh/files/patch-pwdup.diff

Modified: trunk/dports/net/openssh/Portfile
===================================================================
--- trunk/dports/net/openssh/Portfile	2007-12-18 15:53:01 UTC (rev 32160)
+++ trunk/dports/net/openssh/Portfile	2007-12-18 16:05:46 UTC (rev 32161)
@@ -95,6 +95,15 @@
   configure.compiler	gcc-4.0
 }
 
+platform darwin 9 {
+  patch_sites-append   http://www.opensource.apple.com/darwinsource/10.5/OpenSSH-87/patches/
+  patchfiles-append    DVG-5142987_launchd_DISPLAY_for_X11.patch \
+                       patch-pwdup.diff
+  checksums-append     DVG-5142987_launchd_DISPLAY_for_X11.patch md5 e188ebbba95c4cde61e0e1b2edc9f992 \
+                           sha1 62735c5bfbbe1fa41433993435ded7767cc5f1f9 \
+                           rmd160 eb5262f554583f4925f6f91f6a6d0034c70098ad
+}
+
 startupitem.create  yes
 startupitem.name    OpenSSH
 startupitem.start \

Added: trunk/dports/net/openssh/files/patch-pwdup.diff
===================================================================
--- trunk/dports/net/openssh/files/patch-pwdup.diff	                        (rev 0)
+++ trunk/dports/net/openssh/files/patch-pwdup.diff	2007-12-18 16:05:46 UTC (rev 32161)
@@ -0,0 +1,74 @@
+Index: ssh.c
+===================================================================
+RCS file: /cvs/src/usr.bin/ssh/ssh.c,v
+retrieving revision 1.305
+diff -u -p -r1.305 ssh.c
+--- ssh.c	29 Oct 2007 06:54:50 -0000	1.305
++++ ssh.c	3 Nov 2007 00:32:14 -0000
+@@ -1239,6 +1239,7 @@ load_public_identity_files(void)
+ #endif /* SMARTCARD */
+ 	if ((pw = getpwuid(original_real_uid)) == NULL)
+ 		fatal("load_public_identity_files: getpwuid failed");
++	pw = pwcopy(pw);
+ 	if (gethostname(thishost, sizeof(thishost)) == -1)
+ 		fatal("load_public_identity_files: gethostname: %s",
+ 		    strerror(errno));
+@@ -1256,6 +1257,7 @@ load_public_identity_files(void)
+ 		options.identity_files[i] = filename;
+ 		options.identity_keys[i] = public;
+ 	}
++	pwfree(pw);
+ }
+ 
+ static void
+Index: misc.c
+===================================================================
+RCS file: /cvs/src/usr.bin/ssh/misc.c,v
+retrieving revision 1.65
+diff -u -p -r1.65 misc.c
+--- misc.c	23 Nov 2006 01:35:11 -0000	1.65
++++ misc.c	3 Nov 2007 00:32:14 -0000
+@@ -197,6 +197,28 @@ pwcopy(struct passwd *pw)
+ 	return copy;
+ }
+ 
++void
++pwfree(struct passwd *pw)
++{
++#define PW_CLEAR_FREE(f) \
++	do { \
++		if (pw->f != NULL) { \
++			bzero(pw->f, strlen(pw->f)); \
++			xfree(pw->f); \
++		} \
++	} while (0)
++
++	PW_CLEAR_FREE(pw_name);
++	PW_CLEAR_FREE(pw_passwd);
++	PW_CLEAR_FREE(pw_gecos);
++	PW_CLEAR_FREE(pw_class);
++	PW_CLEAR_FREE(pw_dir);
++	PW_CLEAR_FREE(pw_shell);
++	bzero(pw, sizeof(*pw));
++	xfree(pw);
++#undef PW_CLEAR_FREE
++}
++
+ /*
+  * Convert ASCII string to TCP/IP port number.
+  * Port must be >0 and <=65535.
+Index: misc.h
+===================================================================
+RCS file: /cvs/src/usr.bin/ssh/misc.h,v
+retrieving revision 1.36
+diff -u -p -r1.36 misc.h
+--- misc.h	18 Aug 2006 10:27:16 -0000	1.36
++++ misc.h	3 Nov 2007 00:32:14 -0000
+@@ -35,6 +35,7 @@ char	*tohex(const void *, size_t);
+ void	 sanitise_stdfd(void);
+ 
+ struct passwd *pwcopy(struct passwd *);
++void	 pwfree(struct passwd *);
+ 
+ typedef struct arglist arglist;
+ struct arglist {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071218/b4d8757a/attachment-0001.html


More information about the macports-changes mailing list