Commit Graph

1728 Commits

Author SHA1 Message Date
Alexander Barton 30b32e84fe Fix warning message introduced when cleaning up IRC_SERVER()
This reverts a not intentional code change and fixes the following compiler
warning message (tested with gcc 4.4.5):

 irc-server.c: In function "IRC_SERVER":
 irc-server.c:142: warning: suggest parentheses around operand of "!"
                            or change "&" to "&&" or "!" to "~"
2012-10-29 11:44:45 +01:00
Alexander Barton fb92493376 Make server reconnect time a little bit more random
Add randomly up to 15 seconds to the reconnect delay for outgoing server
links when the connection has been "short" and therefore the "ConnectRetry"
delay is being enforced.

This should make it even more unlikely that two servers deadlock each
other when both are trying to connect to the other one at the same time,
for example in test environments.
2012-10-29 11:33:49 +01:00
Alexander Barton eb4f9eac0c Don't accept connections for servers already beeing linked
If two servers try to link each other, there was a time frame that
could result in one connection overwriting the other, e. g. the incoming
connection overwriting the status of the outgoing one. And this could
lead to all kind of weirdness (even crashes!) later on.

So now such incoming connections are dropped. But this most probably
prevents the two servers from linking until timing changes somehow
(network latency?) because each server drops the incoming connection of
the other one, so no connection survives in the end.

But this has to be addressed by an other patch ...
2012-10-29 11:33:49 +01:00
Alexander Barton d7b5dd1bbf IRC_SERVER(): Code cleanup 2012-10-29 11:33:49 +01:00
Alexander Barton b18e81b631 Use lowercase "package name" for syslog logging again
This is how ngIRCd up to release 19.2 behaved; "bug" introduced by commit
67e882, "configure.in: require autoconf 2.67 and automake 1.11", which
changed the "PACKAGE_NAME" to "ngIRCd"; so use "PACKAGE" which still is
the lowercase version for initializing syslog logging.
2012-10-29 10:24:27 +01:00
Brett Smith 32f63abb59 Make the maximum /list reply length a configurable limit. 2012-10-25 14:46:29 -04:00
Alexander Barton 8d9cfa157a Allow remote servers and IRC Ops to change channel topics
Remote servers are always allowed to change all channel topics,
and IRC Operators are allowed to change all channel topics if the
configuration option "OperCanUseMode" is enabled.

Bug introduced by commit 7b01bb8 and reported by DNS777.
2012-10-19 19:45:44 +02:00
DNS 58abd0777b Increased maximum number of possible user and channel modes
Currntly ngIRCd supports 13 user and 15 channel modes, because there
have been quite a few additions since our last release. But our data
structures can only hold 15 user and -- even worse! -- only 9 channel
modes! So enlarge the buffers to 20 bytes (actually 21 including NULL)
to allow storing of all mode characters and to have some space left
for more modes to come ...

(cherry picked from commit 8996d777621d88d4bcc439ab4792b2814920687f)
2012-10-19 18:44:15 +02:00
DNS777 3ee98d9f72 Update error messages for user mode +b and channel Mode +M.
Replaced error message for channel mode +M with ERR_NEEDREGGEDNICK_MSG
(used by Bahamut, inspircd, ircu & Unreal too) and using numeric 477
and the msg simliar like inspircd.

Replaced the error message ERR_CANNOTSENDTONICK_MSG for user mode +b
with ERR_NONONREG_MSG and using numeric 486, similar like unrealircd.

(cherry picked from commit 55a61ab17f63a9e757b7c7598c31b98ce5a132e8
and commit 3737d9ab7da1ea0485cefc07c65dc5308bf0db02)
2012-10-19 18:38:46 +02:00
Alexander Barton e0da56fc7b Disable UID/GID checks on "single user OS"
Don't abort on "single user operating systems" that don't know more than
one user account and therefore can't change user and group IDs.

Currently, the only such system supported by ngIRCd is Haiku, a BeOS
clone.
2012-10-11 14:54:13 +00:00
DNS777 9d97004a28 Implement user mode "b": block messages
When a user has set mode "b", all private messages and notices to this
user are blocked if they don't originate from a registered user, an IRC Op,
server or service. The originator gets an error numeric sent back in this
case, ERR_CANNOTSENDTONICK_MSG(976), which is/was(?) used by KineIRCd, too.

This closes bug #144.
2012-10-08 12:11:04 +02:00
Alexander Barton 87deb43012 Fix ERR_CANNOTSENDTOCHAN_MSG message
This error message is not only used if one can not send to a channel
because it is moderated, but for _all_ reasons when a message can not
be delivered (moderated, banned, no external messages, ...), so strip
the "(+m) -- Moderated" part of the error message again.

Bug introduced by commit 9a82304a.
2012-10-07 15:11:05 +02:00
Alexander Barton 161adbb1aa WHOIS: show RPL_WHOISHOST_MSG to all IRC Ops in the network
Not only show RPL_WHOISHOST_MSG to local IRC opreators, but show
it to all IRC operators in the network. And don't show it to anybody
if the "more privacy" configuration option is enabled.

This closes bug #134.
2012-10-07 00:05:25 +02:00
Alexander Barton c9d166747d Merge branch 'bug141-ModesQq'
This closes bug #141.

* bug141-ModesQq:
  KICK-protect IRC services
  Implement channel mode "Q" and user mode "q"

Conflicts:
	src/ngircd/defines.h
	src/ngircd/messages.h
2012-10-06 22:37:57 +02:00
DNS777 56cdc2175c Show active user modes in WHOIS reply
Implement numeric RPL_WHOISMODES_MSG(379) and show user modes in the
reply of the WHOIS command for the user himself or, if MorePrivacy
isn't set, for request initiated by an IRC operator.

Numeric 379 is used by Unreal and InspIRCd for this purpose, too.

Closes bug #129.
2012-10-06 21:56:59 +02:00
DNS777 de453d71cb Implement channel mode 'V' (invite disallow)
If the new channel mode "V" is set, the INVITE command becomes invalid
and all clients get the new ERR_NOINVITE_MSG(518) reply.

Unreal and InspIRCd uses this mode, too.

This closes bug #143.
2012-10-06 20:49:35 +02:00
DNS777 23b07bdf50 Allow channel admins to "de-admin" channel members
This patch fixes unsetting of channel user mode "+a" (channel admin)
and adds a better error message: without this patch, a channel admin is
unable to unset this mode.

This closes bug #142.
2012-10-06 19:52:15 +02:00
Alexander Barton 9ac94339dc KICK-protect IRC services 2012-10-06 19:23:05 +02:00
Alexander Barton 46b0eef721 Merge branch 'bug109-CHARCONV'
This closes bug #109.

* bug109-CHARCONV:
  Debian: require "telnet" or "telnet-ssl" for building
  Debian ngircd-full[-dbg]: enable CHARCONV
  Add "CHARCONV" to "feature string" when enabled
  Implement new IRC+ "CHARCONV" command
  Added new configure option "--with-iconv"

Conflicts:
	src/ngircd/messages.h
2012-10-06 18:26:25 +02:00
Alexander Barton d3ae351236 Implement channel mode "Q" and user mode "q"
Both modes protect users from channel kicks: only IRC operators and
servers can kick users having mode "q" or in channels with mode "Q".

Original patch by DNS777 <dns@rbose.org>, thanks!

This closes bug #141.
2012-10-06 18:13:01 +02:00
Alexander Barton c66e20ce6e Fix spelling: ERR_CHANOPPRIVTOLOW_MSG -> ERR_CHANOPPRIVTOOLOW_MSG
Thanks to DNS for pointing this out, see bug #126!
2012-10-06 17:21:32 +02:00
Federico G. Schwindt 19ce256a95 ERR_CHANNELISFULL_MSG: better wording
(cherry picked from commit 0fcfa7e00fa8e098dd3724c7188c88ac82a52881)
2012-09-27 00:22:48 +02:00
Federico G. Schwindt d8ee498a65 Send RPL_REHASHING if rehash was accepted
(cherry picked from commit f1b171a09cd076f743a7fff221fa7aa752abb374)
2012-09-27 00:07:40 +02:00
Federico G. Schwindt e3a1a61868 Change variable name "SSLDHFile" to "DHFile" in log messages
(cherry picked from commit d96db0a2e56d310177edb45d0a8b164a37992ab1)
2012-09-27 00:05:07 +02:00
Federico G. Schwindt 1a2bdd9e4c Move ConnSSL_InitLibrary() "dummy" from header into C file
(cherry picked from commit 5fd88c81a70d0c9e627f08522e57d251586288eb)
2012-09-27 00:03:56 +02:00
Alexander Barton 384f965fba NJOIN: correctly reset channel level flags
This fixes commit 7b01bb83.
Bug reported by DNS777 <dns@rbose.org>, thanks!
2012-09-26 23:51:48 +02:00
Alexander Barton 005340c83f Simplify check for valid user names in IRC_USER().
Patches from Federico G. Schwindt, thanks!

