summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-10-17 18:13:32 +0000
committergeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-10-17 18:13:32 +0000
commit4d638356f53eb466eaed8592ada0dee9633b9f95 (patch)
tree2209c0af18be0d8ae46d02e65463d1f5ceb03f95
parentaf5f8af76f67f4053f529243d4ebe43c2bc2e282 (diff)
BUILD : 1.7.16 (1180) BUGS : 614 NOTES : Fixed: [1] MySQL not storing passwords at all (blank passes) [2] saving of ttb with MySQL/RDB was completely fubar [3] do not send PONG-flood anymore on db-load...
git-svn-id: svn://svn.anope.org/anope/trunk@1180 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@901 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes4
-rw-r--r--Changes.mysql9
-rw-r--r--data/tables.sql13
-rw-r--r--src/chanserv.c1
-rw-r--r--src/mysql.c37
-rw-r--r--src/rdb.c9
-rw-r--r--version.log6
7 files changed, 59 insertions, 20 deletions
diff --git a/Changes b/Changes
index 73f544053..055cb17ad 100644
--- a/Changes
+++ b/Changes
@@ -5,7 +5,9 @@ Anope Version S V N
10/16 F MySQL functions did not always escape all values correctly. [#612]
10/16 F Made anoperc restart to accepts arguments like anoperc start. [#611]
10/16 F MySQL query debug quoted displayed queries just a tad too much. [ #00]
-01/16 F MySQL query error in RDB functions. [ #00]
+10/16 F MySQL query error in RDB functions. [ #00]
+10/17 F Erroneous code caused MySQL to store all passwords as blank. [#614]
+10/17 F Saving of ttb-data when using MySQL. [ #00]
Anope Version 1.7.16
--------------------
diff --git a/Changes.mysql b/Changes.mysql
index 5bcf5d1b9..93aa8f580 100644
--- a/Changes.mysql
+++ b/Changes.mysql
@@ -1,6 +1,13 @@
Anope Version S V N
--------------------
-- NONE
+- CREATE TABLE anope_cs_ttb (
+ ct_id int(11) NOT NULL auto_increment,
+ channel varchar(255) NOT NULL default '',
+ ttb_id int(11) NOT NULL default '0',
+ value int(11) NOT NULL default '0',
+ PRIMARY KEY (ct_id)
+ ) TYPE=MyISAM
+- ALTER TABLE anope_cs_info DROP ttb
Anope Version 1.7.16
--------------------
diff --git a/data/tables.sql b/data/tables.sql
index d3170c9a1..ed8b2b60c 100644
--- a/data/tables.sql
+++ b/data/tables.sql
@@ -111,7 +111,6 @@ CREATE TABLE anope_cs_info (
memomax smallint(5) unsigned NOT NULL default '0',
botnick varchar(255) NOT NULL default '',
botflags int(10) unsigned NOT NULL default '0',
- ttb smallint(6) NOT NULL default '0',
bwcount smallint(6) NOT NULL default '0',
capsmin smallint(6) NOT NULL default '0',
capspercent smallint(6) NOT NULL default '0',
@@ -138,6 +137,18 @@ CREATE TABLE anope_cs_levels (
) TYPE=MyISAM;
--
+-- Table structure for table `anope_cs_ttb`
+--
+DROP TABLE IF EXISTS anope_cs_ttb;
+CREATE TABLE anope_cs_ttb (
+ ct_id int(11) NOT NULL auto_increment,
+ channel varchar(255) NOT NULL default '',
+ ttb_id int(11) NOT NULL default '0',
+ value int(11) NOT NULL default '0',
+ PRIMARY KEY (ct_id)
+) TYPE=MyISAM;
+
+--
-- Table structure for table `anope_hs_core`
--
diff --git a/src/chanserv.c b/src/chanserv.c
index 2c53e4af1..1b05f8202 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -1022,6 +1022,7 @@ void save_cs_rdb_dbase(void)
rdb_clear_table("anope_cs_levels");
rdb_clear_table("anope_cs_akicks");
rdb_clear_table("anope_cs_badwords");
+ rdb_clear_table("anope_cs_ttb");
for (i = 0; i < 256; i++) {
for (ci = chanlists[i]; ci; ci = ci->next) {
diff --git a/src/mysql.c b/src/mysql.c
index ed74b6e64..db84f0d27 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -246,7 +246,7 @@ char *db_mysql_secure(char *pass)
}
#else
- if (pass) {
+ if (!pass) {
snprintf(epass, sizeof(epass), "''");
} else if ((!MysqlSecure) || (strcmp(MysqlSecure, "") == 0)) {
snprintf(epass, sizeof(epass), "'%s'", pass);
@@ -455,7 +455,7 @@ void db_mysql_save_cs_info(ChannelInfo * ci)
"forbidby='%s',forbidreason='%s',bantype='%d',accesscount='%d',"
"akickcount='%d',mlock_on='%d',mlock_off='%d',mlock_limit='%d',"
"mlock_key='%s',mlock_flood='%s',mlock_redirect='%s',entry_message='%s',"
- "memomax='%d',botnick='%s',botflags='%d',ttb='%d',bwcount='%d',"
+ "memomax='%d',botnick='%s',botflags='%d',bwcount='%d',"
"capsmin='%d',capspercent='%d',floodlines='%d',floodsecs='%d',"
"repeattimes='%d',active='1' WHERE name='%s'",
cifoundernick,
@@ -474,7 +474,6 @@ void db_mysql_save_cs_info(ChannelInfo * ci)
(int) ci->memos.memomax,
cibotnick,
(int) ci->botflags,
- (int) ci->ttb,
(int) ci->bwcount,
(int) ci->capsmin,
(int) ci->capspercent,
@@ -617,6 +616,16 @@ void db_mysql_save_cs_info(ChannelInfo * ci)
}
}
+ /* TTB's */
+ for (j = 0; j < TTB_SIZE; j++) {
+ snprintf(sqlcmd, MAX_SQL_BUF, "INSERT DELAYED INTO anope_cs_ttb (channel, ttb_id, value)"
+ " VALUES ('%s', %d, %d)", ciname, j, ci->ttb[j]);
+ if (db_mysql_query(sqlcmd)) {
+ log_perror("Can't create sql query: %s", sqlcmd);
+ db_mysql_error(MYSQL_WARNING, "query");
+ }
+ }
+
free(ciname);
free(cifoundernick); /* mark */
free(cisuccessornick); /* mark */
@@ -1148,7 +1157,7 @@ void db_mysql_load_cs_dbase(void)
return;
snprintf(sqlcmd, MAX_SQL_BUF,
- "SELECT `name`,`founder`,`successor`,`founderpass`,`descr`,`url`,`email`,`time_registered`,`last_used`,`last_topic`,`last_topic_setter`,`last_topic_time`,`flags`,`forbidby`,`forbidreason`,`bantype`,`accesscount`,`akickcount`,`mlock_on`,`mlock_off`,`mlock_limit`,`mlock_key`,`mlock_flood`,`mlock_redirect`,`entry_message`,`memomax`,`botnick`,`botflags`,`ttb`,`bwcount`,`capsmin`,`capspercent`,`floodlines`,`floodsecs`,`repeattimes` FROM `anope_cs_info`");
+ "SELECT `name`,`founder`,`successor`,`founderpass`,`descr`,`url`,`email`,`time_registered`,`last_used`,`last_topic`,`last_topic_setter`,`last_topic_time`,`flags`,`forbidby`,`forbidreason`,`bantype`,`accesscount`,`akickcount`,`mlock_on`,`mlock_off`,`mlock_limit`,`mlock_key`,`mlock_flood`,`mlock_redirect`,`entry_message`,`memomax`,`botnick`,`botflags`,`bwcount`,`capsmin`,`capspercent`,`floodlines`,`floodsecs`,`repeattimes` FROM `anope_cs_info`");
if (db_mysql_query(sqlcmd)) {
log_perror("Can't create sql query: %s", sqlcmd);
db_mysql_error(MYSQL_WARNING, "query");
@@ -1323,16 +1332,28 @@ void db_mysql_load_cs_dbase(void)
ci->bi = findbot(mysql_row[26]);
ci->botflags = atoi(mysql_row[27]);
- ci->ttb = scalloc(2 * TTB_SIZE, 1);
- for (j = 0; j < TTB_SIZE; j++) {
- ci->ttb[j] = 0;
- }
ci->capsmin = atoi(mysql_row[30]);
ci->capspercent = atoi(mysql_row[31]);
ci->floodlines = atoi(mysql_row[32]);
ci->floodsecs = atoi(mysql_row[33]);
ci->repeattimes = atoi(mysql_row[34]);
+ ci->ttb = scalloc(2 * TTB_SIZE, 1);
+ snprintf(sqlcmd, MAX_SQL_BUF, "SELECT `ttb_id`, `value` FROM `anope_cs_ttb` WHERE `channel` = '%s'", tempstr);
+ if (db_mysql_query(sqlcmd)) {
+ log_perror("Can't create sql query: %s", sqlcmd);
+ db_mysql_error(MYSQL_WARNING, "query");
+ }
+ res = mysql_store_result(mysql);
+ while ((row = mysql_fetch_row(res))) {
+ j = atoi(row[0]);
+ ci->ttb[j] = atoi(row[1]);
+ }
+ for (j = 0; j < TTB_SIZE; j++) {
+ if (!ci->ttb[j])
+ ci->ttb[j] = 0;
+ }
+
ci->bwcount = atoi(mysql_row[29]);
if (ci->bwcount) {
ci->badwords = scalloc(ci->bwcount, sizeof(BadWord));
diff --git a/src/rdb.c b/src/rdb.c
index 992106f3c..560286789 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -232,6 +232,7 @@ int rdb_cs_delchan(ChannelInfo * ci)
rdb_scrub_table("anope_cs_akicks", buf);
rdb_scrub_table("anope_cs_levels", buf);
rdb_scrub_table("anope_cs_badwords", buf);
+ rdb_scrub_table("anope_cs_ttb", buf);
if (ci->founder) {
snprintf(buf, sizeof(buf),
"update anope_ns_core set channelcount=channelcount-1 where display='%s'",
@@ -462,41 +463,33 @@ void rdb_load_dbases(void)
{
if (!skeleton) {
rdb_load_ns_dbase();
- anope_cmd_pong(ServerName, ServerName);
if (debug)
alog("debug: RDB Loaded NickServ DataBase (1/8)");
if (s_HostServ) {
rdb_load_hs_dbase();
- anope_cmd_pong(ServerName, ServerName);
if (debug)
alog("debug: RDB Loaded HostServ DataBase (2/8)");
}
if (s_BotServ) {
rdb_load_bs_dbase();
- anope_cmd_pong(ServerName, ServerName);
if (debug)
alog("debug: RDB Loaded BotServ DataBase (3/8)");
}
rdb_load_cs_dbase();
- anope_cmd_pong(ServerName, ServerName);
if (debug)
alog("debug: RDB Loaded ChanServ DataBase (4/8)");
}
rdb_load_os_dbase();
- anope_cmd_pong(ServerName, ServerName);
if (debug)
alog("debug: RDB Loaded OperServ DataBase (5/8)");
rdb_load_news();
- anope_cmd_pong(ServerName, ServerName);
if (debug)
alog("debug: RDB Loaded News DataBase (6/8)");
rdb_load_exceptions();
- anope_cmd_pong(ServerName, ServerName);
if (debug)
alog("debug: RDB Loaded Exception Database (7/8)");
if (PreNickDBName) {
rdb_load_ns_req_dbase();
- anope_cmd_pong(ServerName, ServerName);
if (debug)
alog("debug: RDB Loaded PreNick DataBase (8/8)");
} else {
diff --git a/version.log b/version.log
index 8c5dbf594..373c1b345 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="16"
VERSION_EXTRA="-svn"
-VERSION_BUILD="1179"
+VERSION_BUILD="1180"
# $Log$
#
+# BUILD : 1.7.16 (1180)
+# BUGS : 614
+# NOTES : Fixed: [1] MySQL not storing passwords at all (blank passes) [2] saving of ttb with MySQL/RDB was completely fubar [3] do not send PONG-flood anymore on db-load...
+#
# BUILD : 1.7.16 (1179)
# BUGS :
# NOTES : Changed uber-mysql-validation-detection to use AM_LINK_IFELSE as it should have used all along...