aboutsummaryrefslogtreecommitdiff
path: root/mail/php73-imap
diff options
context:
space:
mode:
authorJochen Neumeister <joneum@FreeBSD.org>2018-11-22 11:53:53 +0000
committerJochen Neumeister <joneum@FreeBSD.org>2018-11-22 11:53:53 +0000
commitbedd1930aea771a4b0dc108a7930c39d4d251128 (patch)
tree8da46a8a84cc6d791d6c109118d5d4dd100febee /mail/php73-imap
parentb6df7ad0f2b41c0eae8ccac2978a097bf7f05026 (diff)
downloadports-bedd1930aea771a4b0dc108a7930c39d4d251128.tar.gz
ports-bedd1930aea771a4b0dc108a7930c39d4d251128.zip
Disable rsh/ssh functionality in imap by default (php bug #77153).
PR: 233384 Submitted by: joneum Approved by: tz (implicit) MFH: 2018Q4 Security: ec49f6b5-ee39-11e8-b2f4-74d435b63d51 Sponsored by: Netzkommune GmbH
Notes
Notes: svn path=/head/; revision=485597
Diffstat (limited to 'mail/php73-imap')
-rw-r--r--mail/php73-imap/Makefile1
-rw-r--r--mail/php73-imap/files/patch-php__imap.c40
-rw-r--r--mail/php73-imap/files/patch-php__imap.h10
3 files changed, 51 insertions, 0 deletions
diff --git a/mail/php73-imap/Makefile b/mail/php73-imap/Makefile
index adfe95ecf964..11402f56d2a0 100644
--- a/mail/php73-imap/Makefile
+++ b/mail/php73-imap/Makefile
@@ -1,6 +1,7 @@
# $FreeBSD$
CATEGORIES= mail
+PORTREVISION= 1
MASTERDIR= ${.CURDIR}/../../lang/php73
diff --git a/mail/php73-imap/files/patch-php__imap.c b/mail/php73-imap/files/patch-php__imap.c
new file mode 100644
index 000000000000..faa12adafa16
--- /dev/null
+++ b/mail/php73-imap/files/patch-php__imap.c
@@ -0,0 +1,40 @@
+--- php_imap.c.orig 2018-09-11 22:12:36 UTC
++++ php_imap.c
+@@ -562,6 +562,15 @@ static const zend_module_dep imap_deps[]
+ };
+ /* }}} */
+
++
++/* {{{ PHP_INI
++ */
++PHP_INI_BEGIN()
++STD_PHP_INI_BOOLEAN("imap.enable_insecure_rsh", "0", PHP_INI_SYSTEM, OnUpdateBool, enable_rsh, zend_imap_globals, imap_globals)
++PHP_INI_END()
++/* }}} */
++
++
+ /* {{{ imap_module_entry
+ */
+ zend_module_entry imap_module_entry = {
+@@ -835,6 +844,8 @@ PHP_MINIT_FUNCTION(imap)
+ {
+ unsigned long sa_all = SA_MESSAGES | SA_RECENT | SA_UNSEEN | SA_UIDNEXT | SA_UIDVALIDITY;
+
++ REGISTER_INI_ENTRIES();
++
+ #ifndef PHP_WIN32
+ mail_link(&unixdriver); /* link in the unix driver */
+ mail_link(&mhdriver); /* link in the mh driver */
+@@ -1052,6 +1063,12 @@ PHP_MINIT_FUNCTION(imap)
+ GC_TEXTS texts
+ */
+
++ if (!IMAPG(enable_rsh)) {
++ /* disable SSH and RSH, see https://bugs.php.net/bug.php?id=77153 */
++ mail_parameters (NIL, SET_RSHTIMEOUT, 0);
++ mail_parameters (NIL, SET_SSHTIMEOUT, 0);
++ }
++
+ le_imap = zend_register_list_destructors_ex(mail_close_it, NULL, "imap", module_number);
+ return SUCCESS;
+ }
diff --git a/mail/php73-imap/files/patch-php__imap.h b/mail/php73-imap/files/patch-php__imap.h
new file mode 100644
index 000000000000..f27f888f2ee7
--- /dev/null
+++ b/mail/php73-imap/files/patch-php__imap.h
@@ -0,0 +1,10 @@
+--- php_imap.h.orig 2018-09-11 22:12:36 UTC
++++ php_imap.h
+@@ -214,6 +214,7 @@ ZEND_BEGIN_MODULE_GLOBALS(imap)
+ #endif
+ /* php_stream for php_mail_gets() */
+ php_stream *gets_stream;
++ zend_bool enable_rsh;
+ ZEND_END_MODULE_GLOBALS(imap)
+
+ #ifdef ZTS