Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 482340 | Differences between
and this patch

Collapse All | Expand All

(-)a/lib/ds_ldap.php (-2 / +4 lines)
Lines 1117-1128 Link Here
1117
		if (is_array($dn)) {
1117
		if (is_array($dn)) {
1118
			$a = array();
1118
			$a = array();
1119
			foreach ($dn as $key => $rdn)
1119
			foreach ($dn as $key => $rdn)
1120
				$a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn);
1120
				$a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
1121
					function ($matches) { return chr(hexdec($matches[1])); }, $rdn);
1121
1122
1122
			return $a;
1123
			return $a;
1123
1124
1124
		} else
1125
		} else
1125
			return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn);
1126
			return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
1127
					function ($matches) { return chr(hexdec($matches[1])); }, $dn);
1126
	}
1128
	}
1127
1129
1128
	public function getRootDSE($method=null) {
1130
	public function getRootDSE($method=null) {
(-)a/lib/functions.php (-5 / +7 lines)
Lines 2126-2132 Link Here
2126
 *        crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear.
2126
 *        crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear.
2127
 * @return string The hashed password.
2127
 * @return string The hashed password.
2128
 */
2128
 */
2129
function password_hash($password_clear,$enc_type) {
2129
function pla_password_hash($password_clear,$enc_type) {
2130
	if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
2130
	if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
2131
		debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
2131
		debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
2132
2132
Lines 2307-2313 Link Here
2307
2307
2308
		# SHA crypted passwords
2308
		# SHA crypted passwords
2309
		case 'sha':
2309
		case 'sha':
2310
			if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
2310
			if (strcasecmp(pla_password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
2311
				return true;
2311
				return true;
2312
			else
2312
			else
2313
				return false;
2313
				return false;
Lines 2316-2322 Link Here
2316
2316
2317
		# MD5 crypted passwords
2317
		# MD5 crypted passwords
2318
		case 'md5':
2318
		case 'md5':
2319
			if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
2319
			if( strcasecmp(pla_password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
2320
				return true;
2320
				return true;
2321
			else
2321
			else
2322
				return false;
2322
				return false;
Lines 2545-2556 Link Here
2545
		$a = array();
2545
		$a = array();
2546
2546
2547
		foreach ($dn as $key => $rdn)
2547
		foreach ($dn as $key => $rdn)
2548
			$a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn);
2548
			$a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', 
2549
				function ($matches) { return chr(hexdec($matches[1])); }, $rdn );
2549
2550
2550
		return $a;
2551
		return $a;
2551
2552
2552
	} else {
2553
	} else {
2553
		return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn);
2554
		return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
2555
				function ($matches) { return chr(hexdec($matches[1])); }, $dn);
2554
	}
2556
	}
2555
}
2557
}
2556
2558

Return to bug 482340