]> arthur.barton.de Git - ngircd-alex.git/log
ngircd-alex.git
13 years agoFix up generation and distribution of sample-ngircd.conf
Alexander Barton [Wed, 3 Nov 2010 22:47:21 +0000 (23:47 +0100)]
Fix up generation and distribution of sample-ngircd.conf

- Add generated sample-ngircd.conf to new .gitignore file,
- refactor Makefile.am to generate sample-ngircd.conf on "make all",
  to clean it up on "make clean", and to install it to the correct place.
- Make sure path names in sample-ngircd.conf are separated by "/".

13 years agodoc: change path names in sample-ngircd.conf depending on sysconfdir
Florian Westphal [Mon, 1 Nov 2010 22:47:04 +0000 (23:47 +0100)]
doc: change path names in sample-ngircd.conf depending on sysconfdir

13 years agongIRCd Release 17~rc3 rel-17-rc3
Alexander Barton [Wed, 27 Oct 2010 20:31:05 +0000 (22:31 +0200)]
ngIRCd Release 17~rc3

13 years agoFix connect attempts to further IP addresses of outgoing server links
Alexander Barton [Wed, 27 Oct 2010 19:59:51 +0000 (21:59 +0200)]
Fix connect attempts to further IP addresses of outgoing server links

If a hostname resolves to more than one IP address (round-robin DNS,
IPv4 and IPv6) and an attempt to connect to the first address fails,
ngIRCd should try to connect to the 2nd address, 3rd address etc.

But because of a wrong variable used in the call to New_Server(),
the wrong server structure has been used in further connection attemps
which possibly lead to connection attempts to already connected servers.

13 years agoDebian: Install default /etc/pam.d/ngircd allowing all logins
Alexander Barton [Tue, 26 Oct 2010 22:43:02 +0000 (00:43 +0200)]
Debian: Install default /etc/pam.d/ngircd allowing all logins

This is required for backwards compatibility when installing the -full
or -full-dbg package variant: PAM is enabled now but no configuration
present, so all login attempts would be denied ...

Creating /etc/pam.d/ngircd including "auth required pam_permit.so"
restores the old behaviour of allowing all connections.

13 years agoDebian: update standards to 3.9.1; add libpam0g-dev dependency
Alexander Barton [Tue, 26 Oct 2010 20:56:01 +0000 (22:56 +0200)]
Debian: update standards to 3.9.1; add libpam0g-dev dependency

13 years agoMake contrib/platformtest.sh more portable
Alexander Barton [Tue, 26 Oct 2010 20:18:30 +0000 (22:18 +0200)]
Make contrib/platformtest.sh more portable

13 years agoMac OS X package ("make osxpkg"): generate PAM configuration
Alexander Barton [Tue, 26 Oct 2010 13:15:06 +0000 (15:15 +0200)]
Mac OS X package ("make osxpkg"): generate PAM configuration

13 years agoXcode builds ("make xcode"): disable pam_fail_delay()
Alexander Barton [Tue, 26 Oct 2010 13:13:24 +0000 (15:13 +0200)]
Xcode builds ("make xcode"): disable pam_fail_delay()

disable pam_fail_delay() only is available starting with Mac
OS X 10.6; but we use the 10.5 SDK for campatibility, so don't use
this function at all when building using Xcode.

13 years agoXcode: update project file, use 10.5.x SDK
Alexander Barton [Tue, 26 Oct 2010 13:10:14 +0000 (15:10 +0200)]
Xcode: update project file, use 10.5.x SDK

This is required for universal 32 bit and 64 bit builds: now code
for ppc, i386, and x86_64 is generated (which requires 10.5 or newer).

13 years agoXcode builds ("make xcode"): detect version number correctly
Alexander Barton [Tue, 26 Oct 2010 13:09:01 +0000 (15:09 +0200)]
Xcode builds ("make xcode"): detect version number correctly

13 years agongIRCd release 17~rc2 rel-17-rc2
Alexander Barton [Mon, 25 Oct 2010 16:51:32 +0000 (18:51 +0200)]
ngIRCd release 17~rc2

13 years agoUpdated contrib/platformtest.sh (new version scheme)
Alexander Barton [Mon, 25 Oct 2010 16:49:54 +0000 (18:49 +0200)]
Updated contrib/platformtest.sh (new version scheme)

 - handle version numbers generated by "git describe"
 - detect gcc compiler version correctly when "-std=xxx" is used

