ngircd-alex.git
9 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.

9 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

9 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

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

9 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 :-)

9 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

9 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

9 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.

9 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.

9 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

9 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.

9 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

9 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...

9 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;".

9 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

9 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

9 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"

9 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

9 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

9 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

9 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.

9 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

9 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.

9 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.

9 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.

9 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.

9 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.

9 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).

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

9 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 ...

9 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

9 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

9 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.

9 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

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

9 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

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

9 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

9 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.

9 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!

9 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.

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

9 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 :-)

9 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()

9 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)

9 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

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

9 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.

9 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)

9 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.

9 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

9 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.

9 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

9 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.

9 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.

9 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

9 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.

9 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

9 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

9 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.

9 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

9 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.

9 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

9 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

9 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

9 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

9 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.

9 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.

9 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

9 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.

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

9 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

9 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

9 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.

9 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!

9 years agoNew function Proc_GenericSignalHandler()
Alexander Barton [Wed, 30 Jun 2010 22:39:35 +0000 (00:39 +0200)]
New function Proc_GenericSignalHandler()

9 years agoRename Log_[{Init|Exit}_]Resolver to Log_[{Init|Exit}_]Subprocess
Alexander Barton [Wed, 30 Jun 2010 22:34:56 +0000 (00:34 +0200)]
Rename Log_[{Init|Exit}_]Resolver to Log_[{Init|Exit}_]Subprocess

Rename Log_Init_Resolver, Log_Exit_Resolver, and Log_Resolver to
Log_Init_Subprocess, Log_Exit_Subprocess, and Log_Subprocess and
make it more generic thereby.

9 years agoDon't #include client.h when conn.h/conn-func.h is already included
Alexander Barton [Wed, 30 Jun 2010 21:49:52 +0000 (23:49 +0200)]
Don't #include client.h when conn.h/conn-func.h is already included

conn.h and cinn-func.h both already #include client.h, so it is
not needed to do it twice.

9 years agoNew function Conn_GetFromProc() to get CONN_ID of a subprocess
Alexander Barton [Tue, 29 Jun 2010 21:38:39 +0000 (23:38 +0200)]
New function Conn_GetFromProc() to get CONN_ID of a subprocess

Get CONN_ID from file descriptor associated to a subprocess structure.

9 years agoResolver: Implement signal handler and catch TERM signal
Alexander Barton [Fri, 21 May 2010 21:53:48 +0000 (23:53 +0200)]
Resolver: Implement signal handler and catch TERM signal

9 years agoDon't set a penalty time when doing DNS lookups
Alexander Barton [Fri, 21 May 2010 21:47:28 +0000 (23:47 +0200)]
Don't set a penalty time when doing DNS lookups

The logic isn't as described in the source and intended by this code:
ngIRCd doesn't wait for the asynchronous resolver process until the set
penalty time is over, but until the forked process terminates or the
initial connection timeout (= PongTimeout) triggers.

So don't set the penalty time at all and remove the wrong comment.

9 years agoUpdate comments: subprocesses not only can be resolver processes
Alexander Barton [Fri, 21 May 2010 21:44:20 +0000 (23:44 +0200)]
Update comments: subprocesses not only can be resolver processes

9 years agoRefactoring: Rename CONNECTION.res_stat to .proc_stat
Alexander Barton [Fri, 21 May 2010 20:48:34 +0000 (22:48 +0200)]
Refactoring: Rename CONNECTION.res_stat to .proc_stat

We want to use this process status variable not only for the
resolver subprocesses but other asynchronous tasks as well;
so let's name it more generic.

9 years agoNew "module" proc.c/proc.h for generic process handling
Alexander Barton [Tue, 18 May 2010 15:38:12 +0000 (17:38 +0200)]
New "module" proc.c/proc.h for generic process handling

The new "module" proc.c is used for functions dealing with child
processes. At the moment, it is only used by the asynchronous resolver.

All the functions already implemented habe been migrated from the
resolver code base, and the rest of the ngIRCd source code has been
adepted to the new namespace and calling conventions.

The goal is to develop "generic" process handling functions that can
be used for other purposes as well, e.g. running processes on client
connects etc.

9 years agoOnly #include resolve.h if it is really needed
Alexander Barton [Tue, 18 May 2010 15:06:31 +0000 (17:06 +0200)]
Only #include resolve.h if it is really needed

9 years agoFix redundant redeclaration of Conn_Count*() functions
Alexander Barton [Fri, 25 Jun 2010 22:45:11 +0000 (00:45 +0200)]
Fix redundant redeclaration of Conn_Count*() functions

The wrongly placed #endif lead to the following compiler warnings:

