From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E6ADF1395E2 for ; Thu, 1 Dec 2016 19:53:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 069A2E0A6C; Thu, 1 Dec 2016 19:53:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D1A8EE0A6C for ; Thu, 1 Dec 2016 19:53:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7BF95340F53 for ; Thu, 1 Dec 2016 19:53:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CF631495 for ; Thu, 1 Dec 2016 19:53:41 +0000 (UTC) From: "Brian Evans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Evans" Message-ID: <1480622009.8f113e301d3d56ef3c9623c40014000a102db15c.grknight@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-pam/files/, dev-php/pecl-pam/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-php/pecl-pam/files/1.0.3-php7.patch dev-php/pecl-pam/pecl-pam-1.0.3-r2.ebuild X-VCS-Directories: dev-php/pecl-pam/files/ dev-php/pecl-pam/ X-VCS-Committer: grknight X-VCS-Committer-Name: Brian Evans X-VCS-Revision: 8f113e301d3d56ef3c9623c40014000a102db15c X-VCS-Branch: master Date: Thu, 1 Dec 2016 19:53:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: dfac539e-c05e-4b83-ba8c-85b307d565bb X-Archives-Hash: 18105225a10f5488b39fb9154688ccf6 commit: 8f113e301d3d56ef3c9623c40014000a102db15c Author: Brian Evans gentoo org> AuthorDate: Thu Dec 1 19:51:56 2016 +0000 Commit: Brian Evans gentoo org> CommitDate: Thu Dec 1 19:53:29 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f113e30 dev-php/pecl-pam: Revision bump to support PHP 7 and drop 5.4 and 5.5 PHP 7 patch created by me as it was rather trivial changes Package-Manager: portage-2.3.2 dev-php/pecl-pam/files/1.0.3-php7.patch | 118 ++++++++++++++++++++++++++++++ dev-php/pecl-pam/pecl-pam-1.0.3-r2.ebuild | 45 ++++++++++++ 2 files changed, 163 insertions(+) diff --git a/dev-php/pecl-pam/files/1.0.3-php7.patch b/dev-php/pecl-pam/files/1.0.3-php7.patch new file mode 100644 index 00000000..d56fffb --- /dev/null +++ b/dev-php/pecl-pam/files/1.0.3-php7.patch @@ -0,0 +1,118 @@ +--- a/pam.c 2016-12-01 14:29:27.453904230 -0500 ++++ b/pam.c 2016-12-01 14:27:26.496109755 -0500 +@@ -227,8 +227,13 @@ + 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 @@ + 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 @@ + 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_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 @@ + 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 @@ + 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 @@ + 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; diff --git a/dev-php/pecl-pam/pecl-pam-1.0.3-r2.ebuild b/dev-php/pecl-pam/pecl-pam-1.0.3-r2.ebuild new file mode 100644 index 00000000..2679757 --- /dev/null +++ b/dev-php/pecl-pam/pecl-pam-1.0.3-r2.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +PHP_EXT_NAME="pam" +PHP_EXT_INI="yes" +PHP_EXT_ZENDEXT="no" +DOCS=( README ) + +USE_PHP="php5-6 php7-0" + +inherit php-ext-pecl-r3 pam + +KEYWORDS="~amd64 ~x86" + +DESCRIPTION="This extension provides PAM (Pluggable Authentication Modules) integration" +LICENSE="PHP-2.02" +SLOT="0" +IUSE="debug" + +DEPEND="sys-libs/pam" +RDEPEND="${DEPEND}" + +PATCHES=( "${FILESDIR}/${PV}-php7.patch" ) + +src_prepare() { + #Fix DOS line endings + for slot in $(php_get_slots); do + php_init_slot_env "${slot}" + sed -i 's/\r$//' -- pam.c || die + done + php-ext-source-r3_src_prepare +} + +src_configure() { + local PHP_EXT_ECONF_ARGS=( --with-pam=/usr $(use_enable debug) ) + php-ext-source-r3_src_configure +} + +src_install() { + pamd_mimic_system php auth account password + php-ext-pecl-r3_src_install +}