13 years agoNew doc/HowToRelease.txt file describing the release process
Alexander Barton [Mon, 25 Oct 2010 12:46:58 +0000 (14:46 +0200)]
New doc/HowToRelease.txt file describing the release process

13 years agoZeroConf: include header files missing since commit a988bbc86a
Alexander Barton [Sun, 24 Oct 2010 22:17:46 +0000 (00:17 +0200)]
ZeroConf: include header files missing since commit a988bbc86a

13 years agoGenerate ngIRCd version number from GIT tag version-detect
Alexander Barton [Wed, 20 Oct 2010 22:20:08 +0000 (00:20 +0200)]
Generate ngIRCd version number from GIT tag

Now the ngIRCd release/version number is deduced from the "current"
annotated GIT tag; see "git describe --help" for details. This is the
same scheme the Linux kernel uses and gives much more details version
numbers for interim releases and inofficial source archives generated
using "make dist".

Please note: the version number is only updated it the autogen.sh
script is run; so after pulling in and pushing out new commits, you
should run ./autogen.sh!

13 years agoMake sourcecode compatible with ansi2knr again
Alexander Barton [Sun, 24 Oct 2010 19:48:32 +0000 (21:48 +0200)]
Make sourcecode compatible with ansi2knr again

This allows to compile ngIRCd using a pre-ANSI K&R C compiler again:
all source files are automatically converted by the included ansi2knr
program (of GNU automake/autoconf) before compiling them with the
K&R C compiler, but a few coding standards must be met.

Tested on Apple A/UX 3.x.
Regression testing on Linux and Mac OS X.

13 years ago./configure: check if C compiler can compile ISO Standard C
Alexander Barton [Sun, 24 Oct 2010 12:14:30 +0000 (14:14 +0200)]
./configure: check if C compiler can compile ISO Standard C

This is required for enabling ansi2knr on systems that don't have an
ANSI C compiler installed (e.g. on A/UX with Apple standard C compiler).

13 years ago./configure: check support for C prototypes again
Alexander Barton [Sun, 24 Oct 2010 11:50:22 +0000 (13:50 +0200)]
./configure: check support for C prototypes again

13 years agoDon't use PARAMS() macro for function implementations
Alexander Barton [Sun, 24 Oct 2010 11:41:51 +0000 (13:41 +0200)]
Don't use PARAMS() macro for function implementations

The PARAMS() macro is only needed for function prototypes;
don't use it for the actual implementations.

13 years agoAdded m68k/apple/aux3.0.1 (gcc 2.7.2) to doc/Platforms.txt
Alexander Barton [Tue, 19 Oct 2010 20:19:18 +0000 (22:19 +0200)]
Added m68k/apple/aux3.0.1 (gcc 2.7.2) to doc/Platforms.txt

13 years agoOnly try to set FD_CLOEXEC if this flag is defined
Alexander Barton [Tue, 19 Oct 2010 20:17:12 +0000 (22:17 +0200)]
Only try to set FD_CLOEXEC if this flag is defined

A/UX 3.x doesn't implement this constant, for example.

13 years agoOnly use "__attribute__ ((unused))" if GCC >=2.8 is used
Alexander Barton [Tue, 19 Oct 2010 20:13:12 +0000 (22:13 +0200)]
Only use "__attribute__ ((unused))" if GCC >=2.8 is used

At least GCC 2.7.2 doesn't support this attribute.

13 years agodoc/Makefile.am: don¹t set docdir, automake handles it already
Alexander Barton [Wed, 13 Oct 2010 20:46:29 +0000 (22:46 +0200)]
doc/Makefile.am: don¹t set docdir, automake handles it already

And elder make(1) programs don¹t like "x ?= y" ...

13 years agongIRCd release 17~rc1 rel-17-rc1
Alexander Barton [Mon, 11 Oct 2010 21:25:48 +0000 (23:25 +0200)]
ngIRCd release 17~rc1

13 years agoNew configuration option "NoZeroConf" to disable ZeroConf registration
Alexander Barton [Mon, 11 Oct 2010 14:54:49 +0000 (16:54 +0200)]
New configuration option "NoZeroConf" to disable ZeroConf registration

If ngIRCd is compiled to register its services using ZeroConf (e.g. using
Howl, Avahi or on Mac OS X) this parameter can be used to disable service
registration at runtime.

