diff options
author | ale <ale@FreeBSD.org> | 2012-05-18 04:44:45 +0800 |
---|---|---|
committer | ale <ale@FreeBSD.org> | 2012-05-18 04:44:45 +0800 |
commit | 623aa2252cebebc16044d984e1c032b83fd7e8ea (patch) | |
tree | 424161629b40bb5471b1cc2a620ead48da5af528 /security | |
parent | 7df6f6a77eeb2efed85bf44861a2f0729c86d34a (diff) | |
download | freebsd-ports-gnome-623aa2252cebebc16044d984e1c032b83fd7e8ea.tar.gz freebsd-ports-gnome-623aa2252cebebc16044d984e1c032b83fd7e8ea.tar.zst freebsd-ports-gnome-623aa2252cebebc16044d984e1c032b83fd7e8ea.zip |
Fix build with php 5.4.
Diffstat (limited to 'security')
-rw-r--r-- | security/pecl-gnupg/files/patch-gnupg.c | 95 | ||||
-rw-r--r-- | security/pecl-gnupg/files/patch-gnupg_keylistiterator.c | 28 |
2 files changed, 123 insertions, 0 deletions
diff --git a/security/pecl-gnupg/files/patch-gnupg.c b/security/pecl-gnupg/files/patch-gnupg.c new file mode 100644 index 000000000000..caa2695f7448 --- /dev/null +++ b/security/pecl-gnupg/files/patch-gnupg.c @@ -0,0 +1,95 @@ +--- gnupg.c 2010/07/20 19:27:25 301426 ++++ gnupg.c 2012/05/06 07:43:30 325553 +@@ -18,6 +18,7 @@ + + #include "php.h" + #include "php_ini.h" ++#include "zend_exceptions.h" + #include "ext/standard/info.h" + #include "php_gnupg.h" + +@@ -53,7 +54,7 @@ + php_error_docref(NULL TSRMLS_CC, E_WARNING, (char*)error); \ + break; \ + case 2: \ +- zend_throw_exception(zend_exception_get_default(), (char*) error, 0 TSRMLS_CC); \ ++ zend_throw_exception(zend_exception_get_default(TSRMLS_C), (char*) error, 0 TSRMLS_CC); \ + break; \ + default: \ + intern->errortxt = (char*)error; \ +@@ -136,6 +137,9 @@ + gpgme_ctx_t ctx; + gpgme_check_version (NULL); + gpgme_new (&ctx); ++#ifdef GNUPG_PATH ++ gpgme_ctx_set_engine_info(ctx, GPGME_PROTOCOL_OpenPGP, GNUPG_PATH, NULL); ++#endif + gpgme_set_armor (ctx,1); + intern->ctx = ctx; + intern->encryptkeys = NULL; +@@ -170,16 +174,22 @@ + /* {{{ objects_new */ + zend_object_value gnupg_obj_new(zend_class_entry *class_type TSRMLS_DC){ + gnupg_object *intern; ++#if PHP_VERSION_ID < 50399 + zval *tmp; ++#endif + zend_object_value retval; + +- intern = emalloc(sizeof(gnupg_object)); ++ intern = ecalloc(1, sizeof(gnupg_object)); + intern->zo.ce = class_type; ++ ++#if PHP_VERSION_ID < 50399 + intern->zo.properties = NULL; +- + ALLOC_HASHTABLE (intern->zo.properties); + zend_hash_init (intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_copy (intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); ++#else ++ object_properties_init(&intern->zo, class_type); ++#endif + + retval.handle = zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_obj_dtor,NULL TSRMLS_CC); + retval.handlers = (zend_object_handlers *) & gnupg_object_handlers; +@@ -379,7 +389,7 @@ + /* {{{ callback func for setting the passphrase */ + + gpgme_error_t passphrase_cb (gnupg_object *intern, const char *uid_hint, const char *passphrase_info,int last_was_bad, int fd TSRMLS_DC){ +- char uid[16]; ++ char uid[17]; + int idx; + char *passphrase = NULL; + zval *return_value = NULL; +@@ -407,7 +417,7 @@ + } + + gpgme_error_t passphrase_decrypt_cb (gnupg_object *intern, const char *uid_hint, const char *passphrase_info,int last_was_bad, int fd TSRMLS_DC){ +- char uid[16]; ++ char uid[17]; + int idx; + char *passphrase = NULL; + zval *return_value = NULL; +@@ -1244,7 +1254,6 @@ + gpgme_data_t in, out; + gpgme_decrypt_result_t decrypt_result; + gpgme_verify_result_t verify_result; +- gpgme_signature_t gpg_signatures; + + GNUPG_GETOBJ(); + +@@ -1472,13 +1481,12 @@ + /* {{{ proto array gnupg_listsignatures(string keyid) */ + PHP_FUNCTION(gnupg_listsignatures){ + char *keyid; +- char keyid_len; ++ int keyid_len; + + zval *sub_arr; + zval *sig_arr; + + gpgme_key_t gpgme_key; +- gpgme_subkey_t gpgme_subkey; + gpgme_user_id_t gpgme_userid; + gpgme_key_sig_t gpgme_signature; + diff --git a/security/pecl-gnupg/files/patch-gnupg_keylistiterator.c b/security/pecl-gnupg/files/patch-gnupg_keylistiterator.c new file mode 100644 index 000000000000..4d037cec6551 --- /dev/null +++ b/security/pecl-gnupg/files/patch-gnupg_keylistiterator.c @@ -0,0 +1,28 @@ +--- gnupg_keylistiterator.c 2006/11/03 12:38:35 222719 ++++ gnupg_keylistiterator.c 2012/01/29 02:38:33 322911 +@@ -23,6 +23,7 @@ + #include "php_ini.h" + #include "ext/standard/info.h" + #include "zend_interfaces.h" ++#include "zend_exceptions.h" + #include "php_gnupg.h" + #include "php_gnupg_keylistiterator.h" + +@@ -148,7 +149,7 @@ + gpgme_key_release(intern->gpgkey); + } + +- if(intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey)){ ++ if((intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey))){ + gpgme_key_release(intern->gpgkey); + intern->gpgkey = NULL; + } +@@ -159,7 +160,7 @@ + GNUPG_GET_ITERATOR(); + + if((intern->err = gpgme_op_keylist_start(intern->ctx, Z_STRVAL(intern->pattern), 0)) != GPG_ERR_NO_ERROR){ +- zend_throw_exception(zend_exception_get_default(),gpg_strerror(intern->err),1 TSRMLS_CC); ++ zend_throw_exception(zend_exception_get_default(TSRMLS_C),gpg_strerror(intern->err),1 TSRMLS_CC); + } + if((intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey))!=GPG_ERR_NO_ERROR){ + RETURN_FALSE; |