conn.h:125: warning: redundant redeclaration of ‘Conn_Count’
conn.h:125: warning: previous declaration of ‘Conn_Count’ was here
conn.h:126: warning: redundant redeclaration of ‘Conn_CountMax’
conn.h:126: warning: previous declaration of ‘Conn_CountMax’ was here
conn.h:127: warning: redundant redeclaration of ‘Conn_CountAccepted’
conn.h:127: warning: previous declaration of ‘Conn_CountAccepted’ was here

9 years agoconst'ify Conn_WriteStr() function
Alexander Barton [Fri, 25 Jun 2010 22:44:37 +0000 (00:44 +0200)]
const'ify Conn_WriteStr() function

9 years agoconst'ify Send_ListChange() function in irc-mode.c
Alexander Barton [Fri, 25 Jun 2010 22:42:12 +0000 (00:42 +0200)]
const'ify Send_ListChange() function in irc-mode.c

9 years agoconst'ify IRC_WriteStrXXX() and Get_Prefix() functions
Alexander Barton [Fri, 25 Jun 2010 22:38:20 +0000 (00:38 +0200)]
const'ify IRC_WriteStrXXX() and Get_Prefix() functions

9 years agoconst'ify command name variable in _COMMAND strcuture
Alexander Barton [Fri, 25 Jun 2010 22:37:06 +0000 (00:37 +0200)]
const'ify command name variable in _COMMAND strcuture

9 years agoconst'ify Client_TypeText()
Alexander Barton [Fri, 25 Jun 2010 22:31:08 +0000 (00:31 +0200)]
const'ify Client_TypeText()

9 years agoAdd some documentation for using BOPM with ngIRCd bug103-ConnNotice
Alexander Barton [Fri, 25 Jun 2010 13:19:39 +0000 (15:19 +0200)]
Add some documentation for using BOPM with ngIRCd

9 years agoImplement user mode "c": receive connect/disconnect NOTICEs
Alexander Barton [Sat, 22 May 2010 15:19:24 +0000 (17:19 +0200)]
Implement user mode "c": receive connect/disconnect NOTICEs

Users having the user mode "c" set receive NOTICE messages on each
new client connection to the local server as well as disconnects.
Only IRC operators (users having the mode "o" set) are allowed to
set the 'c' user mode.

These connect/disconnect messages can be useful for open proxy
scanners -- BOPM (http://wiki.blitzed.org/BOPM) is now functional
with ngIRCd, for example.

9 years agoRefactor Wall_ServerNotice() into more generic Log_ServerNotice()
Alexander Barton [Sat, 22 May 2010 15:10:22 +0000 (17:10 +0200)]
Refactor Wall_ServerNotice() into more generic Log_ServerNotice()

Log_ServerNotice() sends a messages to all users having a given
user mode set.

9 years agoNew function Conn_IPA(): get client IP address as string
Alexander Barton [Sat, 22 May 2010 14:35:02 +0000 (16:35 +0200)]
New function Conn_IPA(): get client IP address as string

9 years agongircd.init: require $network $remote_fs when stopping ngircd
Alexander Barton [Thu, 24 Jun 2010 22:10:56 +0000 (00:10 +0200)]
ngircd.init: require $network $remote_fs when stopping ngircd

9 years agoShow SSL status in WHOIS, numeric 275
Neale Pickett [Fri, 11 Jun 2010 22:32:41 +0000 (17:32 -0500)]
Show SSL status in WHOIS, numeric 275

"I've been wanting this for years and finally took the 5 minutes to
patch it in. I took the response code (275) from whatever's running
OFTC's IRC network."
  -- Neale Pickett <neale@woozle.org>, Fri, 11 Jun 2010 17:32:41 -0500

(OFTC is running Hybrid ircd.)

9 years agoInclude correct header files when testing for arpa/inet.h (Closes: #105)
Alexander Barton [Tue, 8 Jun 2010 13:23:04 +0000 (15:23 +0200)]
Include correct header files when testing for arpa/inet.h (Closes: #105)

Tested on OpenBSD 4.7, OpenBSD 4.1, FreeBSD 8, Linux and Mac OS X.
Thanks to rck <dev.rck@gmail.com> for reporting and testing!

9 years agoRevert "configure: make implicit declarations fatal"
Florian Westphal [Sat, 29 May 2010 16:47:27 +0000 (18:47 +0200)]
Revert "configure: make implicit declarations fatal"

This reverts commit b3a6c33da0b12ba74dc395979b677813d4bc2c0f.

apparently not all gcc versions support this 8-(

9 years agoconfigure: make implicit declarations fatal
Florian Westphal [Sat, 29 May 2010 11:06:19 +0000 (13:06 +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.