Module: ngircd.git
Branch: master
Commit: ec5ab4fcd1bc361cacb56e999b2b8f0a00caf5a9
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=ec5ab4fc…
Author: Federico G. Schwindt <fgsch(a)lodoss.net>
Date: Wed Sep 18 23:51:44 2013 +0100
Add support to show user links using "STATS L"
Change "stats L" to show servers and user links and restrict it to
IRC Operators.
---
doc/Commands.txt | 8 ++++++--
src/ngircd/irc-info.c | 14 ++++++++++----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/doc/Commands.txt b/doc/Commands.txt
index dde1498..e4f0090 100644
--- a/doc/Commands.txt
+++ b/doc/Commands.txt
@@ -451,17 +451,21 @@ Status and Informational Commands
Show statistics and other information of type <query> of a particular
IRC server in the network.
.
- The following <query> types are supported (case-insensitive):
+ The following <query> types are supported (case-insensitive where
+ applicable):
.
- g Network-wide bans ("G-Lines").
- k Server-local bans ("K-Lines").
- - l Link status (parent server and own link only).
+ - L Link status (servers and user links).
+ - l Link status (servers and own link).
- m Command usage count.
- u Server uptime.
.
<target> can be a server name, the nickname of a client connected to
a specific server, or a mask matching a server name in the network.
The server of the current connection is used when <target> is omitted.
+ .
+ To use "STATS L" the user must be an IRC Operator.
References:
- RFC 2812, 3.4.4 "Stats message"
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c
index 1c250a4..79a157c 100644
--- a/src/ngircd/irc-info.c
+++ b/src/ngircd/irc-info.c
@@ -41,6 +41,7 @@
#include "irc-macros.h"
#include "irc-write.h"
#include "client-cap.h"
+#include "op.h"
#include "exp.h"
#include "irc-info.h"
@@ -865,6 +866,7 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
unsigned int days, hrs, mins;
struct list_head *list;
struct list_elem *list_item;
+ bool more_links = false;
assert(Client != NULL);
assert(Req != NULL);
@@ -909,16 +911,20 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
list_item = Lists_GetNext(list_item);
}
break;
+ case 'L': /* Link status (servers and user links) */
+ if (!Op_Check(from, Req))
+ return Op_NoPrivileges(from, Req);
+ more_links = true;
+
case 'l': /* Link status (servers and own link) */
- case 'L':
time_now = time(NULL);
for (con = Conn_First(); con != NONE; con = Conn_Next(con)) {
cl = Conn_GetClient(con);
if (!cl)
continue;
- if ((Client_Type(cl) == CLIENT_SERVER)
- || (cl == Client)) {
- /* Server link or our own connection */
+ if (Client_Type(cl) == CLIENT_SERVER ||
+ cl == Client ||
+ (more_links && Client_Type(cl) == CLIENT_USER)) {
#ifdef ZLIB
if (Conn_Options(con) & CONN_ZIP) {
if (!IRC_WriteStrClient
Module: ngircd.git
Branch: master
Commit: 99db111bca731490e8e91dfe3efe075179177005
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=99db111b…
Author: Alexander Barton <alex(a)barton.de>
Date: Thu Sep 19 00:17:36 2013 +0200
doc/PAM.txt: add a slightly more useful example
---
doc/PAM.txt | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/doc/PAM.txt b/doc/PAM.txt
index 64bbc7b..671f071 100644
--- a/doc/PAM.txt
+++ b/doc/PAM.txt
@@ -1,9 +1,8 @@
ngIRCd - Next Generation IRC Server
+ http://ngircd.barton.de/
- (c)2001-2010 Alexander Barton,
- alex(a)barton.de, http://www.barton.de/
-
+ (c)2001-2013 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
@@ -34,3 +33,13 @@ is running as. Therefore a lot of PAM modules aren't working as expected,
because they need root privileges ("pam_unix", for example)!
Only PAM modules not(!) requiring root privileges (such as "pam_pgsql",
"pam_mysql", "pam_opendirectory" ...) can be used in conjunction with ngIRCd.
+
+More Examples:
+
+ * Use an own "password file" for ngIRCd:
+
+ Note: you can use the htpasswd(1) utility of Apache to manage password
+ files used by pam_pwdfile, see "man htpasswd"!
+
+ /etc/pam.d/ngircd:
+ auth required pam_pwdfile.so pwdfile=/etc/ngircd/ngircd.passwd