Author: cycholka
Date: Sat Apr 5 13:32:31 2008
New Revision: 25563
URL: http://svn.gna.org/viewcvs/wesnoth?rev=25563&view=rev
Log:
Fix issues pointed out by Sirp and one incorrect value passing. The code should
no longer die a terrible death by exception.
Modified:
trunk/src/server/forum_auth.cpp
Modified: trunk/src/server/forum_auth.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/forum_auth.cpp?rev=25563&r1=25562&r2=25563&view=diff
==============================================================================
--- trunk/src/server/forum_auth.cpp (original)
+++ trunk/src/server/forum_auth.cpp Sat Apr 5 13:32:31 2008
@@ -12,7 +12,7 @@
// * Failure to obtain database connection data
// * Failure to connect to database
// * Failure to find entry coresponding to username
-// * Two cases of invalid hash
+
class forum_auth
{
private :
@@ -52,7 +52,7 @@
if(!db_access_file.is_open())
{
std::string error("Forum auth : No file with access data\n");
- throw &error;
+ throw error;
}
db_access_file >> db_name;
db_access_file >> db_host;
@@ -63,7 +63,7 @@
if (!db_interface.connect(db_name, db_host, db_user, db_password))
{
std::string error("Forum auth : Connection to the databese
failed\n");
- throw &error;
+ throw error;
}
// Retrive users' password as hash
std::string sql("SELECT hash FROM phpbb3_wesnothd WHERE username='");
@@ -73,9 +73,9 @@
if(!(mysqlpp::StoreQueryReult sql_res = query.store()))
{
std::string error("Forum auth : User not found");
- throw &error;
+ throw error;
}
- hash = sql_res[0][0];
+ hash = std::string(sql_res[0][0]);
// Check hash prefix, if different than $H$ hash is invalid
if(hash.substr(0,3) != "$H$")
return false;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits