about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)Author
2012-08-06Fix compiler warning when not building with ZLIB supportAlexander Barton
This fixes: irc.c: In function ‘Option_String’: irc.c:333:9: error: variable ‘options’ set but not used
2012-08-03Hashed hostnames for CloakHostSebastian Köhler
Implemented support for hashed hostnames for CloakHost. The admin can use '%x' in both the CloakHost and CloakHostModeX setting. The config option CloakHostModeX was renamed to CloakHostSalt. This salt is used for both cloaking options.
2012-08-03Implemented hashed cloaked hostnames for +xSebastian Köhler
CloakHostModeX can now contain '%x'. It will be replace by the hash of the original client hostname. The new config option CloakHostModeXSalt defines the salt for the hash function. When CloakHostModeXSalt is not set a random salt will be generated after each server restart. Spelling fix in defines.h
2012-06-09Rename "CloakModeHost" option to "CloakHostModeX"Alexander Barton
2012-06-09Introduce new configuration option "CloakModeHost"Christoph Biedl
This closes bug #124.
2012-06-09Correctly handle asynchronously re-established server linksAlexander Barton
Don't try to establish an outgoing server link after DNS lookup when this server re-connected on its own in the meantime. In addition, log a warning message if we try to update the connection index of an already connected server structure -- and ignore it. Up to now, both behaviour could lead to a race when the remote server connects to this daemon while it still prepares the outgoing connection: - The local server prepares the new outgoing connection ... - in the meantime the remote server becomes connected and registered. - Now the new outgoing connection overwrites the (correct) socket handle, - then the 2nd connection becomes disconnected: "already registered", - and the 1st connection becomes unhandled ("gets lost") because the configuration structure is reset because of the wrong socket handle. This patch hopefully fixes all these problems.
2012-06-08Log a debug message when SIGUSR2 is handledAlexander Barton
2012-06-02NoticeAuth: Fix test if IDENT reply has been invalidAlexander Barton
This fixes conn.c: In function ‘cb_Read_Resolver_Result’: conn.c:2252: warning: comparison between pointer and integer
2012-06-02IDENT reply: only allow alphanumeric characters in user nameAlexander Barton
Only alphanumeric characters are allowed in the user name, so ignore all IDENT replies that would violate this rule and use the one supplied by the USER command.
2012-06-01USER command: only allow alphanumeric characters in user nameAlexander Barton
Only alphanumeric characters are allowed in the user name, so terminate the connection if any "strage" characters have been supplied by the user. This is how other IRC daemons (like ircd2.11 and ircd-seven) behave ...
2012-05-23Change wording of "TLS initialized" messageAlexander Barton
Don't use the word "socket" to identify the connection number, but use the word "connection" like on all the other messages logged.
2012-05-22Pidfile_Create(): Don't leak file descriptor on error pathAlexander Barton
Detected by cppcheck: [src/ngircd/ngircd.c:502]: (error) Resource leak: pidfd
2012-05-01Numeric 005 (ISUPPORT), CHANMODES: add missing mode "r"Alexander Barton
2012-04-29irc-cap.c: mark arguments of Handle_CAP_ACK() as "unused"Alexander Barton
This fixes irc-cap.c: In function ‘Handle_CAP_ACK’: irc-cap.c:163: warning: unused parameter ‘Client’ irc-cap.c:163: warning: unused parameter ‘Arg’
2012-04-29irc-login.c, login.c: add missing include of "string.h"Alexander Barton
This fixes the following warnings with GCC 4.4.5 on Linux: irc-login.c: In function ‘IRC_PASS’: irc-login.c:92: warning: implicit declaration of function ‘strlen’ irc-login.c:92: warning: incompatible implicit declaration of built-in function ‘strlen’ irc-login.c:113: warning: incompatible implicit declaration of built-in function ‘strlen’ irc-login.c:129: warning: implicit declaration of function ‘strchr’ irc-login.c:129: warning: incompatible implicit declaration of built-in function ‘strchr’ irc-login.c:133: warning: implicit declaration of function ‘strcmp’ irc-login.c: In function ‘IRC_SERVICE’: irc-login.c:556: warning: incompatible implicit declaration of built-in function ‘strchr’ login.c: In function ‘Login_User’: login.c:131: warning: implicit declaration of function ‘strcmp’
2012-04-28Merge branch 'capabilities'Alexander Barton
* capabilities: "multi-prefix" capability 2/2: adjust NAME and WHO handlers "multi-prefix" capability 1/2: implement complete CAP infrastructure IRC_Send_NAMES(): Code cleanup New function Client_CapSet() in addition to Client_Cap{Add|Del} "CAP REQ" starts capability negotiation and delays user registration Correctly handle "CAP END", new client type CLIENT_WAITCAPEND Implement core IRC capability handling and "CAP" command New "login" source file Introduce_Client() => Client_Introduce(), and move it to client.c
2012-04-28"multi-prefix" capability 2/2: adjust NAME and WHO handlersAlexander Barton
The NAME and WHO commands now return multiple usermode prfixes when the "multi-prefix" capability is in effect for the requesting client. See <http://ircv3.atheme.org/extensions/multi-prefix-3.1>
2012-04-28"multi-prefix" capability 1/2: implement complete CAP infrastructureAlexander Barton
Now ngIRCd is able to handle "CAP LS", "CAP REQ", "CAP LIST", and "CAP CLEAR" commands. "multi-prefix" can be set/unset, but has no functionality - yet!
2012-04-28IRC_Send_NAMES(): Code cleanupAlexander Barton
2012-04-27New function Client_CapSet() in addition to Client_Cap{Add|Del}Alexander Barton
2012-04-27"CAP REQ" starts capability negotiation and delays user registrationAlexander Barton
New helper function Set_CAP_Negotiation().
2012-04-18Fix 8ec17063: "Lists_Add(): use size of destination when copying data"Alexander Barton
Thanks to Florian Westphal for spotting my silliness ...
2012-04-17Lists_Add(): use size of destination when copying dataAlexander Barton
This fixes the following warning of clang: /src/ngircd/lists.c:152:44: warning: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Wstrlcpy-strlcat-size] But it isn't a real problem, because the size of the source always is the same than the size of the destination ...
2012-03-31Correctly handle "CAP END", new client type CLIENT_WAITCAPENDAlexander Barton
2012-03-31Implement core IRC capability handling and "CAP" commandAlexander Barton
This patch implements the core functions to support "IRC Capabilities" and the IRC "CAP" command as used by other servers and specified here: <http://www.leeh.co.uk/draft-mitchell-irc-capabilities-02.html>. It enables ngIRCd to support the defined handshake, but it doesn't implement any capabilities, so "CAP LS" and "CAP LIST" always return the empty set and "CAP REQ ..." always fails with "CAP NAK".
2012-03-31New "login" source fileAlexander Barton
Rename Hello_User[_PostAuth] to Login_User[_PostAuth] and move it to the new login.c; and move cb_Read_Auth_Result(), too. This will enable further code to easily call Login_User() when required.
2012-03-31Introduce_Client() => Client_Introduce(), and move it to client.cAlexander Barton
2012-03-31Makefiles: list each source files on a separate lineAlexander Barton
Patches that add/remove source files become much nicer this way :-)
2012-03-28Don't ignore "permission denied" errors when enabling chrootAlexander Barton
Up to now, ngIRCd silently ignored permission denied errors when trying to enable a chroot setup: only the "not running chrooted" message became logged later on. This patch lets ngIRCd exit with a fatal error when the chroot can't be enabled on startup -- this is the much safer bevahiour!
2012-03-12Fix gcc warning, initialize "list" variable to NULLAlexander Barton
This fixes the following warning with gcc 4.6.3.: irc-mode.c: In function "Channel_Mode": irc-mode.c:947:26: error: "list" may be used uninitialized in this function irc-mode.c:884:25: error: "list" may be used uninitialized in this function (The variable has never been used uninitialized, so don't worry)
2012-03-12Fix typo: recieved -> receivedAlexander Barton
Thanks to Christoph Biedl.
2012-03-03getpid.sh: Fix testcase error for Debian using sbuildChristoph Biedl
When * building the ngircd Debian package (on Linux at least) and * using the sbuild build system, the command "ps -af" does not include the commands running inside the sbuild system. Therefore, start-server.sh will report a fail as getpid.sh cannot not find the ./T-ngircd1 just started although it's actually running. This results in a funny build log ... starting server 1 ... failure! FAIL: start-server1 running connect-test ... ok. PASS: connect-test The self-test of getpid.sh however will likely succeed as it's happy if it sees any process with "sh" somewhere in the name. Things go downhill from there. The confusing things are: * The alternative cowbuilder/pbuilder does not have this problem. * The alternative usage "ps ax" does fine. So, as a quick hack, the patch attached adds another switch to getpid.sh.
2012-03-02Don't log "ngIRCd hello message" two timesAlexander Barton
Start "regular" logging not until the configuration file has been read in and "SyslolgFacility" is set, and log all configuration errors using the generic "daemon" facility. So if there are no configuration errors, logging starts right after parsing the configuration and we log the configuration file used _after_ reading it. But this is no problem because every configuration error message includes the configuration file name as well. (The "double hello" has been introduced by commit 3641e5110952)
2012-02-26Don't accept "[SSL]" in config when no SSL support is built inAlexander Barton
2012-02-26Fix C syntax: duplicate ";;" should be ";"Alexander Barton
Using gcc 2.7.2, this fixes: irc-channel.c: In function `join_allowed': irc-channel.c:86: parse error before `const'
2012-02-14Correctly re-open syslog logging after reading of configurationAlexander Barton
Syslog logging has been initialized before reading the configuraton file, so ngIRCd always used the default facility and ignored the "SyslogFacility" configuration option. Thanks to Patrik Schindler for reporting this issue!
2012-02-14Logging: remove "Activating ..." info messageAlexander Barton
2012-02-12Fix forwarding of LIST commandsAlexander Barton
Bug reported by Cahata, thanks!
2012-01-25New_Connection(): don't set the client hostname twiceAlexander Barton
Setting the hostname twice doesn't do much harm a lot, but isn't elegant. And for IPv6 addresses, it isn't correct the first time (missing []) ...
2012-01-25Client_SetHostname(): Code cleanup, more debug loggingAlexander Barton
2012-01-24io: use define for number of possible eventsFlorian Westphal
2012-01-24io: remove outer do {} while loops for epoll/kqueue/devpoll backendsFlorian Westphal
simplifies things a bit. io_dispatch() is called repeatedly from the main loop.
2012-01-24Enhance server command limitsAlexander Barton
This patch updates the limits for handling commands from a remote server: - "<user count> / 5 + <min>" using "<min>=10" during normal operation, - the above count multiplied with 5 while servers are syncing. The intention is to a) make the limit dependent of the number of users in the network (the more users, the more commands required to sync) and b) to significantly rise this limit while servers are joining the network to make the login and synchronization faster.
2012-01-24Send a PING at the end of the server sync to detect itAlexander Barton
At the end of sending all "state" to the remote server, a PING command is sent to request a PONG reply. Until then, no "regual" PING was sent, so Conn_LastPing(<connection>) is null and now becomes non-null in the PONG command handler. So the servers are still synchronizing when Conn_LastPing(<connection>) is 0, which could easily be tested.
2012-01-24New function Conn_UpdatePing() to update the "ping timestamp"Alexander Barton
2012-01-24Conn_UpdateIdle(): Code cleanupAlexander Barton
2012-01-23RPL_ISUPPORT_MSG(005): add "EXCEPTS=e INVEX=I"Alexander Barton
Thanks to Cahata for the idea!
2012-01-23Fix "MAXLIST=beI:50": the limit is the sum of all listsAlexander Barton
"Modes which are specified in the same pair share the same maximum size", so "beI:50" means a total of 50 entries, regardless of the list. See <http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt>, thanks to Cahata for reporting this!
2012-01-22New RPL_WHOISHOST_MSG(378): show hostname and IP addressAlexander Barton
The numeric RPL_WHOISHOST_MSG(378) returns the DNS hostname (if available) and the IP address of a client in the WHOIS reply. Only the user itself and local IRC operators get this numeric.
2012-01-22New function Conn_GetIPAInfo(): get IP address of a connectionAlexander Barton