diff options
author | Matteo Mattei | 2017-04-10 18:49:59 +0200 |
---|---|---|
committer | Matteo Mattei | 2017-04-10 18:49:59 +0200 |
commit | 60d2c94ae208b8c88bd68cb634fa0e06cb2ff843 (patch) | |
tree | e201e14111a62548b655d3c40ec307a16838649f | |
parent | dcb9c0f337e0e813b2dcea12580bb7298dcae9f1 (diff) | |
download | aur-60d2c94ae208b8c88bd68cb634fa0e06cb2ff843.tar.gz |
add zend.patch
-rw-r--r-- | PKGBUILD | 8 | ||||
-rw-r--r-- | zend.patch | 81 |
2 files changed, 86 insertions, 3 deletions
@@ -3,7 +3,7 @@ pkgname=php-pam _extname=pam pkgver=1.0.3 -pkgrel=3 +pkgrel=4 pkgdesc="This extension provides PAM (Pluggable Authentication Modules) integration in PHP." arch=('i686' 'x86_64') url="http://pecl.php.net/package/PAM" @@ -11,10 +11,12 @@ license=('PHP') depends=('php' 'pam' 'php-pear') makedepends=('autoconf') #install=php-pam.install -source=(http://pecl.php.net/get/pam-${pkgver}.tgz pam.ini php) -md5sums=('2dfd378a76021245050333cd4d49ed96' '9582d5f0476e486f2c3084940f1abd86' '5fb207f61ff94b0cc7a2dcc1e3c1c388') +source=(http://pecl.php.net/get/pam-${pkgver}.tgz pam.ini php zend.patch) +md5sums=('2dfd378a76021245050333cd4d49ed96' '9582d5f0476e486f2c3084940f1abd86' '5fb207f61ff94b0cc7a2dcc1e3c1c388' +'806c2d6052159dd58e392dbe91711d05') build() { + patch -p0 < ../zend.patch cd "${_extname}-${pkgver}" phpize ./configure --prefix=/usr diff --git a/zend.patch b/zend.patch new file mode 100644 index 000000000000..d31e512cea45 --- /dev/null +++ b/zend.patch @@ -0,0 +1,81 @@ +--- pam-1.0.3/pam.c.orig 2017-04-09 16:40:13.581520943 +0530 ++++ pam-1.0.3/pam.c 2017-04-09 16:55:59.156281369 +0530 +@@ -228,7 +228,7 @@ + {
+ char *username, *password;
+ int username_len, password_len;
+- zval *status = NULL, **server, **remote_addr;
++ zval *status = NULL, *server, *remote_addr;
+ zend_bool checkacctmgmt = 1;
+
+ pam_auth_t userinfo = {NULL, NULL};
+@@ -248,14 +248,15 @@ + if (status) {
+ spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_start");
+ zval_dtor(status);
+- ZVAL_STRING(status, error_msg, 0);
++ ZVAL_STRING(status, error_msg);
++ efree(error_msg);
+ }
+ RETURN_FALSE;
+ }
+
+- 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));
++ if ((server = zend_hash_str_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER")-1)) != NULL && Z_TYPE_P(server) == IS_ARRAY) {
++ if ((remote_addr = zend_hash_str_find(Z_ARRVAL_P(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));
+ }
+ }
+
+@@ -263,7 +264,8 @@ + if (status) {
+ spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_authenticate");
+ zval_dtor(status);
+- ZVAL_STRING(status, error_msg, 0);
++ ZVAL_STRING(status, error_msg);
++ efree(error_msg);
+ }
+ pam_end(pamh, PAM_SUCCESS);
+ RETURN_FALSE;
+@@ -274,7 +276,8 @@ + if (status) {
+ spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_acct_mgmt");
+ zval_dtor(status);
+- ZVAL_STRING(status, error_msg, 0);
++ ZVAL_STRING(status, error_msg);
++ efree(error_msg);
+ }
+ pam_end(pamh, PAM_SUCCESS);
+ RETURN_FALSE;
+@@ -312,7 +315,8 @@ + if (status) {
+ spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_start");
+ zval_dtor(status);
+- ZVAL_STRING(status, error_msg, 0);
++ ZVAL_STRING(status, error_msg);
++ efree(error_msg);
+ }
+ RETURN_FALSE;
+ }
+@@ -321,7 +325,8 @@ + if (status) {
+ spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_authenticate");
+ zval_dtor(status);
+- ZVAL_STRING(status, error_msg, 0);
++ ZVAL_STRING(status, error_msg);
++ efree(error_msg);
+ }
+ pam_end(pamh, PAM_SUCCESS);
+ RETURN_FALSE;
+@@ -331,7 +336,8 @@ + if (status) {
+ spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_chauthtok");
+ zval_dtor(status);
+- ZVAL_STRING(status, error_msg, 0);
++ ZVAL_STRING(status, error_msg);
++ efree(error_msg);
+ }
+ pam_end(pamh, PAM_SUCCESS);
+ RETURN_FALSE;
|