Commit Graph

172 Commits

Author SHA1 Message Date
Alexander Barton 03628dbeaf Add Doxygen @file documentation to each source and header file 2011-02-13 17:52:38 +01:00
Florian Westphal 1dca082fc6 config: deprecate NoXX-Options
ngircd unfortunately uses several options using double-negation, e.g.

NoIdent = No, NoPam = No, etc.

This renames all options by dropping the "No" prefix, e.g.
"NoIdent = no" becomes "Ident = yes".

The old options will continue to work, but will cause a warning
message.

Also update man pages and default config.

To prevent silly
'Ident = yes' from appearing in  --configtest output in the
'ident support not compiled in and Ident Option not used' case,
make default value depend on feature availability.
If feature is available, enable by default, otherwise disable.

We might consider moving these options to a new
[Feature]

section, or something like that, because none of these options are
essential.

Another possible improvement:

'Ident = yes' option in ngircd.conf causes a warning if ngircd was
built without ident support.

This does not happen with e.g. zeroconf....
2011-01-09 13:59:33 +01:00
Alexander Barton 36d4f6c601 Don't assert() when serching a client for an invalid server token
This is only relevant when a trusted server on a server-server link
sends invalid commands.
2010-12-24 12:48:03 +01:00
Alexander Barton 596bc096b0 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.
2010-10-24 21:48:32 +02:00
Alexander Barton cd954ee7e9 Reformat "server state" debug messages a little bit 2010-09-14 00:04:04 +02:00
Alexander Barton 355828e64f 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.
2010-09-14 00:02:02 +02:00
Alexander Barton 575485eb82 WHOWAS: respect hostname cloaking
Store cloaked hostname if user mode "x" is set when the client
disconnects from the server.
2010-08-17 21:02:39 +02:00
Alexander Barton 6fdd3479f1 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 :-)
2010-08-17 20:54:33 +02:00
Alexander Barton 617640e0a3 Clean up an document Client_Hostname() and Client_Mask() 2010-08-17 20:51:14 +02:00
Alexander Barton 41034950d9 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.
2010-07-13 16:50:00 +02:00
Alexander Barton 03457135b7 Use correct preprocessor syntax when testing for PAM and IDENTAUTH 2010-07-12 13:22:48 +02:00
Alexander Barton 1995af0ed6 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.
2010-07-11 17:03:43 +02:00
Alexander Barton cc336b7558 Only #include resolve.h if it is really needed 2010-06-29 22:55:27 +02:00
Alexander Barton a68103771c const'ify Client_TypeText() 2010-06-26 00:31:08 +02:00
Alexander Barton f76e0a1db6 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.
2010-06-25 00:33:01 +02:00
Alexander Barton 9b3e143a26 Re-format Init_New_Client() function 2010-02-10 23:40:03 +01:00
Alexander Barton 805bf03490 Client_CheckID(): fix connection information
This patch fixes the following silly log messages:
'ID "XXX" already registered (on connection -1)!'

If the ID is already registered on a local connection, the local
connection ID is printed; and if the ID is connected via a remote
server, "via network" is displayed.
2009-07-17 16:16:04 +02:00
Florian Westphal 544b9884f4 remove or translate old comments 2009-04-21 20:58:30 +02:00
Florian Westphal 5e16b6df2d client.c: remove unecessary comments 2009-04-21 20:58:28 +02:00
Florian Westphal ea041b8838 add const qualifier to pointers where possible 2009-04-21 20:58:23 +02:00
Florian Westphal 1c7b9dbe93 remove unneeded LOG_DEBUG when not compiling with DEBUG support
when ngircd is build without DEBUG enabled, LOG_DEBUG messages
are always discarded.

To avoid the extra code, ngircd has a LogDebug() wrapper which
gets removed by the compiler when compiling without DEBUG defined.

