Module: ngircd.git
Branch: master
Commit: bcefdef1eaed14d3156b7fb5b9ad6d3b7078efcf
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=bcefdef1…
Author: Alexander Barton <alex(a)barton.de>
Date: Sun Aug 26 19:14:29 2012 +0200
Merge branch 'move-connection-password' of git://arthur.barton.de/ngircd-alex
This patch series converts the statically allocated password buffer in the
CLIENT structure into a dynamically (and only when needed) allocated buffer
which is referenced by the CONNECTION structure.
This a) saves memory for clients not using passwords at all and b) allows
for "arbitrarily" long passwords.
By Brett Smith (5) and Alexander Barton (2).
* 'move-connection-password' of git://arthur.barton.de/ngircd-alex:
Login_User(): use "conn" insted of calling Client_Conn(Client)
Free already saved password when storing a new one
Indentation and style fixes.
Connection password is not constant.
Implementation clean-ups.
Dynamically allocate memory for connection password.
Move client password from the Client to the Connection struct.
---
Module: ngircd.git
Branch: master
Commit: f79d41e92741fa2f6bc6fef957d278707ad4236a
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=f79d41e9…
Author: Alexander Barton <alex(a)barton.de>
Date: Sun Aug 26 19:11:44 2012 +0200
Login_User(): use "conn" insted of calling Client_Conn(Client)
---
src/ngircd/login.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/ngircd/login.c b/src/ngircd/login.c
index e1959d6..460fcd1 100644
--- a/src/ngircd/login.c
+++ b/src/ngircd/login.c
@@ -93,14 +93,14 @@ Login_User(CLIENT * Client)
* the beahiour of the daemon compiled without PAM support:
* because there can't be any "server password", all
* passwords supplied are classified as "wrong". */
- if(Conn_Password(Client_Conn(Client))[0] == '\0')
+ if(Conn_Password(conn)[0] == '\0')
return Login_User_PostAuth(Client);
Client_Reject(Client, "Non-empty password", false);
return DISCONNECTED;
}
if (Conf_PAMIsOptional &&
- strcmp(Conn_Password(Client_Conn(Client)), "") == 0) {
+ strcmp(Conn_Password(conn), "") == 0) {
/* Clients are not required to send a password and to be PAM-
* authenticated at all. If not, they won't become "identified"
* and keep the "~" in their supplied user name.
@@ -130,7 +130,7 @@ Login_User(CLIENT * Client)
}
#else
/* Check global server password ... */
- if (strcmp(Conn_Password(Client_Conn(Client)), Conf_ServerPwd) != 0) {
+ if (strcmp(Conn_Password(conn), Conf_ServerPwd) != 0) {
/* Bad password! */
Client_Reject(Client, "Bad server password", false);
return DISCONNECTED;
Module: ngircd.git
Branch: master
Commit: 360a254be0e55e975998d0f3a5ff301ac3346f72
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=360a254b…
Author: Alexander Barton <alex(a)barton.de>
Date: Sun Aug 26 13:24:54 2012 +0200
Enhance "ServiceMask" to handle a list of masks
The "ServiceMask" variable in "Server" blocks now can handle more than
one mask using the new MatchCaseInsensitiveList() function.
This makes marking "service clients" much more specific, which is a
good thing per se, but which is the prerequisite for reasonably
blocking these nick names, too (see commit a6dd2e3 for details).
---
doc/sample-ngircd.conf.tmpl | 9 +++++----
man/ngircd.conf.5.tmpl | 10 ++++++----
src/ngircd/conf.c | 3 ++-
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/doc/sample-ngircd.conf.tmpl b/doc/sample-ngircd.conf.tmpl
index 6d9d770..57e6589 100644
--- a/doc/sample-ngircd.conf.tmpl
+++ b/doc/sample-ngircd.conf.tmpl
@@ -297,15 +297,16 @@
# Connect to the remote server using TLS/SSL (Default: false)
;SSLConnect = yes
- # Define a (case insensitive) mask matching nick names that should be
- # treated as IRC services when introduced via this remote server.
+ # Define a (case insensitive) list of masks matching nick names that
+ # should be treated as IRC services when introduced via this remote
+ # server, separated by commas (",").
# REGULAR SERVERS DON'T NEED this parameter, so leave it empty
# (which is the default).
# When you are connecting IRC services which mask as a IRC server
# and which use "virtual users" to communicate with, for example
# "NickServ" and "ChanServ", you should set this parameter to
- # something like "*Serv".
- ;ServiceMask = *Serv
+ # something like "*Serv" or "NickServ,ChanServ,XyzServ".
+ ;ServiceMask = *Serv,Global
[Server]
# More [Server] sections, if you like ...
diff --git a/man/ngircd.conf.5.tmpl b/man/ngircd.conf.5.tmpl
index 71f0007..aff11a6 100644
--- a/man/ngircd.conf.5.tmpl
+++ b/man/ngircd.conf.5.tmpl
@@ -422,14 +422,16 @@ You can use the IRC Operator command CONNECT later on to create the link.
Connect to the remote server using TLS/SSL. Default: false.
.TP
\fBServiceMask\fR (string)
-Define a (case insensitive) mask matching nick names that should be treated as
-IRC services when introduced via this remote server. REGULAR SERVERS DON'T NEED
-this parameter, so leave it empty (which is the default).
+Define a (case insensitive) list of masks matching nick names that should be
+treated as IRC services when introduced via this remote server, separated
+by commas (","). REGULAR SERVERS DON'T NEED this parameter, so leave it empty
+(which is the default).
.PP
.RS
When you are connecting IRC services which mask as a IRC server and which use
"virtual users" to communicate with, for example "NickServ" and "ChanServ",
-you should set this parameter to something like "*Serv".
+you should set this parameter to something like "*Serv", "*Serv,OtherNick",
+or "NickServ,ChanServ,XyzServ".
.SH [CHANNEL]
Pre-defined channels can be configured in
.I [Channel]
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index 41b5469..3966dc9 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -648,7 +648,8 @@ Conf_NickIsService(int ConfServer, const char *Nick)
assert (ConfServer >= 0);
assert (ConfServer < MAX_SERVERS);
- return MatchCaseInsensitive(Conf_Server[ConfServer].svs_mask, Nick);
+ return MatchCaseInsensitiveList(Conf_Server[ConfServer].svs_mask,
+ Nick, ",");
}
/**