[aur-dev] [PATCH 1/2] Fix the return value of save_salt()

Lukas Fleischer archlinux at cryptocrack.de
Fri Aug 8 14:08:42 EDT 2014


Return true if and only if the SQL query was executed successfully.
Logins with an unsalted password no longer fail now.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/lib/aur.inc.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php
index 82730bb..81cbf69 100644
--- a/web/lib/aur.inc.php
+++ b/web/lib/aur.inc.php
@@ -471,7 +471,7 @@ function save_salt($user_id, $passwd) {
 	$hash = salted_hash($passwd, $salt);
 	$q = "UPDATE Users SET Salt = " . $dbh->quote($salt) . ", ";
 	$q.= "Passwd = " . $dbh->quote($hash) . " WHERE ID = " . $user_id;
-	$result = $dbh->exec($q);
+	return $dbh->exec($q);
 }
 
 /**
-- 
2.0.4


More information about the aur-dev mailing list