13 years agoXcode: only build current architecture in "Debug" target
Alexander Barton [Sat, 9 Oct 2010 18:13:54 +0000 (20:13 +0200)]
Xcode: only build current architecture in "Debug" target

13 years agodoc/Platforms.txt: added NetBSD 5.0.2
Alexander Barton [Thu, 7 Oct 2010 11:20:30 +0000 (13:20 +0200)]
doc/Platforms.txt: added NetBSD 5.0.2

13 years agoUpdated doc/Platforms.txt
Alexander Barton [Tue, 5 Oct 2010 21:19:54 +0000 (23:19 +0200)]
Updated doc/Platforms.txt

13 years agoMake sure sighandlers.h is listed in noinst_HEADERS
Alexander Barton [Tue, 5 Oct 2010 19:57:01 +0000 (21:57 +0200)]
Make sure sighandlers.h is listed in noinst_HEADERS

... because it must be included in the distribution archive :-)

13 years agoconst'ify ngt_SyslogFacilityName() function
Alexander Barton [Tue, 5 Oct 2010 18:16:35 +0000 (20:16 +0200)]
const'ify ngt_SyslogFacilityName() function

This fixes the following gcc compiler warning:

tool.c: In function 'ngt_SyslogFacilityName':
tool.c:195: warning: return discards qualifiers from pointer target type

13 years agoDebian packages: build "-full" and "-full-dbg" with support for PAM
Alexander Barton [Sun, 3 Oct 2010 13:06:07 +0000 (15:06 +0200)]
Debian packages: build "-full" and "-full-dbg" with support for PAM

13 years agoNew configuration option "SyslogFacility"
Alexander Barton [Fri, 24 Sep 2010 15:39:11 +0000 (17:39 +0200)]
New configuration option "SyslogFacility"

The new option "SyslogFacility" deines the syslog "facility" to which
ngIRCd should send log messages.

Possible values are system dependant, but most probably "auth", "daemon",
"user" and "local1" through "local7" are possible values; see syslog(3).
Default is "local5" for historical reasons.

13 years agoNew functions ngt_SyslogFacilityName() and ngt_SyslogFacilityID()
Alexander Barton [Fri, 24 Sep 2010 14:29:55 +0000 (16:29 +0200)]
New functions ngt_SyslogFacilityName() and ngt_SyslogFacilityID()

These both functions translate syslog facility names to ID numbers
and vice versa. On systems that don't define the facilitynames[] array
in syslog.h, we try to build one ourself.

13 years agoExplicitly cast return value of read(2) to "int"
Alexander Barton [Wed, 22 Sep 2010 12:15:46 +0000 (14:15 +0200)]
Explicitly cast return value of read(2) to "int"

This fixes the following gcc warning, emitted by Xcode:

src/ngircd/sighandlers.c: In function 'Signal_Callback':
src/ngircd/sighandlers.c:239: warning: implicit conversion shortens 64-bit value into a 32-bit value

13 years agoAdd sighandlers.{c|h} to Xcode project
Alexander Barton [Wed, 22 Sep 2010 12:11:30 +0000 (14:11 +0200)]
Add sighandlers.{c|h} to Xcode project

And update static Mac OS X config.h used by the Xcode project.

13 years agoDon't call sigaction() if it is not available on the system
Alexander Barton [Wed, 22 Sep 2010 12:10:09 +0000 (14:10 +0200)]
Don't call sigaction() if it is not available on the system

13 years agoFix signalpipe file descriptor leak on RESTART
Florian Westphal [Tue, 14 Sep 2010 21:53:59 +0000 (23:53 +0200)]
Fix signalpipe file descriptor leak on RESTART

Signals_Init() must only be called once.
This does not affect any ngircd release version.

Earlier version of this patch moved the io and sighandler
initialization before the while() loop, but as Alexander
Barton noticed that broke all systems without builtin select
support in io.c...

13 years agosighandlers.{c|h}: Code cleanup
Alexander Barton [Mon, 13 Sep 2010 22:30:45 +0000 (00:30 +0200)]
sighandlers.{c|h}: Code cleanup

 - declare signals_catch[] array not between the function implementations.
 - rename now local function NGIRCd_Rehash() to Rehash().
 - remove empty and therefore not used "catch SIGHUP; break;".

