[ircd-ratbox] [PATCH] ratbox-services: ChanServ login_nick_only flag

Ralf S. Engelschall rse at engelschall.com
Mon Apr 18 09:02:53 UTC 2005


Add a special "login_nick_only" configuration flag to Ratbox-Services,
restricting "/msg userserv login <username>" command to cases where the
nickname is also <username> only. This is intentionally in conflict
with NickServ (because under "/msg nickserv regain" you have to able to
login at UserServ under different nickname first), but allows the strict
synchronization of username/nickname (if NickServ is not activated).

Index: ratbox-services/src/conf.c
--- ratbox-services/src/conf.c.orig	2005-04-07 19:26:29 +0200
+++ ratbox-services/src/conf.c	2005-04-13 15:30:42 +0200
@@ -79,6 +79,7 @@
 	config_file.allow_set_password = 1;
 	config_file.allow_set_email = 1;
 	config_file.umax_logins = 5;
+	config_file.login_nick_only = 0;

 	config_file.disable_cregister = 0;
 	config_file.cregister_time = 60;
Index: ratbox-services/src/newconf.c
--- ratbox-services/src/newconf.c.orig	2005-04-07 01:58:30 +0200
+++ ratbox-services/src/newconf.c	2005-04-13 15:30:42 +0200
@@ -850,6 +850,7 @@
 	{ "allow_set_password",	CF_YESNO, NULL, 0, &config_file.allow_set_password	},
 	{ "allow_set_email",	CF_YESNO, NULL, 0, &config_file.allow_set_email		},
 	{ "max_logins",		CF_INT,   NULL, 0, &config_file.umax_logins		},
+	{ "login_nick_only",	CF_YESNO, NULL, 0, &config_file.login_nick_only		},
 	{ "\0", 0, NULL, 0, NULL }
 };

Index: ratbox-services/src/s_userserv.c
--- ratbox-services/src/s_userserv.c.orig	2005-04-07 19:26:29 +0200
+++ ratbox-services/src/s_userserv.c	2005-04-13 15:30:42 +0200
@@ -722,6 +722,15 @@
 		return 1;
 	}

+	if(config_file.login_nick_only &&
+	   strcmp(parv[0], client_p->name) != 0)
+	{
+		service_error(userserv_p, client_p,
+			"Login failed, username %s does not match nickname %s",
+			parv[0], client_p->name);
+		return 1;
+	}
+
 	password = get_crypt(parv[1], reg_p->password);

 	if(strcmp(password, reg_p->password))

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



More information about the ircd-ratbox mailing list