summaryrefslogtreecommitdiff
path: root/dev-php/pecl-pam
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-php/pecl-pam
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-php/pecl-pam')
-rw-r--r--dev-php/pecl-pam/Manifest4
-rw-r--r--dev-php/pecl-pam/files/1.0.3-php7.patch118
-rw-r--r--dev-php/pecl-pam/metadata.xml8
-rw-r--r--dev-php/pecl-pam/pecl-pam-1.0.3-r3.ebuild41
4 files changed, 171 insertions, 0 deletions
diff --git a/dev-php/pecl-pam/Manifest b/dev-php/pecl-pam/Manifest
new file mode 100644
index 000000000000..402a39c18f24
--- /dev/null
+++ b/dev-php/pecl-pam/Manifest
@@ -0,0 +1,4 @@
+AUX 1.0.3-php7.patch 3519 BLAKE2B 649f278a88e12ecbf895ab372aaa97c9f1f7cdcf4724eeda63368daefc89e89c3e5aae9e09cb7026058ca18aa4569423d75ee125795b56d8e2d372ccc93123f1 SHA512 9877b6bede71f402166253521aec667e4f9da99fbbf4fc0e74b9a5c48e498df717f869969b5d7a6432427a50030370771774f77ecb876ef133288eab174c9289
+DIST pam-1.0.3.tgz 6671 BLAKE2B f416fd0e47d3fda6a1d86e44a7ca17fc9a0428f976f18e2b663a2fd1e09b790cd069ca16d930d6dca6554762ca59bda987929e52365ed813949c1a93291c1dcc SHA512 3580582f1456b31be30a713cadaaca106527f2d4f3f12032b5d3617cc361aaf49539a9db3dd27221ce40320187abaac0f6ad4e23cdfe5eaa94436e3eaef3fb9c
+EBUILD pecl-pam-1.0.3-r3.ebuild 820 BLAKE2B 60fc2dd45e6390ffcc7b97ddffc3c93574184df28dd14231b4232549cd13a9e5ceff152419ced823248506ee7919f117643d0c2b6d6691fa5b403ae0fe8eddbe SHA512 24d6a9c2cce0b83d418f436826716aa5506520dbff58c37fe2d69331929cf0fdd803fb9d2b380e6218befcc8597538333254fa8dec2f91a48d8168ad105468dc
+MISC metadata.xml 239 BLAKE2B 9b7c5dcb74289073481cf07031b7a92f32496cc1097becb074d74a8fbb8133de429ce1baf284e446e44132943c8b32e6b824570f15828588e42ea49ef5661f00 SHA512 2181b874bfe8cd31e7730d8207e26cfd2f272eaf2d1b57ae0faff126347a5298fa1c506d9107e1da9736c8a0ed9c8c339e4d9509a8726b79dbe86e073c12dee0
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 000000000000..d56fffb08d38
--- /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/metadata.xml b/dev-php/pecl-pam/metadata.xml
new file mode 100644
index 000000000000..b86acf66c756
--- /dev/null
+++ b/dev-php/pecl-pam/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>php-bugs@gentoo.org</email>
+ <name>PHP</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-php/pecl-pam/pecl-pam-1.0.3-r3.ebuild b/dev-php/pecl-pam/pecl-pam-1.0.3-r3.ebuild
new file mode 100644
index 000000000000..db57bd508765
--- /dev/null
+++ b/dev-php/pecl-pam/pecl-pam-1.0.3-r3.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PHP_EXT_NAME="pam"
+PHP_EXT_INI="yes"
+PHP_EXT_ZENDEXT="no"
+DOCS=( README )
+
+USE_PHP="php5-6 php7-0 php7-1 php7-2"
+
+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
+ sed -i 's/\r$//' -- pam.c || die
+ 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
+}