13 years agoMake sighandlers.{c|h} compatible with ansi2knr
Alexander Barton [Mon, 13 Sep 2010 22:29:34 +0000 (00:29 +0200)]
Make sighandlers.{c|h} compatible with ansi2knr

13 years agoUpdated ChangeLog to include signal handler changes
Alexander Barton [Mon, 13 Sep 2010 22:18:20 +0000 (00:18 +0200)]
Updated ChangeLog to include signal handler changes

13 years agoBump version number to "17-dev"
Alexander Barton [Fri, 10 Sep 2010 22:02:37 +0000 (00:02 +0200)]
Bump version number to "17-dev"

13 years agoUpdate ChangeLog and NEWS: include SIGUSR1/SIGUSR2 changes
Alexander Barton [Fri, 10 Sep 2010 19:22:08 +0000 (21:22 +0200)]
Update ChangeLog and NEWS: include SIGUSR1/SIGUSR2 changes

13 years agoOutput connection status when dumping the internal server state
Alexander Barton [Fri, 10 Sep 2010 19:11:25 +0000 (21:11 +0200)]
Output connection status when dumping the internal server state

13 years agoReformat "server state" debug messages a little bit
Alexander Barton [Fri, 10 Sep 2010 19:10:17 +0000 (21:10 +0200)]
Reformat "server state" debug messages a little bit

13 years agoEnable the daemon to dump its internal state in debug-mode.
Alexander Barton [Wed, 9 Apr 2008 17:03:24 +0000 (19:03 +0200)]
Enable the daemon to dump its internal state in debug-mode.

This patch allows ngIRCd to dump its internal state (connected clients,
actual configuration) when compiled with --enable-debug. The daemon
catches two more signals:

 - SIGUSR1: toggle debug mode (on/off),
 - SIGUSR2: dump internal state to console/syslog.

13 years agosignalhandlers: add fallback to deprecated sysv API
Florian Westphal [Sat, 11 Sep 2010 09:33:27 +0000 (11:33 +0200)]
signalhandlers: add fallback to deprecated sysv API

13 years agoremove NGIRCd_SignalRehash
Florian Westphal [Fri, 10 Sep 2010 22:27:21 +0000 (00:27 +0200)]
remove NGIRCd_SignalRehash

now that the main signal handling is done from the dispatcher
loop we can call NGIRCD_Rehash() directly.

the /REHASH handler can queue the Rehash() function for
execution by sending a SIGHUP.  It will be run when we
return back to the dispatch loop.

13 years agoAdd new 'delayed' signal handlers.
Florian Westphal [Fri, 10 Sep 2010 22:19:01 +0000 (00:19 +0200)]
Add new 'delayed' signal handlers.

Allows to defer/queue signal processing for execution on the next
event dispatch call, i.e. we can perform any signal action in
normal, non-signal context.

Example uses:
- Reload everything on HUP without writing a global "SIGHUP_received"
  variable
- Dump status of internal Lists on SIGUSR1, etc.

13 years agoio: add io_cloexec to set close-on-exec flag.
Florian Westphal [Fri, 10 Sep 2010 21:41:29 +0000 (23:41 +0200)]
io: add io_cloexec to set close-on-exec flag.

13 years agong_ipaddr.h: include assert.h
Florian Westphal [Fri, 10 Sep 2010 22:25:23 +0000 (00:25 +0200)]
ng_ipaddr.h: include assert.h

We use assert() in this header, so we should include assert.h.

13 years agoConn_SyncServerStruct(): test all connections; and work case insensitive
Alexander Barton [Wed, 8 Sep 2010 00:02:01 +0000 (02:02 +0200)]
Conn_SyncServerStruct(): test all connections; and work case insensitive

Fix synchronization of established connections and configured server
structures after a configuration update:

 - Not only test servers that already have a connection, but also check
   and update configured servers to which a new connection is beeing
   established (SERVER_WAIT state).

 - And do the server name comparision case-insensitive.

13 years agoCheck_Servers(): skip servers already beeing connected
Alexander Barton [Tue, 7 Sep 2010 22:45:23 +0000 (00:45 +0200)]
Check_Servers(): skip servers already beeing connected

Let CheckServers() not only skip servers that already have a
connection, but also skip servers to which a new connection is
already beeing established (SERVER_WAIT state).

13 years agoCheck_Servers(): Code cleanup
Alexander Barton [Tue, 7 Sep 2010 22:42:57 +0000 (00:42 +0200)]
Check_Servers(): Code cleanup

