fix sql injection in pacrypt() when mysql_crypt is in use; see previous commits etc esp in the 2.3 branch

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1327 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
David Goodwin 13 years ago
parent 1a9104cab4
commit cb640c87c1

@ -1099,6 +1099,7 @@ function pacrypt ($pw, $pw_db="") {
// See https://sourceforge.net/tracker/?func=detail&atid=937966&aid=1793352&group_id=191583
// this is apparently useful for pam_mysql etc.
elseif ($CONF['encrypt'] == 'mysql_encrypt') {
$pw = escape_string($pw);
if ($pw_db!="") {
$salt=substr($pw_db,0,2);
$res=db_query("SELECT ENCRYPT('".$pw."','".$salt."');");

Loading…
Cancel
Save