Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Apr 2010 15:27:10 +0200 (CEST)
From:      Martin Matuska <mm@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        miwi@FreeBSD.org
Subject:   ports/145672: [PATCH] security/pecl-ssh2: fix build with php 5.3
Message-ID:  <20100413132710.C5CE22D965@mail2.vx.sk>
Resent-Message-ID: <201004131330.o3DDU5a2044410@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         145672
>Category:       ports
>Synopsis:       [PATCH] security/pecl-ssh2: fix build with php 5.3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 13 13:30:05 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 8.0-RELEASE-p2 amd64
>Organization:
>Environment:
System: FreeBSD neo.vx.sk 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #28: Sun Apr 11 23:24:57 CEST 2010
>Description:
- Fix PECL bug #14397 - compile fails on 5.3 (svn r270322)
- Better 5.2/5.3 compat fixes (svn r275348)
- Fix PECL bug #9500 - SSH2 sockets not being closed properly (svn r275356)

Port maintainer (miwi@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- pecl-ssh2-0.11_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/security/pecl-ssh2/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	28 Aug 2009 18:54:45 -0000	1.7
+++ Makefile	13 Apr 2010 13:23:52 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	ssh2
 PORTVERSION=	0.11
+PORTREVISION=	1
 CATEGORIES=	security pear
 MASTER_SITES=	LOCAL/chinsan/PECL/
 PKGNAMEPREFIX=	pecl-
Index: files/patch-ssh2.c
===================================================================
RCS file: /home/pcvs/ports/security/pecl-ssh2/files/patch-ssh2.c,v
retrieving revision 1.2
diff -u -r1.2 patch-ssh2.c
--- files/patch-ssh2.c	13 Apr 2010 13:08:55 -0000	1.2
+++ files/patch-ssh2.c	13 Apr 2010 13:23:52 -0000
@@ -1,14 +1,42 @@
---- ./ssh2.c.orig	2007-08-11 23:25:25.000000000 -0400
-+++ ./ssh2.c	2010-04-13 09:05:17.000000000 -0400
-@@ -48,7 +48,6 @@
+--- ssh2.c.orig	2007-08-12 05:25:25.000000000 +0200
++++ ssh2.c	2010-04-13 15:18:56.789317762 +0200
+@@ -47,14 +47,9 @@
+ int le_ssh2_pkey_subsys;
  #endif
  
- #ifdef ZEND_ENGINE_2
+-#ifdef ZEND_ENGINE_2
 -static
-     ZEND_BEGIN_ARG_INFO(php_ssh2_first_arg_force_ref, 0)
-         ZEND_ARG_PASS_INFO(1)
-     ZEND_END_ARG_INFO()
-@@ -484,7 +483,7 @@
+-    ZEND_BEGIN_ARG_INFO(php_ssh2_first_arg_force_ref, 0)
+-        ZEND_ARG_PASS_INFO(1)
+-    ZEND_END_ARG_INFO()
+-#else
+-static unsigned char php_ssh2_first_arg_force_ref[] = { 1, BYREF_FORCE };
+-#endif
++ZEND_BEGIN_ARG_INFO(php_ssh2_first_arg_force_ref, 0)
++    ZEND_ARG_PASS_INFO(1)
++ZEND_END_ARG_INFO()
+ 
+ /* *************
+    * Callbacks *
+@@ -358,7 +353,7 @@
+ 	if (!session) {
+ 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to initialize SSH2 session");
+ 		efree(data);
+-		close(socket);
++		closesocket(socket);
+ 		return NULL;
+ 	}
+ 	libssh2_banner_set(session, LIBSSH2_SSH_DEFAULT_BANNER " PHP");
+@@ -434,7 +429,7 @@
+ 
+ 		last_error = libssh2_session_last_error(session, &error_msg, NULL, 0);
+ 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error starting up SSH connection(%d): %s", last_error, error_msg);
+-		close(socket);
++		closesocket(socket);
+ 		libssh2_session_free(session);
+ 		efree(data);
+ 		return NULL;
+@@ -484,7 +479,7 @@
  
  	ZEND_FETCH_RESOURCE(session, LIBSSH2_SESSION*, &zsession, -1, PHP_SSH2_SESSION_RES_NAME, le_ssh2_session);
  
@@ -17,7 +45,7 @@
  	libssh2_session_methods(session, &kex, &hostkey, &crypt_cs, &crypt_sc, &mac_cs, &mac_sc, &comp_cs, &comp_sc, &lang_cs, &lang_sc);
  #else
  	kex = libssh2_session_methods(session, LIBSSH2_METHOD_KEX);
-@@ -889,7 +888,7 @@
+@@ -889,7 +884,7 @@
  	for(i = 0; i < numfds; i++) {
  		zval *subarray = *pollmap[i];
  
@@ -26,7 +54,7 @@
  			/* Make a new copy of the subarray zval* */
  			MAKE_STD_ZVAL(subarray);
  			*subarray = **pollmap[i];
-@@ -899,8 +898,8 @@
+@@ -899,8 +894,8 @@
  			zval_copy_ctor(subarray);
  
  			/* Fixup its refcount */
@@ -37,14 +65,23 @@
  		}
  		zend_hash_del(Z_ARRVAL_P(subarray), "revents", sizeof("revents"));
  		add_assoc_long(subarray, "revents", pollfds[i].revents);
-@@ -1009,8 +1008,8 @@
+@@ -1009,8 +1004,8 @@
  			}
  
  			zval_copy_ctor(&copyval);
 -			copyval.is_ref = 0;
 -			copyval.refcount = 1;
-+			Z_UNSET_ISREF(copyval);
-+			Z_SET_REFCOUNT(copyval, 1);
++			Z_UNSET_ISREF_P(&copyval);
++			Z_SET_REFCOUNT_P(&copyval, 1);
  			convert_to_string(&copyval);
  
  			if (*key == '*') {
+@@ -1148,7 +1143,7 @@
+ 			zval_ptr_dtor(&(*data)->disconnect_cb);
+ 		}
+ 
+-		close((*data)->socket);
++		closesocket((*data)->socket);
+ 
+ 		efree(*data);
+ 		*data = NULL;
--- pecl-ssh2-0.11_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100413132710.C5CE22D965>