Module: ngircd.git
Branch: master
Commit: 51ed74205432036f729d96bf5683ca858aae9f10
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=51ed7420…
Author: Alexander Barton <alex(a)barton.de>
Date: Sat May 22 17:10:22 2010 +0200
Refactor Wall_ServerNotice() into more generic Log_ServerNotice()
Log_ServerNotice() sends a messages to all users having a given
user mode set.
---
src/ngircd/log.c | 46 ++++++++++++++++++++++++++++++----------------
src/ngircd/log.h | 7 +++----
2 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/src/ngircd/log.c b/src/ngircd/log.c
index ff81163..439ca41 100644
--- a/src/ngircd/log.c
+++ b/src/ngircd/log.c
@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2005 Alexander Barton (alex(a)barton.de)
+ * Copyright (c)2001-2010 Alexander Barton (alex(a)barton.de)
*
* 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
@@ -50,8 +50,6 @@ static char Error_File[FNAME_LEN];
#endif
-static void Wall_ServerNotice PARAMS(( char *Msg ));
-
static void
Log_Message(int Level, const char *msg)
{
@@ -260,7 +258,7 @@ va_dcl
if (snotice) {
/* Send NOTICE to all local users with mode +s and to the
* local &SERVER channel */
- Wall_ServerNotice(msg);
+ Log_ServerNotice('s', "%s", msg);
Channel_LogServer(msg);
}
} /* Log */
@@ -328,25 +326,41 @@ va_dcl
/**
- * Send log messages to users flagged with the "s" mode.
- * @param Msg The message to send.
+ * Send a log message to all local users flagged with the given user mode.
+ * @param UserMode User mode which the target user must have set,
+ * @param Format The format string.
*/
-static void
-Wall_ServerNotice( char *Msg )
+#ifdef PROTOTYPES
+GLOBAL void
+Log_ServerNotice(const char UserMode, const char *Format, ... )
+#else
+GLOBAL void
+Log_ServerNotice(UserMode, Format, va_alist)
+const char UserMode;
+const char *Format;
+va_dcl
+#endif
{
CLIENT *c;
+ char msg[MAX_LOG_MSG_LEN];
+ va_list ap;
- assert( Msg != NULL );
+ assert(Format != NULL);
- c = Client_First( );
- while(c) {
- if (Client_Conn(c) > NONE && Client_HasMode(c, 's'))
- IRC_WriteStrClient(c, "NOTICE %s :%s%s", Client_ID(c),
- NOTICE_TXTPREFIX, Msg);
+#ifdef PROTOTYPES
+ va_start(ap, Format);
+#else
+ va_start(ap);
+#endif
+ vsnprintf(msg, MAX_LOG_MSG_LEN, Format, ap);
+ va_end(ap);
- c = Client_Next( c );
+ for(c=Client_First(); c != NULL; c=Client_Next(c)) {
+ if (Client_Conn(c) > NONE && Client_HasMode(c, UserMode))
+ IRC_WriteStrClient(c, "NOTICE %s :%s%s", Client_ID(c),
+ NOTICE_TXTPREFIX, msg);
}
-} /* Wall_ServerNotice */
+} /* Log_ServerNotice */
/* -eof- */
diff --git a/src/ngircd/log.h b/src/ngircd/log.h
index 529b164..e7e6b61 100644
--- a/src/ngircd/log.h
+++ b/src/ngircd/log.h
@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001,2002 by Alexander Barton (alex(a)barton.de)
+ * Copyright (c)2001-2010 Alexander Barton (alex(a)barton.de)
*
* 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
@@ -8,8 +8,6 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
- * $Id: log.h,v 1.20 2006/08/05 09:16:21 fw Exp $
- *
* Logging functions (header)
*/
@@ -40,13 +38,14 @@ GLOBAL void Log_Exit PARAMS(( void ));
GLOBAL void Log PARAMS(( int Level, const char *Format, ... ));
+GLOBAL void Log_ServerNotice PARAMS((char UserMode, const char *Format, ...));
+
#ifdef DEBUG
GLOBAL void LogDebug PARAMS(( const char *Format, ... ));
#else
static inline void LogDebug PARAMS(( UNUSED const char *Format, ... )){/* Do nothing. The compiler should optimize this out, please ;-) */}
#endif
-
GLOBAL void Log_Init_Resolver PARAMS(( void ));
GLOBAL void Log_Exit_Resolver PARAMS(( void ));
Module: ngircd.git
Branch: master
Commit: 8ad1c23ae453e2f8ff95bccfdabdfed688539760
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=8ad1c23a…
Author: Alexander Barton <alex(a)barton.de>
Date: Fri Jun 25 15:19:39 2010 +0200
Add some documentation for using BOPM with ngIRCd
---
doc/Bopm.txt | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/doc/Bopm.txt b/doc/Bopm.txt
new file mode 100644
index 0000000..bd14450
--- /dev/null
+++ b/doc/Bopm.txt
@@ -0,0 +1,53 @@
+
+ ngIRCd - Next Generation IRC Server
+
+ (c)2001-2010 Alexander Barton,
+ alex(a)barton.de, http://www.barton.de/
+
+ ngIRCd is free software and published under the
+ terms of the GNU General Public License.
+
+ -- BOPM.txt --
+
+
+I. Introduction
+~~~~~~~~~~~~~~~~
+
+Citing <http://wiki.blitzed.org/BOPM>: "BOPM is an open source open proxy
+monitor, designed for use with hybrid-based ircds, although it can be used
+with slight modification on any server which has the ability to show connects
+to opers and that supports KLINEs."
+
+And starting with Release 17, ngIRCd supports all required log messages that
+BOPM requires to be useful.
+
+II. Installation
+~~~~~~~~~~~~~~~~~
+
+Install BOPM as usual, please see the BOPM documentation for details.
+Afterwards adjust the following configuration parameters that are important
+for ngIRCd:
+
+a) BOPM "IRC" section:
+
+ 1) Set "server" and "port" accordingly,
+
+ 2) adjust the "oper" line to match an [Operator] block in ngircd.conf,
+
+ 3) change "mode" to "+ci" or "+c".
+
+ 4) Set "connregex" to the following string, everything in one line(!):
+ "\\*\\*\\* Notice -- Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*";
+ and comment all the other "connregex" examples (prepend a "#" character).
+
+ 5) Set "kline" to "KILL %n :Open proxy found on your host!"; for example,
+ and comment all the other "kline" examples.
+
+b) BOPM "scanner" section:
+
+ Make sure you configure a valid "target_ip" and "target_port" for the
+ configured scanners to test. And please note that you CAN'T USE the port
+ of ngIRCd, because ngIRCd doesn't send any banner message by default!
+
+ So you need a service what sends a banner, so for example POP3, SMTP,
+ IMAP, or SSH daemons should work ...
Module: ngircd.git
Branch: master
Commit: b849e63fbfcddae7c770944816544c4799856042
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=b849e63f…
Author: Florian Westphal <fw(a)strlen.de>
Date: Sat May 29 13:06:19 2010 +0200
configure: make implicit declarations fatal
from bugzilla #105:
"ngircd-16 works great under openbsd4.7/i386, but it segfaults on
openbsd4.7/amd64."
Caused by missing function prototypes and the resulting truncation of
pointer to int.
Lets try to catch these bugs during compilation instead of SIGSEGV.
---
configure.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/configure.in b/configure.in
index 6d9312d..8526af6 100644
--- a/configure.in
+++ b/configure.in
@@ -542,6 +542,7 @@ AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
# Add additional CFLAGS, eventually specified on the command line, but after
# running this configure script. Useful for "-Werror" for example.
+test "$GCC" = "yes" && CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END"
# -- Generate files --