[ircd-ratbox] ratbox-services nickserv patch

Ralf S. Engelschall rse at engelschall.com
Sun Apr 17 13:22:48 UTC 2005


We're currently using IRCd-Ratbox (version 2.0.8) and Ratbox-Services
(CVS version as of 20050413) on a recently established stand-alone IRC
setup. It works fine and provides all mandatory services we required
(NickServ, UserServ, ChanServ). Unfortunately, after a restart of
Ratbox-Services the registered nicknames were not registered again.
I've found in the source of NickServ that the nickname information is
not actually stored to the SQLite database table.

I felt free and just adding a few lines I assumed to be missing there
(see patch below) and now it works fine -- at least for me. I have not
reviewed the NickServ implementation in detail and perhaps I'm missing
something important and so it is totally bogus what I've done. Then
please ignore my patch and correct the storage of nicknames in the
proper way. But perhaps this part of the implementation was really
just missing and I'm right with my patch, then please take it over and
release a new Ratbox-Services version soon. Thanks.

Yours,
                                       Ralf S. Engelschall
                                       rse at engelschall.com
                                       www.engelschall.com

Index: ratbox-services/src/s_nickserv.c
--- ratbox-services/src/s_nickserv.c.orig	2005-04-07 19:26:29 +0200
+++ ratbox-services/src/s_nickserv.c	2005-04-17 13:27:40 +0200
@@ -91,9 +91,12 @@
 }

 static void
-add_nick_reg(struct nick_reg *nreg_p)
+add_nick_reg(struct nick_reg *nreg_p, struct user_reg *ureg_p)
 {
 	unsigned int hashv = hash_name(nreg_p->name);
+	loc_sqlite_exec(NULL, "INSERT INTO nicks (nickname, username, reg_time, last_time, flags) "
+		"VALUES(%Q, %Q, %lu, %lu, %u)",
+		nreg_p->name, ureg_p->name, nreg_p->reg_time, nreg_p->last_time, nreg_p->flags);
 	dlink_add(nreg_p, &nreg_p->node, &nick_reg_table[hashv]);
 }

@@ -152,7 +155,7 @@
 	nreg_p->last_time = atol(argv[3]);
 	nreg_p->flags = atol(argv[4]);

-	add_nick_reg(nreg_p);
+	add_nick_reg(nreg_p, ureg_p);
 	dlink_add(nreg_p, &nreg_p->usernode, &ureg_p->nicks);
 	nreg_p->user_reg = ureg_p;

@@ -211,7 +214,7 @@
 	strlcpy(nreg_p->name, client_p->name, sizeof(nreg_p->name));
 	nreg_p->reg_time = nreg_p->last_time = CURRENT_TIME;

-	add_nick_reg(nreg_p);
+	add_nick_reg(nreg_p, ureg_p);
 	dlink_add(nreg_p, &nreg_p->usernode, &ureg_p->nicks);
 	nreg_p->user_reg = ureg_p;



More information about the ircd-ratbox mailing list