Commit Graph

1703 Commits

Author SHA1 Message Date
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 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
Alexander Barton 74c7d7131f Don't include <stdint.h>, it is included by "portab.h" 2012-09-11 14:37:31 +02:00
Alexander Barton 4dd1c31dc7 Don't check type.h availability, it is required 2012-09-11 14:36:34 +02:00
Alexander Barton f5441d2170 New_Connection(): mark "IsSSL" parameter as UNUSED
This fixes the following warning message when building without SSL support:

 conn.c: In function "New_Connection":
 conn.c:1365: warning: unused parameter "IsSSL"

Introduced by commit 01b62202.
2012-09-11 13:15:16 +02:00
Alexander Barton 0d67be3f30 Fix some "whitespace glitches"
Some have been introduced by commit 7b01bb83, some are older.
2012-09-11 12:48:51 +02:00
Alexander Barton f37600ee01 Merge branch 'xop' of https://github.com/kart0ffelsack/ngircd into bug92-xop
* 'xop' of https://github.com/kart0ffelsack/ngircd:
  Tests and documentation for xop
  Implemented xop support

Conflicts (because of merge of the 'cmode-M' branch):
	src/ngircd/channel.c
	src/ngircd/defines.h
	src/ngircd/messages.h
2012-09-11 12:30:19 +02:00
Alexander Barton f38a9035e5 Show a warning on startup if config file is not a full path
ngIRCd is a long-running process and changes its working directory to "/" to
not block mounted filesystems and the like when running as daemon ("not in the
foreground"); therefore the path to the configuration file must be relative to
"/" (or the chroot() directory), which basically is "not relative", to ensure
that "kill -HUP" and the "REHASH" command work as expected later on.

This fixes parts of bug #127.
2012-09-11 11:40:47 +02:00
Alexander Barton a12d6ff257 Create &SERVER channel after predefined channels
This patch allows you to define &SERVER in a [Channel] block yourself
and to overwrite the built-in topic and channel modes.

Fixes bug #131.
2012-09-10 17:59:15 +02:00
Alexander Barton 2205227c3b WHO #channel: don't limit list size
It makes no sense to limit the list size when doing WHO for a channel
and not to return all the users in that channel, so I removed the check.
But if there are more than MAX_RPL_WHO(25) replies, the client requesting
the list will be "penalized" one second more (then 2 in total).

This fixes bug #125.
2012-09-10 12:43:44 +02:00
Alexander Barton d2d867ea36 Define EV_SET() for kqueue() on systems that don't have it
Some systems, notably FreeBSD 4.x, do have the kqueue() function but
lack the definition of EV_SET() in their header files -- but don't
worry, we can #define it on our own ;-)

Definition taken from /usr/include/sys/event.h of FreeBSD 8.1.
Patch tested on FreeBSD 4.1 by Götz Hoffart. Thanks!
2012-09-04 23:28:32 +02:00
Alexander Barton 01b62202b2 New function Conn_StartLogin() to finish connection initialization
Conn_StartLogin() is called after the connection has been established and
fully innitialized, including the SSL handshake, for example.

Up to this patch, the "NoticeAuth" option broke the SSL handshake ...
2012-08-29 17:24:19 +02:00
Alexander Barton b68bb560e9 Convert CONN_ID and Conf_MaxConnections to "int" datatype
We can't handle more connections than accept(2) can supply, and
accept(2) returns an "int" ...
2012-08-29 17:03:41 +02:00
Alexander Barton 21467c76f1 Introduce numeric RPL_HOSTHIDDEN_MSG(396)
This numeric is sent to the client each time it changes its displayed
hostname using "MODE +/-x", and if "CloakHost" is set right after the
MOTD has been sent.
2012-08-28 23:28:56 +02:00
Alexander Barton 33fae67579 Always cloak client hostname, if needed
Not only cloak the hostname in Client_MaskCloaked(), but also in
Client_HostnameCloaked() -- so move the actual cloaking to this function
and call it in Client_MaskCloaked() to get the (cloaked) hostname.

This fixes USERHOST not displaying the correctly cloaked hostname,
for example.
2012-08-28 23:26:43 +02:00
Alexander Barton 864015fa3f NoticeAuth: make sure messages are flushed immediately 2012-08-28 22:09:06 +02:00
Alexander Barton 1d3def0cc6 Merge branch 'umode-B'
This patch series allows ngIRCd to support the user mode "B" ("Bot flasg"):
it is settable and unsettable by every (non-restricted) client.
According to DNS777, this is how Unreal and InspIRCd do behave, so do we :-)

By Alexander Barton (1) and DNS777 (1)

* umode-B:
  Add new user mode "B" to doc/Modes.txt
  Implement an Unreal-like user mode "B" ("Bot mode")
2012-08-27 23:27:30 +02:00
Alexander Barton e01e8f1cb6 Merge branch 'recognize-umode-R'
By Alexander Barton (1) and DNS777 (1)

* recognize-umode-R:
  Only allow IRC services to modify user mode "R"
  Recognize user mode "R"
2012-08-27 23:21:28 +02:00
Alexander Barton 186ab51137 Only allow IRC services to modify user mode "R" 2012-08-27 23:20:32 +02:00
Alexander Barton 298cd9a327 Get_CAP_String(): make it buildable with pre-ANSI C compilers 2012-08-27 22:42:04 +02:00
Alexander Barton 414bfe65eb Enhance "NOTICE AUTH": show hostname and IDENT reply 2012-08-27 22:05:55 +02:00
Alexander Barton c519ba9920 Merge branch 'cmode-M'
By Alexander Barton (2) and DNS777 (1)

* cmode-M:
  Add new channel mode "M" to doc/Modes.txt
  Remove Can_Send_To_Channel_Identified()
  Implement channel mode "M"
2012-08-27 21:22:58 +02:00
Alexander Barton fee591b759 Remove Can_Send_To_Channel_Identified()
Move the functionality directly into Can_Send_To_Channel() function.
There should be no functional change ...
2012-08-27 21:15:12 +02:00
Brian Collins 16f94546f5 Fix NAMES response when client has multi-prefix
Two fixes here: IRC_Send_NAMES was checking the capability of the
wrong client when responding, and it didn't return any prefix for
clients that had either +v or +o but not both.
2012-08-27 16:23:57 +01:00
Alexander Barton 55859c1bef Merge branch 'better-chan-errors'
By Alexander Barton (1) and DNS777 (1)

* better-chan-errors:
  Remove unused ERR_CANNOTSENDTOCHAN2_MSG message
  Add some more information to channel error numerics
2012-08-26 19:42:08 +02:00
Alexander Barton bcefdef1ea Merge branch 'move-connection-password' of git://arthur.barton.de/ngircd-alex
This patch series converts the statically allocated password buffer in the
CLIENT structure into a dynamically (and only when needed) allocated buffer
which is referenced by the CONNECTION structure.

This a) saves memory for clients not using passwords at all and b) allows
for "arbitrarily" long passwords.

By Brett Smith (5) and Alexander Barton (2).

* 'move-connection-password' of git://arthur.barton.de/ngircd-alex:
  Login_User(): use "conn" insted of calling Client_Conn(Client)
  Free already saved password when storing a new one
  Indentation and style fixes.
  Connection password is not constant.
  Implementation clean-ups.
  Dynamically allocate memory for connection password.
  Move client password from the Client to the Connection struct.
2012-08-26 19:14:29 +02:00
Alexander Barton f79d41e927 Login_User(): use "conn" insted of calling Client_Conn(Client) 2012-08-26 19:11:44 +02:00