summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes3
-rw-r--r--Changes.conf8
-rw-r--r--data/example.conf6
-rw-r--r--include/extern.h1
-rw-r--r--src/config.c2
-rw-r--r--src/nickserv.c24
-rw-r--r--version.log6
7 files changed, 47 insertions, 3 deletions
diff --git a/Changes b/Changes
index c7b5180c1..2614e4124 100644
--- a/Changes
+++ b/Changes
@@ -1,8 +1,9 @@
Anope Version S V N
-------------------
Provided by Anope Dev. <dev@anope.org> - 2004
-08/24 A New -l option for am script to list possible selectors. [ #00]
+09/20 A Added RestrictOperNicks as new feature in services.conf. [ #00]
09/08 A Removed rand() and ported bsd's arc4random() to fit our needs. [ #00]
+08/24 A New -l option for am script to list possible selectors. [ #00]
09/19 F Rewrote the internals of moduleData to save lots of memory. [ #00]
09/17 F Fixed MySQL error, whereby checks are only done if mysql is on. [ #00]
09/14 F Fixed /os MODE by joining nested ifs into one. [ #00]
diff --git a/Changes.conf b/Changes.conf
index 31d8907ff..764272f5b 100644
--- a/Changes.conf
+++ b/Changes.conf
@@ -12,6 +12,14 @@ Anope Version S V N
#UserKey2 5216332
#UserKey3 9651291
+
+# RestrictOperNick [OPTIONAL]
+# Forbids the registration of nicks that contain nick with services
+# access. So if Tester is a Services Oper, for example, You can't
+# register NewTester or Tester123 unless you are an IRC operator.
+#RestrictOperNicks
+
+
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
diff --git a/data/example.conf b/data/example.conf
index 1e3cdfbd1..937a11213 100644
--- a/data/example.conf
+++ b/data/example.conf
@@ -458,6 +458,12 @@ GlobalOnCycleUP "Services are now back online - have a nice day"
# option on a pre-1.4.35 Bahamut, it is most likely to break.
#UseSVSHOLD
+# RestrictOperNick [OPTIONAL]
+# Forbids the registration of nicks that contain nick with services
+# access. So if Tester is a Services Oper, for example, You can't
+# register NewTester or Tester123 unless you are an IRC operator.
+#RestrictOperNicks
+
###########################################################################
#
# Mail-related options
diff --git a/include/extern.h b/include/extern.h
index 0261abfdf..7fb46ed25 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -291,6 +291,7 @@ E int DumpCore;
E int LogUsers;
E int NickRegDelay;
E int UseSVSHOLD;
+E int RestrictOperNicks;
E char **HostSetters;
E int HostNumber;
diff --git a/src/config.c b/src/config.c
index 10c817668..8bbbd077d 100644
--- a/src/config.c
+++ b/src/config.c
@@ -225,6 +225,7 @@ int BSCaseSensitive;
int HideStatsO;
int GlobalOnCycle;
int AnonymousGlobal;
+int RestrictOperNicks;
char *GlobalOnCycleMessage;
char *GlobalOnCycleUP;
char *ServicesRoot;
@@ -590,6 +591,7 @@ Directive directives[] = {
{PARAM_PORT, 0, &RemotePort3},
{PARAM_STRING, 0, &RemotePassword3}}},
{"RestrictMail", {{PARAM_SET, PARAM_RELOAD, &RestrictMail}}},
+ {"RestrictOperNicks", {{PARAM_SET, PARAM_RELOAD, &RestrictOperNicks}}},
{"SendMailPath", {{PARAM_STRING, PARAM_RELOAD, &SendMailPath}}},
{"SendFrom", {{PARAM_STRING, PARAM_RELOAD, &SendFrom}}},
{"ServerDesc", {{PARAM_STRING, 0, &ServerDesc}}},
diff --git a/src/nickserv.c b/src/nickserv.c
index 1ca4a90e7..932a1b82f 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -1930,12 +1930,13 @@ static int do_help(User * u)
static int do_register(User * u)
{
NickRequest *nr = NULL, *anr = NULL;
+ NickCore *nc = NULL;
int prefixlen = strlen(NSGuestNickPrefix);
int nicklen = strlen(u->nick);
char *pass = strtok(NULL, " ");
char *email = strtok(NULL, " ");
char passcode[11];
- int idx, min = 1, max = 62;
+ int idx, min = 1, max = 62, i = 0;
int chars[] =
{ ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
@@ -1976,6 +1977,27 @@ static int do_register(User * u)
return MOD_CONT;
}
+ if (RestrictOperNicks) {
+ for (i = 0; i < RootNumber; i++) {
+ if (strstr(u->nick, ServicesRoots[i]) && !is_oper(u)) {
+ notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick);
+ return MOD_CONT;
+ }
+ }
+ for (i = 0; i < servadmins.count && (nc = servadmins.list[i]);i++) {
+ if (strstr(u->nick, nc->display) && !is_oper(u)) {
+ notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick);
+ return MOD_CONT;
+ }
+ }
+ for (i = 0; i < servopers.count && (nc = servopers.list[i]);i++) {
+ if (strstr(u->nick, nc->display) && !is_oper(u)) {
+ notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick);
+ return MOD_CONT;
+ }
+ }
+ }
+
if (!pass || (NSForceEmail && !email)) {
syntax_error(s_NickServ, u, "REGISTER",
NICK_REGISTER_SYNTAX_EMAIL);
diff --git a/version.log b/version.log
index a15caece8..91701ecb4 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="5"
-VERSION_BUILD="353"
+VERSION_BUILD="354"
# $Log$
#
+# BUILD : 1.7.5 (354)
+# BUGS :
+# NOTES : Added RestrictOpernicks by request. Small feature.
+#
# BUILD : 1.7.5 (353)
# BUGS : N/A
# NOTES : Fixed version booboo :)