13 years agoUpdate ChangeLog and NEWS in preparation for the next release ...
Alexander Barton [Sun, 29 Aug 2010 16:10:49 +0000 (18:10 +0200)]
Update ChangeLog and NEWS in preparation for the next release ...

13 years agoFix linebreak in INSTALL text to fit in 80 columns
Alexander Barton [Sun, 29 Aug 2010 16:09:57 +0000 (18:09 +0200)]
Fix linebreak in INSTALL text to fit in 80 columns

13 years agoconfigure: correctly indent IPv6 yes/no summary output
Alexander Barton [Tue, 24 Aug 2010 22:02:06 +0000 (00:02 +0200)]
configure: correctly indent IPv6 yes/no summary output

13 years agoDon't reset My_Connections[Idx].lastping when reading data
Alexander Barton [Thu, 19 Aug 2010 13:58:55 +0000 (15:58 +0200)]
Don't reset My_Connections[Idx].lastping when reading data

This fixes PING-PONG lag calculation (which resulted in "0" before).

The "lastping" time is still reset it if a time shift backwards has
been detected to prevent the daemon from miscalculating ping timeouts.

13 years agowrite_whoreply(): respect hostname cloaking bug102-CloakHost
Alexander Barton [Tue, 17 Aug 2010 22:01:14 +0000 (00:01 +0200)]
write_whoreply(): respect hostname cloaking

13 years agoIRC_USERHOST(): respect hostname cloaking
Alexander Barton [Tue, 17 Aug 2010 21:56:36 +0000 (23:56 +0200)]
IRC_USERHOST(): respect hostname cloaking

13 years agoIRC_USERHOST(): Code cleanup & some documentation
Alexander Barton [Tue, 17 Aug 2010 21:55:40 +0000 (23:55 +0200)]
IRC_USERHOST(): Code cleanup & some documentation

13 years agoSend_Message(): respect hostname cloaking
Alexander Barton [Tue, 17 Aug 2010 19:15:58 +0000 (21:15 +0200)]
Send_Message(): respect hostname cloaking

13 years agoIRC_WriteStrClientPrefix() / Get_Prefix(): respect hostname cloaking
Alexander Barton [Tue, 17 Aug 2010 19:14:51 +0000 (21:14 +0200)]
IRC_WriteStrClientPrefix() / Get_Prefix(): respect hostname cloaking

13 years agoRefactor IRC_WriteStr{Channel|Related}Prefix(); support cloaking
Alexander Barton [Tue, 17 Aug 2010 19:11:37 +0000 (21:11 +0200)]
Refactor IRC_WriteStr{Channel|Related}Prefix(); support cloaking

Move common code to new local function Send_Marked_Connections()
and respect hostname cloaking.

