Module: ngircd.git
Branch: master
Commit: cf93881dfbd7b6317d2a41f87e9751b74354203b
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=cf93881d…
Author: Alexander Barton <alex(a)barton.de>
Date: Wed Jul 14 10:27:55 2010 +0200
New function Conn_CloseAllSockets() to close all open sockets
This is useful in forked child processes, for example, to make sure that
they don't hold connections open that the main process wants to close.
---
src/ngircd/conn.c | 17 +++++++++++++++++
src/ngircd/conn.h | 2 ++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index f059d91..d8df627 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -419,6 +419,23 @@ Conn_Exit( void )
} /* Conn_Exit */
+/**
+ * Close all sockets (file descriptors) of open connections.
+ * This is useful in forked child processes, for example, to make sure that
+ * they don't hold connections open that the main process wants to close.
+ */
+GLOBAL void
+Conn_CloseAllSockets(void)
+{
+ CONN_ID idx;
+
+ for(idx = 0; idx < Pool_Size; idx++) {
+ if(My_Connections[idx].sock > NONE)
+ close(My_Connections[idx].sock);
+ }
+}
+
+
static unsigned int
ports_initlisteners(array *a, const char *listen_addr, void (*func)(int,short))
{
diff --git a/src/ngircd/conn.h b/src/ngircd/conn.h
index a63fcbb..a0bddaa 100644
--- a/src/ngircd/conn.h
+++ b/src/ngircd/conn.h
@@ -102,6 +102,8 @@ GLOBAL long WCounter;
GLOBAL void Conn_Init PARAMS((void ));
GLOBAL void Conn_Exit PARAMS(( void ));
+GLOBAL void Conn_CloseAllSockets PARAMS((void));
+
GLOBAL unsigned int Conn_InitListeners PARAMS(( void ));
GLOBAL void Conn_ExitListeners PARAMS(( void ));
Module: ngircd.git
Branch: master
Commit: 583c50476bee24a8da9459163b609ac80353e63e
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=583c5047…
Author: Alexander Barton <alex(a)barton.de>
Date: Mon Jul 12 13:07:07 2010 +0200
Initial documentation for using PAM with ngIRCd
---
doc/PAM.txt | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/doc/PAM.txt b/doc/PAM.txt
new file mode 100644
index 0000000..64bbc7b
--- /dev/null
+++ b/doc/PAM.txt
@@ -0,0 +1,36 @@
+
+ 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.
+
+ -- PAM.txt --
+
+
+ngIRCd can optionally be compiled to use PAM, the Pluggable Authentication
+Modules library, for user authentication. When compiled with PAM support,
+ngIRCd will authenticate all users connecting to the daemon using the
+configured PAM modules in an asynchronous child process.
+
+To enable PAM, you have to pass the command line parameter "--with-pam" to
+the "configure" script. Please see the PAM documentation ("man 7 pam") for
+details and information about configuring PAM and its individual modules.
+
+A very simple -- and quite useless ;-) -- example would be:
+
+ /etc/pam.d/ngircd:
+ auth required pam_debug.so
+
+Here the "pam_debug" module will be called each time a client connects to
+the ngIRCd and has sent its PASS, NICK, and USER commands.
+
+Please note ONE VERY IMPORTANT THING:
+
+All the PAM modules are executed with the privileges of the user ngIRCd
+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.