summaryrefslogtreecommitdiff
path: root/mysql.c
diff options
context:
space:
mode:
authordane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-04-16 18:07:23 +0000
committerdane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-04-16 18:07:23 +0000
commit562a146eb27c9e452553adfffd21eeb10548fee0 (patch)
tree0bb3182341895d1cb26ff76ccadb41d4eda3ab64 /mysql.c
parent9f73d552c4fb89f20be10fed9ce16fe08d7bf23e (diff)
BUILD : 1.7.1 (53) BUGS : 10 NOTES : Fixed previous MySQL fix for saving nick passwords.
git-svn-id: svn://svn.anope.org/anope/trunk@53 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@34 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'mysql.c')
-rw-r--r--mysql.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mysql.c b/mysql.c
index 004e07967..e1c5f5b22 100644
--- a/mysql.c
+++ b/mysql.c
@@ -208,11 +208,12 @@ void db_mysql_save_ns_req(NickRequest * nr)
char *db_mysql_secure(char *pass)
{
+ char epass[BUFSIZE];
+
#ifdef USE_ENCRYPTION
/* If we use the builtin encryption don't double encrypt! */
- return sstrdup(pass);
+ snprintf(epass, sizeof(epass), "'%s'", pass);
#else
- char epass[BUFSIZE];
if (!pass) {
snprintf(epass, sizeof(epass), "''");
@@ -229,9 +230,10 @@ char *db_mysql_secure(char *pass)
MysqlSecure);
}
- return sstrdup(epass);
#endif
+ return sstrdup(epass);
+
}
/*************************************************************************/
@@ -256,7 +258,7 @@ void db_mysql_save_ns_core(NickCore * nc)
/* Let's take care of the core itself */
/* Update the existing records */
snprintf(sqlcmd, MAX_SQL_BUF,
- "UPDATE anope_ns_core SET pass='%s',email='%s',greet='%s',icq='%d',url='%s',flags='%d',"
+ "UPDATE anope_ns_core SET pass=%s,email='%s',greet='%s',icq='%d',url='%s',flags='%d',"
"language='%d',accesscount='%d',memocount='%d',memomax='%d',channelcount='%d'"
",channelmax='%d',active='1' WHERE display='%s'",
epass, cemail, cgreet, nc->icq, curl, nc->flags,
@@ -414,7 +416,7 @@ void db_mysql_save_cs_info(ChannelInfo * ci)
/* Let's take care of the core itself */
snprintf(sqlcmd, MAX_SQL_BUF,
- "UPDATE anope_cs_info SET founder='%s',successor='%s',founderpass='%s',"
+ "UPDATE anope_cs_info SET founder=%s,successor='%s',founderpass='%s',"
"descr='%s',url='%s',email='%s',time_registered='%d',last_used='%d',"
"last_topic='%s',last_topic_setter='%s',last_topic_time='%d',flags='%d',"
"forbidby='%s',forbidreason='%s',bantype='%d',accesscount='%d',"