Zhang Huangbin avatar Zhang Huangbin committed 25291b5

Patch to support 'SSHA' with PHP-5.3 in Roundcubemail-0.7.

Comments (0)

Files changed (2)

iRedMail/functions/roundcubemail.sh

     perl -pi -e 's#(.*managesieve_port.*=).*#${1} $ENV{'MANAGESIEVE_PORT'};#' config.inc.php
     perl -pi -e 's#(.*managesieve_host.*=).*#${1} "$ENV{'MANAGESIEVE_BINDADDR'}";#' config.inc.php
     perl -pi -e 's#(.*managesieve_usetls.*=).*#${1} false;#' config.inc.php
-    perl -pi -e 's#(.*managesieve_default.*=).*#${1} "$ENV{DOVECOT_GLOBAL_SIEVE_FILE_SYMBOL}";#' config.inc.php
+    perl -pi -e 's#(.*managesieve_default.*=).*#${1} "$ENV{DOVECOT_GLOBAL_SIEVE_FILE}";#' config.inc.php
 
     echo 'export status_rcm_plugin_managesieve="DONE"' >> ${STATUS_FILE}
 }
     cd ${RCM_HTTPD_ROOT}/config/ && \
     perl -pi -e 's#(.*rcmail_config.*plugins.*=.*array\()(.*\).*)#${1}"password",${2}#' main.inc.php
 
+    # Patch to use 'SSHA' with PHP-5.3.
+    cd ${RCM_HTTPD_ROOT}/ && \
+        patch -p0 < ${PATCH_DIR}/roundcube/ldap_simple.patch >/dev/null
+
     cd ${RCM_HTTPD_ROOT}/plugins/password/ && \
     cp config.inc.php.dist config.inc.php
 
         perl -pi -e 's#(.*password_driver.*=).*#${1} "sql";#' config.inc.php
         perl -pi -e 's#(.*password_db_dsn.*= )(.*)#${1}"$ENV{'PHP_CONN_TYPE'}://$ENV{'RCM_DB_USER'}:$ENV{'RCM_DB_PASSWD'}\@$ENV{'MYSQL_SERVER'}/$ENV{'VMAIL_DB'}";#' config.inc.php
         perl -pi -e 's#(.*password_query.*=).*#${1} "UPDATE $ENV{'VMAIL_DB'}.mailbox SET password=%c,passwordlastchange=NOW() WHERE username=%u LIMIT 1";#' config.inc.php
-        perl -pi -e 's#(.*password_hash_algorithm.*=).*#${1} "md5crypt";#' config.inc.php
+        perl -pi -e 's#(.*password_hash_algorithm.*=).*#${1} "ssha";#' config.inc.php
         perl -pi -e 's#(.*password_hash_base64.*=).*#${1} false;#' config.inc.php
 
     elif [ X"${BACKEND}" == X"OpenLDAP" ]; then

iRedMail/patches/roundcube/ldap_simple.patch

+--- plugins/password/drivers/ldap_simple.php	2011-11-24 15:53:00.000000000 +0800
++++ /Users/zhb/ldap_simple.php	2011-12-31 00:44:35.000000000 +0800
+@@ -216,7 +216,7 @@
+ 			}
+ 			break;
+ 		case 'ssha':
+-			if (function_exists('mhash') && function_exists('mhash_keygen_s2k')) {
++			if (function_exists('mhash_keygen_s2k')) {
+ 				mt_srand((double) microtime() * 1000000 );
+ 				$salt = mhash_keygen_s2k(MHASH_SHA1, $password_clear, substr(pack('h*', md5(mt_rand())), 0, 8), 4);
+ 				$crypted_password = '{SSHA}' . base64_encode(mhash(MHASH_SHA1, $password_clear . $salt) . $salt);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.