Update a few functings which were using the
Log(LOG_DEBUG, .. interface directly without #ifdef DEBUG guards.

   text	   data	    bss	    dec	    hex	filename
 127748	   1900	  28280	 157928	  268e8	ngircd.before
 126836	   1896	  28280	 157012	  26554	ngircd.after
2009-01-10 00:54:07 +01:00
Alexander Barton d93030ad27 Make real use of the CLIENT_SERVICE client type.
This patch enables ngIRCd to handle IRC services as real services, and not
as "fake users":

  - Set correct client type CLIENT_SERVICE for services,
  - Change log messages to include correct client type,
  - PRIVMSG: allow users to send messages to services,
  - Send services nick names to other servers (as users).

Please note that this patch doesn't announce services as services in the
network, but as regular users (as before). Only the local server knows
of services as services (see LUSERS command, for example). It is up to
one of the next patches to fix this and to introduce the SERVICE command
in server to server communication.

The propagation of services as regular users between servers doesn't limit
the functionality of the IRC services and will be the fallback for servers
that don't support "real" services propagation in the future.
2008-09-23 11:53:15 +02:00
Alexander Barton 33f32dbd67 New function Client_TypeText() and Destroy_UserOrService().
Client_TypeText() is used to get correct naming ("Client", "Service", ...)
for log messages, and Destroy_UserOrService() is used to correctly destroy
user and services clients.
2008-09-23 11:53:15 +02:00
Florian Westphal 98a8ea105c constify Client_Search() argument. 2008-05-05 15:38:43 +02:00
Florian Westphal be844d74d3 Fix client.c sparse warnings.
client.c:72:6: warning: symbol 'Max_Users' was not declared. Should it be static?
client.c:72:21: warning: symbol 'My_Max_Users' was not declared. Should it be static?
2008-04-04 23:22:06 +02:00
Alexander Barton 47ca178a21 Introduce option to configure the maximum nick name lenth in ngircd.conf
- New configuration option "MaxNickLength" to specify the allowed maximum
  length of user nick names. Note: must be unique in an IRC network!
- Enhanced the IRC+ protocol to support an enhanced "server handshake" and
  enable server to recognice numeric 005 (ISUPPORT) and 376 (ENDOFMOTD).
  See doc/Protocol.txt for details.
2007-11-21 12:16:33 +00:00
Florian Westphal 001c00b273 New config option NoDNS: disables all DNS queries. 2007-10-25 11:01:19 +00:00
Alexander Barton 429f85b77a Remove Client_DestroyNow() to keep semantik "every CONNECTON has a CLIENT". 2007-01-23 16:07:19 +00:00
Florian Westphal 5040d56489 minor cleanup 2006-12-07 22:24:14 +00:00
Florian Westphal 018e351630 -Whitespace Damage; Client_OperCount(), Client_UnknownCount(), Client_MyServerCount() return unsigned long 2006-10-07 10:40:52 +00:00
Florian Westphal 27c96632f1 Client_IsValidNick: no need to strcpy. 2006-10-06 19:57:56 +00:00
Florian Westphal 87f4b1c6f6 Client_GetFromConn() removed and replaced with new function Conn_GetClient() 2006-04-23 10:37:27 +00:00
Florian Westphal bebfbedf3f fix ngt_TrimStr(), fix format string 2006-03-24 23:25:38 +00:00
Florian Westphal eedfc35bbc s/gehoert// 2006-03-11 10:43:49 +00:00
Florian Westphal d39d3ec4b9 Client_RegisterWhowas(): call time() only once 2006-03-11 10:33:30 +00:00
Alexander Barton 29ad5e0d94 Moved now local prototype of Client_New() to C file, renamed it to
Init_New_Client() and cleaned up some code and comments.
2006-03-11 01:37:31 +00:00
Florian Westphal 7e8ac0afcf Client_New() not used outside client.c -> static 2006-03-10 20:25:29 +00:00
Alexander Barton 77f54693ef Removed unnecessary #define of "LOCAL", now use plain C "static" instead. 2005-07-31 20:13:07 +00:00
Alexander Barton 5c20474fdb Only register clients that have been connected at least 30 sec. in WHOIS database. 2005-06-12 16:39:42 +00:00
Alexander Barton a4660f40db New function Client_StartTime(). 2005-06-12 16:18:49 +00:00
Florian Westphal cac9f279fa send RFC compliant netsplit messages. 2005-06-04 12:32:09 +00:00
Alexander Barton 1aeaf64c66 New function Client_RegisterWhowas(). 2005-05-17 23:18:54 +00:00
Alexander Barton 7f0d101184 New functions Client_GetWhowas, Client_GetLastWhowasIndex, and Register_Whowas. 2005-05-16 12:23:48 +00:00
Alexander Barton a02f25a810 Added #include of "defines.h", necessary due to removal of the #include of
"defines.h" in the client.h header file.
2005-04-27 07:46:50 +00:00
Florian Westphal 8adff59223 Remove INT, LONG, BOOLEAN, STATIC, CONST, CHAR datatypes.
use stdbool.h / inttypes.h if available.
2005-03-19 18:43:48 +00:00
Alexander Barton d16ce5a735 Code cleanups from Florian Westphal, <westphal@foo.fh-furtwangen.de>. 2005-01-20 00:11:49 +00:00
Alexander Barton cb76d96efb Fixed some warnings of non-gcc-compilers (e. g. original Apple compiler on
A/UX): "warning: illegal pointer combination, op =".
2004-03-11 22:16:31 +00:00
Alexander Barton 57c7e23622 Added #include for strings.h to fix compiler warnings. 2004-01-17 03:17:49 +00:00
Alexander Barton 62796722f1 Changed all PACKAGE's to PACKAGE_NAME and all VERSION's to PACKAGE_VERSION. 2003-03-31 15:54:21 +00:00
Alexander Barton 939767d502 - New function Client_DestroyNow(). 2003-01-15 14:28:25 +00:00
Alexander Barton 51e1a2e04a - Changed semantics of Client_SetAway(). 2003-01-08 22:03:21 +00:00
Alexander Barton b316c380ad - replaced some calls to sprintf() with snprintf() -- more secure :-) 2002-12-26 17:14:48 +00:00
Alexander Barton 695631b298 - replaced a lot of strcpy() calls with strlcpy() which is more secure. 2002-12-26 17:04:54 +00:00
Alexander Barton 6626395c88 - replaced a lot of strcat() calls with strlcat() which is more secure. 2002-12-26 16:48:14 +00:00
Alexander Barton 0ced4181b0 - replaced all strncpy()'s and strncat()'s with strlcpy() and strlcat(). 2002-12-26 16:25:43 +00:00
Alexander Barton d0304b19a2 - new Functions: Client_MaxUserCount(), Client_MyMaxUserCount, Adjust_Counters(). 2002-12-22 23:29:09 +00:00
Alexander Barton 77c4c015e3 - renamed variables to fit new signal handler. 2002-12-19 04:33:27 +00:00
Alexander Barton 490f28ffd1 - new file header format (in english);
- new file ident semantics.
2002-12-12 12:24:18 +00:00
Alexander Barton 9f122037ae - Logging von doppelten ID's verbessert. 2002-12-03 18:56:33 +00:00
Alexander Barton ad98f2c20d - Falsche Variable korrigiert ... 2002-11-26 08:36:34 +00:00
Alexander Barton c7b55aa6f4 - verwendete Datentypen aufgeraumt: beispielsweise INT32 ist nun oft ein LONG. 2002-10-09 16:53:02 +00:00
Alexander Barton 467e76aa32 - der Puffer fuer das Prefix war zu klein. 2002-10-04 12:39:58 +00:00
Alexander Barton e62ad97937 - CLIENT-Struktur um Flags erweitert.
- neue Funktionen Client_SetFlags() und Client_Flags().
2002-09-03 18:54:31 +00:00
Alexander Barton e6d1bcdf82 - bessere Fehlermeldung, wenn malloc() fehl schlaegt. 2002-06-10 21:09:39 +00:00
Alexander Barton 9cb74e8135 - besseres Logging beim Restart des Servers. 2002-06-02 23:16:42 +00:00
Alexander Barton dadebb2196 - Channel_RemoveClient() heisst nun Channel_Quit(). 2002-06-01 14:36:43 +00:00
Alexander Barton f7327524fc - Weitere Anpassungen an pre-ANSI-Compiler. 2002-05-30 16:52:20 +00:00
Alexander Barton c2f60abe55 - Anpassungen an pre-ANSI-Compiler,
- Includes aufgeraumt: Header includieren keine anderen mehr.
2002-05-27 13:09:26 +00:00
Alexander Barton 3be7b9ef59 - Count_MyServers() zaehlt nun wieder richtig, LUSERS sollte nun wieder die
korrekte Anzahl eigener Server-Links anzeigen.
2002-04-14 13:54:51 +00:00
Alexander Barton 6b58ab8427 - einige Log-Meldungen werden nun auch als Server Notice verschickt. 2002-03-27 20:52:58 +00:00
Alexander Barton 95a4b1b158 - einige Anpassungen nach Code-Check mit SPLint ;-) 2002-03-25 19:11:01 +00:00
Alexander Barton b5c16c228b - Client_SetID() berechnet Hash-Wert ueber ID/Nick.
- Client_GetFromID() heisst nun Client_Search(), zudem wird via Hash gesucht.
- Client_CheckNick() sucht nicht mehr selber.
- altes Client_Search() ist entfallen (s.o.).
2002-03-25 16:59:36 +00:00
Alexander Barton 03c3f3c990 - Netz-Split-Nachricht war so falsch. Nun ist sie korrekt aber nicht schoen. 2002-03-12 23:43:56 +00:00
Alexander Barton 9146fa2534 - Projektdatei an neue Quellcode-Struktur angepasst. 2002-03-12 23:42:59 +00:00
Alexander Barton ca33cbda05 - externe portab-Header werden nicht mehr benoetigt/benutzt, dadurch
einige Aenderungen an diversen Source-Dateien und Headern.
- Dateien enthalten keine CVS-History mehr.
2002-03-12 14:37:51 +00:00
Alexander Barton 50ec7a56a4 - Client_Destroy() hat neuen Paramter: QUITs fuer Clients verschicken? 2002-03-11 22:04:10 +00:00
Alexander Barton dce77559fa - Netz-Splits werden nun als soche ausgegeben. 2002-03-10 22:03:20 +00:00
Alexander Barton 965855756b - der Bindestrich ("-") ist nun auch in Nicknames erlaubt. 2002-03-10 17:15:20 +00:00
Alexander Barton c68c092ce3 - ein paar assert()-Tests ergaenzt. 2002-03-06 14:30:43 +00:00
Alexander Barton a1a3e67de6 - neuen Clients mit Mode "a" wird nun auch der Default-Away-Text gesetzt. 2002-03-04 01:04:46 +00:00
Alexander Barton 10363b398e - strncpy() und vsnprintf() kopieren nun etwas "optimierter" (1 Byte weniger) :-) 2002-03-03 17:17:01 +00:00
Alexander Barton 7157d93651 - Channel- und Nicknames werden nun ordentlich validiert. 2002-03-02 01:35:50 +00:00
Alexander Barton ff54198f43 - Includes fuer einige Header bereinigt. 2002-02-27 23:23:53 +00:00
Alexander Barton c48501245e - neue Funktion Client_SetAway() und Client_Away() implementiert. 2002-02-27 18:22:09 +00:00
Alexander Barton 28d5898617 - Logging beim Abmelden von Clients (erneut) geaendert: nun ist's aber gut ;-) 2002-02-27 14:47:53 +00:00
Alexander Barton 9f3a9df24a - Client_CheckNick() und Client_CheckID() lieferten u.U. falsche Ergebnisse. 2002-02-17 19:02:49 +00:00
Alexander Barton 33944e8cdb - neue Funktion Client_IsValidNick(), Nicknames werden besser validiert. 2002-02-06 16:49:41 +00:00
Alexander Barton 1ab92bb9cb - neue Funktion Client_TopServer(), Client_NewXXX() angepasst. 2002-01-29 00:14:49 +00:00
Alexander Barton 40c9fd26d6 - Client_GetFromID() besser dokumentiert, kleinere Aenderungen. 2002-01-27 22:07:36 +00:00
Alexander Barton b5ee4552c1 - weitere Anpassungen an Chennals, v.a. ueber Server-Links. 2002-01-27 21:56:54 +00:00
Alexander Barton d17748e978 - Client_GetFromID() kommt nun auch mit Host-Masken zurecht. 2002-01-27 18:27:12 +00:00
Alexander Barton fc3c82f7df - wird ein Client entfernt, so wird er auch aus allen Channels geloescht. 2002-01-21 00:08:50 +00:00
Alexander Barton 49ed223c1b - bei Client_SetModes() wurde das NULL-Byte falsch gesetzt. Opsa. 2002-01-18 15:32:01 +00:00
Alexander Barton b9d701dbeb - neue Funktionen Client_xxxCount(). 2002-01-16 22:10:35 +00:00
Alexander Barton 4fe7e9d6f1 - Hop-Count fuer den Server selber (0) wird korrekt initialisiert. 2002-01-11 23:50:40 +00:00
Alexander Barton 8f7e7d666a - wird ein Server abgemeldet, so wird anderen Server ein SQUIT geschickt. 2002-01-09 01:08:08 +00:00
Alexander Barton a53857b4c7 - Es werden fuer alle Server eigene Token generiert,
- QUIT von einem Server fuer einen User wird an andere Server geforwarded,
- ebenso NICK-Befehle, die "fremde" User einfuehren.
2002-01-07 23:42:12 +00:00
Alexander Barton b89c310891 - Bei Log-Meldungen ueber Clients wird nun immer die "Client Mask" verwendet. 2002-01-07 15:31:00 +00:00
Alexander Barton 79809118a3 - Loglevel und Meldungen nochmals geaendert. Level passen nun besser. 2002-01-06 15:18:14 +00:00
Alexander Barton 904d5e5b09 - Vorbereitungen fuer Ident-Abfragen in Client-Strukturen. 2002-01-05 23:26:05 +00:00