13 years agoImplement user mode "x": hostname cloaking (closes: #102)
Alexander Barton [Tue, 17 Aug 2010 19:05:06 +0000 (21:05 +0200)]
Implement user mode "x": hostname cloaking (closes: #102)

When a client has user mode "x" set, its real hostname is cloaked
by substituting it with the server name (as configured in ngircd.conf).

Restricted clients (user mode "r") aren't allowed to change mode "x".

Please note that hostname cloaking is only in effect in server-client
communication! The server still uses the real hostname for its own
logging and for all server-server communication -- therefore all servers
in the network must support user mode "x" to prevent older servers
from leaking the real hostname of a cloaked client!

13 years agoWHOWAS: respect hostname cloaking
Alexander Barton [Tue, 17 Aug 2010 19:02:39 +0000 (21:02 +0200)]
WHOWAS: respect hostname cloaking

Store cloaked hostname if user mode "x" is set when the client
disconnects from the server.

13 years agoWHOIS: respect hostname cloaking
Alexander Barton [Tue, 17 Aug 2010 19:00:02 +0000 (21:00 +0200)]
WHOIS: respect hostname cloaking

13 years agoImplement Client_HostnameCloaked() and Client_MaskCloaked()
Alexander Barton [Tue, 17 Aug 2010 18:54:33 +0000 (20:54 +0200)]
Implement Client_HostnameCloaked() and Client_MaskCloaked()

These two functions return the cloaked hostname, if the client has
enabled hostname cloaking indicated by the -- still to implement --
user mode "x". See furter patches :-)

13 years agoClean up an document Client_Hostname() and Client_Mask()
Alexander Barton [Tue, 17 Aug 2010 18:51:14 +0000 (20:51 +0200)]
Clean up an document Client_Hostname() and Client_Mask()

13 years agoMake configure switch "--docdir" work (closes: #108)
Alexander Barton [Tue, 17 Aug 2010 13:59:54 +0000 (15:59 +0200)]
Make configure switch "--docdir" work (closes: #108)

13 years agoReformat and update FAQ.txt a little bit
Alexander Barton [Fri, 13 Aug 2010 13:53:24 +0000 (15:53 +0200)]
Reformat and update FAQ.txt a little bit

13 years agoINSTALL: mention SSL and IPv6
Florian Westphal [Wed, 11 Aug 2010 21:24:02 +0000 (23:24 +0200)]
INSTALL: mention SSL and IPv6

13 years agoINSTALL: mention changed handling of MotdFile.
Florian Westphal [Wed, 11 Aug 2010 21:19:23 +0000 (23:19 +0200)]
INSTALL: mention changed handling of MotdFile.

13 years agongircd: change MOTD file handling
Florian Westphal [Wed, 11 Aug 2010 20:52:06 +0000 (22:52 +0200)]
ngircd: change MOTD file handling

previously, the given MotdFile file was read whenever a client
requested it.

Change handling to read the MotdFile contents into memory once
during config file parsing.

Two side effects:
- changes to the MOTD file do not have any effect until ngircds
  configuration is reloaded
- MOTD file does no longer have to reside in the chroot directory
  (the MOTD contents will then not be re-read on reload in that case)

13 years agostartup: open /dev/null before chroot
Florian Westphal [Sat, 31 Jul 2010 22:05:07 +0000 (00:05 +0200)]
startup: open /dev/null before chroot

before people had to create a /dev/null inside the chroot to make
redirection work.

13 years agoAllow IRC ops to change channel modes even without OperServerMode set
Alexander Barton [Sun, 25 Jul 2010 14:44:38 +0000 (16:44 +0200)]
Allow IRC ops to change channel modes even without OperServerMode set

13 years agoAllow IRC operators to use MODE command on any channel (closes: #100)
Florian Westphal [Fri, 14 May 2010 18:07:34 +0000 (20:07 +0200)]
Allow IRC operators to use MODE command on any channel (closes: #100)

This allows IRC operators to change channel modes of ANY channel,
even without joining these channels first.

13 years agoAdded mailmap file for git-[short]log and git-blame
Alexander Barton [Sun, 25 Jul 2010 13:13:50 +0000 (15:13 +0200)]
Added mailmap file for git-[short]log and git-blame

13 years agoRemove Proc_Kill(), use timeout to kill child processes generic-proc
Alexander Barton [Wed, 14 Jul 2010 08:29:05 +0000 (10:29 +0200)]
Remove Proc_Kill(), use timeout to kill child processes

This avoids a race and potentionally killing the wrong process on
systems that use randomized process IDs; now the child itself is
responsible to exit in a timely manner using SIGALRM.

13 years agoNew function Conn_CloseAllSockets() to close all open sockets
Alexander Barton [Wed, 14 Jul 2010 08:27:55 +0000 (10:27 +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.

13 years agoAuthenticated users should be registered without the "~" mark
Alexander Barton [Tue, 13 Jul 2010 21:18:54 +0000 (23:18 +0200)]
Authenticated users should be registered without the "~" mark

13 years agoDon't Proc_Kill() childs after Proc_Read(): done there already.
Alexander Barton [Tue, 13 Jul 2010 20:29:06 +0000 (22:29 +0200)]
Don't Proc_Kill() childs after Proc_Read(): done there already.

13 years agoDon't even fork a PAM-subprocess if "NoPAM" option is set
Alexander Barton [Tue, 13 Jul 2010 20:14:53 +0000 (22:14 +0200)]
Don't even fork a PAM-subprocess if "NoPAM" option is set

13 years agoUse Proc_GenericSignalHandler() as handler for SIGTERM by default
Alexander Barton [Tue, 13 Jul 2010 20:04:35 +0000 (22:04 +0200)]
Use Proc_GenericSignalHandler() as handler for SIGTERM by default

13 years agoMark some variables as "unused" to prevent compiler warnings
Alexander Barton [Tue, 13 Jul 2010 14:50:00 +0000 (16:50 +0200)]
Mark some variables as "unused" to prevent compiler warnings

Some variables are only used when compiling with IDENT or PAM support
or when the debug code is enabled. Mark them as "unused" so that gcc
doesn't generate warnings when neither of these options is enabled.

13 years agoSet NoPAM=yes in configuration files used for the testsuite
Alexander Barton [Tue, 13 Jul 2010 14:48:24 +0000 (16:48 +0200)]
Set NoPAM=yes in configuration files used for the testsuite

13 years agoNew configuration option "NoPAM" to disable PAM
Alexander Barton [Tue, 13 Jul 2010 13:10:35 +0000 (15:10 +0200)]
New configuration option "NoPAM" to disable PAM

When the "NoPAM" configuration option is set and ngIRCd is compiled
with support for PAM, ngIRCd will not call any PAM functions: all
connection attemps without password will succeed instead and all
connection attemps with password will fail.

If ngIRCd is compiled without PAM support, this option is a dummy
option and nothing changes: the global server password will still be
in effect.

13 years agoio.c: Include conn.h when using the select() API
Alexander Barton [Mon, 12 Jul 2010 11:24:45 +0000 (13:24 +0200)]
io.c: Include conn.h when using the select() API

13 years agoUse correct preprocessor syntax when testing for PAM and IDENTAUTH
Alexander Barton [Mon, 12 Jul 2010 11:22:48 +0000 (13:22 +0200)]
Use correct preprocessor syntax when testing for PAM and IDENTAUTH

13 years agoMake sure signal.h is #include'd when needed
Alexander Barton [Mon, 12 Jul 2010 11:22:19 +0000 (13:22 +0200)]
Make sure signal.h is #include'd when needed

13 years agoInitial documentation for using PAM with ngIRCd
Alexander Barton [Mon, 12 Jul 2010 11:07:07 +0000 (13:07 +0200)]
Initial documentation for using PAM with ngIRCd

13 years agoImplement asynchronous user authentication using PAM
Alexander Barton [Mon, 12 Jul 2010 10:56:33 +0000 (12:56 +0200)]
Implement asynchronous user authentication using PAM

For each client connection a child process is forked which handles the
actual PAM authentication and reports the result back to the master
process using a pipe for communication.

While the PAM authentication is in process the daemon does not block.

13 years agoAdd new pam.{c|h} module to Xcode project
Alexander Barton [Mon, 12 Jul 2010 10:54:01 +0000 (12:54 +0200)]
Add new pam.{c|h} module to Xcode project

Adjust Xcode project and Mac OS X static config.h header to use PAM.

13 years agoAdd pam.{c|h} to project and implement PAM_Authenticate() function
Alexander Barton [Mon, 12 Jul 2010 10:53:08 +0000 (12:53 +0200)]
Add pam.{c|h} to project and implement PAM_Authenticate() function

13 years agoNew functions Client_[Set]OrigUser() to get/set user specified by peer
Alexander Barton [Sun, 11 Jul 2010 15:03:43 +0000 (17:03 +0200)]
New functions Client_[Set]OrigUser() to get/set user specified by peer

The Client_SetOrigUser() function is used to store the peer-provided
user name (see USER command) in its original form, not changed by
IDENT results, for example.

13 years agoDetect PAM libraries
Alexander Barton [Sun, 11 Jul 2010 15:01:45 +0000 (17:01 +0200)]
Detect PAM libraries

13 years agoRefactor Resolve_Read() into generic Proc_Read() function
Alexander Barton [Sun, 11 Jul 2010 14:58:30 +0000 (16:58 +0200)]
Refactor Resolve_Read() into generic Proc_Read() function

13 years agoMake Proc_Kill() more fault-tolerant
Alexander Barton [Sun, 11 Jul 2010 14:54:44 +0000 (16:54 +0200)]
Make Proc_Kill() more fault-tolerant

13 years agoNew function Conn_GetProcStat()
Alexander Barton [Sun, 11 Jul 2010 13:15:23 +0000 (15:15 +0200)]
New function Conn_GetProcStat()

Get PROC_STAT sub-process structure of a given connection.

13 years agoCode cleanup: don't reset penalty time on DNS resolver result
Alexander Barton [Sun, 11 Jul 2010 13:12:17 +0000 (15:12 +0200)]
Code cleanup: don't reset penalty time on DNS resolver result

See commit d4632a727fbee6: it's not necessary any more!