diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-php/pecl-pam |
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-php/pecl-pam')
-rw-r--r-- | dev-php/pecl-pam/Manifest | 6 | ||||
-rw-r--r-- | dev-php/pecl-pam/files/1.0.3-php7.patch | 118 | ||||
-rw-r--r-- | dev-php/pecl-pam/metadata.xml | 8 | ||||
-rw-r--r-- | dev-php/pecl-pam/pecl-pam-1.0.3-r2.ebuild | 44 |
4 files changed, 176 insertions, 0 deletions
diff --git a/dev-php/pecl-pam/Manifest b/dev-php/pecl-pam/Manifest new file mode 100644 index 000000000000..097b13e297af --- /dev/null +++ b/dev-php/pecl-pam/Manifest @@ -0,0 +1,6 @@ +AUX 1.0.3-php7.patch 3519 SHA256 255f0e1f9c16e7744ec5ef58f45f65fd90d453846147816afedbe549bf83b163 SHA512 9877b6bede71f402166253521aec667e4f9da99fbbf4fc0e74b9a5c48e498df717f869969b5d7a6432427a50030370771774f77ecb876ef133288eab174c9289 WHIRLPOOL 32287736873def51b5b7f299d6ba83a12c2c50ad2ccc02dd02e4242b3ee3f7f79f164d3c4b5aa142e3bf80cabd7d40876da3db0d235e8fb5030b6f72c1dcaf61 +DIST pam-1.0.3.tgz 6671 SHA256 2e00f253ffd987e2634b44689473beb61ae64120a3899b6f2d1ffdde06ddc887 SHA512 3580582f1456b31be30a713cadaaca106527f2d4f3f12032b5d3617cc361aaf49539a9db3dd27221ce40320187abaac0f6ad4e23cdfe5eaa94436e3eaef3fb9c WHIRLPOOL cbb1fb40286f501affab097be92709e142e7bfbc950dc6140051e03f9dc54d1992f84a8e575aab98e1a8d58e56a8bb3868669cc8a7daf1d620a1cc54454e7b3f +EBUILD pecl-pam-1.0.3-r2.ebuild 877 SHA256 e3a3f51479eece21b5744d126b7db86fba476407eeb2a1ca8448cd9783782811 SHA512 61d8d9e8369ea3c873e67b844030ebfeae4f5b66242307836e544c656da691086eada905a32fa1cb066aa52a4a83dd83c15234de7b553a3c962671624e3ed358 WHIRLPOOL afceaa09cd892669d185d97d76d72d649bb6680df9b27799dffe5c59cdd1e8859696b46885c9d89de6fc869328b8636b112fd67167959521cb67717e8858228e +MISC ChangeLog 2845 SHA256 d9b47a089eb2fb6f29614474e4eefdd6155a579583d32115b2e70dfd63897c58 SHA512 a9c06226e3ae6838d49da586d5feb21c8df21207c79a86f9f1f10a8443e4f5c8d09b89a34980015d29d8a341d5a58c1fec2e66201a8eb6157f180c5d601d2b1c WHIRLPOOL ad4c07fad7e93b8761d4d80d5532996a550845ae2da40959b60ec4815779d0ef5888bd902580de14d1607282e22871362458daf7c55ef17385437436627cd8fb +MISC ChangeLog-2015 1624 SHA256 56d653c9793b571d3b2f48e8a12e447559573c59516312618c1b47c792e90278 SHA512 88ad702b2af617f42c839ebf2dc3a6bdf8e4aef5c301ab933dd747bfec8188c5624cf13c2cccbf50d179d575889990e283adc963d7e058b1efb53fa221b990ad WHIRLPOOL 2db5b87844bb9c387e69fe6f3c6f25ad00d33aac2d3a883a4cbea566acb3e90f904f606dd1520c073740382befbb942df9e6c28f611998967d785f9d15d5051f +MISC metadata.xml 239 SHA256 b54aca642ac424532264a97d14931720ed288cf387dbdef6a10b34ffed6689f1 SHA512 2181b874bfe8cd31e7730d8207e26cfd2f272eaf2d1b57ae0faff126347a5298fa1c506d9107e1da9736c8a0ed9c8c339e4d9509a8726b79dbe86e073c12dee0 WHIRLPOOL 80ab9605bb31ce3310bf524de4705c67ca85cf8f2346b7e13274595598b9fe92c9b119beb865ef214ad33ef172b880e318d18ff8c8d2026cb7319f0524d8a7aa 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-r2.ebuild b/dev-php/pecl-pam/pecl-pam-1.0.3-r2.ebuild new file mode 100644 index 000000000000..dcd2afeb7764 --- /dev/null +++ b/dev-php/pecl-pam/pecl-pam-1.0.3-r2.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2016 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" + +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 +} |