(cherry picked from commit a44b7126227ba1118ec02b399e31b08102af5e8c
and 6fbe9583753b2620da275676cde46a89cb4d06c2)
2012-09-26 23:28:13 +02:00
Alexander Barton d21afce2b6 Allow user mode +x only when "CloakHostModeX" is set
Allow users to "cloak" their hostname only when the configuration
variable "CloakHostModeX" (introduced in 19.2) is set. Otherwise, only
IRC opertators, other servers, and services are allowed to set mode +x.

This prevents regular users from changing their hostmask to the name
of the IRC server itself, which confused quite a few people ;-)

This fixes bug #133.
2012-09-26 22:55:10 +02:00
DNS777 808c291c76 New configuration option "OperChanPAutoOp"
If disabled, IRC operators don't become channel operators in persistent
channels when joining. Enabled by default, which has been the behavior
of ngIRCd up to this patch.

Closes bug #135.

(Cosmetic fixes by Alex.)
2012-09-25 13:08:39 +02:00
DNS777 62a07596d6 Allow opers to see secret (+s) channels in LIST command
As long as 'MorePrivacy' isn't enabled in the configuration file, local
IRC operators can see secret (+s) channels when using the LIST command.

Closes bug #136.
2012-09-25 12:55:07 +02:00
Alexander Barton 3e22fc32f3 Remove all geneerated Makefile.am on "make maintainer-clean" 2012-09-24 20:45:37 +02:00
Alexander Barton 8cfb910441 Merge branch 'automake-am11-am12'
* automake-am11-am12:
  autogen.sh: detect automake version format a.b.c and a.b
  configure.ng: don't require GIT tree to detect version string
  Include .mailmap file in distribution archives
  Include all build-system files into distribution archives
  Change build system to support new and old GNU automake
2012-09-24 20:28:02 +02:00
Alexander Barton d4df626d88 automake: don't use INCLUDES, it's AM_CPPFLAGS nowadays 2012-09-24 17:45:15 +02:00
Alexander Barton 8e1beae4e7 Include all build-system files into distribution archives 2012-09-24 14:34:16 +02:00
Alexander Barton e3e181f4b3 Merge branch 'bug92-xop'
By Alexander Barton (5) and Sebastian Köhler (2)

* bug92-xop:
  Fix NAMES/WHO response when client has multi-prefix
  Fix prefix of "halfop" when "multi-prefix" is active
  Clean up doc/.gitignore
  doc/Modes.txt: add version number to new channel modes
  Fix some "whitespace glitches"
  Tests and documentation for xop
  Implemented xop support

Conflicts (because of "multi-prefix fix"):
	src/ngircd/irc-info.c

This fixes bug #92 "ngircd does not support XOP usermodes".
2012-09-23 20:06:14 +02:00
Alexander Barton 1f2aa4da6f Fix NAMES/WHO response when client has multi-prefix
This has been fixed by commit 16f94546 "Fix NAMES response when
client has multi-prefix" in the master branch, fix it in this patch
series, too.
2012-09-23 19:37:06 +02:00
Alexander Barton fc39146f48 Fix prefix of "halfop" when "multi-prefix" is active 2012-09-23 19:23:23 +02:00
Alexander Barton 192e304b94 Change build system to support new and old GNU automake
Starting with GNU automake 1.12, the "de-ANSI-fication support" has been
removed, which ngIRCd used to enable building itself on very old systems.

Now the problem is, that using automake >= 1.12 isn't working because of
the now unsupported M4 macros. Therefore the solution that this patch
implements is to dynamically generate the automake input files with our
own ./autogen.sh script:

  configure.ng => configure.in
  Makefile.ng => Makefile.am

