Module: ngircd.git
Branch: master
Commit: 508ca3044dd6d1a88686efceda92a7f2a9b4a926
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=508ca304…
Author: Alexander Barton <alex(a)barton.de>
Date: Tue Jan 22 10:54:06 2013 +0100
Return better "Connection not registered as server link" errors
Now ngIRCd returns a more specific error message for numeric
ERR_NOTREGISTERED(451) when a regular user tries to use a command that
isn't allowed for users but for servers:…
[View More] ERR_NOTREGISTEREDSERVER(451).
---
src/ngircd/parse.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c
index 5ff9fcc..46164ce 100644
--- a/src/ngircd/parse.c
+++ b/src/ngircd/parse.c
@@ -514,10 +514,20 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
continue;
}
- if (!(client_type & cmd->type))
- return IRC_WriteStrClient(client, ERR_NOTREGISTERED_MSG, Client_ID(client));
+ if (!(client_type & cmd->type)) {
+ if (client_type == CLIENT_USER
+ && cmd->type & CLIENT_SERVER)
+ return IRC_WriteStrClient(client,
+ ERR_NOTREGISTEREDSERVER_MSG,
+ Client_ID(client));
+ else
+ return IRC_WriteStrClient(client,
+ ERR_NOTREGISTERED_MSG,
+ Client_ID(client));
+ }
- /* Command is allowed for this client: call it and count produced bytes */
+ /* Command is allowed for this client: call it and count
+ * generated bytes in output */
Conn_ResetWCounter();
result = (cmd->function)(client, Req);
cmd->bytes += Conn_WCounter();
[View Less]
Module: ngircd.git
Branch: master
Commit: d8f2964710985597281de73aecd0a1ece30ecb03
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=d8f29647…
Author: Alexander Barton <alex(a)barton.de>
Date: Sun Jan 13 16:52:00 2013 +0100
MODE: don't report error on "more modes than parameters"
Don't report ERR_NEEDMOREPARAMS(461) when a MDOE command with more modes
than nicknames is handled, as well as for channel limit and key changes
without specifying the limit or …
[View More]key parameters.
This is how a lot (all?) other IRC servers behave, including ircd2.11,
InspIRCd, and ircd-seven. And because of clients (tested with Textual and
mIRC) sending bogus MODE commands like "MODE -ooo nick", end-users got the
expected result as well as correct but misleading error messages ...
If ngIRCd is compiled using "strict mode", these errors are still reported.
Reported-by: Tim <tim(a)stackwatch.net>
---
src/ngircd/irc-mode.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c
index a63a0f4..b5f28fa 100644
--- a/src/ngircd/irc-mode.c
+++ b/src/ngircd/irc-mode.c
@@ -628,9 +628,13 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
Req->argv[arg_arg][0] = '\0';
arg_arg++;
} else {
+#ifdef STRICT_RFC
+ /* Only send error message in "strict" mode,
+ * this is how ircd2.11 and others behave ... */
connected = IRC_WriteStrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
+#endif
goto chan_exit;
}
break;
@@ -668,9 +672,13 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
Req->argv[arg_arg][0] = '\0';
arg_arg++;
} else {
+#ifdef STRICT_RFC
+ /* Only send error message in "strict" mode,
+ * this is how ircd2.11 and others behave ... */
connected = IRC_WriteStrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
+#endif
goto chan_exit;
}
break;
@@ -761,9 +769,17 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
Req->argv[arg_arg][0] = '\0';
arg_arg++;
} else {
+#ifdef STRICT_RFC
+ /* Report an error to the client, when a user
+ * mode should be changed but no nickname is
+ * given. But don't do it when not in "strict"
+ * mode, because most other servers don't do
+ * it as well and some clients send "wired"
+ * MODE commands like "MODE #chan -ooo nick". */
connected = IRC_WriteStrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
+#endif
goto chan_exit;
}
break;
[View Less]
Module: ngircd.git
Branch: master
Commit: ab009976984ede815c31c9a6b318c80006823b81
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=ab009976…
Author: Alexander Barton <alex(a)barton.de>
Date: Mon Jan 7 18:42:57 2013 +0100
Correctly detect when SSL subsystem must be initialized
This patch introduces the new function Conf_SSLInUse() to check when the
current server configuration requires the SSL subsystem to be initialized
and accounts incoming as well as …
[View More]outgoing connections -- so this fixes
commit bb20aeb9 ("Initialize SSL when needed only, and disable SSL on
errors") which only handled the inbound case ...
Tested-by: Brett Smith <brett(a)w3.org>
---
src/ngircd/conf.c | 22 ++++++++++++++++++++++
src/ngircd/conf.h | 4 ++++
src/ngircd/conn-ssl.c | 4 +++-
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index d5a28bd..929ab05 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -110,6 +110,28 @@ ConfSSL_Init(void)
}
/**
+ * Check if the current configuration uses/requires SSL.
+ *
+ * @returns true if SSL is used and should be initialized.
+ */
+GLOBAL bool
+Conf_SSLInUse(void)
+{
+ int i;
+
+ /* SSL listen ports configured? */
+ if (array_bytes(&Conf_SSLOptions.ListenPorts))
+ return true;
+
+ for (i = 0; i < MAX_SERVERS; i++) {
+ if (Conf_Server[i].port > 0
+ && Conf_Server[i].SSLConnect)
+ return true;
+ }
+ return false;
+}
+
+/**
* Make sure that a configured file is readable.
*
* Currently, this function is only used for SSL-related options ...
diff --git a/src/ngircd/conf.h b/src/ngircd/conf.h
index ac42746..c203b57 100644
--- a/src/ngircd/conf.h
+++ b/src/ngircd/conf.h
@@ -256,6 +256,10 @@ GLOBAL bool Conf_AddServer PARAMS(( const char *Name, UINT16 Port, const char *H
GLOBAL bool Conf_NickIsService PARAMS((int ConfServer, const char *Nick));
GLOBAL bool Conf_NickIsBlocked PARAMS((const char *Nick));
+#ifdef SSL_SUPPORT
+GLOBAL bool Conf_SSLInUse PARAMS((void));
+#endif
+
/* Password required by WEBIRC command */
GLOBAL char Conf_WebircPwd[CLIENT_PASS_LEN];
diff --git a/src/ngircd/conn-ssl.c b/src/ngircd/conn-ssl.c
index 59729e0..45e6458 100644
--- a/src/ngircd/conn-ssl.c
+++ b/src/ngircd/conn-ssl.c
@@ -241,8 +241,10 @@ void ConnSSL_Free(CONNECTION *c)
bool
ConnSSL_InitLibrary( void )
{
- if (!array_bytes(&Conf_SSLOptions.ListenPorts))
+ if (!Conf_SSLInUse()) {
+ LogDebug("SSL not in use, skipping initialization.");
return true;
+ }
#ifdef HAVE_LIBSSL
SSL_CTX *newctx;
[View Less]
Module: ngircd.git
Branch: master
Commit: b4966aa1bd8d11ed2bc97cc5fea418fab3485b08
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=b4966aa1…
Author: Alexander Barton <alex(a)barton.de>
Date: Sun Jan 6 17:46:06 2013 +0100
configure: use AS_HELP_STRING for --with-iconv
---
configure.ng | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configure.ng b/configure.ng
index 47c9599..c89096f 100644
--- a/configure.ng
+++ b/configure.ng
@…
[View More]@ -518,7 +518,8 @@ if test "$x_ircplus_on" = "yes"; then
# CHARCONV is the only function depending on it.
x_iconv_on=no
AC_ARG_WITH(iconv,
- [ --with-iconv enable character conversation using libiconv],
+ AS_HELP_STRING([--with-iconv],
+ [enable character conversation using libiconv]),
[ if test "$withval" != "no"; then
if test "$withval" != "yes"; then
CFLAGS="-I$withval/include $CFLAGS"
[View Less]
Module: ngircd.git
Branch: master
Commit: 68cb1a8c2e507e7c99f787fab3540b904cfa1cc1
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=68cb1a8c…
Author: Alexander Barton <alex(a)barton.de>
Date: Wed Jan 2 23:41:46 2013 +0100
Merge branch 'bug145-ProvideHelp'
* bug145-ProvideHelp:
Use "${docdir}/Commands.txt" as help text file
Add a note that "help file" is updated on startup and REHASH only
Add doc/Commands.txt which should document all commands
…
[View More]Implement Help() function parsing and returning the help text
Document "HelpFile" in sample-ngircd.conf and ngircd.conf.5
Implement new configuration option "HelpFile"
IRC_HELP(): Code cleanup
Refactor Read_Motd() into Read_TextFile()
---
[View Less]
Module: ngircd.git
Branch: master
Commit: 950aeec3ff0e15c456ac32d8fecee8c73f7c5df3
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=950aeec3…
Author: Alexander Barton <alex(a)barton.de>
Date: Tue Jan 1 19:25:06 2013 +0100
Use "${docdir}/Commands.txt" as help text file
---
configure.ng | 4 ++--
contrib/MacOSX/config.h | 3 ++-
doc/Makefile.am | 3 ++-
doc/sample-ngircd.conf.tmpl | 2 +-
src/ngircd/conf.c …
[View More] | 4 ++--
src/ngircd/defines.h | 2 +-
6 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/configure.ng b/configure.ng
index 84e2750..732e55e 100644
--- a/configure.ng
+++ b/configure.ng
@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2012 Alexander Barton (alex(a)barton.de) and Contributors
+# Copyright (c)2001-2013 Alexander Barton (alex(a)barton.de) and Contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -110,7 +110,7 @@ esac
# Add additional CFLAGS, eventually specified on the command line:
test -n "$CFLAGS_ADD" && CFLAGS="$CFLAGS $CFLAGS_ADD"
-CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
+CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"' -DDOCDIR='\"\$(docdir)\"'"
# -- Headers --
diff --git a/contrib/MacOSX/config.h b/contrib/MacOSX/config.h
index 6da7496..f483827 100644
--- a/contrib/MacOSX/config.h
+++ b/contrib/MacOSX/config.h
@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2012 Alexander Barton (alex(a)barton.de) and Contributors.
+ * Copyright (c)2001-2013 Alexander Barton (alex(a)barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@
#define VERSION "??("__DATE__")"
#endif
#define SYSCONFDIR "/etc/ngircd"
+#define DOCDIR "/usr/share/doc/ngircd"
#ifndef TARGET_VENDOR
#define TARGET_VENDOR "apple"
diff --git a/doc/Makefile.am b/doc/Makefile.am
index eb6fa93..04f74b6 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2012 Alexander Barton (alex(a)barton.de) and Contributors
+# Copyright (c)2001-2013 Alexander Barton (alex(a)barton.de) and Contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -12,6 +12,7 @@
.tmpl:
$(AM_V_GEN)sed \
-e "s@:ETCDIR:@${sysconfdir}@" \
+ -e "s@:DOCDIR:@${docdir}@" \
<$< >$@
SUFFIXES = .tmpl
diff --git a/doc/sample-ngircd.conf.tmpl b/doc/sample-ngircd.conf.tmpl
index 3f80a9f..1c3998a 100644
--- a/doc/sample-ngircd.conf.tmpl
+++ b/doc/sample-ngircd.conf.tmpl
@@ -35,7 +35,7 @@
# Text file which contains the ngIRCd help text. This file is required
# to display help texts when using the "HELP <cmd>" command.
- ;HelpFile = :ETCDIR:/ngircd.help
+ ;HelpFile = :DOCDIR:/Commands.txt
# Info text of the server. This will be shown by WHOIS and
# LINKS requests for example.
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index fa1bfba..d5a28bd 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2012 Alexander Barton (alex(a)barton.de) and Contributors.
+ * Copyright (c)2001-2013 Alexander Barton (alex(a)barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -706,7 +706,7 @@ Set_Defaults(bool InitServers)
array_free(&Conf_Helptext);
strlcpy(Conf_MotdFile, SYSCONFDIR, sizeof(Conf_MotdFile));
strlcat(Conf_MotdFile, MOTD_FILE, sizeof(Conf_MotdFile));
- strlcpy(Conf_HelpFile, SYSCONFDIR, sizeof(Conf_HelpFile));
+ strlcpy(Conf_HelpFile, DOCDIR, sizeof(Conf_HelpFile));
strlcat(Conf_HelpFile, HELP_FILE, sizeof(Conf_HelpFile));
strcpy(Conf_ServerPwd, "");
strlcpy(Conf_PidFile, PID_FILE, sizeof(Conf_PidFile));
diff --git a/src/ngircd/defines.h b/src/ngircd/defines.h
index 28a260b..3850b58 100644
--- a/src/ngircd/defines.h
+++ b/src/ngircd/defines.h
@@ -78,7 +78,7 @@
#define MOTD_FILE "/ngircd.motd"
/** Name of the help file. */
-#define HELP_FILE "/ngircd.help"
+#define HELP_FILE "/Commands.txt"
/** Default chroot() directory. */
#define CHROOT_DIR ""
[View Less]
Module: ngircd.git
Branch: master
Commit: 60a9a7f11860a3953d215a377d31714e02d09eba
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=60a9a7f1…
Author: Alexander Barton <alex(a)barton.de>
Date: Tue Jan 1 15:35:49 2013 +0100
Add a note that "help file" is updated on startup and REHASH only
---
man/ngircd.conf.5.tmpl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/man/ngircd.conf.5.tmpl b/man/ngircd.conf.5.tmpl
index 681e86c..859c6a8 100644
--- a/…
[View More]man/ngircd.conf.5.tmpl
+++ b/man/ngircd.conf.5.tmpl
@@ -104,6 +104,8 @@ command. This information is not required by the server but by RFC!
\fBHelpFile\fR (string)
Text file which contains the ngIRCd help text. This file is required
to display help texts when using the "HELP <cmd>" command.
+Please note: Changes made to this file take effect when ngircd starts up
+or is instructed to re-read its configuration file.
.TP
\fBInfo\fR (string)
Info text of the server. This will be shown by WHOIS and LINKS requests for
[View Less]
Module: ngircd.git
Branch: master
Commit: 8ec09e3ca47a8d2ca0502831d77f7edc8c4749a6
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=8ec09e3c…
Author: Alexander Barton <alex(a)barton.de>
Date: Tue Jan 1 15:09:09 2013 +0100
Add doc/Commands.txt which should document all commands
This document can be used as "help text", too, see configuration option
"HelpFile" in ngircd.conf(5).
Please note that this file in its current state is far from complete, only
a …
[View More]few commands are documented, but you should get an idea how it works.
So please send in patches adding the remaining parts! :-)
---
doc/Commands.txt | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
doc/Makefile.am | 1 +
2 files changed, 220 insertions(+)
diff --git a/doc/Commands.txt b/doc/Commands.txt
new file mode 100644
index 0000000..e9b7873
--- /dev/null
+++ b/doc/Commands.txt
@@ -0,0 +1,219 @@
+
+ ngIRCd - Next Generation IRC Server
+ http://ngircd.barton.de/
+
+ (c)2001-2013 Alexander Barton and Contributors.
+ ngIRCd is free software and published under the
+ terms of the GNU General Public License.
+
+ -- Commands.txt --
+
+
+This file lists all commands available on ngIRCd. It is written in a format
+that is human readable as well as machine parseable and therefore can be used
+as "help text file" of the daemon.
+
+In short, the HELP command parses this file as following when a user user
+issues a "HELP <cmd>" command:
+
+ 1. Search the file for a line "- <cmd>",
+ 2. Output all subsequent lines that start with a TAB (ASCII 9) character
+ to the client using NOTICE commands, treat lines containing a single "."
+ after the TAB as empty lines.
+ 3. Break at the first line not starting with a TAB character.
+
+This format allows to have information to each command stored in this file
+which will not be sent to an IRC user requesting help which enables us to
+have additional annotations stored here which further describe the origin,
+implementation details, or limits of the specific command.
+
+A special "Intro" block is returned to the user when the HELP command is
+used without a command name:
+
+
+- Intro
+ This is ngIRCd, a server software for Internet Relay Chat (IRC)
+ networks. You can find more information about ngIRCd on its homepage:
+ <http://ngircd.barton.de>
+ .
+ Use "HELP COMMANDS" to get a list of all available commands and
+ "HELP <command-name>" to get help for a specific IRC command, for
+ example "HELP quit" or "HELP privmsg".
+
+
+General Commands
+~~~~~~~~~~~~~~~~
+
+- AWAY
+
+- CAP
+
+- CHARCONV
+
+- HELP
+ HELP [<command>]
+ .
+ Show help information for a specific IRC <command>. The <command> name
+ is case-insensitive.
+ .
+ Use the command "HELP Commands" to get a list of all available commands.
+
+ The HELP command isn't specified by any RFC but implemented by most
+ daemons. If no help text could be read in, ngIRCd outputs a list of all
+ implemented commands when receiving a plain "HELP" command as well as
+ on "HELP Commands".
+
+ ngIRCd replies using "NOTICE" commands like ircd 2.10/2.11; other
+ implementations are using numerics 704, 705, and 706.
+
+
+- MODE
+
+- NICK
+
+- NOTICE
+
+- PASS
+
+- PING
+
+- PONG
+
+- PRIVMSG
+
+- QUIT
+ QUIT [<quit-message>]
+ .
+ End IRC session and disconnect from the server.
+ .
+ If a <quit-message> has been given, it is displayed to all the
+ channels that you are a member of when leaving.
+
+- USER
+
+- WALLOPS
+
+- WEBIRC
+
+
+Status and Informational Commands
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- INFO
+
+- ISON
+
+- LINKS
+
+- LUSERS
+
+- METADATA
+
+- MOTD
+
+- NAMES
+
+- STATS
+
+- TIME
+
+- TRACE
+
+- USERHOST
+
+- VERSION
+
+- WHO
+
+- WHOIS
+
+- WHOWAS
+
+
+Channel Commands
+~~~~~~~~~~~~~~~~
+
+- INVITE
+
+- JOIN
+
+- KICK
+
+- LIST
+
+- PART
+
+- TOPIC
+
+
+Administrative Commands
+~~~~~~~~~~~~~~~~~~~~~~~
+
+- ADMIN
+ ADMIN [<server>]
+ .
+ Show administartive information about an IRC server in the network.
+ If no server name has been given, the local server will respond.
+
+- CONNECT
+
+- DIE
+
+- DISCONNECT
+
+- GLINE
+
+- KILL
+
+- KLINE
+
+- OPER
+
+- REHASH
+
+- RESTART
+
+
+IRC Service Commands
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+- SERVICE
+
+- SERVLIST
+
+- SQUERY
+
+- SVSNICK
+
+
+Server Protocol Commands
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+- CHANINFO
+
+- ERROR
+ ERROR [<message> [<> [...]]]
+ .
+ Return an error message to the server. The first parameter, if given,
+ will be logged by the server, all further parameters are silently
+ ignored.
+ .
+ This command is silently ignored on non-server and non-service links.
+
+- NJOIN
+
+- SERVER
+
+- SQUIT
+
+
+Dummy Commands
+~~~~~~~~~~~~~~
+
+- SUMMON
+
+- USERS
+
+- GET
+
+- POST
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 2b9b3aa..eb6fa93 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -19,6 +19,7 @@ SUFFIXES = .tmpl
static_docs = \
Bopm.txt \
Capabilities.txt \
+ Commands.txt \
Contributing.txt \
FAQ.txt \
GIT.txt \
[View Less]