From owner-svn-ports-all@freebsd.org Wed Jan 3 20:01:10 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 459F1EACBB0; Wed, 3 Jan 2018 20:01:10 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D045635A8; Wed, 3 Jan 2018 20:01:10 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w03K19xr042221; Wed, 3 Jan 2018 20:01:09 GMT (envelope-from joneum@FreeBSD.org) Received: (from joneum@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w03K18sI042219; Wed, 3 Jan 2018 20:01:08 GMT (envelope-from joneum@FreeBSD.org) Message-Id: <201801032001.w03K18sI042219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joneum set sender to joneum@FreeBSD.org using -f From: Jochen Neumeister Date: Wed, 3 Jan 2018 20:01:08 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r458001 - in head/security/pecl-pam: . files X-SVN-Group: ports-head X-SVN-Commit-Author: joneum X-SVN-Commit-Paths: in head/security/pecl-pam: . files X-SVN-Commit-Revision: 458001 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 20:01:10 -0000 Author: joneum Date: Wed Jan 3 20:01:08 2018 New Revision: 458001 URL: https://svnweb.freebsd.org/changeset/ports/458001 Log: security/pecl-pam: Add patch to fix pecl-pam with PHP 7* PR: 224843 Submitted by: flo Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D13740 Added: head/security/pecl-pam/files/ head/security/pecl-pam/files/patch-pam.c (contents, props changed) Modified: head/security/pecl-pam/Makefile Modified: head/security/pecl-pam/Makefile ============================================================================== --- head/security/pecl-pam/Makefile Wed Jan 3 19:33:21 2018 (r458000) +++ head/security/pecl-pam/Makefile Wed Jan 3 20:01:08 2018 (r458001) @@ -3,7 +3,7 @@ PORTNAME= pam PORTVERSION= 1.0.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security pear MAINTAINER= joneum@FreeBSD.org @@ -11,7 +11,6 @@ COMMENT= PECL classes for PAM integration LICENSE= PHP202 -USES= php:pecl -IGNORE_WITH_PHP=70 71 72 +USES= php:pecl dos2unix .include Added: head/security/pecl-pam/files/patch-pam.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/pecl-pam/files/patch-pam.c Wed Jan 3 20:01:08 2018 (r458001) @@ -0,0 +1,121 @@ +Obtained from Gentoo: + https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f113e301d3d56ef3c9623c40014000a102db15c + +--- pam.c.orig 2018-01-02 11:11:25 UTC ++++ pam.c +@@ -227,8 +227,13 @@ int chpass_pam_talker(int num_msg, + PHP_FUNCTION(pam_auth) + { + char *username, *password; ++#if PHP_MAJOR_VERSION >= 7 ++ size_t username_len, password_len; ++ zval *status = NULL, *server, *remote_addr; ++#else + int username_len, password_len; + zval *status = NULL, **server, **remote_addr; ++#endif + zend_bool checkacctmgmt = 1; + + pam_auth_t userinfo = {NULL, NULL}; +@@ -248,22 +253,37 @@ PHP_FUNCTION(pam_auth) + if (status) { + spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_start"); + zval_dtor(status); ++#if PHP_MAJOR_VERSION >= 7 ++ ZVAL_STRING(status, error_msg); ++ efree(error_msg); ++#else + ZVAL_STRING(status, error_msg, 0); ++#endif + } + RETURN_FALSE; + } + ++#if PHP_MAJOR_VERSION >= 7 ++ if ((remote_addr = zend_hash_str_find(Z_ARR(PG(http_globals)[TRACK_VARS_SERVER]), "REMOTE_ADDR", sizeof("REMOTE_ADDR")-1)) != NULL && Z_TYPE_P(remote_addr) == IS_STRING) { ++ pam_set_item(pamh, PAM_RHOST, Z_STRVAL_P(remote_addr)); ++#else + if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **)&server) == SUCCESS && Z_TYPE_PP(server) == IS_ARRAY) { + if (zend_hash_find(Z_ARRVAL_PP(server), "REMOTE_ADDR", sizeof("REMOTE_ADDR"), (void **)&remote_addr) == SUCCESS && Z_TYPE_PP(remote_addr) == IS_STRING) { + pam_set_item(pamh, PAM_RHOST, Z_STRVAL_PP(remote_addr)); + } ++#endif + } + + if ((result = pam_authenticate(pamh, PAM_DISALLOW_NULL_AUTHTOK)) != PAM_SUCCESS) { + if (status) { + spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_authenticate"); + zval_dtor(status); ++#if PHP_MAJOR_VERSION >= 7 ++ ZVAL_STRING(status, error_msg); ++ efree(error_msg); ++#else + ZVAL_STRING(status, error_msg, 0); ++#endif + } + pam_end(pamh, PAM_SUCCESS); + RETURN_FALSE; +@@ -274,7 +294,12 @@ PHP_FUNCTION(pam_auth) + if (status) { + spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_acct_mgmt"); + zval_dtor(status); ++#if PHP_MAJOR_VERSION >= 7 ++ ZVAL_STRING(status, error_msg); ++ efree(error_msg); ++#else + ZVAL_STRING(status, error_msg, 0); ++#endif + } + pam_end(pamh, PAM_SUCCESS); + RETURN_FALSE; +@@ -291,7 +316,11 @@ PHP_FUNCTION(pam_auth) + PHP_FUNCTION(pam_chpass) + { + char *username, *oldpass, *newpass; ++#if PHP_MAJOR_VERSION >= 7 ++ size_t username_len, oldpass_len, newpass_len; ++#else + int username_len, oldpass_len, newpass_len; ++#endif + zval *status = NULL; + + pam_chpass_t userinfo = {NULL, NULL, NULL, 0}; +@@ -312,7 +341,12 @@ PHP_FUNCTION(pam_chpass) + if (status) { + spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_start"); + zval_dtor(status); ++#if PHP_MAJOR_VERSION >= 7 ++ ZVAL_STRING(status, error_msg); ++ efree(error_msg); ++#else + ZVAL_STRING(status, error_msg, 0); ++#endif + } + RETURN_FALSE; + } +@@ -321,7 +355,12 @@ PHP_FUNCTION(pam_chpass) + if (status) { + spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_authenticate"); + zval_dtor(status); ++#if PHP_MAJOR_VERSION >= 7 ++ ZVAL_STRING(status, error_msg); ++ efree(error_msg); ++#else + ZVAL_STRING(status, error_msg, 0); ++#endif + } + pam_end(pamh, PAM_SUCCESS); + RETURN_FALSE; +@@ -331,7 +370,12 @@ PHP_FUNCTION(pam_chpass) + if (status) { + spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_chauthtok"); + zval_dtor(status); ++#if PHP_MAJOR_VERSION >= 7 ++ ZVAL_STRING(status, error_msg); ++ efree(error_msg); ++#else + ZVAL_STRING(status, error_msg, 0); ++#endif + } + pam_end(pamh, PAM_SUCCESS); + RETURN_FALSE;