This is quite an ugly approach, but it works and enables us to:

  1. use current automake >= 1.12 for development and "private builds",
  2. still build distribution archives using automake 1.11.x that have
     "de-ANSI-fication support" enabled in the generated Makefile's.

And if you are using Makefile's generated with a automake version newer
than 1.11.x (without "de-ANSI-fication support"), the ./configure script
warns you not to use this generated build system to generate distribution
archives.

Drawback of this patch: you MUST use our autogen.sh script, you can't call
the autoconf/automake commands directly any more; but autoreconf should
still work ...
2012-09-23 18:13:55 +02:00
Alexander Barton ef82ef4ddb Free all listen ports on initialization
Now you can reconfigure listen ports and reload the server configuration
on runtime. Without this patch, no ports could be removed.
2012-09-21 10:41:03 +02:00
Alexander Barton bb20aeb9bc Initialize SSL when needed only, and disable SSL on errors
With this patch, the SSL subsystem will only be initialized if at least
one SSL ports is configured; so you won't get "SSL initialization failed"
messages if you didn't configured it at all.

And if SSL initialization fails, no SSL listen ports will be enabled
later which never could establish a working SSL connection at all ...
2012-09-21 10:36:09 +02:00
Alexander Barton e9d0b2f039 Add "CHARCONV" to "feature string" when enabled 2012-09-17 01:00:05 +02:00
Alexander Barton 222ecbffbb Implement new IRC+ "CHARCONV" command
See bug 109 and doc/Protocol.txt for details and documentation.
2012-09-17 00:56:36 +02:00
Alexander Barton 1413a4886f Sort "feature string" alphabetically 2012-09-17 00:55:30 +02:00
Alexander Barton cfec819f0d Include CAP command even when using "strict RFC mode" 2012-09-16 14:08:52 +02:00
Alexander Barton 107bfdc821 Merge branch 'autoconf-update'
Update GNU autoconf and automake infrastructure.
Tested on modern systems as well as Apple A/UX :-)

* autoconf-update:
  AUTOMAKE_OPTIONS: fix ansi2knr option, include path
  Don't use AC_FUNC_MALLOC and AC_FUNC_REALLOC
  Make our own targets "silent", if enabled
  configure.in: use AC_CHECK_{FUNCS|HEADERS}_ONCE
  Updated config.{guess|sub} to version 2012-08-14
  Make autogen.sh more verbose when VERBOSE=1 is set
  configure.in: use AC_SEARCH_LIBS (not AC_CHECK_LIB)
  configure.in: use AS_HELP_STRING macro
  configure.in: use AC_CANONICAL_HOST (not AC_CANONICAL_TARGET)
  configure.in: inttypes.h is an optional header file
  Use HAVE_SETSID #define when testing for setsid()
  Don't include <stdint.h>, it is included by "portab.h"
  Don't check type.h availability, it is required
  configure.in: Use AC_CONFIG_FILES macro
  configure.in: Don't use AC_C_PROTOTYPES
  configure.in: Update checks for required and optional features
  configure.in: require autoconf 2.67 and automake 1.11
  configure.in: sort some lists (templates, output, ...)
2012-09-16 13:05:23 +02:00
Brett Smith 85abfd84be Allow limited punctuation in usernames, for better PAM integration. 2012-09-14 11:56:38 -04:00
Alexander Barton 82bf4eb059 configure.in: use AC_CANONICAL_HOST (not AC_CANONICAL_TARGET)
See the autoconf manual for details:
http://www.gnu.org/software/autoconf/manual/autoconf.html#Specifying-Target-Triplets
2012-09-13 00:06:08 +02:00
Alexander Barton a072180c92 Merge pull request #2 from briancollins/master
Fix IRC_Send_NAMES not sending correct prefix for certain clients.
2012-09-11 11:29:14 -07:00
Alexander Barton 0fd9a8505a Correctly re-initialize signal handlers on RESTART
This fixes part 2 of bug #127 :-)
2012-09-11 15:44:31 +02:00
Alexander Barton b2482b39e4 Use HAVE_SETSID #define when testing for setsid() 2012-09-11 14:38:19 +02:00