1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-09-21 11:44:04 +00:00

Compare commits

...

289 Commits

Author SHA1 Message Date
Alexander Barton
04744e9d89 ngIRCd release 18 2011-07-10 20:05:16 +02:00
Alexander Barton
54f04f81e9 Update ChangeLog and NEWS for ngIRCd release 18 2011-07-10 20:02:01 +02:00
Alexander Barton
95e156b519 Updated doc/Platforms.txt for ngIRCd release 18 2011-07-10 19:58:41 +02:00
Alexander Barton
e160121698 MorePrivacy: Don't register WHOWAS information
Citing an email from Florian to the ngIRCd mailing list:

"I wonder what the expected behaviour is when Conf_MorePrivacy is changed
 from 'yes' to 'no' and the config is reloaded.

 At the moment, WHOWAS will start giving out information on Users that
 were connected during Conf_MorePrivacy=yes period.  If this is not
 wanted, Client_RegisterWhowas() should be changed to not store a record
 when Conf_MorePrivacy is enabled."

And I think it is "not wanted" :-)
2011-07-10 14:45:33 +02:00
Alexander Barton
54566b6b32 Add preliminary ngIRCd protocol module for Anope 1.9
See contrib/Anope/README and doc/Services.txt for more details
and installation instructions!
2011-07-10 14:23:11 +02:00
Alexander Barton
c041bb340c Update timestamp of ngircd(8) manual page 2011-07-02 22:02:43 +02:00
Alexander Barton
af60f04fef ngIRCd release 18~rc2 2011-06-29 10:22:46 +02:00
Alexander Barton
2d35731399 GnuTLS: use 1024 (DH_BITS_MIN) as minimum size of the DH prime
For outgoing connections, we use 2048 (DH_BITS) since commit 49b2d0e.

This patch enables ngIRCd to accept incoming connections from other servers
and clients that use at least 1024 bits (and no longer requires 2048 for
incoming connections, too).

Patch proposed by Florian Westphal.
2011-06-28 13:48:33 +02:00
Alexander Barton
7ae7ace579 ngircd.8: document debugging options 2011-06-28 13:45:16 +02:00
Alexander Barton
5f400694cf ngircd.conf.5: strip "SSL" prefix from variables in [SSL] section 2011-06-28 13:21:38 +02:00
Alexander Barton
bd118c65fd Fix some wording, use spellchecker ;-) 2011-06-28 13:12:06 +02:00
Alexander Barton
29c49f643f doc/SSL.txt: adopt to new configuration file layout 2011-06-28 13:11:14 +02:00
Alexander Barton
b6185b1ac8 ngIRCd release 18~rc1 2011-06-27 23:00:30 +02:00
Alexander Barton
14afdaee08 hash: Use UINT32 instead of uint32_t 2011-06-27 10:27:07 +02:00
Alexander Barton
949c8ea7c7 Update NEWS and ChangeLog file for our upcoming next release 2011-06-27 00:33:58 +02:00
Florian Westphal
1765f0ae0b hash: use more recent lookup3 algorithm instead of lookup2
Bob Jenkins published a newer hash function in May 2006, it has
better distribution.

See http://burtleburtle.net/bob/hash/doobs.html for lengthy
comparisions.
2011-06-27 00:16:37 +02:00
Alexander Barton
7f8d0ea5a3 Use srand()/rand() instead of srandom()/random(); seems to be more portable 2011-06-26 23:39:20 +02:00
Alexander Barton
d99edb7728 Merge branch 'MorePrivacy'
* MorePrivacy:
  New configuration opion "MorePrivacy" to "censor" some user information
2011-06-26 15:41:27 +02:00
Alexander Barton
cb28c4ff03 sample-ngircd.conf: remove "SSL" prefix from SSL-related variables 2011-06-26 15:39:39 +02:00
Alexander Barton
269310f04b Merge branch 'ScrubCTCP'
* ScrubCTCP:
  Add documentation for "ScrubCTCP" configuration option
  New option to scrub incoming CTCP commands
2011-06-26 15:38:53 +02:00
Alexander Barton
3282c1325e Merge branch 'newconfig'
* newconfig:
  sample-ngircd.conf: "SyslogFacility" should be commented out
  Move SSL-related configuration variables to new [SSL] section
  CheckFileReadable(): only check when a filename is given ...
  PAM: make clear which "Password" config option is ignored
  Really remove [Features] in our manual pages
  INSTALL: document changed location of configuration variables
  Update sample config file and manual page for new config structure
  Testsuite: update configuration files for new config file format
  Display configuration errors more prominent on "--configtest"
  conf.c: code cleanup
  Check for redability of SSL-related files like for MOTD file
  Restructure ngIRCd configuration, introduce [Limits] and [Options]
2011-06-26 15:24:07 +02:00
Alexander Barton
3d0ce77f12 sample-ngircd.conf: "SyslogFacility" should be commented out 2011-06-26 00:10:22 +02:00
Alexander Barton
946d838de4 Move SSL-related configuration variables to new [SSL] section 2011-06-26 00:09:36 +02:00
Alexander Barton
a085444035 CheckFileReadable(): only check when a filename is given ... 2011-06-26 00:07:47 +02:00
Alexander Barton
449ad1eeea PAM: make clear which "Password" config option is ignored 2011-06-25 23:55:54 +02:00
Alexander Barton
9dfde13f0c Really remove [Features] in our manual pages 2011-06-25 23:54:41 +02:00
xor
5410d96748 Add documentation for "ScrubCTCP" configuration option 2011-06-25 22:27:56 +02:00
xor
b80e115f39 New configuration opion "MorePrivacy" to "censor" some user information
this patch contains:

  * Fix for Conf_CloakUserToNick to make it conceal user details
  * Adds MorePrivacy-feature

MorePrivacy censors some user information from being reported by the
server. Signon time and idle time is censored. Part and quit messages
are made to look the same. WHOWAS requests are silently dropped. All
of this is useful if one wish to conceal users that access the ngircd
servers from TOR or I2P.
2011-06-25 22:21:20 +02:00
xor
f087c68a99 New option to scrub incoming CTCP commands
This patch makes it possible to scrub incomming CTCP commands from
other servers and clients alike. The ngircd oper can enable it from
the config file, by adding "ScrubCTCP = yes" under [OPTIONS]. It is
default off.

CTCP can be used to profile IRC users (get user clients name and
version, and also their IP addresses). This is not something we like
to happen when user pseudonymity/secrecy is important.

The server silently drops incomming CTCP requests from both other
servers and from users. The server that scrubs CTCP will not forward
the CTCP requests to other servers in the network either, which can
spell trouble if not every oper knows about the CTCP-scrubbing.
Scrubbing CTCP commands also means that it is not possible to send
files between users.

There is one exception to the CTCP scrubbing performed: ACTION ("/me
commands") requests are not scrubbed. ACTION is not dangerous to users
(unless they use OTR, which does not encrypt CTCP requests) and most
users would be confused if they were just dropped.

A CTCP request looks like this:

ctcp_char, COMMAND, arg0, arg1, arg2, .. argN, ctcp_char

ctcp_char is 0x01. (just like bold is 0x02 and color is 0x03.)

They are sent as part of a message and can be delivered to channels
and users alike.
2011-06-25 21:37:17 +02:00
Alexander Barton
6aad5a6706 INSTALL: document changed location of configuration variables 2011-06-25 14:59:02 +02:00
Alexander Barton
eba14d937d Update sample config file and manual page for new config structure 2011-06-25 14:58:12 +02:00
Alexander Barton
c438c227b5 Testsuite: update configuration files for new config file format 2011-06-25 14:57:26 +02:00
Alexander Barton
d41f4d6d20 Display configuration errors more prominent on "--configtest" 2011-06-25 14:56:27 +02:00
Alexander Barton
391cf4e2a1 conf.c: code cleanup 2011-06-25 14:55:34 +02:00
Alexander Barton
7ef6cb4584 Check for redability of SSL-related files like for MOTD file
Remove functions ssl_print_configvar() and ConfSSL_Puts(), introduce
new function CheckFileReadable().
2011-06-25 14:50:52 +02:00
Alexander Barton
e7256bb8ac Restructure ngIRCd configuration, introduce [Limits] and [Options]
The intention of this restructuring is to make the [Global] section much
cleaner, so that it only contains variables that most installations must
adjust to the local requirements.

All the optional variables are moved to [Limits], for configurable limits
and timers of ngIRCd, and [Options], for optional features.

The old variables in the [Global] section are deprecated now, but still
recognized.
2011-06-25 14:45:36 +02:00
Alexander Barton
b1786f309e New documentation: "how to contribute" 2011-06-24 21:01:18 +02:00
Florian Westphal
42b32f8a2a conn: fix error handling when connecting to server
The io_event_create error handling seems to miss a 'return'
statement.

Fix this by moving io_event_create() call around so we do not
need the Conn_Close/Init calls in the error case.
2011-06-05 15:00:32 +02:00
Florian Westphal
49b2d0ec98 ssl: gnutls: bump dh bitsize to 2048
problem is that some clients refuse to connect to severs that only offer
1024.  For interoperability it would be best to just use 4096, but that
takes minutes, even on current hardware.
2011-06-04 22:57:29 +02:00
Alexander Barton
dd7d64f577 Mac OS X: split up make targets
New targets are: "have-packagemaker", "osxpkg-dest"
2011-05-12 00:21:18 +02:00
Florian Westphal
605b6a67bc fix clang warning about dead stores
clang 'scan-build':
Value stored to 'r' is never read
Value stored to 'fd' is never read
2011-05-06 20:31:56 +02:00
Alexander Barton
10c7a15687 contrib/platformtest.sh: fix gcc version detection
Now the version of GNU C is detected correctly on SuSE Linux, too ...
2011-04-30 01:03:17 +02:00
Florian Westphal
05748aa5ee parse: fix logical expression testing for non RFC1459 links
parse.c:284: warning: suggest parentheses around operand of '!' or
change '&' to '&&' or '!' to '~'

The expression looks dubious, this should probably be
an if-not-set, then... test.
2011-04-29 23:27:56 +02:00
Florian Westphal
0bb892bb5f conn: avoid needlesly scary 'buffer overflow' messages
When the write buffer space grows too large, ngircd has to disconnect
the client to avoid wasting too much memory.

ngircd logs this with a scary 'write buffer overflow' message.
Change this to a more descriptive wording.
2011-04-29 23:10:01 +02:00
Alexander Barton
c26ca7773b Only require server prefixes on non RFC1459 links
Not all servers (and services!) using the RFC1459 protocol style send
prefixes on all commands; so don't require them to do so.

This relaxes the requirements introduced by commit 15775e679.
2011-04-29 12:33:58 +02:00
Alexander Barton
1cb2f5739d Merge branch 'master' of git://arthur.barton.de/ngircd-alex
* 'master' of git://arthur.barton.de/ngircd-alex:
  Do reverse lookups using the AF of the incoming connection
  resolve: fix reverse lookups of client connections with ConnectIPv6=no
2011-04-26 12:04:22 +02:00
Alexander Barton
160f5725a6 Do reverse lookups using the AF of the incoming connection
This fixes errors like this one:
  Address mismatch: 2001🔢abcd:1::1 != 192.168.1.1
2011-04-26 11:10:50 +02:00
Florian Westphal
e4e1595bff resolve: fix reverse lookups of client connections with ConnectIPv6=no
We re-use the same helper function for both forward lookups
(when we want to connect to a peer server) and for validation of reverse
loopups (where we make a lookup on the hostname returned
by a reverse lookup on the IP address that connected).

Problem:

When ConnectIPv6=no, the forward lookup helper sets the adderss family
to AF_INET, and, if out client connected via ipv6, we fail to validate
the result.

Thus move the ConnectIPvX check out of the helper.
2011-04-25 18:00:10 +02:00
Alexander Barton
66315cab9a Mac OS X: install on root volume only, and set correct permissions
Update Mac OS X Installer.app description bundle, so that the ngIRCd
package can only be installed on the root volume ("/"); and make sure
that all installed files and directories have correct ownership and
permissions.
2011-04-16 15:18:43 +02:00
Alexander Barton
67a9d994e3 Mac OS X: update installer texts and add logo. 2011-04-14 11:24:07 +02:00
Alexander Barton
1cd8d7f386 Doxygen'ify conf.c 2011-04-12 23:15:29 +02:00
Alexander Barton
9a102ca96b New function Config_Error_Section(); and code cleanup 2011-04-12 21:55:32 +02:00
Alexander Barton
e70e81460b Add some type casts to random() and srandom() functions
This fixes two gcc warnings (on Mac OS X):
 "warning: implicit conversion shortens 64-bit value into a 32-bit value"
2011-04-12 21:23:14 +02:00
Florian Westphal
5acb90fafc ngircd: improve rng initialisation
we do not need this for cryptographic purposes, but we can do better
than plain srandom(getpid()).

Also, keep in mind that rng state is inherited across fork(), so re-init
it in the child.
2011-03-28 00:29:58 +02:00
Alexander Barton
d61fbfc6e3 Merge branch 'AuthPing'
* AuthPing:
  Add documentation for "RequireAuthPing" configuration option
  New configuration option "RequireAuthPing": PING-PONG on login
2011-03-27 20:58:18 +02:00
Alexander Barton
cf7e3b1c02 Merge branch 'NoticeAuth'
* NoticeAuth:
  Add documentation for "NoticeAuth" configuration option
  Configuration: move "NoticeAuth" to GLOBAL section
  New configuration option "NoticeAuth": send NOTICE AUTH on connect
2011-03-27 20:56:50 +02:00
Alexander Barton
1b5d1064de ngircd.conf.5: Add variable type to "CloakHost" and "CloakUserToNick" 2011-03-27 20:46:16 +02:00
Alexander Barton
5b2512c215 Xcode: don't list sample-ngircd.conf, use sample-ngircd.conf.tmpl 2011-03-27 20:41:48 +02:00
Alexander Barton
680db6755b Add documentation for "NoticeAuth" configuration option 2011-03-27 20:40:28 +02:00
Alexander Barton
fc0b026149 Add documentation for "RequireAuthPing" configuration option 2011-03-27 20:34:44 +02:00
Alexander Barton
162433398e New configuration option "RequireAuthPing": PING-PONG on login
When enabled, this configuration option lets ngIRCd send a PING with an
numeric "token" to clients logging in; and it will not become registered
in the network until the client responds with the correct PONG.

This is used by QuakeNet for example (ircu/snircd), and looks like this:

  NICK nick
  :irc.example.net PING :1858979527
  USER user . . :real name
  PONG 1858979527
  :irc.example.net 001 nick :Welcome to the Internet Relay Network ...
2011-03-27 19:33:48 +02:00
Alexander Barton
f99d33ddd9 Configuration: move "NoticeAuth" to GLOBAL section 2011-03-26 17:11:44 +01:00
Alexander Barton
d29e389779 New configuration option "NoticeAuth": send NOTICE AUTH on connect
When enabling "NoticeAuth" in the [Features] section, ngircd will send
"NOTICE AUTH" messages on client connect like e.g. snircd (QuakeNet) does.
2011-03-25 12:15:11 +01:00
Alexander Barton
f1a4a4dc88 Warn when unknown variables are found in [Features] section 2011-03-25 12:12:20 +01:00
Alexander Barton
6cb90f399d Update doc/GIT.txt 2011-03-25 11:14:04 +01:00
Alexander Barton
d587926eb0 Update INSTALL text 2011-03-23 01:08:49 +01:00
Alexander Barton
770a58ac6d Generate WALLOPS message on SQUIT from IRC operator
So SQUIT now behaves like CONNECT and DISCONNECT commands, when called
by an IRC operator (and not received from an other server).
2011-03-21 23:52:42 +01:00
Alexander Barton
15775e6790 Commands received from other servers must have prefixes
Make sure that all commands received from other servers do have
valid prefixes.

Only exceptions are PING and ERROR commands that can occure without
prefixes when generated by the remote peer itself.
2011-03-21 10:46:09 +01:00
Alexander Barton
62f705f97e Allow servers to send more commands in the first 10 secods
This helps to speed up server login and network synchronisation.
2011-03-21 09:42:01 +01:00
Alexander Barton
a39e2f22c9 IRC_CHANINFO(): Code cleanup 2011-03-19 17:29:19 +01:00
Alexander Barton
dcb1951efd Handle_GLOBAL(): don't use multi-line strings
They aren't supported by elder C compilers ...
2011-03-19 17:28:38 +01:00
Alexander Barton
fa8b83e69b Merge branches 'CloakUserHost', 'QuitOnHTTP' and 'bug72-WHOIS-List'
* CloakUserHost:
  Add a note not to use a percent sign ("%") in CloakHost variable
  Rename ClientHost to CloakHost, and ClientUserNick to CloakUserToNick
  Don't use "the.net" in sample-ngircd.conf, use "example.net"
  ngircd.conf.5: document "ClientHost" and "ClientUserNick"
  Move "ClientHost" and "ClientUserNick" to end of [Global] section
  ClientUserNick setting
  ClientHost setting

* QuitOnHTTP:
  Only "handle" HTTP commands on unregistered connections
  Don't use IRC_QUIT_HTTP() if STRICT_RFC is #define'd
  IRC_QUIT_HTTP(): enhance error message
  Move IRC_QUIT_HTTP() below IRC_QUIT()
  quit on HTTP commands: GET & POST

* bug72-WHOIS-List:
  Add "whois-test" to testsuite and distribution archive
  Add support for up to 3 targets in WHOIS queries.
2011-03-19 17:16:14 +01:00
Alexander Barton
acd7a5d6d4 Add a note not to use a percent sign ("%") in CloakHost variable
The percent sign is reserved for future extensions, for example to
expand some variables like %H to a hash value of the real host name ...

Idea by kaFux in #ngircd.
2011-03-19 17:04:57 +01:00
Alexander Barton
ae7470ceb5 Rename ClientHost to CloakHost, and ClientUserNick to CloakUserToNick 2011-03-19 16:58:29 +01:00
Alexander Barton
d1f604ab89 Add "whois-test" to testsuite and distribution archive
Test script proposed by Dana Dahlstrom, 2008-02-17.
See <https://arthur.barton.de/bugzilla/show_bug.cgi?id=72> ...
2011-03-19 15:03:15 +01:00
Florian Westphal
ff2a425ab8 Add support for up to 3 targets in WHOIS queries.
also allow up to one wildcard query from local hosts.
Follows ircd 2.10 implementation rather than RFC 2812.
At most 10 entries are returned per wildcard expansion.

WHOIS test cases by Dana Dahlstrom.
2011-03-19 15:03:15 +01:00
Alexander Barton
f419a369bf Doxygen: Remove header.inc.html and ngircd-doc.css from distribution 2011-03-19 15:02:28 +01:00
Alexander Barton
152b529abf ngircd.conf.5: describe types of variables
Describe the possible types of variables in ngircd.conf:
booleans, text strings, integer numbers.

And add type information to each variable description.
2011-03-18 11:15:48 +01:00
Alexander Barton
fc55c945db Don't use "the.net" in sample-ngircd.conf, use "example.net"
"the.net" is an existing domain of the Texas Higher Education Network ...
See RFC 2606.
2011-03-18 10:46:56 +01:00
Alexander Barton
b19f7d73cb Only "handle" HTTP commands on unregistered connections 2011-03-17 00:03:10 +01:00
Alexander Barton
38747b40dc Don't use IRC_QUIT_HTTP() if STRICT_RFC is #define'd 2011-03-16 23:58:39 +01:00
Alexander Barton
dbb66695c9 IRC_QUIT_HTTP(): enhance error message 2011-03-16 23:58:01 +01:00
Alexander Barton
77cff9e47c Move IRC_QUIT_HTTP() below IRC_QUIT() 2011-03-16 23:56:27 +01:00
Alexander Barton
c0d13c4713 ngircd.conf.5: document "ClientHost" and "ClientUserNick" 2011-03-16 23:44:00 +01:00
Alexander Barton
25dd193e9b Move "ClientHost" and "ClientUserNick" to end of [Global] section 2011-03-16 23:43:29 +01:00
Gabor Adam Toth
71d8c37171 ClientUserNick setting 2011-03-16 23:15:50 +01:00
Gabor Adam Toth
52f59149ad ClientHost setting 2011-03-16 23:15:50 +01:00
Gabor Adam Toth
33e8c24806 quit on HTTP commands: GET & POST 2011-03-16 22:59:57 +01:00
Florian Westphal
5417a72536 channel: always reject zero-length channel key
previously, any client could join in this configuration:

[Channel]
  Name = #test
  Modes = tnk
  KeyFile = /tmp/foobar

fix this by checking for zero-length key before comparing
key to channel key.
2011-02-28 23:28:24 +01:00
Alexander Barton
94e4562c1c PAM-Auth child: log if result can't be reported
This fixes the followin GCC warning on modern Linux systems as well:

irc-login.c:     In function ‘Hello_User’:
irc-login.c:876: warning: ignoring return value of ‘write’,
                 declared with attribute warn_unused_result
2011-02-23 22:55:45 +01:00
Alexander Barton
6caa947f98 Protocol.txt: Update description of CHANINFO command 2011-02-17 12:26:56 +01:00
Alexander Barton
e49109e36d Add cscope.out to .gitignore file 2011-02-16 14:06:25 +01:00
Alexander Barton
adfa968f99 Correctly detect errors when handling "MODE x" commands 2011-02-14 01:44:40 +01:00
Alexander Barton
07f241ff6d Enhance documentation for the WEBIRC command 2011-02-13 17:52:39 +01:00
Alexander Barton
53fecf5a2b Doxygen'ify irc-login.c 2011-02-13 17:52:39 +01:00
Alexander Barton
8a674c3263 Doxygen'ify irc-channel.c 2011-02-13 17:52:39 +01:00
Alexander Barton
1f5fbd5992 Doxygen'ify conn.c 2011-02-13 17:52:39 +01:00
Alexander Barton
5858dc3886 Doxygen'ify proc.h 2011-02-13 17:52:39 +01:00
Alexander Barton
af6ac0fa41 Doxygen'ify parse.h 2011-02-13 17:52:39 +01:00
Alexander Barton
f3ec90f3f0 Doxygen'ify and update comments in ngircd.{c|h} 2011-02-13 17:52:39 +01:00
Alexander Barton
c6a7de869c Doxygen'ify and update comments in match.c 2011-02-13 17:52:39 +01:00
Alexander Barton
4ef23df813 Update and translate comments in hash.c 2011-02-13 17:52:39 +01:00
Alexander Barton
5555b6cc86 Doxygen'ify conf.h 2011-02-13 17:52:39 +01:00
Alexander Barton
72a982ae7e Add missong Doxygen @file tags to ngircd.h and irc-op.h 2011-02-13 17:52:39 +01:00
Alexander Barton
2a7dd06ebd Code cleanup: mostly removing empty lines 2011-02-13 17:52:38 +01:00
Alexander Barton
ebfcdb088b Doxygen: define ZLIB, PAM, and ZEROCONF 2011-02-13 17:52:38 +01:00
Alexander Barton
03628dbeaf Add Doxygen @file documentation to each source and header file 2011-02-13 17:52:38 +01:00
Alexander Barton
408cefd15d Updated Doxygen configuration file
Removed unnecessary variables DETAILS_AT_TOP, EXTRACT_PRIVATE,
EXTRACT_LOCAL_CLASSES, added SHOW_DIRECTORIES=YES, STRIP_CODE_COMMENTS=NO,
REFERENCED_BY_RELATION=YES, REFERENCES_RELATION=YES,
HTML_DYNAMIC_SECTIONS=YES and GENERATE_DOCSET=NO; updated PREDEFINED.
2011-02-13 17:52:38 +01:00
Alexander Barton
f59f773cfe Doxygen: remove own header and CSS file
Use the ones of Doxygen instead, this has the advantage that we
benefit of new functionality of Doxygen without having to make changes.
2011-02-13 17:52:38 +01:00
Alexander Barton
f732c7117e Make write buffers bigger, but flush early
This patch
 - makes the server write buffer bigger: 64k,
 - makes the regular write buffer bigger: 32k,
 - tries to flush the write buffer starting at 4K.

Before this patch, a client got disconnected if the buffer flushing at 4k
failed, now regular clients can store up to 32k and servers up 64k even
if flushing is not possible at the moment (e.g. on slow links).
2011-02-12 23:24:56 +01:00
Alexander Barton
477224be5c Enhance logging on "write buffer overflow" 2011-02-12 23:24:26 +01:00
Alexander Barton
493ccd57f4 Clean up Validate_Prefix(); don't send punctuation in ERROR commands 2011-01-29 16:05:55 +01:00
Alexander Barton
8700f4d93c Better check for invalid IRC+ PASS command
Don't do a NULL-pointer dereference when a remote server using the
IRC+ protocol sends an invalid PASS command without the required
<serverversion> parameter ...
2011-01-23 18:38:36 +01:00
Alexander Barton
765dc320f1 Read_Request(): don't access possibly free'd CLIENT structure
Handle_Buffer() can shut down connections and remove clients, so after
calling it, we have to make sure that our CLIENT pointer is still valid.
2011-01-23 15:14:18 +01:00
Alexander Barton
9fff9f6a2b ngircd-test2.conf: really disable Ident and PAM ... 2011-01-19 01:19:40 +01:00
Alexander Barton
b856a58051 Log "Can't read MOTD file" as "configuration error"
Now this error message is displayed in the console without debug prefix
when running the configuration test (--configtest).
2011-01-18 23:44:07 +01:00
Alexander Barton
8927700b22 Allow "Port = 0" in [Server] blocks
Port number 0 marks remote servers that try to connect to this
daemon, but where this daemon never tries to establis a connection
on its own: only incoming connections are allowed.
2011-01-18 22:45:01 +01:00
Alexander Barton
58a4dae56d conf: fix 'Value of "..." is not a number!' for negative values
Don't use isdigit() function any more, because it only checks the
first character of the variable value and because it doesn't know
about the minus sign which is required e.g. for "Group = -1".
2011-01-18 22:41:27 +01:00
Alexander Barton
914d6a26d8 Don't read MOTD file twice
The MOTD file is read in Read_Config(), so don't read it when handling
the "MotdFile" configuration variable. Instead make sure that it is
initialized properly when (re-)reading the configuration.
2011-01-18 22:01:27 +01:00
Alexander Barton
c98e794b38 Add [Features] section to ngircd-test{1|2}.conf
Fix commit 5a34bb203a:
It is not enough to strip the "No" prefix from "Ident" and "PAM",
but we have to introduce the new [Features] section to fix all
warning messages of ngIRCd.

Variables "Ident" and "PAM" in [Global] are completely wrong :-(
2011-01-18 21:39:48 +01:00
Alexander Barton
a990bd72ec Enable WHOIS command to return information about services 2011-01-18 21:04:55 +01:00
Alexander Barton
5a34bb203a Update testsuite configuration: strip No... prefixes 2011-01-18 14:28:39 +01:00
Alexander Barton
d3ef2239e1 Add connection/socket information to some log messages 2011-01-16 23:24:41 +01:00
Alexander Barton
a57748e1a1 Implement channel mode 'O': "IRC operators only"
This channel mode is used on DALnet (bahamut), for example.
2011-01-10 12:15:05 +01:00
Alexander Barton
6600ce3445 Remove ZeroConf variable from sample-ngircd.conf 2011-01-10 00:10:01 +01:00
Alexander Barton
4a6d44dce2 Remove support for ZeroConf/Bonjour/Rendezvous service registration 2011-01-09 23:51:30 +01:00
Alexander Barton
5ed7a4ea57 TOPIC command: test for channel admin rights correctly
This enables other servers, services and IRC operators to change
channel topics, even when the client is not joined to this channel.

Now the handler for TOPIC behaves like the one for MODE.
2011-01-09 23:08:15 +01:00
Alexander Barton
ba32d594fd Channel_CheckAdminRights(): test if client can admin a channel
This generic function tests if a client is allowed to do administrative
tasks to a specific channel:

 - servers and services are always truested ("allowed everything"),
 - channel operators are allowed,
 - IRC operarors are allowed if OperCanUseMode is set in the config.
2011-01-09 22:40:11 +01:00
Florian Westphal
3460c87c58 conf: fix 'unknown section' FEATURES parse error
pointed out by Alex:
ngircd.conf, line 105: Unknown section "[Features]"!
2011-01-09 22:19:17 +01:00
Alexander Barton
02592f912e IRC_TOPIC(): code cleanup 2011-01-09 22:10:30 +01:00
Florian Westphal
1964bda252 conf: move 'run-time-feature-disable' options to new FEATURE section 2011-01-09 19:42:42 +01:00
Florian Westphal
23ce0393b2 array: remove check for allocated == 0
allocated can only be zero if ->mem is NULL.
2011-01-09 19:40:54 +01:00
Florian Westphal
994a003aba array: remove alignment of requested size
libc should know better than us.
Also, this helps debugging with tools like valgrind:
When you allocate an array of size x, and then erronoulsy
use x+1 valgrind cannot detect the bug because due to ALIGN_()
made by array.c we might have allocated more than size x...
2011-01-09 19:28:50 +01:00
Florian Westphal
eda2556e09 conf: Warn if PAM=true when ngircd was built without PAM support 2011-01-09 18:17:35 +01:00
Florian Westphal
9402bcaa73 conf: add missing static qualifier
internal helper, so it should be static.

also, add UNUSED to 'Line'.
2011-01-09 17:54:21 +01:00
Alexander Barton
6d11fb1497 Update copyright notices for 2010 :)
And update the NEWS and ChangeLog file as well.
2011-01-09 16:11:12 +01:00
Alexander Barton
28bbd7e27a Make NoZeroConf option work with Howl 2011-01-09 14:31:18 +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
Florian Westphal
4a5dfcc3ac channel: fix confusing "adding to invite list" debug output
adding entries to ban list produced 'invite list' debug output...
2010-12-31 11:35:40 +01:00
Alexander Barton
f37e495a2b Command throttling: introduce MAX_COMMANDS_SERVICE
New MAX_COMMANDS_SERVICE (currently set to MAX_COMMANDS_SERVER[10]),
so that services are handled like servers (and not regular users).
2010-12-29 14:19:51 +01:00
Alexander Barton
21cbf37db5 Don't throttle services and servers beeing registered 2010-12-29 14:12:34 +01:00
Alexander Barton
4188a82e76 Xcode: correctly sort files 2010-12-29 14:11:40 +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
186b14f332 ngIRCd release 17.1 2010-12-19 15:59:00 +01:00
Alexander Barton
8ea1c5bb82 --configtest: remember if MOTD is configured by file or phrase
Configuration variables "MotdFile" and "MotdPhrase" are mutually
exclusive; so don't display content in both of them when running
"ngircd --configtest": instead remember which one is beeing used.
2010-12-02 16:51:21 +01:00
Alexander Barton
79ca5fe04d Enhance log messages when establishing server links a little bit 2010-12-02 13:40:08 +01:00
Alexander Barton
60bb40d67a Reset ID of outgoing server link on DNS error correctly
Not resetting the ID prevents the daemon from trying to re-establish
outgoing server links when the DNS resolver failed to resole a hostname.
2010-12-02 13:38:42 +01:00
Alexander Barton
5da98ec389 Don't log critical (or worse) messages to stderr
stderr isn't redirected to the "error file" any more, so there is
no point in trying to log to it ...
2010-12-02 13:36:19 +01:00
Alexander Barton
0305f75456 Manual page ngircd(8): add SIGNALS section 2010-12-01 22:04:28 +01:00
Alexander Barton
65bcff35ff Manual pages: update and simplyfy AUTHORS section 2010-12-01 22:04:01 +01:00
Alexander Barton
790fa89e67 Remove "error file" when compiled with debug code enabled
The information written to the "error file" (/tmp/ngircd-<PID>.err) when
ngIRCd is compiled with debug code enabled isn't that usefule, so don't
create this file at all.
2010-12-01 21:22:20 +01:00
Alexander Barton
ce448e9077 README: Updated list of implemented commands 2010-11-19 21:38:03 +01:00
Alexander Barton
dd580d3ea7 add doc/README-Interix.txt and doc/Bopm.txt to distribution tarball 2010-11-15 20:11:16 +01:00
Alexander Barton
de6f08cc04 Merge branch 'numeric-329'
* numeric-329:
  New numeric 329: get channel creation time on "MODE #chan" commands
  Save channel creation time; new function Channel_CreationTime()
2010-11-15 19:36:21 +01:00
Florian Westphal
678d5411e2 add doc/PAM.txt to distribution tarball
doc/PAM.txt was not included in the release tarball.
reported by Christoph Biedl.
2010-11-14 23:17:04 +01:00
Alexander Barton
7321be2ccd New numeric 329: get channel creation time on "MODE #chan" commands 2010-11-11 12:39:49 +01:00
Alexander Barton
9bc5d565bb Save channel creation time; new function Channel_CreationTime() 2010-11-11 12:39:19 +01:00
Alexander Barton
0d19f2b43a ngIRCd release 17 2010-11-07 17:24:07 +01:00
Alexander Barton
5a14942b0a Updated doc/Platforms.txt for upcoming release 17 2010-11-07 17:20:28 +01:00
Alexander Barton
2bca14b52e contrib/platformtest.sh: make command name quoting consistent 2010-11-07 15:26:26 +01:00
Alexander Barton
29b41a4ecc contrib/ngircd-redhat.init: updated email address of Naoya Nakazawa 2010-11-07 14:18:04 +01:00
Alexander Barton
30b6e72b96 Fix up generation and distribution of sample-ngircd.conf
- Add generated sample-ngircd.conf to new .gitignore file,
- refactor Makefile.am to generate sample-ngircd.conf on "make all",
  to clean it up on "make clean", and to install it to the correct place.
- Make sure path names in sample-ngircd.conf are separated by "/".
2010-11-03 23:47:21 +01:00
Florian Westphal
4a19763868 doc: change path names in sample-ngircd.conf depending on sysconfdir 2010-11-03 20:41:42 +01:00
Alexander Barton
bdcf3f0e24 ngIRCd Release 17~rc3 2010-10-27 22:31:05 +02:00
Alexander Barton
d7ad956a06 Fix connect attempts to further IP addresses of outgoing server links
If a hostname resolves to more than one IP address (round-robin DNS,
IPv4 and IPv6) and an attempt to connect to the first address fails,
ngIRCd should try to connect to the 2nd address, 3rd address etc.

But because of a wrong variable used in the call to New_Server(),
the wrong server structure has been used in further connection attemps
which possibly lead to connection attempts to already connected servers.
2010-10-27 21:59:51 +02:00
Alexander Barton
e2c9290030 Debian: Install default /etc/pam.d/ngircd allowing all logins
This is required for backwards compatibility when installing the -full
or -full-dbg package variant: PAM is enabled now but no configuration
present, so all login attempts would be denied ...

Creating /etc/pam.d/ngircd including "auth required pam_permit.so"
restores the old behaviour of allowing all connections.
2010-10-27 00:43:02 +02:00
Alexander Barton
5edde9a760 Debian: update standards to 3.9.1; add libpam0g-dev dependency 2010-10-26 22:56:01 +02:00
Alexander Barton
864f3df575 Make contrib/platformtest.sh more portable 2010-10-26 22:18:30 +02:00
Alexander Barton
ffccfb0975 Mac OS X package ("make osxpkg"): generate PAM configuration 2010-10-26 15:15:06 +02:00
Alexander Barton
76f40bdb98 Xcode builds ("make xcode"): disable pam_fail_delay()
disable pam_fail_delay() only is available starting with Mac
OS X 10.6; but we use the 10.5 SDK for campatibility, so don't use
this function at all when building using Xcode.
2010-10-26 15:13:24 +02:00
Alexander Barton
3dd91923e4 Xcode: update project file, use 10.5.x SDK
This is required for universal 32 bit and 64 bit builds: now code
for ppc, i386, and x86_64 is generated (which requires 10.5 or newer).
2010-10-26 15:10:14 +02:00
Alexander Barton
a4de27deee Xcode builds ("make xcode"): detect version number correctly 2010-10-26 15:09:01 +02:00
Alexander Barton
8449e08245 ngIRCd release 17~rc2 2010-10-25 18:51:32 +02:00
Alexander Barton
05d1df97c3 Updated contrib/platformtest.sh (new version scheme)
- handle version numbers generated by "git describe"
 - detect gcc compiler version correctly when "-std=xxx" is used
2010-10-25 18:49:54 +02:00
Alexander Barton
01c39ba001 New doc/HowToRelease.txt file describing the release process 2010-10-25 14:46:58 +02:00
Alexander Barton
0c0cac641d ZeroConf: include header files missing since commit a988bbc86a 2010-10-25 00:17:46 +02:00
Alexander Barton
8288878122 Generate ngIRCd version number from GIT tag
Now the ngIRCd release/version number is deduced from the "current"
annotated GIT tag; see "git describe --help" for details. This is the
same scheme the Linux kernel uses and gives much more details version
numbers for interim releases and inofficial source archives generated
using "make dist".

Please note: the version number is only updated it the autogen.sh
script is run; so after pulling in and pushing out new commits, you
should run ./autogen.sh!
2010-10-24 21:51:38 +02: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
5700329f8c ./configure: check if C compiler can compile ISO Standard C
This is required for enabling ansi2knr on systems that don't have an
ANSI C compiler installed (e.g. on A/UX with Apple standard C compiler).
2010-10-24 14:14:30 +02:00
Alexander Barton
3b74280879 ./configure: check support for C prototypes again 2010-10-24 13:50:22 +02:00
Alexander Barton
f1267ca375 Don't use PARAMS() macro for function implementations
The PARAMS() macro is only needed for function prototypes;
don't use it for the actual implementations.
2010-10-24 13:41:51 +02:00
Alexander Barton
ccb175dce6 Added m68k/apple/aux3.0.1 (gcc 2.7.2) to doc/Platforms.txt 2010-10-19 22:19:18 +02:00
Alexander Barton
99e08eaced Only try to set FD_CLOEXEC if this flag is defined
A/UX 3.x doesn't implement this constant, for example.
2010-10-19 22:17:12 +02:00
Alexander Barton
5f2bc55d36 Only use "__attribute__ ((unused))" if GCC >=2.8 is used
At least GCC 2.7.2 doesn't support this attribute.
2010-10-19 22:13:48 +02:00
Alexander Barton
1fa5b11995 doc/Makefile.am: don¹t set docdir, automake handles it already
And elder make(1) programs don¹t like "x ?= y" ...
2010-10-13 22:46:29 +02:00
Alexander Barton
d00a0f1e7c ngIRCd release 17~rc1 2010-10-11 23:25:48 +02:00
Alexander Barton
a988bbc86a 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.
2010-10-11 16:54:49 +02:00
Alexander Barton
4226db873f Xcode: only build current architecture in "Debug" target 2010-10-09 20:13:54 +02:00
Alexander Barton
f579043671 doc/Platforms.txt: added NetBSD 5.0.2 2010-10-07 13:20:30 +02:00
Alexander Barton
50cb321bb1 Updated doc/Platforms.txt 2010-10-05 23:19:54 +02:00
Alexander Barton
ade8902b88 Make sure sighandlers.h is listed in noinst_HEADERS
... because it must be included in the distribution archive :-)
2010-10-05 21:57:01 +02:00
Alexander Barton
3a826b774a 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
2010-10-05 20:16:35 +02:00
Alexander Barton
c51cc88eb0 Debian packages: build "-full" and "-full-dbg" with support for PAM 2010-10-03 15:06:07 +02:00
Alexander Barton
5e82a91d13 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.
2010-09-24 17:39:11 +02:00
Alexander Barton
4943bbb066 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.
2010-09-24 16:29:55 +02:00
Alexander Barton
e2ba7e08b4 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
2010-09-22 14:15:46 +02:00
Alexander Barton
b1a117cd98 Add sighandlers.{c|h} to Xcode project
And update static Mac OS X config.h used by the Xcode project.
2010-09-22 14:11:30 +02:00
Alexander Barton
4a770e8e2d Don't call sigaction() if it is not available on the system 2010-09-22 14:10:09 +02:00
Florian Westphal
ba720fcbae 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...
2010-09-14 23:53:59 +02:00
Alexander Barton
b3cfbc3d28 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;".
2010-09-14 00:30:45 +02:00
Alexander Barton
74578890b7 Make sighandlers.{c|h} compatible with ansi2knr 2010-09-14 00:29:34 +02:00
Alexander Barton
212311efc5 Updated ChangeLog to include signal handler changes 2010-09-14 00:18:20 +02:00
Alexander Barton
fe5c7cb22d Bump version number to "17-dev" 2010-09-14 00:05:31 +02:00
Alexander Barton
cdae82413d Update ChangeLog and NEWS: include SIGUSR1/SIGUSR2 changes 2010-09-14 00:05:31 +02:00
Alexander Barton
3600dc60fc Output connection status when dumping the internal server state 2010-09-14 00:05:31 +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
Florian Westphal
755f54b150 signalhandlers: add fallback to deprecated sysv API 2010-09-11 11:36:12 +02:00
Florian Westphal
ef3dbf96eb 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.
2010-09-11 11:36:12 +02:00
Florian Westphal
1fe17e246c 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.
2010-09-11 11:36:12 +02:00
Florian Westphal
c135d0dded io: add io_cloexec to set close-on-exec flag. 2010-09-11 11:36:12 +02:00
Florian Westphal
1e281a8baa ng_ipaddr.h: include assert.h
We use assert() in this header, so we should include assert.h.
2010-09-11 11:35:01 +02:00
Alexander Barton
6349ec8bb3 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.
2010-09-08 02:02:01 +02:00
Alexander Barton
8d68fe3f86 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).
2010-09-08 00:45:23 +02:00
Alexander Barton
4f6c19712e Check_Servers(): Code cleanup 2010-09-08 00:42:57 +02:00
Alexander Barton
4833f9e5c8 Update ChangeLog and NEWS in preparation for the next release ... 2010-08-29 18:10:49 +02:00
Alexander Barton
90a186158b Fix linebreak in INSTALL text to fit in 80 columns 2010-08-29 18:09:57 +02:00
Alexander Barton
b52d5e2a78 configure: correctly indent IPv6 yes/no summary output 2010-08-25 00:02:06 +02:00
Alexander Barton
04e38f17ae 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.
2010-08-19 15:58:55 +02:00
Alexander Barton
32188d821b write_whoreply(): respect hostname cloaking 2010-08-18 00:01:14 +02:00
Alexander Barton
6f4a348b75 IRC_USERHOST(): respect hostname cloaking 2010-08-17 23:56:36 +02:00
Alexander Barton
a51670005f IRC_USERHOST(): Code cleanup & some documentation 2010-08-17 23:55:40 +02:00
Alexander Barton
0263fa4c66 Send_Message(): respect hostname cloaking 2010-08-17 21:16:46 +02:00
Alexander Barton
31ea0f8ee9 IRC_WriteStrClientPrefix() / Get_Prefix(): respect hostname cloaking 2010-08-17 21:14:51 +02:00
Alexander Barton
fd4dfccc30 Refactor IRC_WriteStr{Channel|Related}Prefix(); support cloaking
Move common code to new local function Send_Marked_Connections()
and respect hostname cloaking.
2010-08-17 21:11:37 +02:00
Alexander Barton
2a4bf67aac 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!
2010-08-17 21:05:06 +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
3fd4f320b7 WHOIS: respect hostname cloaking 2010-08-17 21:00:47 +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
f72e22d361 Make configure switch "--docdir" work (closes: #108) 2010-08-17 15:59:54 +02:00
Alexander Barton
c65bf5d2ce Reformat and update FAQ.txt a little bit 2010-08-13 15:53:24 +02:00
Florian Westphal
9c6230e177 INSTALL: mention SSL and IPv6 2010-08-12 21:46:51 +02:00
Florian Westphal
479a43b1c6 INSTALL: mention changed handling of MotdFile. 2010-08-12 21:46:51 +02:00
Florian Westphal
056de78e31 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)
2010-08-12 21:46:47 +02:00
Florian Westphal
a02bc9cc6f startup: open /dev/null before chroot
before people had to create a /dev/null inside the chroot to make
redirection work.
2010-08-01 00:07:33 +02:00
Alexander Barton
01e40f4b55 Allow IRC ops to change channel modes even without OperServerMode set 2010-07-25 16:44:38 +02:00
Florian Westphal
acb66d6463 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.
2010-07-25 16:18:25 +02:00
Alexander Barton
63a304755a Added mailmap file for git-[short]log and git-blame 2010-07-25 15:13:50 +02:00
Alexander Barton
6ebb31ab35 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.
2010-07-14 10:29:05 +02:00
Alexander Barton
cf93881dfb 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.
2010-07-14 10:27:55 +02:00
Alexander Barton
560492a4a4 Authenticated users should be registered without the "~" mark 2010-07-13 23:18:54 +02:00
Alexander Barton
9cd3494de9 Don't Proc_Kill() childs after Proc_Read(): done there already. 2010-07-13 22:29:06 +02:00
Alexander Barton
6131822af6 Don't even fork a PAM-subprocess if "NoPAM" option is set 2010-07-13 22:14:53 +02:00
Alexander Barton
57a2faf4a7 Use Proc_GenericSignalHandler() as handler for SIGTERM by default 2010-07-13 22:04:35 +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
6faf44bc6d Set NoPAM=yes in configuration files used for the testsuite 2010-07-13 16:48:24 +02:00
Alexander Barton
f369177617 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.
2010-07-13 16:47:01 +02:00
Alexander Barton
37ee0a3313 io.c: Include conn.h when using the select() API 2010-07-12 13:24:45 +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
28424d013d Make sure signal.h is #include'd when needed 2010-07-12 13:22:19 +02:00
Alexander Barton
583c50476b Initial documentation for using PAM with ngIRCd 2010-07-12 13:07:07 +02:00
Alexander Barton
808d4f6e85 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.
2010-07-12 12:56:33 +02:00
Alexander Barton
fb4b5acfb8 Add new pam.{c|h} module to Xcode project
Adjust Xcode project and Mac OS X static config.h header to use PAM.
2010-07-12 12:54:01 +02:00
Alexander Barton
77870ddf2d Add pam.{c|h} to project and implement PAM_Authenticate() function 2010-07-12 12:53:08 +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
761b2284b9 Detect PAM libraries 2010-07-11 17:01:45 +02:00
Alexander Barton
79be1c477e Refactor Resolve_Read() into generic Proc_Read() function 2010-07-11 16:58:30 +02:00
Alexander Barton
7b5e2fe38e Make Proc_Kill() more fault-tolerant 2010-07-11 16:54:44 +02:00
Alexander Barton
bf8b646304 New function Conn_GetProcStat()
Get PROC_STAT sub-process structure of a given connection.
2010-07-11 15:15:23 +02:00
Alexander Barton
e4ffcd00bd Code cleanup: don't reset penalty time on DNS resolver result
See commit d4632a727f: it's not necessary any more!
2010-07-11 15:12:17 +02:00
Alexander Barton
4cc4c29e38 New function Proc_GenericSignalHandler() 2010-07-01 00:39:35 +02:00
Alexander Barton
0db9a31e50 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.
2010-07-01 00:34:56 +02:00
Alexander Barton
5462c6c50f 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.
2010-06-30 23:49:52 +02:00
Alexander Barton
3d49fa5bff New function Conn_GetFromProc() to get CONN_ID of a subprocess
Get CONN_ID from file descriptor associated to a subprocess structure.
2010-06-29 23:38:39 +02:00
Alexander Barton
2d4ea28835 Resolver: Implement signal handler and catch TERM signal 2010-06-29 22:55:27 +02:00
Alexander Barton
d4632a727f 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.
2010-06-29 22:55:27 +02:00
Alexander Barton
60f5dd5b29 Update comments: subprocesses not only can be resolver processes 2010-06-29 22:55:27 +02:00
Alexander Barton
89e73ad4b4 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.
2010-06-29 22:55:27 +02:00
Alexander Barton
54e67ea9ee 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.
2010-06-29 22:55:27 +02:00
Alexander Barton
cc336b7558 Only #include resolve.h if it is really needed 2010-06-29 22:55:27 +02:00
Alexander Barton
ae55d4f500 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
2010-06-26 00:45:11 +02:00
Alexander Barton
edfa215481 const'ify Conn_WriteStr() function 2010-06-26 00:44:37 +02:00
Alexander Barton
c6742192a6 const'ify Send_ListChange() function in irc-mode.c 2010-06-26 00:42:12 +02:00
Alexander Barton
0c0d4af55a const'ify IRC_WriteStrXXX() and Get_Prefix() functions 2010-06-26 00:38:20 +02:00
Alexander Barton
8605e9c0fe const'ify command name variable in _COMMAND strcuture 2010-06-26 00:37:06 +02:00
Alexander Barton
a68103771c const'ify Client_TypeText() 2010-06-26 00:31:08 +02:00
Alexander Barton
8ad1c23ae4 Add some documentation for using BOPM with ngIRCd 2010-06-25 15:19:39 +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
51ed742054 Refactor Wall_ServerNotice() into more generic Log_ServerNotice()
Log_ServerNotice() sends a messages to all users having a given
user mode set.
2010-06-25 00:33:00 +02:00
Alexander Barton
60eac5e952 New function Conn_IPA(): get client IP address as string 2010-06-25 00:33:00 +02:00
Alexander Barton
139d6303e7 ngircd.init: require $network $remote_fs when stopping ngircd 2010-06-25 00:10:56 +02:00
Neale Pickett
28f8b50174 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.)
2010-06-23 11:00:09 +02:00
Alexander Barton
e2930f3f5e 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!
2010-06-09 12:03:08 +02:00
Florian Westphal
059e707249 Revert "configure: make implicit declarations fatal"
This reverts commit b3a6c33da0b12ba74dc395979b677813d4bc2c0f.

apparently not all gcc versions support this 8-(
2010-06-09 12:03:00 +02:00
Florian Westphal
b849e63fbf 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.
2010-06-09 11:49:57 +02:00
Alexander Barton
55190f2d3d Don't access already freed memory in IRC_KILL()
It is not possible to call Conn_Close() after Client_Destroy() has been
called, because Conn_Close wants to access the CLIENT structure which
then has been freed already.

Fix IRC_KILL to use Conn_Close() for local clients and Client_Destroy()
for remote clients only (and never both).
2010-05-22 17:03:54 +02:00
Florian Westphal
6dc80bd195 fix "beeing" typo
reported by Fabio Scotoni via bugzilla #101.
2010-05-14 19:43:08 +02:00
Florian Westphal
df359835d1 SSL/TLS: fix bogus 'socket closed' error message
When we get there then the ssl handshake has failed, or
we could not create a ssl context because ssl library
initialization failed on startup.

Reflect that in the log message.
2010-05-07 23:25:59 +02:00
139 changed files with 6816 additions and 3170 deletions

6
.gitignore vendored
View File

@@ -5,15 +5,17 @@ ansi2knr.1
ansi2knr.c
ansi2knr.h
autom4te.cache
build-stamp-ngircd*
config.log
config.status
configure
configure.lineno
cscope.out
debian
depcomp
install-sh
missing
ngircd.dest
.deps
*.a
*.o
debian
build-stamp-ngircd*

4
.mailmap Normal file
View File

@@ -0,0 +1,4 @@
# mailmap file for git-[short]log and git-blame
Alexander Barton <anonymous>
Ali Shemiran <ashemira@ucsd.edu>

View File

@@ -1,9 +1,8 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2009 Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.

212
ChangeLog
View File

@@ -1,15 +1,221 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2010 Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- ChangeLog --
ngIRCd Release 18 (2011-07-10)
- Update timestamp of ngircd(8) manual page.
- Add preliminary ngIRCd protocol module for Anope 1.9 to contrib/Anope/.
- Don't register WHOWAS information when "MorePrivacy" option is in effect.
ngIRCd 18~rc2 (2011-06-29)
- Update documentation, fix some wording, and use a spellchecker :-)
- ngircd.conf.5: strip "SSL" prefix from variables in [SSL] section.
- ngircd.8: document debugging options.
- GnuTLS: use 1024 bits as minimum size of the DH prime. This enables
ngIRCd to accept incoming connections from other servers and clients
that "only" use at least 1024 bits again, like ngIRCd 17 did (and no
longer requires 2048 bits for incoming connections).
ngIRCd 18~rc1 (2011-06-27)
- PAM warning message: make clear which "Password" config option is ignored.
- New configuration option "MorePrivacy" to "censor" some user information.
When enabled, signon time and idle time is left out. Part and quit
messages are made to look the same. WHOWAS requests are silently dropped.
All of this is useful if one wish to conceal users that access the ngircd
servers from TOR or I2P.
- New configuration option "ScrubCTCP" to scrub incoming CTCP commands. If
activated, the server silently drops incoming CTCP requests from both
other servers and from users. The server that scrubs CTCP will not forward
the CTCP requests to other servers in the network either, which can spell
trouble if not every oper knows about the CTCP-scrubbing. Scrubbing CTCP
commands also means that it is not possible to send files between users.
There is one exception to the CTCP scrubbing performed: ACTION ("/me
commands") requests are not scrubbed.
- Display configuration errors more prominent on "--configtest".
- Restructure ngIRCd configuration file: introduce new [Limits], [Options],
and [SSL] sections. The intention of this restructuring is to make the
[Global] section much cleaner, so that it only contains variables that
most installations must adjust to the local requirements. All the optional
variables are moved to [Limits], for configurable limits and timers of
ngIRCd, and [Options], for optional features. All SSL-related variables
are moved to [SSL] and the "SSL"-prefix is stripped. The old variables in
the [Global] section are deprecated now, but are still recognized.
=> Don't forget to check your configuration, use "ngircd --configtest"!
- New documentation "how to contribute": doc/Contributing.txt.
- Slightly fix error handling when connecting to remote servers.
- GnuTLS: bump DH-bitsize to 2048: this solves the problem that some clients
refuse to connect to severs that only offer 1024. For interoperability it
would be best to just use 4096 bits, but that takes minutes, even on
current hardware ...
- contrib/platformtest.sh: fix gcc version detection.
- Avoid needlessly scary 'buffer overflow' messages: When the write buffer
space grows too large, ngIRCd has to disconnect the client to avoid
wasting too much memory, which is logged with a scary 'write buffer
overflow' message. Change this to a more descriptive wording.
- Require server prefixes for most commands on RFC2812 links. RFC1459 links
(often used by services, for example) are not affected.
- Mac OS X: update installer functionality, texts, and add our logo :-)
- New configuration option "RequireAuthPing": PING-PONG on login. When
enabled, this configuration option lets ngIRCd send a PING with an numeric
"token" to clients logging in; and it will not become registered in the
network until the client responds with the correct PONG.
- New configuration option "NoticeAuth": send NOTICE AUTH on connect. When
active, ngircd will send "NOTICE AUTH" messages on client connect time
like e.g. snircd (QuakeNet) does.
- Generate WALLOPS message on SQUIT from IRC operators; so SQUIT now behaves
like CONNECT and DISCONNECT commands, when called by an IRC operator.
- Allow servers to send more commands in the first 10 seconds ("burst"). This
helps to speed up server login and network synchronization.
- Add support for up to 3 targets in WHOIS queries, also allow up to one
wildcard query from local hosts. Follows ircd 2.10 implementation rather
than RFC 2812. At most 10 entries are returned per wildcard expansion.
- ngircd.conf(5) manual page: describe types of configuration variables
(booleans, text strings, integer numbers) and add type information to each
variable description.
- Don't use "the.net" in sample-ngircd.conf, use "example.net".
- Terminate incoming connections on HTTP commands "GET" and "POST".
- New configuration option "CloakHost": when set, this hostname is used for
every client instead of the real DNS hostname (or IP address).
- New configuration option "CloakUserToNick": when enabled, ngIRCd sets
every clients' user name to their nick name and hides the user name
supplied by the IRC client.
- doc/Protocol.txt: Update description of the CHANINFO and WEBIRC commands.
- Doxygen'ify (document) much more source files; code cleanup ...
- Make write buffers bigger, but flush early. Before this change, a client
got disconnected if the buffer flushing at 4k failed, now regular clients
can store up to 32k and servers up 64k even if flushing is not possible at
the moment. This enhances reliability on slow links.
- Don't access possibly free'd CLIENT structure. Ooops.
- Allow "Port = 0" in [Server] blocks. Port number 0 marks remote servers
that try to connect to this daemon, but where this daemon never tries to
establish a connection on its own: only incoming connections are allowed.
- Configuration: fix 'Value of "..." is not a number!' for negative values.
- Enable WHOIS command to return information about services.
- Implement channel mode 'O': "IRC operators only". This channel mode is
used on DALnet (bahamut), for example.
- Remove support for ZeroConf/Bonjour/Rendezvous service registration
including the "[No]ZeroConf" configuration option.
- TOPIC command: test for channel admin rights correctly: this enables other
servers, services and IRC operators to change channel topics, even when
the client is not joined to this channel.
- Deprecate NoXX-Options in ngircd.conf and move new variants into our new
[Options] section: 'NoDNS=no' => 'DNS=yes', 'NoIdent=no' => 'Ident=yes',
'NoPAM=no' => 'PAM=yes', and 'NoZeroConf=no' => 'ZeroConf=yes' (and
vice-versa). The defaults are adjusted accordingly and the old variables
in [Global] are still accepted, so there is no functional change.
- Fix confusing "adding to invite list" debug messages: adding entries to
ban list produced 'invite list' debug output ...
- Don't throttle services and servers being registered.
- Xcode: correctly sort files :-)
- Don't assert() when searching a client for an invalid server token (this is
only relevant when a trusted server on a server-server link sends invalid
commands).
ngIRCd Release 17.1 (2010-12-19)
- --configtest: remember if MOTD is configured by file or phrase
- Enhance log messages when establishing server links a little bit
- Reset ID of outgoing server link on DNS error correctly
- Don't log critical (or worse) messages to stderr
- Manual page ngircd(8): add SIGNALS section
- Manual pages: update and simplify AUTHORS section
- Remove "error file" when compiled with debug code enabled
- README: Updated list of implemented commands
- add doc/README-Interix.txt and doc/Bopm.txt to distribution tarball
- Merge branch 'numeric-329'
- add doc/PAM.txt to distribution tarball
- New numeric 329: get channel creation time on "MODE #chan" commands
- Save channel creation time; new function Channel_CreationTime()
ngIRCd Release 17 (2010-11-07)
- doc: change path names in sample-ngircd.conf depending on sysconfdir
- Fix up generation and distribution of sample-ngircd.conf
- contrib/ngircd-redhat.init: updated email address of Naoya Nakazawa
- contrib/platformtest.sh: make command name quoting consistent
ngIRCd 17~rc3 (2010-10-27)
- Xcode builds: detect version number correctly, updateed project file
to use the Mac OS X 10.5.x SDK, disable pam_fail_delay() because it
is only available starting with Mac OS X 10.6, and generate a default
PAM configuration for the Mac OS X Installer.app package of ngIRCd.
- Debian: updated standards version to 3.9.1, added libpam0g-dev to the
dependencies, and install a default /etc/pam.d/ngircd allowing all logins.
- Make contrib/platformtest.sh more portable.
- Fix connect attempts to further IP addresses of outgoing server links.
ngIRCd 17~rc2 (2010-10-25)
- ZeroConf: include header files missing since commit a988bbc86a.
- Generate ngIRCd version number from GIT tag.
- Make sourcecode compatible with ansi2knr again. This allows to compile
ngIRCd using a pre-ANSI K&R C compiler again.
- ./configure: check if C compiler can compile ISO Standard C.
- ./configure: check support for C prototypes again.
- Don't use PARAMS() macro for function implementations.
- Added m68k/apple/aux3.0.1 (gcc 2.7.2) to doc/Platforms.txt.
- Only try to set FD_CLOEXEC if this flag is defined.
- Only use "__attribute__ ((unused))" if GCC >=2.8 is used.
- doc/Makefile.am: don't set docdir, automake handles it already.
ngIRCd 17~rc1 (2010-10-11)
- New configuration option "NoZeroConf" to disable service registration at
runtime even if ngIRCd is compiled with support for ZeroConf (e.g. using
Howl, Avahi or on Mac OS X).
- New configuration option "SyslogFacility" to define the syslog "facility"
(the "target"), to which ngIRCd should send its 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.
- Dump the "internal server state" (configured servers, established
connections and known clients) to the console or syslog when receiving
the SIGUSR2 signal and debug mode is enabled.
- Enable the daemon to disable and enable "debug mode" on runtime using
signal SIGUSR1, when debug code is compiled in, not only on startup
using the command line parameters.
- Signal handler: added new 'delayed' signal handlers, including fallback
to deprecated sysv API. And removed global NGIRCd_SignalRehash variable.
- IO: add io_cloexec() to set close-on-exec flag.
- ng_ipaddr.h: include required assert.h header.
- Conn_SyncServerStruct(): test all connections; and work case insensitive
- configure script: correctly indent IPv6 yes/no summary output.
- Don't reset My_Connections[Idx].lastping when reading data, so the
client lag debug-output is working again.
- Implement user mode "x": hostname cloaking (closes: #102).
- Make configure switch "--docdir" work (closes: #108).
- Reformat and update FAQ.txt a little bit.
- INSTALL: mention SSL, IPv6, and changed handling of MotdFile.
- Change MOTD file handling: ngIRCd now caches the contens of the MOTD
file, so the daemon now requires a HUP signal or REHASH command to
re-read the MOTD file when its content changed.
- Startup: open /dev/null before chroot'ing the daemon.
- Allow IRC ops to change channel modes even without OperServerMode set.
- Allow IRC operators to use MODE command on any channel (closes: #100).
- Added mailmap file for git-[short]log and git-blame.
- Authenticated users should be registered without the "~" mark.
- Set NoPAM=yes in configuration files used for the testsuite.
- New configuration option "NoPAM" to disable PAM.
- Implement asynchronous user authentication using PAM, please see the
file doc/PAM.txt for details.
- Resolver: Implement signal handler and catch TERM signals.
- Don't set a penalty time when doing DNS lookups.
- Add some documentation for using BOPM with ngIRCd, see doc/Bopm.txt.
- Implement user mode "c": receive connect/disconnect NOTICEs. Note that
this new mode requires the user to be an IRC operator.
- ngircd.init: require "$network" and "$remote_fs" when stopping ngircd.
- Show SSL status in WHOIS output, numeric 275.
- Include correct header files when testing for arpa/inet.h (Closes: #105).
- Don't access already freed memory in IRC_KILL().
- Fix "beeing" typo ...
- SSL/TLS: fix bogus "socket closed" error message.
ngIRCd Release 16 (2010-05-02)
- doc/SSL: remove line continuation marker

98
INSTALL
View File

@@ -1,19 +1,59 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2007 Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- INSTALL --
I. Upgrade Information
~~~~~~~~~~~~~~~~~~~~~~
Differences to version 17
- Support for ZeroConf/Bonjour/Rendezvous service registration has been
removed. The configuration option "NoZeroconf" is no longer available.
- The structure of ngircd.conf has been cleaned up and three new configuration
sections have been introduced: [Limits], [Options], and [SSL].
Lots of configuration variables stored in the [Global] section are now
deprecated there and should be stored in one of these new sections (but
still work in [Global]):
"AllowRemoteOper" -> [Options]
"ChrootDir" -> [Options]
"ConnectIPv4" -> [Options]
"ConnectIPv6" -> [Options]
"ConnectRetry" -> [Limits]
"MaxConnections" -> [Limits]
"MaxConnectionsIP" -> [Limits]
"MaxJoins" -> [Limits]
"MaxNickLength" -> [Limits]
"NoDNS" -> [Options], and renamed to "DNS"
"NoIdent" -> [Options], and renamed to "Ident"
"NoPAM" -> [Options], and renamed to "PAM"
"OperCanUseMode" -> [Options]
"OperServerMode" -> [Options]
"PingTimeout" -> [Limits]
"PongTimeout" -> [Limits]
"PredefChannelsOnly" -> [Options]
"SSLCertFile" -> [SSL], and renamed to "CertFile"
"SSLDHFile" -> [SSL], and renamed to "DHFile"
"SSLKeyFile" -> [SSL], and renamed to "KeyFile"
"SSLKeyFilePassword" -> [SSL], and renamed to "KeyFilePassword"
"SSLPorts" -> [SSL], and renamed to "Ports"
"SyslogFacility" -> [Options]
"WebircPassword" -> [Options]
You should adjust your ngircd.conf and run "ngircd --configtest" to make
sure that your settings are correct and up to date!
Differences to version 16
- Changes to the "MotdFile" specified in ngircd.conf now require a ngircd
configuration reload to take effect (HUP signal, REHASH command).
Differences to version 0.9.x
- The option of the configure script to enable support for Zeroconf/Bonjour/
@@ -65,7 +105,8 @@ location, /usr/local/sbin/.
The next step is to configure and afterwards starting the daemon. Please
have a look at the ngircd(8) and ngircd.conf(5) manual pages for details
and all possible options.
and all possible options -- and don't forget to run "ngircd --configtest"
to validate your configuration file!
If no previous version of the configuration file exists (the standard name
is /usr/local/etc/ngircd.conf), a sample configuration file containing all
@@ -93,7 +134,7 @@ Again: "end users" do not need this step!
The configure-script is used to detect local system dependencies.
In the perfect case, configure should recognise all needed libraries, header
In the perfect case, configure should recognize all needed libraries, header
files and so on. If this shouldn't work, "./configure --help" shows all
possible options.
@@ -120,11 +161,12 @@ the local system. Normally, root privileges are necessary to complete this
step. If there is already an older configuration file present, it won't be
overwritten.
This files will be installed by default:
These files and folders will be installed by default:
- /usr/local/sbin/ngircd: executable server
- /usr/local/etc/ngircd.conf: sample configuration (if not already present)
- /usr/local/share/doc/ngircd/: documentation
- /usr/local/share/man/: manual pages
III. Additional features
@@ -170,13 +212,6 @@ standard locations.
Include support for IDENT ("AUTH") lookups. The "ident" library is
required for this option.
* ZeroConf Support:
--with-zeroconf[=<path>]
Compile ngIRCd with support for ZeroConf multicast DNS service registration.
Either the Apple ZeroConf implementation (e. g. Mac OS X) or the Howl
library is required. Which one is available is autodetected.
* TCP-Wrappers:
--with-tcp-wrappers[=<path>]
@@ -184,6 +219,24 @@ standard locations.
to the daemon, for example by using "/etc/hosts.{allow|deny}".
The "libwrap" is required for this option.
* PAM:
--with-pam[=<path>]
Enable support for PAM, the Pluggable Authentication Modules library.
See doc/PAM.txt for details.
* SSL:
--with-openssl[=<path>]
--with-gnutls[=<path>]
Enable support for SSL/TLS using OpenSSL or gnutls libraries.
See doc/SSL.txt for details.
* IPv6:
--enable-ipv6
Adds support for version 6 of the Internet Protocol.
IV. Useful make-targets
~~~~~~~~~~~~~~~~~~~~~~~
@@ -207,19 +260,20 @@ V. Sample configuration file ngircd.conf
In the sample configuration file, there are comments beginning with "#" OR
";" -- this is only for the better understanding of the file.
The file is separated in four blocks: [Global], [Operator], [Server], and
[Channel].
The file is separated in five blocks: [Global], [Features], [Operator],
[Server], and [Channel].
In the [Global] section, there is the main configuration like the server
name and the ports, on which the server should be listening. IRC operators
of this server are defined in [Operator] blocks. [Server] is the section
where server links are configured. And [Channel] blocks are used to
configure pre-defined ("persistent") IRC channels.
name and the ports, on which the server should be listening. Options in
the [Features] section enable or disable functionality in the daemon.
IRC operators of this server are defined in [Operator] blocks, remote
servers are configured in [Server] sections, and [Channel] blocks are
used to configure pre-defined ("persistent") IRC channels.
The meaning of the variables in the configuration file is explained in the
"doc/sample-ngircd.conf", which is used as sample configuration file in
/usr/local/etc after running "make install" (if you don't already have one)
and in the "ngircd.conf" manual page.
and in the ngircd.conf(5) manual page.
VI. Command line options
@@ -244,3 +298,5 @@ These parameters could be passed to the ngIRCd:
Use "--help" to see a short help text describing all available parameters
the server understands, with "--version" the ngIRCd shows its version
number. In both cases the server exits after the output.
Please see the ngircd(8) manual page for complete details!

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
# Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,8 +37,12 @@ have-xcodebuild:
>/dev/null 2>&1 \
|| ( echo; echo "Error: \"xcodebuild\" not found!"; echo; exit 1 )
have-packagemaker:
@packagemaker >/dev/null 2>&1; [ $$? -le 1 ] \
|| ( echo; echo "Error: \"packagemaker\" not found!"; echo; exit 2)
xcode: have-xcodebuild
rel=`grep AC_INIT configure.in | cut -d' ' -f2 | cut -d')' -f1`; \
rel=`git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'`; \
def="GCC_PREPROCESSOR_DEFINITIONS=\"VERSION=\\\"$$rel\\\"\""; \
xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -alltargets \
-configuration Default $$def build
@@ -55,10 +59,15 @@ deb:
[ -f debian/rules ] || ln -s contrib/Debian debian
dpkg-buildpackage -rfakeroot -i
osxpkg: have-xcodebuild
@packagemaker >/dev/null 2>&1; [ $$? -le 1 ] \
|| ( echo; echo "Error: \"packagemaker\" not found!"; echo; exit 2)
make clean
osxpkg: have-packagemaker osxpkg-dest
cd contrib/MacOSX && packagemaker \
--doc ngIRCd.pmdoc \
--out ../../$(distdir).mpkg
rm -f $(distdir).mpkg.zip
zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg
rm -rf ngircd.dest $(distdir).mpkg
osxpkg-dest: have-xcodebuild clean
./configure --prefix=/opt/ngircd
make xcode
make -C contrib/MacOSX de.barton.ngircd.plist
@@ -71,11 +80,8 @@ osxpkg: have-xcodebuild
rm ngircd.dest/opt/ngircd/etc/ngircd.conf
echo "Have a nice day IRCing!" >ngircd.dest/opt/ngircd/etc/ngircd.motd
chmod -R a-s,og-w,a+rX ngircd.dest
cd contrib/MacOSX && packagemaker \
--doc ngIRCd.pmdoc \
--out ../../$(distdir).mpkg
rm -f $(distdir).mpkg.zip
zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg
rm -rf ngircd.dest $(distdir).mpkg
.PHONY: deb have-packagemaker have-xcodebuild lint osxpkg osxpkg-dest rpm \
srcdoc testsuite xcode xcode-clean
# -eof-

123
NEWS
View File

@@ -1,14 +1,131 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2010 Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- NEWS --
ngIRCd Release 18 (2011-07-10)
- Add preliminary ngIRCd protocol module for Anope 1.9 to contrib/Anope/.
ngIRCd 18~rc2 (2011-06-29)
- GnuTLS: use 1024 bits as minimum size of the DH prime. This enables
ngIRCd to accept incoming connections from other servers and clients
that "only" use at least 1024 bits again, like ngIRCd 17 did (and no
longer requires 2048 bits for incoming connections).
ngIRCd 18~rc1 (2011-06-27)
- New configuration option "MorePrivacy" to "censor" some user information.
When enabled, signon time and idle time is left out. Part and quit
messages are made to look the same. WHOWAS requests are silently dropped.
All of this is useful if one wish to conceal users that access the ngircd
servers from TOR or I2P.
- New configuration option "ScrubCTCP" to scrub incoming CTCP commands. If
activated, the server silently drops incoming CTCP requests from both
other servers and from users. The server that scrubs CTCP will not forward
the CTCP requests to other servers in the network either, which can spell
trouble if not every oper knows about the CTCP-scrubbing. Scrubbing CTCP
commands also means that it is not possible to send files between users.
There is one exception to the CTCP scrubbing performed: ACTION ("/me
commands") requests are not scrubbed.
- Restructure ngIRCd configuration file: introduce new [Limits], [Options],
and [SSL] sections. The intention of this restructuring is to make the
[Global] section much cleaner, so that it only contains variables that
most installations must adjust to the local requirements. All the optional
variables are moved to [Limits], for configurable limits and timers of
ngIRCd, and [Options], for optional features. All SSL-related variables
are moved to [SSL] and the "SSL"-prefix is stripped. The old variables in
the [Global] section are deprecated now, but are still recognized.
=> Don't forget to check your configuration, use "ngircd --configtest"!
- New documentation "how to contribute": doc/Contributing.txt.
- Avoid needlessly scary 'buffer overflow' messages: When the write buffer
space grows too large, ngIRCd has to disconnect the client to avoid
wasting too much memory, which is logged with a scary 'write buffer
overflow' message. Change this to a more descriptive wording.
- New configuration option "RequireAuthPing": PING-PONG on login. When
enabled, this configuration option lets ngIRCd send a PING with an numeric
"token" to clients logging in; and it will not become registered in the
network until the client responds with the correct PONG.
- New configuration option "NoticeAuth": send NOTICE AUTH on connect. When
active, ngircd will send "NOTICE AUTH" messages on client connect time
like e.g. snircd (QuakeNet) does.
- Add support for up to 3 targets in WHOIS queries, also allow up to one
wildcard query from local hosts. Follows ircd 2.10 implementation rather
than RFC 2812. At most 10 entries are returned per wildcard expansion.
- ngircd.conf(5) manual page: describe types of configuration variables
(booleans, text strings, integer numbers) and add type information to each
variable description.
- Terminate incoming connections on HTTP commands "GET" and "POST".
- New configuration option "CloakHost": when set, this hostname is used for
every client instead of the real DNS hostname (or IP address).
- New configuration option "CloakUserToNick": when enabled, ngIRCd sets
every clients' user name to their nick name and hides the user name
supplied by the IRC client.
- Make write buffers bigger, but flush early. Before this change, a client
got disconnected if the buffer flushing at 4k failed, now regular clients
can store up to 32k and servers up 64k even if flushing is not possible at
the moment. This enhances reliability on slow links.
- Allow "Port = 0" in [Server] blocks. Port number 0 marks remote servers
that try to connect to this daemon, but where this daemon never tries to
establish a connection on its own: only incoming connections are allowed.
- Enable WHOIS command to return information about services.
- Implement channel mode 'O': "IRC operators only". This channel mode is
used on DALnet (bahamut), for example.
- Remove support for ZeroConf/Bonjour/Rendezvous service registration
including the "[No]ZeroConf" configuration option.
- Deprecate NoXX-Options in ngircd.conf and move new variants into our new
[Options] section: 'NoDNS=no' => 'DNS=yes', 'NoIdent=no' => 'Ident=yes',
'NoPAM=no' => 'PAM=yes', and 'NoZeroConf=no' => 'ZeroConf=yes' (and
vice-versa). The defaults are adjusted accordingly and the old variables
in [Global] are still accepted, so there is no functional change.
ngIRCd Release 17.1 (2010-12-19)
- Don't log critical (or worse) messages to stderr
- Remove "error file" when compiled with debug code enabled
- New numeric 329: get channel creation time on "MODE #chan" commands
ngIRCd Release 17 (2010-11-07)
- doc: change path names in sample-ngircd.conf depending on sysconfdir
ngIRCd 17~rc2 (2010-10-25)
- Generate ngIRCd version number from GIT tag.
- Make sourcecode compatible with ansi2knr again. This allows to compile
ngIRCd using a pre-ANSI K&R C compiler again.
ngIRCd 17~rc1 (2010-10-11)
- New configuration option "NoZeroConf" to disable service registration at
runtime even if ngIRCd is compiled with support for ZeroConf (e.g. using
Howl, Avahi or on Mac OS X).
- New configuration option "SyslogFacility" to define the syslog "facility"
(the "target"), to which ngIRCd should send its 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.
- Dump the "internal server state" (configured servers, established
connections and known clients) to the console or syslog when receiving
the SIGUSR2 signal and debug mode is enabled.
- Enable the daemon to disable and enable "debug mode" on runtime using
signal SIGUSR1, when debug code is compiled in, not only on startup
using the command line parameters.
- Implement user mode "x": hostname cloaking (closes: #102).
- Change MOTD file handling: ngIRCd now caches the contens of the MOTD
file, so the daemon now requires a HUP signal or REHASH command to
re-read the MOTD file when its content changed.
- Allow IRC ops to change channel modes even without OperServerMode set.
- Allow IRC operators to use MODE command on any channel (closes: #100).
- New configuration option "NoPAM" to disable PAM.
- Implement asynchronous user authentication using PAM, please see the
file doc/PAM.txt for details.
- Add some documentation for using BOPM with ngIRCd, see doc/Bopm.txt.
- Implement user mode "c": receive connect/disconnect NOTICEs. Note that
this new mode requires the user to be an IRC operator.
- Show SSL status in WHOIS output, numeric 275.
ngIRCd Release 16 (2010-05-02)

15
README
View File

@@ -1,9 +1,8 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2007 Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
@@ -34,11 +33,11 @@ used in real IRC networks.
Implemented IRC-commands are:
ADMIN, AWAY, CHANINFO, CONNECT, DIE, DISCONNECT, ERROR, HELP, INVITE, ISON,
JOIN, KICK, KILL, LINKS, LIST, LUSERS, MODE, MOTD, NAMES, NICK, NJOIN, NOTICE,
OPER, PART, PASS, PING, PONG, PRIVMSG, QUIT, REHASH, RESTART, SERVER, SQUIT,
STATS, TIME, TOPIC, TRACE, USER, USERHOST, VERSION, WALLOPS, WHO, WHOIS,
WHOWAS.
ADMIN, AWAY, CHANINFO, CONNECT, DIE, DISCONNECT, ERROR, HELP, INFO, INVITE,
ISON, JOIN, KICK, KILL, LINKS, LIST, LUSERS, MODE, MOTD, NAMES, NICK, NJOIN,
NOTICE, OPER, PART, PASS, PING, PONG, PRIVMSG, QUIT, REHASH, RESTART, SERVER,
SERVICE, SERVLIST, SQUERY, SQUIT, STATS, SUMMON, TIME, TOPIC, TRACE, USER,
USERHOST, USERS, VERSION, WALLOPS, WEBIRC, WHO, WHOIS, WHOWAS.
III. Features (or: why use ngIRCd?)

View File

@@ -150,20 +150,23 @@ echo "Generating files ..."
$ACLOCAL && \
$AUTOHEADER && \
$AUTOMAKE --add-missing && \
$AUTOCONF
$AUTOCONF --force
if [ $? -eq 0 -a -x ./configure ]; then
# Success: if we got some parameters we call ./configure and pass
# all of them to it.
NAME=`grep PACKAGE_STRING= configure | cut -d"'" -f2`
if [ "$GO" = "1" ]; then
[ -n "$PREFIX" ] && p=" --prefix=$PREFIX" || p=""
[ -n "$*" ] && a=" $*" || a=""
c="./configure${p}${a}"
echo "Okay, autogen.sh for $NAME done."
echo "Calling \"$c\" ..."
$c
exit $?
else
echo "Okay, autogen.sh done; now run the \"configure\" script."
echo "Okay, autogen.sh for $NAME done."
echo "Now run the \"./configure\" script."
exit 0
fi
else

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2009 Alexander Barton <alex@barton.de>
# Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -9,10 +9,12 @@
# Please read the file COPYING, README and AUTHORS for more information.
#
define(VERSION_ID,esyscmd(git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'|tr -d \\n))
# -- Initialisation --
AC_PREREQ(2.50)
AC_INIT(ngircd, 16)
AC_INIT(ngircd, VERSION_ID)
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6)
@@ -31,8 +33,8 @@ AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled])
AH_TEMPLATE([TCPWRAP], [Define if TCP wrappers should be used])
AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
AH_TEMPLATE([WANT_IPV6], [Define if IPV6 protocol should be enabled])
AH_TEMPLATE([ZEROCONF], [Define if support for Zeroconf should be included])
AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests])
AH_TEMPLATE([PAM], [Define if PAM should be used])
AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists])
AH_TEMPLATE([TARGET_OS], [Target operating system name])
@@ -42,6 +44,8 @@ AH_TEMPLATE([TARGET_CPU], [Target CPU name])
# -- C Compiler --
AC_PROG_CC
AC_PROG_CC_STDC
AC_C_PROTOTYPES
# -- Helper programs --
@@ -108,9 +112,14 @@ AC_CHECK_HEADERS([ \
AC_CHECK_HEADERS([ \
arpa/inet.h ctype.h malloc.h netinet/ip.h stdbool.h stddef.h varargs.h \
],[],[],[[
#include <netinet/in.h>
#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
]]
)
@@ -153,7 +162,7 @@ AC_CHECK_FUNCS([ \
bind gethostbyaddr gethostbyname gethostname inet_ntoa \
setsid setsockopt socket strcasecmp waitpid],,AC_MSG_ERROR([required function missing!]))
AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_aton isdigit sigaction snprintf \
AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_aton sigaction sigprocmask snprintf \
vsnprintf strdup strlcpy strlcat strtok_r)
# -- Configuration options --
@@ -401,56 +410,6 @@ int deny_severity = 0;
]
)
# include support for "zeroconf"?
x_zeroconf_on=no
AC_ARG_WITH(zeroconf,
[ --with-zeroconf enable support for "Zeroconf"],
[ if test "$withval" != "no"; then
if test "$withval" != "yes"; then
CFLAGS="-I$withval/include $CFLAGS"
CPPFLAGS="-I$withval/include $CPPFLAGS"
LDFLAGS="-L$withval/lib $LDFLAGS"
fi
AC_CHECK_FUNCS(DNSServiceRegistrationCreate, x_zeroconf_on=osx,
[
AC_CHECK_LIB(pthread, pthread_mutexattr_init)
AC_CHECK_LIB(howl, sw_discovery_init)
AC_CHECK_FUNCS(sw_discovery_init, \
x_zeroconf_on=howl, \
AC_MSG_ERROR([Can't enable Zeroconf!]))
])
fi
]
)
if test "$x_zeroconf_on" = "osx"; then
AC_CHECK_HEADERS([DNSServiceDiscovery/DNSServiceDiscovery.h \
mach/port.h],,AC_MSG_ERROR([required C header missing!]))
AC_DEFINE(ZEROCONF, 1)
fi
if test "$x_zeroconf_on" = "howl"; then
for dir in /usr/local/include /usr/local/include/howl* \
/usr/include /usr/include/howl* \
/usr/local/include/avahi* /usr/include/avahi*; do
test -d "$dir" || continue
AC_MSG_CHECKING([for Howl headers in $dir])
if test -f "$dir/rendezvous/rendezvous.h"; then
if test "$dir" != "/usr/local/include" -a \
"$dir" != "/usr/include"; then
CFLAGS="-I$dir $CFLAGS"
CPPFLAGS="-I$dir $CPPFLAGS"
fi
AC_MSG_RESULT(yes)
break
else
AC_MSG_RESULT(no)
fi
done
AC_CHECK_HEADERS([rendezvous/rendezvous.h],, \
AC_MSG_ERROR([required C header missing!]))
AC_DEFINE(ZEROCONF, 1)
fi
# do IDENT requests using libident?
x_identauth_on=no
@@ -474,6 +433,33 @@ if test "$x_identauth_on" = "yes"; then
AC_CHECK_HEADERS(ident.h,,AC_MSG_ERROR([required C header missing!]))
fi
# compile in PAM support?
x_pam_on=no
AC_ARG_WITH(pam,
[ --with-pam enable user authentication using PAM],
[ if test "$withval" != "no"; then
if test "$withval" != "yes"; then
CFLAGS="-I$withval/include $CFLAGS"
CPPFLAGS="-I$withval/include $CPPFLAGS"
LDFLAGS="-L$withval/lib $LDFLAGS"
fi
AC_CHECK_LIB(pam, pam_authenticate)
AC_CHECK_FUNCS(pam_authenticate, x_pam_on=yes,
AC_MSG_ERROR([Can't enable PAM support!])
)
fi
]
)
if test "$x_pam_on" = "yes"; then
AC_DEFINE(PAM, 1)
AC_CHECK_HEADERS(security/pam_appl.h,pam_ok=yes)
if test "$pam_ok" != "yes"; then
AC_CHECK_HEADERS(pam/pam_appl.h,pam_ok=yes,
AC_MSG_ERROR([required C header missing!]))
fi
fi
# compile in IRC+ protocol support?
x_ircplus_on=yes
@@ -558,6 +544,7 @@ AC_OUTPUT([ \
src/testsuite/Makefile \
man/Makefile \
contrib/Makefile \
contrib/Anope/Makefile \
contrib/Debian/Makefile \
contrib/MacOSX/Makefile \
contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
@@ -583,7 +570,7 @@ B=`eval echo ${bindir}` ; B=`eval echo ${B}`
S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
M=`eval echo ${mandir}` ; M=`eval echo ${M}`
D=`eval echo ${datadir}/doc/${PACKAGE}` ; D=`eval echo ${D}`
D=`eval echo ${docdir}` ; D=`eval echo ${D}`
echo " Target: ${target}"
test "$target" != "$host" && echo " Host: ${host}"
@@ -626,33 +613,26 @@ test "$x_strict_rfc_on" = "yes" \
&& echo "yes" \
|| echo "no"
echo $ECHO_N " Zeroconf support: $ECHO_C"
case "$x_zeroconf_on" in
osx)
echo $ECHO_N "Apple $ECHO_C"
;;
howl)
echo $ECHO_N "Howl $ECHO_C"
;;
*)
echo $ECHO_N "no $ECHO_C"
;;
esac
echo $ECHO_N " IDENT support: $ECHO_C"
test "$x_identauth_on" = "yes" \
&& echo $ECHO_N "yes $ECHO_C" \
|| echo $ECHO_N "no $ECHO_C"
echo $ECHO_N " IRC+ protocol: $ECHO_C"
test "$x_ircplus_on" = "yes" \
&& echo "yes" \
|| echo "no"
echo $ECHO_N " IDENT support: $ECHO_C"
test "$x_identauth_on" = "yes" \
echo $ECHO_N " IPv6 protocol: $ECHO_C"
test "$x_ipv6_on" = "yes" \
&& echo $ECHO_N "yes $ECHO_C" \
|| echo $ECHO_N "no $ECHO_C"
echo $ECHO_N " I/O backend: $ECHO_C"
echo "\"$x_io_backend\""
echo $ECHO_N " IPv6 protocol: $ECHO_C"
echo $ECHO_N "$x_ipv6_on $ECHO_C"
echo $ECHO_N " PAM support: $ECHO_C"
test "$x_pam_on" = "yes" \
&& echo $ECHO_N "yes $ECHO_C" \
|| echo $ECHO_N "no $ECHO_C"
echo $ECHO_N " SSL support: $ECHO_C"
echo "$x_ssl_lib"

View File

@@ -0,0 +1,496 @@
From bc5023fdba8091ab7eee29fe0deeca6843159743 Mon Sep 17 00:00:00 2001
From: Alexander Barton <alex@barton.de>
Date: Mon, 16 May 2011 18:23:01 +0200
Subject: [PATCH 1/2] Revert "Removed ngircd as we've decided not to support it at this time"
This reverts commit 605b5d57171d2f0fac56ee2ee3e1b1bbdadeb24f and re-enables
the ngIRCd protocol module for Anope.
---
modules/protocol/ngircd.cpp | 475 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 475 insertions(+), 0 deletions(-)
create mode 100644 modules/protocol/ngircd.cpp
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
new file mode 100644
index 0000000..6e1f21f
--- /dev/null
+++ b/modules/protocol/ngircd.cpp
@@ -0,0 +1,475 @@
+/* ngIRCd IRCD functions
+ *
+ * (C) 2003-2011 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+#include "services.h"
+#include "modules.h"
+
+IRCDVar myIrcd[] = {
+ {"ngIRCd", /* ircd name */
+ "+oi", /* Modes used by pseudoclients */
+ 0, /* SVSNICK */
+ 0, /* Vhost */
+ 0, /* Supports SNlines */
+ 0, /* Supports SQlines */
+ 0, /* Supports SZlines */
+ 0, /* Join 2 Message */
+ 0, /* Chan SQlines */
+ 1, /* Quit on Kill */
+ 0, /* vidents */
+ 0, /* svshold */
+ 0, /* time stamp on mode */
+ 0, /* UMODE */
+ 0, /* O:LINE */
+ 0, /* No Knock requires +i */
+ 0, /* Can remove User Channel Modes with SVSMODE */
+ 0, /* Sglines are not enforced until user reconnects */
+ 0, /* ts6 */
+ "$", /* TLD Prefix for Global */
+ 20, /* Max number of modes we can send per line */
+ 0, /* IRCd sends a SSL users certificate fingerprint */
+ }
+ ,
+ {NULL}
+};
+
+/* PASS */
+class ngIRCdProto : public IRCDProto
+{
+ void SendAkill(User *u, const XLine *x)
+ {
+ if (SGLine && u == NULL)
+ for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end();)
+ {
+ u = it->second;
+ ++it;
+ if (SGLine->Check(u) != NULL)
+ break;
+ }
+ }
+
+ void SendAkillDel(const XLine*) { }
+
+ void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf)
+ {
+ send_cmd(source ? source->nick : Config->ServerName, "WALLOPS :%s", buf.c_str());
+ }
+
+ void SendJoin(BotInfo *user, Channel *c, const ChannelStatus *status)
+ {
+ send_cmd(user->nick, "JOIN %s", c->name.c_str());
+ if (status)
+ for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i)
+ if (status->HasFlag(ModeManager::ChannelModes[i]->Name))
+ c->SetMode(user, ModeManager::ChannelModes[i], user->nick, false);
+ }
+
+ void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
+ {
+ send_cmd(source ? source->nick : Config->ServerName, "KILL %s :%s", user->nick.c_str(), buf.c_str());
+ }
+
+ /* SERVER name hop descript */
+ void SendServer(const Server *server)
+ {
+ send_cmd("", "SERVER %s %d :%s", server->GetName().c_str(), server->GetHops(), server->GetDescription().c_str());
+ }
+
+ void SendConnect()
+ {
+ send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", uplink_server->password.c_str(), Anope::VersionShort().c_str());
+ /* Make myself known to myself in the serverlist */
+ SendServer(Me);
+ /* finish the enhanced server handshake and register the connection */
+ this->SendNumeric(Config->ServerName, 376, "*", ":End of MOTD command");
+ }
+
+ // Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator
+ void SendClientIntroduction(const User *u, const Anope::string &modes)
+ {
+ EnforceQlinedNick(u->nick, "");
+ send_cmd(Config->ServerName, "NICK %s 1 %s %s 1 %s :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), modes.c_str(), u->realname.c_str());
+ }
+
+ void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf)
+ {
+ if (!buf.empty())
+ send_cmd(bi->nick, "PART %s :%s", chan->name.c_str(), buf.c_str());
+ else
+ send_cmd(bi->nick, "PART %s", chan->name.c_str());
+ }
+
+ void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf)
+ {
+ send_cmd(bi ? bi->nick : Config->ServerName, "MODE %s %s", dest->name.c_str(), buf.c_str());
+ }
+
+ void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
+ {
+ send_cmd(bi ? bi->nick : Config->ServerName, "MODE %s %s", u->nick.c_str(), buf.c_str());
+ }
+
+ void SendKickInternal(const BotInfo *bi, const Channel *chan, const User *user, const Anope::string &buf)
+ {
+ if (!buf.empty())
+ send_cmd(bi->nick, "KICK %s %s :%s", chan->name.c_str(), user->nick.c_str(), buf.c_str());
+ else
+ send_cmd(bi->nick, "KICK %s %s", chan->name.c_str(), user->nick.c_str());
+ }
+
+ void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
+ {
+ send_cmd(source ? source->nick : Config->s_ChanServ, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
+ }
+
+ /* INVITE */
+ void SendInvite(BotInfo *source, const Anope::string &chan, const Anope::string &nick)
+ {
+ send_cmd(source->nick, "INVITE %s %s", nick.c_str(), chan.c_str());
+ }
+
+ void SendChannel(Channel *c)
+ {
+ Anope::string mlock_modes = get_mlock_modes(c->ci, true);
+ if (mlock_modes.empty())
+ mlock_modes = "+";
+ send_cmd(Config->ServerName, "CHANINFO %s %s", c->name.c_str(), mlock_modes.c_str());
+ }
+ void SendTopic(BotInfo *bi, Channel *c)
+ {
+ send_cmd(bi->nick, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str());
+ }
+};
+
+class ngIRCdIRCdMessage : public IRCdMessage
+{
+ public:
+ bool OnSJoin(const Anope::string&, const std::vector<Anope::string>&) { return false; }
+
+ /*
+ * Received: :dev.anope.de MODE #anope +b *!*@*aol*
+ */
+ bool OnMode(const Anope::string &source, const std::vector<Anope::string> &params)
+ {
+ if (params.size() < 2)
+ return true;
+
+ Anope::string modes = params[1];
+ for (unsigned i = 2; i < params.size(); ++i)
+ modes += " " + params[i];
+
+ if (params[0][0] == '#' || params[0][0] == '&')
+ do_cmode(source, params[0], modes, "");
+ else
+ do_umode(params[0], params[1]);
+
+ return true;
+ }
+
+ /*
+ Received: :DukeP_ NICK :test2
+ Received: :dev.anope.de NICK DukeP_ 1 ~DukePyro ip-2-201-236-154.web.vodafone.de 1 + :DukePyrolator
+ source = nickname on nickchange, servername on newuser
+ params[0] = nick
+ params[1] = <unknown>
+ params[2] = username
+ params[3] = host
+ params[4] = <unknown>
+ params[5] = modes
+ params[6] = info
+ */
+ bool OnNick(const Anope::string &source, const std::vector<Anope::string> &params)
+ {
+ if (params.size() == 1)
+ {
+ // we have a nickchange
+ do_nick(source, params[0], "", "", "", "", Anope::CurTime, "", "", "", "");
+ }
+ else if (params.size() == 7)
+ {
+ // a new user is connecting to the network
+ User *user = do_nick("", params[0], params[2], params[3], source, params[6], Anope::CurTime, "", "", "", params[5]);
+ if (user)
+ validate_user(user);
+ }
+ else
+ {
+ Log() << "Received NICK with invalid number of parameters. source = " << source << "param[0] = " << params[0] << "params.size() = " << params.size();
+ }
+ return true;
+ }
+
+ bool OnServer(const Anope::string &source, const std::vector<Anope::string> &params)
+ {
+ if (params.size() == 3)
+ do_server("", params[0], 0, params[2], params[1]);
+ else
+ do_server(source, params[0], params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0, params[3], params[2]);
+ return true;
+ }
+
+ bool OnTopic(const Anope::string &source, const std::vector<Anope::string> &params)
+ {
+ Channel *c = findchan(params[0]);
+ if (!c)
+ {
+ Log() << "TOPIC for nonexistant channel " << params[0];
+ return true;
+ }
+
+ c->ChangeTopicInternal(source, params[1]);
+ return true;
+ }
+
+ /*
+ * <@po||ux> DukeP: RFC 2813, 4.2.1: the JOIN command on server-server links
+ * separates the modes ("o") with ASCII 7, not space. And you can't see ASCII 7.
+ *
+ * if a user joins a new channel, the ircd sends <channelname>\7<umode>
+ */
+ bool OnJoin (const Anope::string &source, const std::vector<Anope::string> &params)
+ {
+ if (!params.empty())
+ {
+ size_t pos = params[0].find('\7');
+ if (pos != Anope::string::npos)
+ {
+ Anope::string channel = params[0].substr(0, pos);
+ Anope::string mode = '+' + params[0].substr(pos, params[0].length()) + " " + source;
+ do_join(source, channel, "");
+ do_cmode(source, channel, mode, "");
+ }
+ else
+ do_join(source, params[0], "");
+ }
+ return true;
+ }
+};
+
+/*
+ * CHANINFO <chan> +<modes>
+ * CHANINFO <chan> +<modes> :<topic>
+ * CHANINFO <chan> +<modes> <key> <limit> :<topic>
+ */
+bool event_chaninfo(const Anope::string &source, const std::vector<Anope::string> &params)
+{
+
+ Channel *c = findchan(params[0]);
+ if (!c)
+ c = new Channel(params[0]);
+
+ Anope::string modes = params[1];
+
+ if (params.size() == 3)
+ {
+ c->ChangeTopicInternal(source, params[2], Anope::CurTime);
+ }
+ else if (params.size() == 5)
+ {
+ for (size_t i = 0, end = params[1].length(); i < end; ++i)
+ {
+ switch(params[1][i])
+ {
+ case 'k':
+ modes += " " + params[2];
+ continue;
+ case 'l':
+ modes += " " + params[3];
+ continue;
+ }
+ }
+ c->ChangeTopicInternal(source, params[4], Anope::CurTime);
+ }
+
+ c->SetModesInternal(NULL, modes);
+
+ return true;
+}
+
+/*
+ * Received: :dev.anope.de NJOIN #test :DukeP2,@DukeP
+ */
+bool event_njoin(const Anope::string &source, const std::vector<Anope::string> &params)
+{
+ Channel *c = findchan(params[0]);
+ commasepstream sep(params[1]);
+ Anope::string buf;
+
+ if (!c)
+ {
+ c = new Channel(params[0], Anope::CurTime);
+ c->SetFlag(CH_SYNCING);
+ }
+
+ while (sep.GetToken(buf))
+ {
+ std::list<ChannelMode *> Status;
+ char ch;
+
+ /* Get prefixes from the nick */
+ while ((ch = ModeManager::GetStatusChar(buf[0])))
+ {
+ buf.erase(buf.begin());
+ ChannelMode *cm = ModeManager::FindChannelModeByChar(ch);
+ if (!cm)
+ {
+ Log() << "Received unknown mode prefix " << ch << " in NJOIN string.";
+ continue;
+ }
+ Status.push_back(cm);
+ }
+ User *u = finduser(buf);
+ if (!u)
+ {
+ Log(LOG_DEBUG) << "NJOIN for nonexistant user " << buf << " on " << c->name;
+ continue;
+ }
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnPreJoinChannel, OnPreJoinChannel(u, c));
+
+ /* Add the user to the Channel */
+ c->JoinUser(u);
+
+ /* Update their status internally on the channel
+ * This will enforce secureops etc on the user
+ */
+ for (std::list<ChannelMode *>::iterator it = Status.begin(), it_end = Status.end(); it != it_end; ++it)
+ c->SetModeInternal(*it, buf);
+ /* Now set whatever modes this user is allowed to have on the channel */
+ chan_set_correct_modes(u, c, 1);
+
+ /* Check to see if modules want the user to join, if they do
+ * check to see if they are allowed to join (CheckKick will kick/ban them)
+ * Don't trigger OnJoinChannel event then as the user will be destroyed
+ */
+ if (MOD_RESULT != EVENT_STOP && c->ci && c->ci->CheckKick(u))
+ continue;
+
+ FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(u, c));
+ } /* while */
+
+ if (c->HasFlag(CH_SYNCING))
+ {
+ c->UnsetFlag(CH_SYNCING);
+ c->Sync();
+ }
+
+ return true;
+}
+
+bool event_kick(const Anope::string &source, const std::vector<Anope::string> &params)
+{
+ if (params.size() > 2)
+ do_kick(source, params[0], params[1], params[2]);
+ return true;
+}
+
+bool event_pass(const Anope::string &source, const std::vector<Anope::string> &params)
+{
+ return true;
+}
+
+bool event_005(const Anope::string &source, const std::vector<Anope::string> &params)
+{
+ size_t pos;
+ Anope::string name, data;
+ for (unsigned i = 0, end = params.size(); i < end; ++i)
+ {
+ pos = params[i].find('=');
+ if (pos != Anope::string::npos)
+ {
+ name = params[i].substr(0, pos);
+ data = params[i].substr(pos+1, params[i].length());
+ if (name == "NICKLEN")
+ {
+ unsigned newlen = convertTo<unsigned>(data);
+ if (Config->NickLen != newlen)
+ {
+ Log() << "Config->NickLen changed from " << Config->NickLen << " to " << newlen;
+ Config->NickLen = newlen;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool event_442(const Anope::string &source, const std::vector<Anope::string> &params)
+{
+ return true;
+}
+
+bool event_376(const Anope::string &source, const std::vector<Anope::string> &params)
+{
+ return true;
+}
+
+
+class ProtongIRCd : public Module
+{
+ Message message_kick, message_pass, message_njoin, message_chaninfo, message_005,
+ message_442, message_376;
+
+ ngIRCdProto ircd_proto;
+ ngIRCdIRCdMessage ircd_message;
+
+ void AddModes()
+ {
+ /* Add user modes */
+ ModeManager::AddUserMode(new UserMode(UMODE_ADMIN, 'a'));
+ ModeManager::AddUserMode(new UserMode(UMODE_INVIS, 'i'));
+ ModeManager::AddUserMode(new UserMode(UMODE_OPER, 'o'));
+ ModeManager::AddUserMode(new UserMode(UMODE_RESTRICTED, 'r'));
+ ModeManager::AddUserMode(new UserMode(UMODE_SNOMASK, 's'));
+ ModeManager::AddUserMode(new UserMode(UMODE_WALLOPS, 'w'));
+ ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x'));
+
+ /* b/e/I */
+ ModeManager::AddChannelMode(new ChannelModeBan(CMODE_BAN, 'b'));
+ ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I'));
+
+ /* v/h/o/a/q */
+ ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_VOICE, 'v', '+'));
+ ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_OP, 'o', '@'));
+
+ /* Add channel modes */
+ // channel modes: biIklmnoPstvz
+ ModeManager::AddChannelMode(new ChannelMode(CMODE_INVITE, 'i'));
+ ModeManager::AddChannelMode(new ChannelModeKey('k'));
+ ModeManager::AddChannelMode(new ChannelModeParam(CMODE_LIMIT, 'l'));
+ ModeManager::AddChannelMode(new ChannelMode(CMODE_MODERATED, 'm'));
+ ModeManager::AddChannelMode(new ChannelMode(CMODE_NOEXTERNAL, 'n'));
+ ModeManager::AddChannelMode(new ChannelMode(CMODE_PERM, 'P'));
+ ModeManager::AddChannelMode(new ChannelMode(CMODE_SECRET, 's'));
+ ModeManager::AddChannelMode(new ChannelMode(CMODE_TOPIC, 't'));
+ ModeManager::AddChannelMode(new ChannelMode(CMODE_SSL, 'z'));
+ }
+
+ public:
+ ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator),
+ message_kick("KICK", event_kick), message_pass("PASS", event_pass),
+ message_njoin("NJOIN", event_njoin), message_chaninfo("CHANINFO", event_chaninfo),
+ message_005("005", event_005), message_442("442", event_442), message_376("376", event_376)
+ {
+ this->SetAuthor("Anope");
+ this->SetType(PROTOCOL);
+
+ Capab.SetFlag(CAPAB_QS);
+
+ pmodule_ircd_var(myIrcd);
+ pmodule_ircd_proto(&this->ircd_proto);
+ pmodule_ircd_message(&this->ircd_message);
+
+ this->AddModes();
+ }
+};
+
+MODULE_INIT(ProtongIRCd)
--
1.7.2.5

View File

@@ -0,0 +1,60 @@
From 1ea1dd2095e63cef34edbebb729edc687f410a96 Mon Sep 17 00:00:00 2001
From: Alexander Barton <alex@barton.de>
Date: Mon, 16 May 2011 18:26:56 +0200
Subject: [PATCH 2/2] ngircd: whitespace fixes
---
modules/protocol/ngircd.cpp | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
index 6e1f21f..e546d05 100644
--- a/modules/protocol/ngircd.cpp
+++ b/modules/protocol/ngircd.cpp
@@ -266,11 +266,11 @@ bool event_chaninfo(const Anope::string &source, const std::vector<Anope::string
c = new Channel(params[0]);
Anope::string modes = params[1];
-
+
if (params.size() == 3)
{
c->ChangeTopicInternal(source, params[2], Anope::CurTime);
- }
+ }
else if (params.size() == 5)
{
for (size_t i = 0, end = params[1].length(); i < end; ++i)
@@ -307,7 +307,7 @@ bool event_njoin(const Anope::string &source, const std::vector<Anope::string> &
c = new Channel(params[0], Anope::CurTime);
c->SetFlag(CH_SYNCING);
}
-
+
while (sep.GetToken(buf))
{
std::list<ChannelMode *> Status;
@@ -415,9 +415,9 @@ bool event_376(const Anope::string &source, const std::vector<Anope::string> &pa
class ProtongIRCd : public Module
{
- Message message_kick, message_pass, message_njoin, message_chaninfo, message_005,
+ Message message_kick, message_pass, message_njoin, message_chaninfo, message_005,
message_442, message_376;
-
+
ngIRCdProto ircd_proto;
ngIRCdIRCdMessage ircd_message;
@@ -461,7 +461,7 @@ class ProtongIRCd : public Module
{
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
-
+
Capab.SetFlag(CAPAB_QS);
pmodule_ircd_var(myIrcd);
--
1.7.2.5

20
contrib/Anope/Makefile.am Normal file
View File

@@ -0,0 +1,20 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
EXTRA_DIST = \
README \
0001-Revert-Removed-ngircd.patch \
0002-ngircd-whitespace-fixes.patch
maintainer-clean-local:
rm -f Makefile Makefile.in
# -eof-

36
contrib/Anope/README Normal file
View File

@@ -0,0 +1,36 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- contrib/Anope/README --
This directory contains two preliminary patches that (re-) add a ngIRCd
protocol module to the Anope 1.9 development branch. It has been tested
with Anope 1.9.4, there is no guarantee that it will work with other
versions as Anope 1.9.x is under heavy development ...
To build this Anope protocol module, you have to
- Download the Anope 1.9.x sources (tested with 1.9.4),
- Patch in the ngIRCd protocol module,
- Build and install Anope as usual,
- Configure Anope as usual, use "ngircd" as protocol module.
So the command sequence can be something like this:
$ tar xzf anope-1.9.4-source.tar.gz
$ cd anope-1.9.4-source
$ patch -p1 < .../ngircd/contrib/Anope/0001-Revert-Removed-ngircd.patch
$ patch -p1 < .../ngircd/contrib/Anope/0002-ngircd-whitespace-fixes.patch
$ ./Config
$ cd build
$ make
$ make install
Please have a look at the file doc/Services.txt for more information about
how to set up ngIRCd and Anope.

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
# Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -10,7 +10,7 @@
#
EXTRA_DIST = rules changelog compat control copyright \
ngircd.init ngircd.default ngircd.postinst
ngircd.init ngircd.default ngircd.pam ngircd.postinst
maintainer-clean-local:
rm -f Makefile Makefile.in

View File

@@ -1,3 +1,58 @@
ngircd (18-0ab1) unstable; urgency=low
* New "upstream" release: ngIRCd 18.
-- Alexander Barton <alex@barton.de> Sun, 10 Jul 2011 20:03:20 +0200
ngircd (18~rc2-0ab1) unstable; urgency=low
* New "upstream" release candidate 2 for ngIRCd Release 18.
-- Alexander Barton <alex@barton.de> Wed, 29 Jun 2011 10:20:51 +0200
ngircd (18~rc1-0ab1) unstable; urgency=low
* New "upstream" release candidate 1 for ngIRCd Release 18.
-- Alexander Barton <alex@barton.de> Mon, 27 Jun 2011 22:58:36 +0200
ngircd (17.1-0ab1) unstable; urgency=low
* New "upstream" release: ngIRCd 17.1.
-- Alexander Barton <alex@barton.de> Sun, 19 Dec 2010 15:56:42 +0100
ngircd (17-0ab1) unstable; urgency=low
* New "upstream" release: ngIRCd 17.
-- Alexander Barton <alex@barton.de> Sun, 07 Nov 2010 17:23:07 +0100
ngircd (17~rc3-0ab1) unstable; urgency=low
* New "upstream" release candidate 3 for ngIRCd Release 17.
-- Alexander Barton <alex@barton.de> Wed, 27 Oct 2010 22:30:08 +0200
ngircd (17~rc2-0ab2) unstable; urgency=low
* Install /etc/pam.d/ngircd including "auth required pam_permit.so" when
installing -full or -full-dbg variant to keep backwards compatibility.
-- Alexander Barton <alex@barton.de> Tue, 26 Oct 2010 23:34:56 +0200
ngircd (17~rc2-0ab1) unstable; urgency=low
* New "upstream" release candidate 2 for ngIRCd Release 17.
-- Alexander Barton <alex@barton.de> Mon, 25 Oct 2010 18:51:15 +0200
ngircd (17~rc1-0ab1) unstable; urgency=low
* New "upstream" release candidate 1 for ngIRCd Release 17.
-- Alexander Barton <alex@barton.de> Mon, 11 Oct 2010 16:57:47 +0200
ngircd (16-0ab1) unstable; urgency=low
* New "upstream" release: ngIRCd 16.

View File

@@ -2,8 +2,8 @@ Source: ngircd
Section: net
Priority: optional
Maintainer: Alexander Barton <alex@barton.de>
Build-Depends: debhelper (>> 4.0.0), libz-dev, libwrap0-dev, libident-dev, libgnutls-dev
Standards-Version: 3.8.0
Build-Depends: debhelper (>> 4.0.0), libz-dev, libwrap0-dev, libident-dev, libgnutls-dev, libpam0g-dev
Standards-Version: 3.9.1
Package: ngircd
Architecture: any

View File

@@ -1,13 +1,13 @@
#!/bin/sh
#
# ngIRCd start and stop script for Debian-based systems
# Copyright 2008,2009 Alexander Barton <alex@barton.de>
# Copyright 2008-2010 Alexander Barton <alex@barton.de>
#
### BEGIN INIT INFO
# Provides: ngircd
# Required-Start: $network $remote_fs
# Required-Stop:
# Required-Stop: $network $remote_fs
# Should-Start: $syslog $named
# Should-Stop: $syslog
# Default-Start: 2 3 4 5

View File

@@ -0,0 +1,4 @@
# /etc/pam.d/ngircd
# allow all connections to ngIRCd
auth required pam_permit.so

View File

@@ -53,7 +53,7 @@ configure-ngircd-full: configure
--sysconfdir=/etc/ngircd \
--mandir=\$${prefix}/share/man \
--with-syslog --with-zlib \
--with-gnutls --with-ident --with-tcp-wrappers \
--with-gnutls --with-ident --with-tcp-wrappers --with-pam \
--enable-ipv6
configure-ngircd-full-dbg: configure
@@ -66,7 +66,7 @@ configure-ngircd-full-dbg: configure
--mandir=\$${prefix}/share/man \
--enable-debug --enable-sniffer \
--with-syslog --with-zlib \
--with-gnutls --with-ident --with-tcp-wrappers \
--with-gnutls --with-ident --with-tcp-wrappers --with-pam \
--enable-ipv6
build:
@@ -163,6 +163,8 @@ install-ngircd-full: build-ngircd-full
sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
>$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
mkdir -p $(CURDIR)/debian/ngircd-full/etc/pam.d
cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full/etc/pam.d/ngircd
install-ngircd-full-dbg: build-ngircd-full-dbg
dh_testdir
@@ -183,6 +185,8 @@ install-ngircd-full-dbg: build-ngircd-full-dbg
sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
>$(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.conf
touch $(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.motd
mkdir -p $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d
cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d/ngircd
# Build architecture-independent files here.
binary-indep:

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2009 Alexander Barton (alex@barton.de).
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de).
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,15 +42,15 @@
/* Define if TCP wrappers should be used */
/*#define TCPWRAP 1*/
/* Define if support for Zeroconf should be included */
/*#define ZEROCONF 1*/
/* Define if zlib compression should be enabled */
#define ZLIB 1
/* Define if IPV6 protocol should be enabled */
#define WANT_IPV6 1
/* Define if PAM should be used */
#define PAM 1
/* -- Supported features -- */
/* Define if SSP C support is enabled. */
@@ -94,15 +94,19 @@
#define HAVE_GETADDRINFO 1
/* Define to 1 if you have the `getnameinfo' function. */
#define HAVE_GETNAMEINFO 1
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
/* Define if socklen_t exists */
#define HAVE_socklen_t 1
#ifdef ZEROCONF
/* Define to 1 if you have the <DNSServiceDiscovery/DNSServiceDiscovery.h> header file. */
#define HAVE_DNSSERVICEDISCOVERY_DNSSERVICEDISCOVERY_H 1
/* Define to 1 if you have the `DNSServiceRegistrationCreate' function. */
#define HAVE_DNSSERVICEREGISTRATIONCREATE 1
#ifdef PAM
/* Define to 1 if you have the `pam_authenticate' function. */
#define HAVE_PAM_AUTHENTICATE 1
/* Define to 1 if you have the <pam/pam_appl.h> header file. */
#define HAVE_PAM_PAM_APPL_H 1
/* Mac OS X <10.6 doesn't have pam_fail_delay() */
#define NO_PAM_FAIL_DELAY 1
#endif
/* -eof- */

View File

@@ -1 +1 @@
<pkg-contents spec="1.12"/>
<pkg-contents spec="1.12"><f n="ngircd.dest" o="root" g="admin" p="16877" pt="/Users/alex/Develop/ngircd/alex.git/ngircd.dest" m="false" t="file"><f n="opt" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="16877"><f n="etc" o="root" g="admin" p="16877"><f n="ngircd.motd" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="sbin" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="33261"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="share" o="root" g="admin" p="16877"><f n="doc" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="16877"><f n="AUTHORS" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Bopm.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="ChangeLog" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="COPYING" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="FAQ.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="GIT.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="HowToRelease.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="INSTALL" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="NEWS" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="PAM.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Platforms.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Protocol.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-AUX.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-BeOS.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-Interix.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="RFC.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="sample-ngircd.conf" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Services.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="SSL.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="man" o="root" g="admin" p="16877"><f n="man5" o="root" g="admin" p="16877"><f n="ngircd.conf.5" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="man8" o="root" g="admin" p="16877"><f n="ngircd.8" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f></pkg-contents>

View File

@@ -1 +1 @@
<pkgref spec="1.12" uuid="6AF4DF80-E7DE-45E7-8B40-890A10AE51D0"><config><identifier>de.barton.ngircd.daemon.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true">../../ngircd.dest</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>parent</mod><mod>scripts.postinstall.path</mod><mod>scripts.postinstall.isRelativeType</mod><mod>scripts.preupgrade.path</mod><mod>installFrom.isRelativeType</mod><mod>version</mod><mod>scripts.preinstall.isRelativeType</mod><mod>identifier</mod><mod>installTo</mod></config><scripts><preinstall relative="true" mod="true">preinstall.sh</preinstall><preupgrade relative="true" mod="true">preinstall.sh</preupgrade></scripts></pkgref>
<pkgref spec="1.12" uuid="46208410-4A1B-48C6-97BD-DE284F13F864"><config><identifier>de.barton.ngircd.daemon.pkg</identifier><version>17.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom>/Users/alex/Develop/ngircd/alex.git/ngircd.dest</installFrom><installTo mod="true">/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>extraFiles</mod><mod>installTo</mod><mod>installTo.isAbsoluteType</mod><mod>scripts.preinstall.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>installTo.path</mod><mod>scripts.preupgrade.path</mod><mod>requireAuthorization</mod></config><contents><file-list>02ngircd-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref>

View File

@@ -1 +1 @@
<pkg-contents spec="1.12"/>
<pkg-contents spec="1.12"><f n="de.barton.ngircd.plist" o="root" g="wheel" p="33188" pt="/Users/alex/Develop/ngircd/alex.git/contrib/MacOSX/de.barton.ngircd.plist" m="false" t="file"><mod>group</mod><mod>owner</mod></f></pkg-contents>

View File

@@ -1 +1 @@
<pkgref spec="1.12" uuid="F0954DA7-0607-4277-AE10-D882AC7C38CA"><config><identifier>de.barton.ngircd.launchscript.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true">de.barton.ngircd.plist</installFrom><installTo mod="true">/Library/LaunchDaemons</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>parent</mod><mod>scripts.postinstall.path</mod><mod>scripts.postupgrade.path</mod><mod>installFrom.isRelativeType</mod><mod>installTo.path</mod><mod>installTo</mod><mod>identifier</mod></config><scripts><postinstall relative="true" mod="true">postinstall.sh</postinstall><postupgrade relative="true" mod="true">postinstall.sh</postupgrade></scripts></pkgref>
<pkgref spec="1.12" uuid="F0954DA7-0607-4277-AE10-D882AC7C38CA"><config><identifier>de.barton.ngircd.launchscript.pkg</identifier><version>17.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true">de.barton.ngircd.plist</installFrom><installTo mod="true">/Library/LaunchDaemons</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>scripts.preinstall.path</mod><mod>installTo</mod><mod>scripts.postinstall.path</mod><mod>scripts.postinstall.isRelativeType</mod><mod>installFrom.isRelativeType</mod><mod>installTo.isAbsoluteType</mod><mod>version</mod><mod>parent</mod><mod>scripts.preupgrade.path</mod><mod>identifier</mod><mod>scripts.postupgrade.path</mod><mod>requireAuthorization</mod><mod>extraFiles</mod><mod>scripts.postupgrade.isRelativeType</mod><mod>installTo.path</mod></config><scripts><preinstall relative="true" mod="true">preinstall.sh</preinstall><postinstall relative="true" mod="true">postinstall.sh</postinstall><preupgrade relative="true" mod="true">preinstall.sh</preupgrade><postupgrade relative="true" mod="true">postinstall.sh</postupgrade></scripts><contents><file-list>01de-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref>

View File

@@ -1,10 +1,11 @@
<pkmkdoc spec="1.12"><properties><title>ngIRCd</title><build>/Users/alex/Desktop/ngIRCd.mpkg</build><organization>de.barton.ngircd</organization><userSees ui="both"/><min-target os="2"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>ngIRCd next generation IRC (Internet Relay Chat) server daemon</description><contents><choice title="ngIRCd daemon" id="choicengircd" tooltip="ngIRCd daemon, documentation and manual pages" description="Binaries, documentation and manual pages of the ngIRCd, the next generation IRC (Internet Relay Chat) daemon. This package will be installed into /opt/ngircd." starts_selected="true" starts_enabled="true" starts_hidden="false"><customLoc>/</customLoc><pkgref id="de.barton.ngircd.daemon.pkg"/></choice><choice title="Start and stop script" id="choicelaunchscript" tooltip="LaunchDaemon start and stop script" description="Installs the ngIRCd start and stop script for the &quot;launch daemon&quot;. If this is an update/upgrade, and ngIRCd is already running, it will be automatically restarted." starts_selected="true" starts_enabled="true" starts_hidden="false"><customLoc>/Library/LaunchDaemons</customLoc><pkgref id="de.barton.ngircd.launchscript.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
<pkmkdoc spec="1.12"><properties><title>ngIRCd</title><build>/Users/alex/Desktop/ngIRCd.mpkg</build><organization>de.barton.ngircd</organization><userSees ui="both"/><min-target os="2"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>ngIRCd next generation Internet Relay Chat (IRC) server
daemon</description><contents><choice title="ngIRCd daemon" id="choicengircd" tooltip="ngIRCd daemon, documentation and manual pages" description="Binaries, documentation and manual pages of the ngIRCd, the next generation IRC (Internet Relay Chat) daemon. This package will be installed into /opt/ngircd." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="de.barton.ngircd.daemon.pkg"/></choice><choice title="Start and stop script" id="choicelaunchscript" tooltip="LaunchDaemon start and stop script" description="Installs the ngIRCd start and stop script for the &quot;launch daemon&quot;. If this is an update/upgrade, and ngIRCd is already running, it will be automatically restarted." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="de.barton.ngircd.launchscript.pkg"/></choice></contents><resources bg-scale="none" bg-align="bottomleft"><locale lang="en"><resource type="background">/Users/alex/Develop/ngircd/alex.git/contrib/ngIRCd-Logo.gif</resource><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
\f0\i\fs24 \cf0 ngIRCd -- The Next Generation IRC Daemon\
Copyright (c)2001-2010 Alexander Barton and Contributors.\
Copyright (c)2001-2011 Alexander Barton and Contributors.\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
\i0 \cf0 \
@@ -150,41 +151,88 @@ Each version is given a distinguishing version number. If the Program specifies
\cf0 \
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\
\
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\
}]]></resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="readme"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0\fs26 \cf0 Please not:\
\
\pard\tx260\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li260\fi-260\ql\qnatural\pardirnatural
\cf0 \'95 You
\b have to adjust the configuration file
\b0 of ngIRCd, at least if you are installing ngIRCd for the first time on this system (it is preserved while updating, of course).\
\
\'95 The daemon is automatically restarted when updating, so your
\b users will be disconnected
\b0 .\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 \
ngIRCd becomes installed in the (newly created) /opt/ngircd directory on your system volume. Interesting files and directories are:\
\
\pard\tx260\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li260\fi-260\ql\qnatural\pardirnatural
\cf0 \'95
\f1 /opt/ngircd/sbin/ngircd
\f0 \'96 executable daemon\
\'95
\f1 /opt/ngircd/etc/ngircd.conf
\f0 \'96 configuration file\
\'95
\f1 /opt/ngircd/share/doc/ngircd/\'85
\f0 \'96 documentation\
\'95
\f1 /opt/ngircd/share/mac/\'85
\f0 \'96 manual pages}]]></resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0\fs26 \cf0 ngIRCd is a free open source daemon for the Internet Relay Chat (IRC) protocol, developed under the GNU General Public License (GPL). It's written from scratch, is quite portable and is not based upon the original IRCd like many others.\
\f0\fs26 \cf0 ngIRCd is a free and open source daemon for the Internet Relay Chat (IRC) protocol, developed under the GNU General Public License (GPL). It is written from scratch, is quite portable and is not based upon the original IRCd like many others.\
\
Homepage: http://ngircd.barton.de\
ngIRCd Homepage: {\field{\*\fldinst{HYPERLINK "http://ngircd.barton.de"}}{\fldrslt http://ngircd.barton.de}}\
\
You will be guided through all steps necessary to install this software.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset0 Monaco;}
Please see the documentation for details! You can find it online here on the Homepage:\
\
Documentation: {\field{\*\fldinst{HYPERLINK "http://ngircd.barton.de/documentation"}}{\fldrslt http://ngircd.barton.de/documentation}}\
\
You will be guided through all steps necessary to install this software on Mac OS X.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid2}}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid1\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid101\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0\fs26 \cf0 ngIRCd has been successfully installed/upgraded.\
\f0\fs26 \cf0 The daemon has been restarted if it was already running before this installation and you have installed the LaunchDaemon start and stop script (which is the default).\
\
It has been restarted if it was already running before and you have installed the LaunchDaemon start and stop script (which is the default).\
\
If you installed ngIRCd the first time (or had the LaunchDaemon script disabled before), you can start ngIRCd using the following terminal command:\
\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls1\ilvl0
\f1\fs24 \cf0 sudo launchctl load -w \\\
/Library/LaunchDaemons/de.barton.ngircd.plist\
If you installed ngIRCd for the first time (or had the LaunchDaemon script disabled before), you can start ngIRCd using the following terminal command:\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0\fs26 \cf0 \
\fs20 \cf0 \
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls1\ilvl0
\f1\fs26 \cf0 sudo launchctl load -w \\\
/Library/LaunchDaemons/de.barton.ngircd.plist\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0 \cf0 \
To disable automatic starting of ngIRCd, use this command:\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\fs18 \cf0 \
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls2\ilvl0
\f1\fs24 \cf0 sudo launchctl unload -w \\\
/Library/LaunchDaemons/de.barton.ngircd.plist\
}]]></resource></locale></resources><flags/><item type="file">01ngircd.xml</item><item type="file">02de.xml</item><mod>properties.customizeOption</mod><mod>properties.title</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
\f1\fs26 \cf0 sudo launchctl unload -w \\\
/Library/LaunchDaemons/de.barton.ngircd.plist\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0 \cf0 \
But don\'92t forget to
\b adjust the configuration!
\b0 By default, it is stored in the following file:\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\fs18 \cf0 \
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\f1\fs26 \cf0 /opt/ngircd/etc/ngircd.conf}]]></resource></locale></resources><flags/><extra-files/><item type="file">02de.xml</item><item type="file">01ngircd.xml</item><mod>extraFiles</mod><mod>properties.title</mod><mod>properties.customizeOption</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>

View File

@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
FA2D564A11EA158B00D37A35 /* pam.c in Sources */ = {isa = PBXBuildFile; fileRef = FA2D564911EA158B00D37A35 /* pam.c */; };
FA2D567B11EA1AB300D37A35 /* libpam.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FA2D567A11EA1AB300D37A35 /* libpam.dylib */; };
FA322D350CEF74B1001761B3 /* array.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322CD90CEF74B1001761B3 /* array.c */; };
FA322D360CEF74B1001761B3 /* channel.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322CDB0CEF74B1001761B3 /* channel.c */; };
FA322D370CEF74B1001761B3 /* client.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322CDD0CEF74B1001761B3 /* client.c */; };
@@ -30,13 +32,14 @@
FA322D490CEF74B1001761B3 /* match.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322D030CEF74B1001761B3 /* match.c */; };
FA322D4A0CEF74B1001761B3 /* ngircd.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322D060CEF74B1001761B3 /* ngircd.c */; };
FA322D4B0CEF74B1001761B3 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322D080CEF74B1001761B3 /* parse.c */; };
FA322D4C0CEF74B1001761B3 /* rendezvous.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322D0A0CEF74B1001761B3 /* rendezvous.c */; };
FA322D4D0CEF74B1001761B3 /* resolve.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322D0C0CEF74B1001761B3 /* resolve.c */; };
FA322DBE0CEF7766001761B3 /* tool.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322D330CEF74B1001761B3 /* tool.c */; };
FA322DC10CEF77CB001761B3 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FA322DC00CEF77CB001761B3 /* libz.dylib */; };
FA407F2E0DB159F400271AF1 /* ng_ipaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */; };
FA85178C0FA061EC006A1F5A /* op.c in Sources */ = {isa = PBXBuildFile; fileRef = FA85178B0FA061EC006A1F5A /* op.c */; };
FA99428C10E82A27007F27ED /* proc.c in Sources */ = {isa = PBXBuildFile; fileRef = FA99428B10E82A27007F27ED /* proc.c */; };
FAA3D27B0F139CDC00B2447E /* conn-ssl.c in Sources */ = {isa = PBXBuildFile; fileRef = FAA3D2790F139CDC00B2447E /* conn-ssl.c */; };
FAA97C57124A271400D5BBA9 /* sighandlers.c in Sources */ = {isa = PBXBuildFile; fileRef = FAA97C55124A271400D5BBA9 /* sighandlers.c */; };
FAE5CC2E0CF2308A007D69B6 /* numeric.c in Sources */ = {isa = PBXBuildFile; fileRef = FAE5CC2D0CF2308A007D69B6 /* numeric.c */; };
/* End PBXBuildFile section */
@@ -55,6 +58,9 @@
/* Begin PBXFileReference section */
FA1A6BBC0D6857BB00AA8F71 /* misc-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "misc-test.e"; sourceTree = "<group>"; };
FA1A6BBD0D6857D900AA8F71 /* who-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "who-test.e"; sourceTree = "<group>"; };
FA2D564811EA158B00D37A35 /* pam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pam.h; sourceTree = "<group>"; };
FA2D564911EA158B00D37A35 /* pam.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pam.c; sourceTree = "<group>"; };
FA2D567A11EA1AB300D37A35 /* libpam.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpam.dylib; path = usr/lib/libpam.dylib; sourceTree = SDKROOT; };
FA322BBA0CEF72E4001761B3 /* ngIRCd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ngIRCd; sourceTree = BUILT_PRODUCTS_DIR; };
FA322CD60CEF74B1001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
FA322CD90CEF74B1001761B3 /* array.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = array.c; sourceTree = "<group>"; };
@@ -106,8 +112,6 @@
FA322D070CEF74B1001761B3 /* ngircd.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = ngircd.h; sourceTree = "<group>"; };
FA322D080CEF74B1001761B3 /* parse.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = parse.c; sourceTree = "<group>"; };
FA322D090CEF74B1001761B3 /* parse.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = parse.h; sourceTree = "<group>"; };
FA322D0A0CEF74B1001761B3 /* rendezvous.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = rendezvous.c; sourceTree = "<group>"; };
FA322D0B0CEF74B1001761B3 /* rendezvous.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = rendezvous.h; sourceTree = "<group>"; };
FA322D0C0CEF74B1001761B3 /* resolve.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = resolve.c; sourceTree = "<group>"; };
FA322D0D0CEF74B1001761B3 /* resolve.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = resolve.h; sourceTree = "<group>"; };
FA322D100CEF74B1001761B3 /* ansi2knr.1 */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.man; path = ansi2knr.1; sourceTree = "<group>"; };
@@ -177,14 +181,12 @@
FA322D9E0CEF752C001761B3 /* README-AUX.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "README-AUX.txt"; sourceTree = "<group>"; };
FA322D9F0CEF752C001761B3 /* README-BeOS.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "README-BeOS.txt"; sourceTree = "<group>"; };
FA322DA00CEF752C001761B3 /* RFC.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = RFC.txt; sourceTree = "<group>"; };
FA322DA10CEF752C001761B3 /* sample-ngircd.conf */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "sample-ngircd.conf"; sourceTree = "<group>"; };
FA322DA40CEF752C001761B3 /* Doxyfile */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Doxyfile; sourceTree = "<group>"; };
FA322DA50CEF752C001761B3 /* footer.inc.html */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.html; path = footer.inc.html; sourceTree = "<group>"; };
FA322DA60CEF752C001761B3 /* header.inc.html */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.html; path = header.inc.html; sourceTree = "<group>"; };
FA322DA70CEF752C001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
FA322DA80CEF752C001761B3 /* ngircd-doc.css */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.css; path = "ngircd-doc.css"; sourceTree = "<group>"; };
FA322DA90CEF752C001761B3 /* SSL.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = SSL.txt; sourceTree = "<group>"; };
FA322DAA0CEF752C001761B3 /* Zeroconf.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Zeroconf.txt; sourceTree = "<group>"; };
FA322DAD0CEF7538001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
FA322DAE0CEF7538001761B3 /* ngircd.8.tmpl */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = ngircd.8.tmpl; sourceTree = "<group>"; };
FA322DAF0CEF7538001761B3 /* ngircd.conf.5.tmpl */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = ngircd.conf.5.tmpl; sourceTree = "<group>"; };
@@ -194,8 +196,11 @@
FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = ng_ipaddr.c; path = ipaddr/ng_ipaddr.c; sourceTree = "<group>"; };
FA407F2D0DB159F400271AF1 /* ng_ipaddr.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = ng_ipaddr.h; path = ipaddr/ng_ipaddr.h; sourceTree = "<group>"; };
FA407F380DB15AC700271AF1 /* GIT.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = GIT.txt; sourceTree = "<group>"; };
FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "sample-ngircd.conf.tmpl"; sourceTree = "<group>"; };
FA85178A0FA061EC006A1F5A /* op.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = op.h; sourceTree = "<group>"; };
FA85178B0FA061EC006A1F5A /* op.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = op.c; sourceTree = "<group>"; };
FA99428A10E82A27007F27ED /* proc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = proc.h; sourceTree = "<group>"; };
FA99428B10E82A27007F27ED /* proc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = proc.c; sourceTree = "<group>"; };
FAA3D2700F139CB300B2447E /* invite-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "invite-test.e"; sourceTree = "<group>"; };
FAA3D2710F139CB300B2447E /* join-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "join-test.e"; sourceTree = "<group>"; };
FAA3D2720F139CB300B2447E /* kick-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "kick-test.e"; sourceTree = "<group>"; };
@@ -218,6 +223,8 @@
FAA3D2880F139D2E00B2447E /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
FAA3D28A0F139D2E00B2447E /* postinstall.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = postinstall.sh; sourceTree = "<group>"; };
FAA3D28B0F139D2E00B2447E /* preinstall.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = preinstall.sh; sourceTree = "<group>"; };
FAA97C55124A271400D5BBA9 /* sighandlers.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = sighandlers.c; sourceTree = "<group>"; };
FAA97C56124A271400D5BBA9 /* sighandlers.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = sighandlers.h; sourceTree = "<group>"; };
FAE5CC2C0CF2308A007D69B6 /* numeric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = numeric.h; sourceTree = "<group>"; };
FAE5CC2D0CF2308A007D69B6 /* numeric.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = numeric.c; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -228,6 +235,7 @@
buildActionMask = 2147483647;
files = (
FA322DC10CEF77CB001761B3 /* libz.dylib in Frameworks */,
FA2D567B11EA1AB300D37A35 /* libpam.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -254,6 +262,7 @@
FA322D630CEF750F001761B3 /* Makefile.am */,
1AB674ADFE9D54B511CA2CBB /* Products */,
FA322DC00CEF77CB001761B3 /* libz.dylib */,
FA2D567A11EA1AB300D37A35 /* libpam.dylib */,
);
name = ngIRCd;
sourceTree = "<group>";
@@ -335,14 +344,18 @@
FA322D070CEF74B1001761B3 /* ngircd.h */,
FAE5CC2D0CF2308A007D69B6 /* numeric.c */,
FAE5CC2C0CF2308A007D69B6 /* numeric.h */,
FA85178A0FA061EC006A1F5A /* op.h */,
FA85178B0FA061EC006A1F5A /* op.c */,
FA85178A0FA061EC006A1F5A /* op.h */,
FA322D080CEF74B1001761B3 /* parse.c */,
FA322D090CEF74B1001761B3 /* parse.h */,
FA322D0A0CEF74B1001761B3 /* rendezvous.c */,
FA322D0B0CEF74B1001761B3 /* rendezvous.h */,
FA99428B10E82A27007F27ED /* proc.c */,
FA99428A10E82A27007F27ED /* proc.h */,
FA322D0C0CEF74B1001761B3 /* resolve.c */,
FA322D0D0CEF74B1001761B3 /* resolve.h */,
FAA97C55124A271400D5BBA9 /* sighandlers.c */,
FAA97C56124A271400D5BBA9 /* sighandlers.h */,
FA2D564811EA158B00D37A35 /* pam.h */,
FA2D564911EA158B00D37A35 /* pam.c */,
);
path = ngircd;
sourceTree = "<group>";
@@ -548,10 +561,9 @@
FA322D9E0CEF752C001761B3 /* README-AUX.txt */,
FA322D9F0CEF752C001761B3 /* README-BeOS.txt */,
FA322DA00CEF752C001761B3 /* RFC.txt */,
FA322DA10CEF752C001761B3 /* sample-ngircd.conf */,
FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */,
FA322DA20CEF752C001761B3 /* src */,
FA322DA90CEF752C001761B3 /* SSL.txt */,
FA322DAA0CEF752C001761B3 /* Zeroconf.txt */,
);
name = doc;
path = ../../doc;
@@ -631,7 +643,14 @@
isa = PBXProject;
buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "ngIRCd" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 08FB7794FE84155DC02AAC07 /* ngIRCd */;
projectDirPath = "";
projectReferences = (
@@ -675,13 +694,15 @@
FA322D490CEF74B1001761B3 /* match.c in Sources */,
FA322D4A0CEF74B1001761B3 /* ngircd.c in Sources */,
FA322D4B0CEF74B1001761B3 /* parse.c in Sources */,
FA322D4C0CEF74B1001761B3 /* rendezvous.c in Sources */,
FA322D4D0CEF74B1001761B3 /* resolve.c in Sources */,
FA322DBE0CEF7766001761B3 /* tool.c in Sources */,
FAE5CC2E0CF2308A007D69B6 /* numeric.c in Sources */,
FA407F2E0DB159F400271AF1 /* ng_ipaddr.c in Sources */,
FAA3D27B0F139CDC00B2447E /* conn-ssl.c in Sources */,
FA85178C0FA061EC006A1F5A /* op.c in Sources */,
FA99428C10E82A27007F27ED /* proc.c in Sources */,
FA2D564A11EA158B00D37A35 /* pam.c in Sources */,
FAA97C57124A271400D5BBA9 /* sighandlers.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -711,7 +732,6 @@
GCC_WARN_UNUSED_VALUE = YES;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = ngIRCd;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
};
name = Default;
};
@@ -724,22 +744,22 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Default;
};
FAB0570C105D917F006AF9E2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
GCC_DEBUGGING_SYMBOLS = full;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = 4.0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
SDKROOT = "";
};
name = Debug;
};
@@ -766,7 +786,6 @@
GCC_WARN_UNUSED_VALUE = YES;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = ngIRCd;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
};
name = Debug;
};

View File

@@ -19,6 +19,20 @@ else
fi
chmod o-rwx /opt/ngircd/etc/ngircd.conf
if [ ! -e /opt/ngircd/etc/ngircd.pam ]; then
echo "Creating default PAM configuration: /opt/ngircd/etc/ngircd.pam"
echo "# PAM configuration for ngIRCd" >/opt/ngircd/etc/ngircd.pam
echo "" >>/opt/ngircd/etc/ngircd.pam
echo "auth required pam_permit.so" >>/opt/ngircd/etc/ngircd.pam
echo "#auth required pam_opendirectory.so" >>/opt/ngircd/etc/ngircd.pam
fi
chmod 644 /opt/ngircd/etc/ngircd.pam
if [ ! -e /etc/pam.d/ngircd ]; then
echo "Linkint /opt/ngircd/etc/ngircd.pam to /etc/pam.d/ngircd"
ln -s /opt/ngircd/etc/ngircd.pam /etc/pam.d/ngircd || exit 1
fi
if [ -f "$LDPLIST" ]; then
echo "Fixing ownership and permissions of LaunchDaemon script ..."
chown root:wheel "$LDPLIST" || exit 1

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
# Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -9,10 +9,10 @@
# Please read the file COPYING, README and AUTHORS for more information.
#
SUBDIRS = Debian MacOSX
SUBDIRS = Anope Debian MacOSX
EXTRA_DIST = README ngircd.spec systrace.policy ngindent ngircd-bsd.sh \
ngircd-redhat.init platformtest.sh
ngIRCd-Logo.gif ngircd-redhat.init platformtest.sh
maintainer-clean-local:
rm -f Makefile Makefile.in

View File

@@ -1,15 +1,17 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2009 Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- Contributions --
Anope/
- A preliminary patch that adds a ngIRCd protocol module to Anope 1.9.
Debian/
- Various files for building Debian GNU/Linux packages (".deb's").

BIN
contrib/ngIRCd-Logo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1,7 +1,7 @@
#!/bin/sh
#
# ngIRCd start and stop script for RedHat based distributions.
# Written by Naoya Nakazawa <naoya@sanow.net> for CentOS 5.2, 2009.
# Written by Naoya Nakazawa <naoya.n@gmail.com> for CentOS 5.2, 2009.
#
# chkconfig: 2345 01
# description: ngIRCd is an Open Source server for \

View File

@@ -1,5 +1,5 @@
%define name ngircd
%define version 16
%define version 18
%define release 1
%define prefix %{_prefix}

View File

@@ -1,7 +1,7 @@
#!/bin/sh
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2009 Alexander Barton <alex@barton.de>
# Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -51,16 +51,16 @@ if [ $? -ne 0 ]; then
cd ..
fi
echo "$NAME: Checking for ./configure script ..."
if [ ! -e ./configure ]; then
echo "$NAME: Not found. Running ./autogen.sh ..."
echo "$NAME: Checking for \"./autogen.sh\" script ..."
if [ -r ./autogen.sh ]; then
echo "$NAME: Running \"./autogen.sh\" ..."
[ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null
fi
if [ -e ./configure ]; then
if [ -r ./configure ]; then
echo "$NAME: Running \"./configure\" script ..."
[ -n "$VERBOSE" ] && ./configure || ./configure >/dev/null
if [ $? -eq 0 -a -e ./Makefile ]; then
if [ $? -eq 0 -a -r ./Makefile ]; then
CONFIGURE=1
echo "$NAME: Running \"make\" ..."
[ -n "$VERBOSE" ] && make || make >/dev/null
@@ -93,22 +93,29 @@ fi
# Get compiler information
if [ -r "Makefile" ]; then
eval $(grep "^CC = " Makefile | sed -e 's/ //g')
CC=$(grep "^CC = " Makefile | cut -d' ' -f3)
$CC --version 2>&1 | grep -i "GCC" >/dev/null
if [ $? -eq 0 ]; then
COMPILER=$($CC --version | head -n 1 | awk "{ print \$3 }" \
| cut -d'-' -f1)
COMPILER=$($CC --version | head -1 \
| cut -d')' -f2 | cut -d' ' -f2)
COMPILER="gcc $COMPILER"
else
case "$CC" in
gcc*)
v="`$CC --version 2>/dev/null | head -1`"
[ -n "$v" ] && COMPILER="gcc $v"
;;
esac
fi
fi
# Get ngIRCd version information
if [ -d ".git" ]; then
VERSION=`git log --abbrev-commit --pretty=oneline HEAD~1.. \
| head -1 | cut -d' ' -f1 | tr -d '.'`
elif [ -r "Makefile" ]; then
eval $(grep "^VERSION = " Makefile | sed -e 's/ //g')
fi
eval $(grep "^VERSION = " Makefile | sed -e 's/ //g')
case "$VERSION" in
*-*-*)
VERSION=`echo "$VERSION" | cut -d'-' -f3 | cut -b2-`
;;
esac
[ -n "$VERSION" ] || VERSION="unknown"
# Get IO interface information
@@ -137,7 +144,13 @@ echo " ./configure works --+ | |
echo " | | | |"
echo "Platform Compiler ngIRCd Date Tester C M T R See"
echo "--------------------------- ------------ ---------- -------- ------ - - - - ---"
printf "%-27s %-12s %-10s %s %-6s %s %s %s %s%s" \
"$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$USER" \
"$C" "$M" "$T" "$R" "$COMMENT"
type printf >/dev/null 2>&1
if [ $? -eq 0 ]; then
printf "%-27s %-12s %-10s %s %-6s %s %s %s %s%s" \
"$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$USER" \
"$C" "$M" "$T" "$R" "$COMMENT"
else
echo "$PLATFORM $COMPILER $VERSION $DATE $USER" \
"$C" "$M" "$T" "$R" "$COMMENT"
fi
echo; echo

1
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
sample-ngircd.conf

53
doc/Bopm.txt Normal file
View File

@@ -0,0 +1,53 @@
ngIRCd - Next Generation IRC Server
(c)2001-2010 Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- BOPM.txt --
I. Introduction
~~~~~~~~~~~~~~~~
Citing <http://wiki.blitzed.org/BOPM>: "BOPM is an open source open proxy
monitor, designed for use with hybrid-based ircds, although it can be used
with slight modification on any server which has the ability to show connects
to opers and that supports KLINEs."
And starting with Release 17, ngIRCd supports all required log messages that
BOPM requires to be useful.
II. Installation
~~~~~~~~~~~~~~~~~
Install BOPM as usual, please see the BOPM documentation for details.
Afterwards adjust the following configuration parameters that are important
for ngIRCd:
a) BOPM "IRC" section:
1) Set "server" and "port" accordingly,
2) adjust the "oper" line to match an [Operator] block in ngircd.conf,
3) change "mode" to "+ci" or "+c".
4) Set "connregex" to the following string, everything in one line(!):
"\\*\\*\\* Notice -- Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*";
and comment all the other "connregex" examples (prepend a "#" character).
5) Set "kline" to "KILL %n :Open proxy found on your host!"; for example,
and comment all the other "kline" examples.
b) BOPM "scanner" section:
Make sure you configure a valid "target_ip" and "target_port" for the
configured scanners to test. And please note that you CAN'T USE the port
of ngIRCd, because ngIRCd doesn't send any banner message by default!
So you need a service what sends a banner, so for example POP3, SMTP,
IMAP, or SSH daemons should work ...

54
doc/Contributing.txt Normal file
View File

@@ -0,0 +1,54 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- Contributing.txt --
If you want to contribute to ngIRCd, please read the following paragraphs to
get an idea of how to do it the best :-)
- Use GIT
The source code of ngIRCd is maintained using GIT, see doc/GIT.txt. So if
remotely possible, use GIT for your work, too. It makes your and our lifes
much easier ;-)
- Don't forget to include documentation
When adding features and new configuration options, don't forget to not
only code the features but to describe them in doc/sample-ngircd.conf,
man/ngircd.8.tmp and/or man/ngircd.conf.5.tmpl as well!
- Be present on IRC
If you intend to code some new features or do some code cleanups or better
documentation, please be present on <irc://irc.barton.de/#ngircd> and
discuss your plans early! So other developers have an idea on what others
are working on, can offer help, and can synchronize their own work.
- Check and validate your work!
Use "make check" to validate your work, and use "make distcheck" to
validate the resulting archives, especially when adding/removing files!
- Send patches in "unified diff" format
Please send patches in "unified" format, that is, use "diff -u".
Or even better: use GIT ("git diff"), see above.
- Send patches to the mailing list
If you have some code to present, send the patch(es) and/or pointers to
your GIT repository to the official ngIRCd mailing list for review, not
only to #ngircd: so it becomes archived and more people have a chance to
review your patch.
Sure it is a good idea to post some notes to #ngircd, too! :-)
And this is open source, your work must not be 100% finished and perfect,
work in progress is interesting, too: "release early, release often"!

View File

@@ -1,7 +1,7 @@
ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton,
(c)2001-2010 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
@@ -12,9 +12,11 @@
I. General
~~~~~~~~~~
Q: Is it possible to link the ngIRCd with non-ngIRCd servers?
A: Yes. ngIRCd is compatible to the original ircd used by IRCNet. Actually
this is being tested with version 2.10.3p3.
this is being tested with version 2.10.3p3. Please note that newer
versions (2.11.x) aren't compatible any more!
Q: Is there a homepage with further information and downloads?
A: Yes. Please visit <http://ngircd.barton.de/>.
@@ -26,6 +28,7 @@ A: ngIRCd offers several benefits: no problems with dynamic IPs, easy to
II. Compilation
~~~~~~~~~~~~~~~
Q: I did a "CVS checkout" but can't execute ./configure because the script
is missing in the generated directory!?
A: When using development versions via CVS, the configure script as well as
@@ -55,27 +58,33 @@ III. Runtime
~~~~~~~~~~~~
Q: Where is the log file located?
A: ngIRCd does not write its own log file. Instead, ngIRCd uses
syslog(3). Check the files in /var/log/ and/or consult the
documentation for your system logger daemon.
A: ngIRCd does not write its own log file. Instead, ngIRCd uses syslog(3).
Check the files in /var/log/ and/or consult the documentation for your
system logger daemon.
Q: I cannot connect to remote peers when I use the chroot option, the
following is logged: "Can't resolve example.com: unknown error!".
A: On Linux/glibc with chroot enabled you need to put some libraries inside
the chroot as well, notably libnss_dns; maybe others. Unfortunately, even
linking ngircd statically does not help this. The only known workaround
linking ngIRCd statically does not help this. The only known workaround
is to either disable chroot support or to link against dietlibc instead
of glibc. (tnx to Sebastian Siewior)
Q: I have added an [Oper] section, how do i log on as IRC operator?
A: You can use the /OPER command in your IRC client to become an IRC operator.
ngIRCd will also log all OPER requests (using syslog), if OPER fails you
can look there to determine why it did not work (bad password, unauthorized
host mask, etc.)
Q: I am an IRC operator, but MODE doesn't work!
A: You need to set 'OperCanUseMode = yes' in ngircd.conf to enable MODE for IRC
operators.
A: You need to set 'OperCanUseMode = yes' in ngircd.conf, then IRC operators
can use the MODE command for changing modes even when they are not joined
to the specific channel.
IV. Bugs!?
~~~~~~~~~~
Q: Is there a list of known bugs and desired feature enhancements?
A: Yes. Have a look at the bug tracking system (Bugzilla) for ngIRCd located
at <http://ngircd.barton.de/bugzilla/index.cgi>. There you can file bug
@@ -85,6 +94,3 @@ Q: What should I do if I found a bug?
A: Please file a bug report at <http://ngircd.barton.de/bugzilla/index.cgi>!
The author of the particular component will be notified automagically :-)
--
$Id: FAQ.txt,v 1.12 2008/01/02 22:47:58 alex Exp $

View File

@@ -1,10 +1,18 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- GIT.txt --
The source code of ngIRCd is maintained using git, the stupid content
tracker.
I. Getting the source code
~~~~~~~~~~~~~~~~~~~~~~~~~~
To access the source tree anonymously, run:
@@ -20,7 +28,8 @@ git commands will be executed from within this directory in the future.
Please note: When checking out a fresh copy of ngIRCd using git, the
configure script doesn't exist; you have to run the autogen.sh shell script
(which is included in the source tree) to generate it. This requires you to
have GNU automake and GNU autoconf installed on your system.
have GNU automake and GNU autoconf installed on your system. Please see the
file INSTALL for details!
To update the git tree:
@@ -28,6 +37,7 @@ To update the git tree:
This retrieves all changes and merges them into the current branch.
II. Contributing
~~~~~~~~~~~~~~~~
@@ -42,4 +52,3 @@ III. Write Access
~~~~~~~~~~~~~~~~~
If you want to contribute a couple of patches and write access to the git
repository would be handy, please contact Alex Barton, <alex@barton.de>.

77
doc/HowToRelease.txt Normal file
View File

@@ -0,0 +1,77 @@
ngIRCd - Next Generation IRC Server
(c)2001-2010 Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- HowToRelease.txt --
I. Introduction
~~~~~~~~~~~~~~~
Creating a new ngIRCd release requires a few steps to follow: the source
tree must be in a releasable state (be up to date, include all required
patches, be tested on as many platforms as possible), a name for the new
release must be chosen, and all the files describing the release must be
updated accordingly.
Since ngIRCd release 13 (2009-12-25) we use "simple" release numbers for
major releases (e.g. "13", "17", "42", ...) introducing new features and
sub-releases for bug fixes only (e.g. "14.1", "22.3", ...).
When creating pre-releases or release candidates, please use the tilde ("~")
character to separate the "postfix" in the release number (e.g. "17~rc2"
or "123.4~rc6").
The release/version number of a build is automatically generated using the
GIT "describe" command, see git-describe(1). Therefore it is required that
a new release is tagged in the GIT tree and that the configure script is
up-to-date (e.g. using ./autogen.sh) before generating the archives!
II. How to prepare a new ngIRCd release?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a) Make sure the source tree is in a releasable state ;-)
b) Make sure you have working versions of GNU autoconf and GNU automake
installed on the system you use for generating the release:
as of October 2010 we are using GNU autoconf 2.61 and GNU automake 1.10.1
which seem to work just fine.
c) Update the files describing the new release:
- ChangeLog
- NEWS
d) Update the version numbers in the following files:
- contrib/ngircd.spec
e) Generate a new Debian change log entry in the following file, e.g. using
the Debian "dch" tool of the "devscripts" package:
- contrib/Debian/changelog
f) Commit the above changes to GIT: "git add", "git commit"
g) Create a new signed GIT tag for the new release: "git tag -s".
Please note that we don't use the tilde ("~") here, instead use a simple
hyphen ("-") as delimiter: e.g. "rel-16" "rel-17-rc1", "rel-18-pre2", ...
h) Run "./autogen.sh" to update the ./configure script with the correct
release number (autogenerated using "git describe", see above).
i) Run "./configure" to rebuild all generated Makefiles.
j) Run "make distcheck" to generate the distribution archives.
k) Sign the distribution archive(s) using GnuPG: "gpg -b <archivefile>"
l) Upload and distribute the newly generated ngIRCd release archive(s)
and GnuPG signatures.
m) Write an announcement to the mailing list, freshmeat, Twitter, ...
n) Relax :-)

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
# Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
#
# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
# der GNU General Public License (GPL), wie von der Free Software Foundation
@@ -10,29 +10,46 @@
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
#
.tmpl:
sed \
-e s@:ETCDIR:@${sysconfdir}@ \
<$< >$@
SUFFIXES = .tmpl
static_docs = Bopm.txt FAQ.txt GIT.txt HowToRelease.txt PAM.txt Platforms.txt \
Protocol.txt README-AUX.txt README-BeOS.txt README-Interix.txt RFC.txt \
SSL.txt Services.txt
doc_templates = sample-ngircd.conf.tmpl
generated_docs = sample-ngircd.conf
toplevel_docs = ../AUTHORS ../COPYING ../ChangeLog ../INSTALL ../NEWS ../README
SUBDIRS = src
EXTRA_DIST = FAQ.txt GIT.txt Protocol.txt Platforms.txt README-AUX.txt \
README-BeOS.txt RFC.txt Services.txt SSL.txt Zeroconf.txt \
sample-ngircd.conf
EXTRA_DIST = $(static_docs) $(doc_templates)
CLEANFILES = $(generated_docs)
maintainer-clean-local:
rm -f Makefile Makefile.in
docdir = $(datadir)/doc/$(PACKAGE)
all: $(generated_docs)
documents = $(EXTRA_DIST) ../AUTHORS ../COPYING ../ChangeLog ../INSTALL \
../NEWS ../README
install-data-hook:
install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs)
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \
$(INSTALL) -m 600 -c $(srcdir)/sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
$(INSTALL) -m 600 -c sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
fi
$(mkinstalldirs) $(DESTDIR)$(docdir)
for f in $(documents); do \
for f in $(static_docs) $(toplevel_docs); do \
$(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/; \
done
for f in $(generated_docs); do \
$(INSTALL) -m 644 -c $$f $(DESTDIR)$(docdir)/; \
done
uninstall-hook:
rm -rf $(DESTDIR)$(docdir)

36
doc/PAM.txt Normal file
View File

@@ -0,0 +1,36 @@
ngIRCd - Next Generation IRC Server
(c)2001-2010 Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- PAM.txt --
ngIRCd can optionally be compiled to use PAM, the Pluggable Authentication
Modules library, for user authentication. When compiled with PAM support,
ngIRCd will authenticate all users connecting to the daemon using the
configured PAM modules in an asynchronous child process.
To enable PAM, you have to pass the command line parameter "--with-pam" to
the "configure" script. Please see the PAM documentation ("man 7 pam") for
details and information about configuring PAM and its individual modules.
A very simple -- and quite useless ;-) -- example would be:
/etc/pam.d/ngircd:
auth required pam_debug.so
Here the "pam_debug" module will be called each time a client connects to
the ngIRCd and has sent its PASS, NICK, and USER commands.
Please note ONE VERY IMPORTANT THING:
All the PAM modules are executed with the privileges of the user ngIRCd
is running as. Therefore a lot of PAM modules aren't working as expected,
because they need root privileges ("pam_unix", for example)!
Only PAM modules not(!) requiring root privileges (such as "pam_pgsql",
"pam_mysql", "pam_opendirectory" ...) can be used in conjunction with ngIRCd.

View File

@@ -1,9 +1,8 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2010 Alexander Barton
alex@barton.de, http://www.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
@@ -32,44 +31,45 @@ hppa1.1/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
hppa2.0/unknown/linux-gnu gcc 3.3.5 13~rc1 08-12-02 alex Y Y Y Y
hppa2.0w-hp-hpux11.11 gcc 4.2.3 14.1 09-07-22 goetz Y Y Y Y
i386/apple/darwin9.7.0 gcc 4.0.1 14.1 09-08-04 alex Y Y Y Y (3)
i386/apple/darwin10.3.0 gcc 4.2.1 16 10-04-23 alex Y Y Y Y (3)
i386/apple/darwin10.7.0 gcc 4.2.1 18 11-07-05 alex Y Y Y Y (3)
i386/apple/darwin11.0.0 gcc 4.2.1 18 11-07-02 alex Y Y Y Y (3)
i386/pc/solaris2.9 gcc 3.2.2 CVSHEAD 04-02-24 alex Y Y Y Y
i386/pc/solaris2.11 gcc 3.4.3 14.1 09-08-03 alex Y Y Y Y (4)
i386/pc/solaris2.11 gcc 3.4.3 18 11-07-10 alex Y Y N Y (4)
i386/unknown/freebsd5.2.1 gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
i386/unknown/freebsd6.0 gcc 3.4.4 0.10.0-p1 06-08-04 alex Y Y Y Y (3)
i386/unknown/freebsd6.1 gcc 3.4.4 CVSHEAD 06-05-07 fw Y Y Y Y (3)
i386/unknown/freebsd6.2 gcc 3.4.6 16 10-04-11 alex Y Y Y Y (3)
i386/unknown/freebsd7.0 gcc 4.2.1 14.1 09-07-28 alex Y Y Y Y (3)
i386/unknown/freebsd7.2 gcc 4.2.1 14.1 09-08-03 alex Y Y Y Y (3)
i386/unknown/freebsd7.3 gcc 4.2.1 16 10-04-11 alex Y Y Y Y (3)
i386/unknown/gnu0.3 gcc 3.3.3 0.8.0 04-05-30 alex Y Y n Y
i686/unknown/gnu0.3 gcc 4.3.1 14.1 09-07-28 alex Y Y Y Y
i386/unknown/freebsd6.2 gcc 3.4.6 18 11-07-10 alex Y Y Y Y (3)
i386/unknown/freebsd7.3 gcc 4.2.1 18 11-07-1ß alex Y Y Y Y (3)
i686/unknown/gnu0.3 gcc 4.4.5 18 11-07-10 alex Y Y Y Y
i686/unkn./kfreebsd7.2-gnu gcc 4.3.4 15 09-12-02 alex Y Y Y Y (3)
i386/unknown/netbsdelf1.6.1 gcc 2.95.3 CVSHEAD 04-02-24 alex Y Y Y Y
i386/unknown/netbsdelf1.6.2 gcc 2.95.3 18 11-07-10 goetz Y Y Y Y
i386/unknown/netbsdelf3.0.1 gcc 3.3.3 0.10.0-p1 06-08-30 alex Y Y Y Y (3)
i386/unknown/netbsdelf4.0 gcc 4.1.2 16 10-04-11 alex Y Y Y Y (3)
i386/unknown/netbsdelf4.0 gcc 4.1.2 18 11-07-10 alex Y Y Y Y (3)
i386/unknown/netbsdelf5.0.2 gcc 4.1.3 18 11-07-10 alex Y Y Y Y (3)
i386/unknown/openbsd3.9 gcc 3.3.5 0.10.0-p1 06-08-30 alex Y Y Y Y (3)
i386/unknown/openbsd4.1 gcc 3.3.5 16 10-04-11 alex Y Y Y Y (3)
i586/pc/interix3.5 gcc 3.3 15 10-01-22 alex Y Y N Y
i686/pc/cygwin gcc 3.3.1 0.8.0 04-05-30 alex Y Y n Y
i586/pc/interix3.5 gcc 3.3 18 11-07-10 alex Y Y N Y
i686/pc/cygwin gcc 3.3.1 0.8.0 04-05-30 alex Y Y N Y
i686/pc/linux-gnu gcc 2.95.4 0.8.0 04-05-30 alex Y Y Y Y (1)
i686/pc/linux-gnu gcc 3.3.5 14.1 09-08-04 alex Y Y Y Y (1)
i386/pc/linux-gnu gcc 4.1.2 13~rc1 08-12-05 alex Y Y Y Y (1)
i686/pc/linux-gnu gcc 4.3.2 14.1 09-08-04 alex Y Y Y Y (1)
m68k/apple/aux3.1.1 Orig. A/UX 0.7.x-CVS 03-04-22 alex Y Y Y Y (2)
m68k/apple/aux3.0.1 gcc 2.7.2 17 10-11-07 alex Y Y N Y
m68k/apple/aux3.0.1 Orig. A/UX 17 10-11-07 alex Y Y N Y (2)
m68k/apple/aux3.1.1 gcc 2.7.2 18 11-07-02 alex Y Y N Y
m68k/apple/aux3.1.1 Orig. A/UX 18 11-07-02 alex Y Y N Y (2)
m68k/hp/hp-ux9.10 Orig. HPUX 0.7.x-CVS 03-04-30 goetz Y Y Y Y
m88k/dg/dgux5.4R3.10 gcc 2.5.8 CVSHEAD 04-03-15 alex Y Y ? ?
mipsel/unknown/linux-gnu gcc 4.1.2 18 11-07-05 goetz Y Y N Y (1)
powerpc/apple/darwin6.5 gcc 3.1 0.7.x-CVS 03-04-23 alex Y Y Y Y
powerpc/apple/darwin7.4.0 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
powerpc/apple/darwin7.9.0 gcc 3.3 CVSHEAD 06-05-07 fw Y Y Y Y (3)
powerpc/apple/darwin8.1.0 gcc 4.0 0.9.x-CVS 05-06-27 alex Y Y Y Y
powerpc/apple/darwin8.11.0 gcc 4.0.1 18 11-07-02 goetz Y Y Y Y (3)
powerpc/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
powerpc/unknown/openbsd3.6 gcc 2.95.3 0.10.0 06-10-08 alex Y Y n Y
powerpc/unknown/openbsd3.6 gcc 2.95.3 0.10.0 06-10-08 alex Y Y N Y
sparc/sun/solaris2.6 gcc 2.95.3 0.7.x-CVS 03-04-22 alex Y Y Y Y
sparc/sun/solaris2.7 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
sparc/unkn./netbsdelf1.6.1 gcc 2.95.3 0.8.0 04-05-30 alex Y Y Y Y
x86_64/unknown/freebsd8.0 gcc 4.2.1 16 10-04-23 alex Y Y Y Y (3)
x86_64/unknown/linux-gnu gcc 4.3.2 16 10-04-23 alex Y Y Y Y (1)
x86_64/unknown/freebsd8.1 gcc 4.2.1 18 11-07-10 alex Y Y Y Y (3)
x86_64/unknown/linux-gnu gcc 4.4.5 18 11-07-02 alex Y Y Y Y (1)
x86_64/unknown/openbsd4.7 gcc 3.3.5 18 11-07-10 alex Y Y Y Y (3)
Notes

View File

@@ -141,11 +141,17 @@ therefore to disconnect the peer prior to registering it in the network.
II.3 Exchange channel-modes, topics, and persistent channels
Command: CHANINFO
Parameters: <channel> +<modes> <key> <limit> [<topic>]
Parameters: <channel> +<modes> [[<key> <limit>] <topic>]
Used by: servers only
CHANINFO is used by servers to inform each other about a channel: its
modes, channel key, user limits and its topic. <topic> is optional.
modes, channel key, user limits and its topic. The parameter combination
<key> and <limit> is optional, as well as the <topic> parameter, so that
there are three possible forms of this command:
CHANINFO <channel> +<modes>
CHANINFO <channel> +<modes> <topic>
CHANINFO <channel> +<modes> <key> <limit> <topic>
If the channel already exists on the server receiving the CHANINFO command,
it only adopts the <modes> (or the <topic>) if there are no modes (or topic)
@@ -161,3 +167,17 @@ and therefore can't be omitted. The parameter <limit> must be ignored when
a channel has no user limit (the parameter <modes> doesn't list the "l"
channel mode). In this case <limit> should be "0".
II.4 Update webchat/proxy client information
Command: WEBIRC
Parameters: <password> <username> <hostname> <ip-address>
Used by: unregistered clients only
The WEBIRC command is used by some Web-to-IRC gateways to set the correct
user name and host name of users instead of their own. It must be the very
first command sent to the server, even before USER and NICK commands!
The <password> must be set in the server configuration file to prevent
unauthorized clients to fake their identity; it is an arbitrary string.

View File

@@ -34,7 +34,7 @@ possible to handle unencrypted and encrypted connections on the same port!
This is a limitation of the IRC protocol ...
You have to set (at least) the following configuration variables in the
[GLOBAL] section of ngircd.conf(5): SSLPorts, SSLKeyFile, and SSLCertFile.
[SSL] section of ngircd.conf(5): Ports, KeyFile, and CertFile.
Now IRC clients are able to connect using SSL on the configured port(s).
(Using port 6697 for encrypted connections is common.)
@@ -51,7 +51,7 @@ OpenSSL:
Creating a self-signed certificate and key:
$ openssl req -newkey rsa:2048 -x509 -keyout server-key.pem -out server-cert.pem -days 1461
Create DH parameters (optional):
$ openssl dhparam -2 -out dhparams.pem 2048
$ openssl dhparam -2 -out dhparams.pem 4096
GnuTLS:
@@ -59,7 +59,7 @@ Creating a self-signed certificate and key:
$ certtool --generate-privkey --bits 2048 --outfile server-key.pem
$ certtool --generate-self-signed --load-privkey server-key.pem --outfile server-cert.pem
Create DH parameters (optional):
$ certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
$ certtool --generate-dh-params --bits 4096 --outfile dhparams.pem
Alternate approach using stunnel(1)

View File

@@ -1,9 +1,8 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
(c)2001-2008 Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001-2011 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
@@ -14,9 +13,11 @@ At the moment, ngIRCd doesn't implement a "special IRC services interface".
But services acting as a "regular server" are supported, either using the IRC
protocol defined in RFC 1459 or RFC 2812.
Services have been tested using "IRC Services" version 5.x by Andrew Church,
homepage: <http://www.ircservices.za.net/>. This document describes setting up
ngIRCd and these services.
Support for Services has been tested using "IRC Services" version 5.x by
Andrew Church (<http://achurch.org/services/>), and a Anope 1.9 using a
preliminary protocol module for ngIRCd (<http://www.anope.org/>).
This document describes setting up ngIRCd and these services.
Setting up ngIRCd
@@ -36,6 +37,31 @@ Example:
ServiceMask = *Serv
Setting up Anope 1.9.x
~~~~~~~~~~~~~~~~~~~~~~
Anope 1.9.4 (and above) can be used with ngIRCd using a preliminary "ngircd"
protocol module contained in our contrib/Anope/ directory. Please see the
file contrib/Anope/README for installation instructions!
After patching and installing Anope, at least the following configuration
variables have to be adjusted in data/services.conf, in addition to all the
settings marked as required:
uplink
{
host = "server.irc.net"
port = 6667
password = "123abc"
}
serverinfo
{
name = "services.irc.net"
type = "ngircd"
}
Setting up IRC Services 5.1.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -66,5 +92,6 @@ In modules.conf:
The documentation of IRC Services can be found here:
<http://www.ircservices.za.net/docs/>
Please let us know if you are successfully using other IRC service packages or
which problems you encounter, thanks!

View File

@@ -1,40 +0,0 @@
ngIRCd - Next Generation IRC Server
(c)2001-2006 Alexander Barton
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- Zeroconf.txt --
ngIRCd supports one aspect of Zeroconf Networking[1]: Multicast DNS (mDNS[2])
with DNS Service Discovery (DNS-SD[3]).
To use this features you can use one of two APIs:
a) Apple "Bonjour" API as used by Mac OS X,
b) the Howl[4] Zeroconf library or the Howl compatibility layer
of the newer Avahi[5] library.
When calling the configure script using the "--with-zeroconf" switch the
available API will be autodetected and the required additional libraries will
be linked to the ngircd binary as required.
ngIRCd then registers a DNS-SD service for each port it is listening on using
the service type "_ircu._tcp.".
Links:
[1] http://www.zeroconf.org/
[2] http://www.multicastdns.org/
[3] http://www.dns-sd.org/
[4] http://www.porchdogsoft.com/products/howl/
[5] http://avahi.org/
--
$Id: Zeroconf.txt,v 1.2 2006/08/03 14:37:29 alex Exp $

View File

@@ -12,57 +12,32 @@
# Use "ngircd --configtest" (see manual page ngircd(8)) to validate that the
# server interprets the configuration file as expected!
#
# Please see ngircd.conf(5) for a complete list of configuration options.
# Please see ngircd.conf(5) for a complete list of configuration options
# and their descriptions.
#
[Global]
# The [Global] section of this file is used to define the main
# configuration of the server, like the server name and the ports
# on which the server should be listening.
# These settings depend on your personal preferences, so you should
# make sure that they correspond to your installation and setup!
# Server name in the IRC network, must contain at least one dot
# (".") and be unique in the IRC network. Required!
Name = irc.the.net
# Info text of the server. This will be shown by WHOIS and
# LINKS requests for example.
Info = Server Info Text
# Global password for all users needed to connect to the server.
# (Default: not set)
;Password = abc
# Password required for using the WEBIRC command used by some
# Web-to-IRC gateways. If not set/empty, the WEBIRC command can't
# be used. (Default: not set)
;WebircPassword = xyz
Name = irc.example.net
# Information about the server and the administrator, used by the
# ADMIN command. Not required by server but by RFC!
;AdminInfo1 = Description
;AdminInfo2 = Location
;AdminEMail = admin@irc.server
# Ports on which the server should listen. There may be more than
# one port, separated with ",". (Default: 6667)
;Ports = 6667, 6668, 6669
# Additional Listen Ports that expect SSL/TLS encrypted connections
;SSLPorts = 6697, 9999
# Info text of the server. This will be shown by WHOIS and
# LINKS requests for example.
Info = Server Info Text
# SSL Server Key
;SSLKeyFile = /usr/local/etc/ngircd/ssl/server-key.pem
# password to decrypt SSLKeyFile (OpenSSL only)
;SSLKeyFilePassword = secret
# SSL Server Key Certificate
;SSLCertFile = /usr/local/etc/ngircd/ssl/server-cert.pem
# Diffie-Hellman parameters
;SSLDHFile = /usr/local/etc/ngircd/ssl/dhparams.pem
# comma separated list of IP addresses on which the server should
# Comma separated list of IP addresses on which the server should
# listen. Default values are:
# "0.0.0.0" or (if compiled with IPv6 support) "::,0.0.0.0"
# so the server listens on all IP addresses of the system by default.
@@ -70,12 +45,30 @@
# Text file with the "message of the day" (MOTD). This message will
# be shown to all users connecting to the server:
;MotdFile = /usr/local/etc/ngircd.motd
;MotdFile = :ETCDIR:/ngircd.motd
# A simple Phrase (<256 chars) if you don't want to use a motd file.
# If it is set no MotdFile will be read at all.
;MotdPhrase = "Hello world!"
# Global password for all users needed to connect to the server.
# (Default: not set)
;Password = abc
# This tells ngIRCd to write its current process ID to a file.
# Note that the pidfile is written AFTER chroot and switching the
# user ID, e.g. the directory the pidfile resides in must be
# writable by the ngIRCd user and exist in the chroot directory.
;PidFile = /var/run/ngircd/ngircd.pid
# Ports on which the server should listen. There may be more than
# one port, separated with ",". (Default: 6667)
;Ports = 6667, 6668, 6669
# Group ID under which the ngIRCd should run; you can use the name
# of the group or the numerical ID. ATTENTION: For this to work the
# server must have been started with root privileges!
;ServerGID = 65534
# User ID under which the server should run; you can use the name
# of the user or the numerical ID. ATTENTION: For this to work the
# server must have been started with root privileges! In addition,
@@ -83,62 +76,14 @@
# otherwise RESTART and REHASH won't work!
;ServerUID = 65534
# Group ID under which the ngircd should run; you can use the name
# of the group or the numerical ID. ATTENTION: For this to work the
# server must have been started with root privileges!
;ServerGID = 65534
# A directory to chroot in when everything is initialized. It
# doesn't need to be populated if ngIRCd is compiled as a static
# binary. By default ngIRCd won't use the chroot() feature.
# ATTENTION: For this to work the server must have been started
# with root privileges!
;ChrootDir = /var/empty
# This tells ngircd to write its current process id to a file.
# Note that the pidfile is written AFTER chroot and switching uid,
# i. e. the Directory the pidfile resides in must be writeable by
# the ngircd user and exist in the chroot directory.
;PidFile = /var/run/ngircd/ngircd.pid
# After <PingTimeout> seconds of inactivity the server will send a
# PING to the peer to test whether it is alive or not.
;PingTimeout = 120
# If a client fails to answer a PING with a PONG within <PongTimeout>
# seconds, it will be disconnected by the server.
;PongTimeout = 20
[Limits]
# Define some limits and timeouts for this ngIRCd instance. Default
# values should be safe, but it is wise to double-check :-)
# The server tries every <ConnectRetry> seconds to establish a link
# to not yet (or no longer) connected servers.
;ConnectRetry = 60
# Should IRC Operators be allowed to use the MODE command even if
# they are not(!) channel-operators?
;OperCanUseMode = no
# Mask IRC Operator mode requests as if they were coming from the
# server? (This is a compatibility hack for ircd-irc2 servers)
;OperServerMode = no
# Are remote IRC operators allowed to control this server, e. g.
# use commands like CONNECT, SQUIT, DIE, ...?
;AllowRemoteOper = no
# Allow Pre-Defined Channels only (see Section [Channels])
;PredefChannelsOnly = no
# Don't do any DNS lookups when a client connects to the server.
;NoDNS = no
# Don't do any IDENT lookups, even if ngIRCd has been compiled
# with support for it.
;NoIdent = no
# try to connect to other irc servers using ipv4 and ipv6, if possible
;ConnectIPv6 = yes
;ConnectIPv4 = yes
# Maximum number of simultaneous in- and outbound connections the
# server is allowed to accept (0: unlimited):
;MaxConnections = 0
@@ -155,6 +100,111 @@
# maximum nick name length!
;MaxNickLength = 9
# After <PingTimeout> seconds of inactivity the server will send a
# PING to the peer to test whether it is alive or not.
;PingTimeout = 120
# If a client fails to answer a PING with a PONG within <PongTimeout>
# seconds, it will be disconnected by the server.
;PongTimeout = 20
[Options]
# Optional features and configuration options to further tweak the
# behavior of ngIRCd. If you want to get started quickly, you most
# probably don't have to make changes here -- they are all optional.
# Are remote IRC operators allowed to control this server, e.g.
# use commands like CONNECT, SQUIT, DIE, ...?
;AllowRemoteOper = no
# A directory to chroot in when everything is initialized. It
# doesn't need to be populated if ngIRCd is compiled as a static
# binary. By default ngIRCd won't use the chroot() feature.
# ATTENTION: For this to work the server must have been started
# with root privileges!
;ChrootDir = /var/empty
# Set this hostname for every client instead of the real one.
# Please note: don't use the percentage sign ("%"), it is reserved for
# future extensions!
;CloakHost = irc.example.net
# Set every clients' user name to their nick name
;CloakUserToNick = yes
# Try to connect to other IRC servers using IPv4 and IPv6, if possible.
;ConnectIPv6 = yes
;ConnectIPv4 = yes
# Do any DNS lookups when a client connects to the server.
;DNS = yes
# Do IDENT lookups if ngIRCd has been compiled with support for it.
;Ident = yes
# Enhance user privacy slightly (useful for IRC server on TOR or I2P)
# by censoring some information like idle time, logon time, etc.
;MorePrivacy = no
# Normally ngIRCd doesn't send any messages to a client until it is
# registered. Enable this option to let the daemon send "NOTICE AUTH"
# messages to clients while connecting.
;NoticeAuth = no
# Should IRC Operators be allowed to use the MODE command even if
# they are not(!) channel-operators?
;OperCanUseMode = no
# Mask IRC Operator mode requests as if they were coming from the
# server? (This is a compatibility hack for ircd-irc2 servers)
;OperServerMode = no
# Use PAM if ngIRCd has been compiled with support for it.
;PAM = no
# Allow Pre-Defined Channels only (see Section [Channels])
;PredefChannelsOnly = no
# Let ngIRCd send an "authentication PING" when a new client connects,
# and register this client only after receiving the corresponding
# "PONG" reply.
;RequireAuthPing = no
# Silently drop all incoming CTCP requests.
;ScrubCTCP = no
# Syslog "facility" to which ngIRCd should send log messages.
# Possible values are system dependent, but most probably auth, daemon,
# user and local1 through local7 are possible values; see syslog(3).
# Default is "local5" for historical reasons, you probably want to
# change this to "daemon", for example.
;SyslogFacility = local1
# Password required for using the WEBIRC command used by some
# Web-to-IRC gateways. If not set/empty, the WEBIRC command can't
# be used. (Default: not set)
;WebircPassword = xyz
;[SSL]
# SSL-related configuration options. Please note that this section
# is only available when ngIRCd is compiled with support for SSL!
# So don't forget to remove the ";" above if this is the case ...
# SSL Server Key Certificate
;CertFile = :ETCDIR:/ssl/server-cert.pem
# Diffie-Hellman parameters
;DHFile = :ETCDIR:/ssl/dhparams.pem
# SSL Server Key
;KeyFile = :ETCDIR:/ssl/server-key.pem
# password to decrypt SSLKeyFile (OpenSSL only)
;KeyFilePassword = secret
# Additional Listen Ports that expect SSL/TLS encrypted connections
;Ports = 6697, 9999
[Operator]
# [Operator] sections are used to define IRC Operators. There may be
# more than one [Operator] block, one for each local operator.
@@ -187,11 +237,11 @@
# IRC name of the remote server, must match the "Name" variable in
# the [Global] section of the other server (when using ngIRCd).
;Name = irc2.the.net
;Name = irc2.example.net
# Internet host name or IP address of the peer (only required when
# this server should establish the connection).
;Host = connect-to-host.the.net
;Host = connect-to-host.example.net
# IP address to use as _source_ address for the connection. if
# unspecified, ngircd will let the operating system pick an address.
@@ -257,7 +307,7 @@
# Key file, syntax for each line: "<user>:<nick>:<key>".
# Default: none.
;KeyFile = /etc/ngircd/#chan.key
;KeyFile = :ETCDIR:/#chan.key
# maximum users per channel (mode l)
;MaxUsers = 23

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2005 Alexander Barton (alex@barton.de)
# Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -8,11 +8,9 @@
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: Doxyfile,v 1.2 2005/07/23 00:48:38 alex Exp $
#
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for ngIRCd.
#
#---------------------------------------------------------------------------
# Project related configuration options
@@ -47,13 +45,6 @@ STRIP_FROM_PATH = ../..
JAVADOC_AUTOBRIEF = YES
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
# will output the detailed description near the top, like JavaDoc.
# If set to NO, the detailed description appears after the member
# documentation.
DETAILS_AT_TOP = NO
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
@@ -72,21 +63,16 @@ OPTIMIZE_OUTPUT_FOR_C = YES
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = YES
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory
# hierarchy in the documentation. The default is NO.
EXTRACT_LOCAL_CLASSES = YES
SHOW_DIRECTORIES = YES
#---------------------------------------------------------------------------
# configuration options related to the input files
@@ -116,18 +102,43 @@ RECURSIVE = YES
SOURCE_BROWSER = YES
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = NO
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES then for each documented
# function all documented entities called/used by that function will be listed.
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# Output formats
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER = header.inc.html
HTML_FOOTER = footer.inc.html
HTML_STYLESHEET = ngircd-doc.css
# The HTML_FOOTER tag can be used to specify a personal HTML footer for each
# generated HTML page. If it is left blank doxygen will generate a standard
# footer.
HTML_FOOTER = footer.inc.html
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports JavaScript and
# DHTML is required (for instance Mozilla 1.0+, Firefox Netscape 6.0+,
# Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = YES
GENERATE_DOCSET = NO
GENERATE_HTMLHELP = NO
GENERATE_LATEX = NO
GENERATE_RTF = NO
@@ -148,6 +159,6 @@ GENERATE_PERLMOD = NO
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = CONN_MODULE __client_c__
PREDEFINED = DEBUG ZLIB PAM ZEROCONF CONN_MODULE __client_c__
# -eof-

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
# Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -9,7 +9,7 @@
# Please read the file COPYING, README and AUTHORS for more information.
#
EXTRA_DIST = Doxyfile header.inc.html footer.inc.html ngircd-doc.css
EXTRA_DIST = Doxyfile footer.inc.html
maintainer-clean-local:
rm -f Makefile Makefile.in

View File

@@ -1,10 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ngIRCd Source Documentation</title>
<link href="ngircd-doc.css" rel="stylesheet" type="text/css">
</head>
<body>

View File

@@ -1,77 +0,0 @@
/*
* Cascading Style Sheet for the ngIRCd source documentation
*
* $Id: ngircd-doc.css,v 1.2 2005/07/22 21:23:22 alex Exp $
*/
BODY {
background-color: white;
color: black;
margin: 30px;
font-family: Geneva, sans-serif;
font-size: 12px;
}
A:visited { color: purple; background: transparent; }
A:link { color: navy; background: transparent; }
A:active { color: red; background: transparent; }
A:hover { background: #ffa; }
H1, H2, H3 {
font-family: Verdana, sans-serif;
background-color: white;
color: #005555;
}
H1 { margin-bottom: 10px; }
H2 {
margin-top: 20px;
margin-bottom: 10px;
}
P, LI, TD, TH, DT {
font-family: Geneva, sans-serif;
font-size: 12px;
line-height: 1.2
}
DD { margin-bottom: 1em; }
UL { list-style-type: square; }
HR { margin: 2em 0px; }
BODY>TABLE { padding: 1em 0px; }
TD.mdRow {
border: 1px dotted silver;
background-color: #fff9dd;
}
TD.md { font-weight: bold; }
TD.memItemLeft { padding-top: 4px; }
TD.memItemRight { padding-top: 4px; }
TD.mdescRight { font-style: italic; }
DIV.qindex {
background-color: #eee;
border: 1px dotted silver;
padding: 3px;
margin-bottom: 2px;
}
DIV.nav {
margin: 1em 0px;
}
HR.footer { margin-top: 50px; }
.comment {
color: gray;
font-style: italic;
}
.preprocessor { color: #f90; }
.keyword, .keywordflow, .keywordtype { color: red; }
.stringliteral { color: green; }
/* -eof- */

View File

@@ -1,7 +1,7 @@
.\"
.\" ngircd(8) manual page template
.\"
.TH ngircd 8 "Dec 2008" ngircd "ngIRCd Manual"
.TH ngircd 8 "Jul 2011" ngircd "ngIRCd Manual"
.SH NAME
ngIRCd \- the next generation IRC daemon
.SH SYNOPSIS
@@ -26,7 +26,7 @@ there are good chances that it also supports other UNIX-based operating
systems as well. By default, ngIRCd writes diagnostic and informational messages using
the syslog mechanism.
.SH OPTIONS
The default behaviour of
The default behavior of
.BR ngircd
is to read its standard configuration file (see below), to detach from the
controlling terminal and to wait for clients.
@@ -64,17 +64,49 @@ The system wide default configuration file.
.RS
Default "message of the day" (MOTD).
.RE
.SH SIGNALS
The daemon understands the following signals:
.TP
\fBTERM\fR
Shut down all connections and terminate the daemon.
.TP
\fBHUP\fR
Shut down all listening sockets, re-read the configuration file and
re-initialize the daemon.
.SH HINTS
It's wise to use "ngircd \-\-configtest" to validate the configuration file
after changing it.
.SH AUTHOR
Alexander Barton,
.UR mailto:alex@barton.de
.UE
.SH DEBUGGING
When ngIRCd is compiled with debug code, that is, its source code has
been ./configure'd with "--enable-debug" and/or "--enable-sniffer" (witch
enables debug mode automatically as well), you can use two more command
line options and two more signals to debug problems with the daemon itself
or IRC clients:
.PP
\fBOptions:\fR
.TP
\fB\-d\fR, \fB\-\-debug\fR
Enable debug mode and log extra messages.
.TP
\fB\-s\fR, \fB\-\-sniffer\fR
Enable IRC protocol sniffer, which logs all sent and received IRC commands to
the console/syslog. This option requires that ngIRCd has been ./configure'd
with "--enable-sniffer" and enables debug mode automatically, too.
.PP
\fBSignals:\fR
.TP
\fBUSR1\fR
Toggle debug mode on and off during runtime.
.TP
\fBUSR2\fR
Dump internal server state to the console/syslog when debug mode is on (use
command line option \-\-debug or signal USR1).
.SH AUTHORS
Alexander Barton, <alex@barton.de>
.br
Homepage:
.UR http://ngircd.barton.de/
.UE
Florian Westphal, <fw@strlen.de>
.PP
Homepage: http://ngircd.barton.de/
.SH "SEE ALSO"
.BR ngircd.conf (5),
.BR ircd (8)

View File

@@ -1,7 +1,7 @@
.\"
.\" ngircd.conf(5) manual page template
.\"
.TH ngircd.conf 5 "Dec 2008" ngircd "ngIRCd Manual"
.TH ngircd.conf 5 "Jun 2011" ngircd "ngIRCd Manual"
.SH NAME
ngircd.conf \- configuration file of ngIRCd
.SH SYNOPSIS
@@ -10,11 +10,12 @@ ngircd.conf \- configuration file of ngIRCd
.BR ngircd.conf
is the configuration file of the
.BR ngircd (8)
Internet Relay Chat (IRC) daemon which you should adept to your local
Internet Relay Chat (IRC) daemon, which must be customized to the local
preferences and needs.
.PP
Most variables can be modified while the ngIRCd daemon is already running:
It will reload its configuration when a HUP signal is received.
It will reload its configuration file when a HUP signal or REHASH command
is received.
.SH "FILE FORMAT"
The file consists of sections and parameters. A section begins with the name
of the section in square brackets and continues until the next section
@@ -36,119 +37,170 @@ The file format is line-based - that means, each non-empty newline-terminated
line represents either a comment, a section name, or a parameter.
.PP
Section and parameter names are not case sensitive.
.PP
There are three types of variables:
.I booleans,
.I text strings,
and
.I numbers.
Boolean values are
.I true
if they are "yes", "true", or any non-null integer. Text strings are used 1:1
without leading and following spaces; there is no way to quote strings. And
for numbers all decimal integer values are valid.
.PP
In addition, some string or numerical variables accept lists of values,
separated by commas (",").
.SH "SECTION OVERVIEW"
The file can contain blocks of four types: [Global], [Operator], [Server],
and [Channel].
The file can contain blocks of seven types: [Global], [Limits], [Options],
[SSL], [Operator], [Server], and [Channel].
.PP
The main configuration of the server is stored in the
.I [Global]
section, like the server name, administrative information and the
ports on which the server should be listening. IRC operators of this
server are defined in
section, like the server name, administrative information and the ports on
which the server should be listening. The variables in this section have to be
adjusted to the local requirements most of the time, whereas all the variables
in the other sections can be left on there defaults very often.
.PP
Options in the
.I [Limits]
block are used to tweak different limits and timeouts of the daemon, like the
maximum number of clients allowed to connect to this server. Variables in the
.I [Options]
section can be used to enable or disable specific features of ngIRCd, like
support for IDENT, PAM, IPv6, and protocol and cloaking features. The
.I [SSL]
block contains all SSL-related configuration variables. These three sections
are all optional.
.PP
IRC operators of this server are defined in
.I [Operator]
blocks.
blocks. Links to remote servers are configured in
.I [Server]
is the section where server links are configured. And
sections. And
.I [Channel]
blocks are used to configure pre-defined ("persistent") IRC channels.
.PP
There can be more than one [Operator], [Server] and [Channel] sections
per configuration file, but only one [Global] section.
There can be more than one [Operator], [Server] and [Channel] section per
configuration file (one for each operator, server, and channel), but only
exactly one [Global], one [Limits], one [Options], and one [SSL] section.
.SH [GLOBAL]
The
.I [Global]
section is used to define the server main configuration, like the server
name and the ports on which the server should be listening.
section of this file is used to define the main configuration of the server,
like the server name and the ports on which the server should be listening.
These settings depend on your personal preferences, so you should make sure
that they correspond to your installation and setup!
.TP
\fBName\fR
\fBName\fR (string; required)
Server name in the IRC network. This is an individual name of the IRC
server, it is not related to the DNS host name. It must be unique in the
IRC network and must contain at least one dot (".") character.
.TP
\fBInfo\fR
\fBAdminInfo1\fR, \fBAdminInfo2\fR, \fBAdminEMail\fR (string)
Information about the server and the administrator, used by the ADMIN
command. This information is not required by the server but by RFC!
.TP
\fBInfo\fR (string)
Info text of the server. This will be shown by WHOIS and LINKS requests for
example.
.TP
\fBPassword\fR
Global password for all users needed to connect to the server. The default
is empty, so no password is required.
.TP
\fBWebircPassword\fR
Password required for using the WEBIRC command used by some Web-to-IRC
gateways. If not set or empty, the WEBIRC command can't be used.
Default: not set.
.TP
\fBAdminInfo1\fR, \fBAdminInfo2\fR, \fBAdminEMail\fR
Information about the server and the administrator, used by the ADMIN
command.
.TP
\fBPorts\fR
Ports on which the server should listen. There may be more than one port,
separated with commas (","). Default: 6667, unless \fBSSL_Ports\fR are also
specified.
.TP
\fBSSLPorts\fR
Same as \fBPorts\fR , except that ngIRCd will expect incoming connections
to be SSL/TLS encrypted. Common port numbers for SSL-encrypted IRC are 6669
and 6697. Default: none.
.TP
\fBSSLKeyFile\fR
Filename of SSL Server Key to be used for SSL connections. This is required for
SSL/TLS support.
.TP
\fBSSLKeyFilePassword\fR
(OpenSSL only:) Password to decrypt private key.
.TP
\fBSSLCertFile\fR
Certificate file of the private key.
.TP
\fBSSLDHFile\fR
Name of the Diffie-Hellman Parameter file. Can be created with gnutls
"certtool \-\-generate-dh-params" or "openssl dhparam".
If this file is not present, it will be generated on startup when ngIRCd
was compiled with gnutls support (this may take some time). If ngIRCd
was compiled with OpenSSL, then (Ephemeral)-Diffie-Hellman Key Exchanges and several
Cipher Suites will not be available.
.TP
\fBListen\fR
\fBListen\fR (list of strings)
A comma separated list of IP address on which the server should listen.
If unset, the defaults value is "0.0.0.0" or, if ngIRCd was compiled
with IPv6 support, "::,0.0.0.0". So the server listens on all configured
IP addresses and interfaces by default.
.TP
\fBMotdFile\fR
Text file with the "message of the day" (MOTD). This message will be shown
to all users connecting to the server.
\fBMotdFile\fR (string)
Text file with the "message of the day" (MOTD). This message will be shown to
all users connecting to the server. Please note: Changes made to this file
take effect when ngircd starts up or is instructed to re-read its
configuration file.
.TP
\fBMotdPhrase\fR
\fBMotdPhrase\fR (string)
A simple Phrase (<256 chars) if you don't want to use a MOTD file.
If this variable is set, no \fBMotdFile\fR will be read at all which can be
handy if the daemon should run inside a chroot directory.
.TP
\fBServerUID\fR
User ID under which the server should run; you can use the name of the user
or the numerical ID.
.PP
.RS
.B Attention:
.br
For this to work the server must have been
started with root privileges! In addition, the configuration and MOTD files
must be readable by this user, otherwise RESTART and REHASH won't work!
.RE
\fBPassword\fR (string)
Global password for all users needed to connect to the server. The default is
empty, so no password is required. Please note: This feature is not available
if ngIRCd is using PAM!
.TP
\fBServerGID\fR
\fBPidFile\fR (string)
This tells ngIRCd to write its current process ID to a file. Note that the
pidfile is written AFTER chroot and switching the user ID, e.g. the directory
the pidfile resides in must be writable by the ngIRCd user and exist in the
chroot directory (if configured, see above).
.TP
\fBPorts\fR (list of numbers)
Ports on which the server should listen. There may be more than one port,
separated with commas (","). Default: 6667, unless \fBSSL_Ports\fR are also
specified.
.TP
\fBServerGID\fR (string or number)
Group ID under which the ngIRCd should run; you can use the name of the
group or the numerical ID.
.PP
.RS
.B Attention:
.br
For this to work the server must have
been started with root privileges!
For this to work the server must have been started with root privileges!
.RE
.TP
\fBChrootDir\fR
\fBServerUID\fR (string or number)
User ID under which the server should run; you can use the name of the user
or the numerical ID.
.PP
.RS
.B Attention:
.br
For this to work the server must have been started with root privileges! In
addition, the configuration and MOTD files must be readable by this user,
otherwise RESTART and REHASH won't work!
.RE
.SH [LIMITS]
Define some limits and timeouts for this ngIRCd instance. Default values
should be safe, but it is wise to double-check :-)
.TP
\fBConnectRetry\fR (number)
The server tries every <ConnectRetry> seconds to establish a link to not yet
(or no longer) connected servers. Default: 60.
.TP
\fBMaxConnections\fR (number)
Maximum number of simultaneous in- and outbound connections the server is
allowed to accept (0: unlimited). Default: 0.
.TP
\fBMaxConnectionsIP\fR (number)
Maximum number of simultaneous connections from a single IP address that
the server will accept (0: unlimited). This configuration options lowers
the risk of denial of service attacks (DoS). Default: 5.
.TP
\fBMaxJoins\fR (number)
Maximum number of channels a user can be member of (0: no limit).
Default: 10.
.TP
\fBMaxNickLength\fR (number)
Maximum length of an user nick name (Default: 9, as in RFC 2812). Please
note that all servers in an IRC network MUST use the same maximum nick name
length!
.TP
\fBPingTimeout\fR (number)
After <PingTimeout> seconds of inactivity the server will send a PING to
the peer to test whether it is alive or not. Default: 120.
.TP
\fBPongTimeout\fR (number)
If a client fails to answer a PING with a PONG within <PongTimeout>
seconds, it will be disconnected by the server. Default: 20.
.SH [OPTIONS]
Optional features and configuration options to further tweak the behavior of
ngIRCd. If you want to get started quickly, you most probably don't have to
make changes here -- they are all optional.
.TP
\fBAllowRemoteOper\fR (boolean)
Are IRC operators connected to remote servers allowed to control this server,
e.g. are they allowed to use administrative commands like CONNECT, DIE,
SQUIT, ... that affect this server? Default: no.
.TP
\fBChrootDir\fR (string)
A directory to chroot in when everything is initialized. It doesn't need
to be populated if ngIRCd is compiled as a static binary. By default ngIRCd
won't use the chroot() feature.
@@ -156,99 +208,147 @@ won't use the chroot() feature.
.RS
.B Attention:
.br
For this to work the server must have
been started with root privileges!
For this to work the server must have been started with root privileges!
.RE
.TP
\fBPidFile\fR
This tells ngIRCd to write its current process ID to a file. Note that the
pidfile is written AFTER chroot and switching the user ID, i. e. the
directory the pidfile resides in must be writeable by the ngIRCd user and
exist in the chroot directory (if configured, see above).
\fBCloakHost\fR (string)
Set this hostname for every client instead of the real one. Default: empty,
don't change.
.PP
.RS
.B Please note:
.br
Don't use the percentage sign ("%"), it is reserved for future extensions!
.RE
.TP
\fBPingTimeout\fR
After <PingTimeout> seconds of inactivity the server will send a PING to
the peer to test whether it is alive or not. Default: 120.
\fBCloakUserToNick\fR (boolean)
Set every clients' user name to their nick name and hide the one supplied
by the IRC client. Default: no.
.TP
\fBPongTimeout\fR
If a client fails to answer a PING with a PONG within <PongTimeout>
seconds, it will be disconnected by the server. Default: 20.
\fBConnectIPv4\fR (boolean)
Set this to no if you do not want ngIRCd to connect to other IRC servers using
the IPv4 protocol. This allows the usage of ngIRCd in IPv6-only setups.
Default: yes.
.TP
\fBConnectRetry\fR
The server tries every <ConnectRetry> seconds to establish a link to not yet
(or no longer) connected servers. Default: 60.
\fBConnectIPv6\fR (boolean)
Set this to no if you do not want ngIRCd to connect to other IRC servers using
the IPv6 protocol.
Default: yes.
.TP
\fBOperCanUseMode\fR
\fBDNS\fR (boolean)
If set to false, ngIRCd will not make any DNS lookups when clients connect.
If you configure the daemon to connect to other servers, ngIRCd may still
perform a DNS lookup if required.
Default: yes.
.TP
\fBIdent\fR (boolean)
If ngIRCd is compiled with IDENT support this can be used to disable IDENT
lookups at run time.
Default: yes.
.TP
\fBMorePrivacy\fR (boolean)
This will cause ngIRCd to censor user idle time, logon time as well as the
part/quit messages (that are sometimes used to inform everyone about which
client software is being used). WHOWAS requests are also silently ignored.
This option is most useful when ngIRCd is being used together with
anonymizing software such as TOR or I2P and one does not wish to make it
too easy to collect statistics on the users.
Default: no.
.TP
\fBNoticeAuth\fR (boolean)
Normally ngIRCd doesn't send any messages to a client until it is registered.
Enable this option to let the daemon send "NOTICE AUTH" messages to clients
while connecting. Default: no.
.TP
\fBOperCanUseMode\fR (boolean)
Should IRC Operators be allowed to use the MODE command even if they are
not(!) channel-operators? Default: no.
.TP
\fBOperServerMode\fR
If \fBOperCanUseMode\fR is enabled, this may lead the compatibility problems with
Servers that run the ircd-irc2 Software. This Option "masks" mode requests
by non-chanops as if they were coming from the server. Default: no.
\fBOperServerMode\fR (boolean)
If \fBOperCanUseMode\fR is enabled, this may lead the compatibility problems
with Servers that run the ircd-irc2 Software. This Option "masks" mode
requests by non-chanops as if they were coming from the server. Default: no;
only enable it if you have ircd-irc2 servers in your IRC network.
.TP
\fBAllowRemoteOper\fR
Are IRC operators connected to remote servers allowed to control this server,
e. g. are they allowed to use administrative commands like CONNECT, DIE,
SQUIT, ... that affect this server? Default: no.
.TP
\fBPredefChannelsOnly\fR
If enabled, no new channels can be created. Useful if
you do not want to have channels other than those defined in
[Channel] sections in the configuration file.
Default: no.
.TP
\fBNoDNS\fR
If set to true, ngIRCd will not make DNS lookups when clients connect.
If you configure the daemon to connect to other servers, ngIRCd may still
perform a DNS lookup if required.
Default: no.
.TP
\fBNoIdent\fR
If ngIRCd is compiled with IDENT support this can be used to disable IDENT
lookups at run time.
Default: no.
.TP
\fBConnectIPv4\fR
Set this to no if you do not want ngIRCd to connect to other IRC servers using
IPv4. This allows usage of ngIRCd in IPv6-only setups.
\fBPAM\fR (boolean)
If ngIRCd is compiled with PAM support this can be used to disable all calls
to the PAM library at runtime; all users connecting without password are
allowed to connect, all passwords given will fail.
Default: yes.
.TP
\fBConnectIPv6\fR
Set this to no if you do not want ngIRCd to connect to other irc servers using IPv6.
Default: yes.
\fBPredefChannelsOnly\fR (boolean)
If enabled, no new channels can be created. Useful if you do not want to have
other channels than those defined in [Channel] sections in the configuration
file on this server.
Default: no.
.TP
\fBMaxConnections\fR
Maximum number of simultaneous in- and outbound connections the server is
allowed to accept (0: unlimited). Default: 0.
\fBRequireAuthPing\fR (boolean)
Let ngIRCd send an "authentication PING" when a new client connects, and
register this client only after receiving the corresponding "PONG" reply.
Default: no.
.TP
\fBMaxConnectionsIP\fR
Maximum number of simultaneous connections from a single IP address that
the server will accept (0: unlimited). This configuration options lowers
the risk of denial of service attacks (DoS). Default: 5.
\fBScrubCTCP\fR (boolean)
If set to true, ngIRCd will silently drop all CTCP requests sent to it from
both clients and servers. It will also not forward CTCP requests to any
other servers. CTCP requests can be used to query user clients about which
software they are using and which versions said software is. CTCP can also be
used to reveal clients IP numbers. ACTION CTCP requests are not blocked,
this means that /me commands will not be dropped, but please note that
blocking CTCP will disable file sharing between users!
Default: no.
.TP
\fBMaxJoins\fR
Maximum number of channels a user can be member of (0: no limit).
Default: 10.
\fBSyslogFacility\fR (string)
Syslog "facility" to which ngIRCd should send log messages. Possible
values are system dependent, but most probably "auth", "daemon", "user"
and "local1" through "local7" are possible values; see syslog(3).
Default is "local5" for historical reasons, you probably want to
change this to "daemon", for example.
.TP
\fBMaxNickLength\fR
Maximum length of an user nick name (Default: 9, as in RFC 2812). Please
note that all servers in an IRC network MUST use the same maximum nick name
length!
\fBWebircPassword\fR (string)
Password required for using the WEBIRC command used by some Web-to-IRC
gateways. If not set or empty, the WEBIRC command can't be used.
Default: not set.
.SH [SSL]
All SSL-related configuration variables are located in the
.I [SSL]
section. Please note that this whole section is only recognized by ngIRCd
when it is compiled with support for SSL using OpenSSL or GnuTLS!
.TP
\fBCertFile\fR (string)
SSL Certificate file of the private server key.
.TP
\fBDHFile\fR (string)
Name of the Diffie-Hellman Parameter file. Can be created with GnuTLS
"certtool \-\-generate-dh-params" or "openssl dhparam". If this file is not
present, it will be generated on startup when ngIRCd was compiled with GnuTLS
support (this may take some time). If ngIRCd was compiled with OpenSSL, then
(Ephemeral)-Diffie-Hellman Key Exchanges and several Cipher Suites will not be
available.
.TP
\fBKeyFile\fR (string)
Filename of SSL Server Key to be used for SSL connections. This is required
for SSL/TLS support.
.TP
\fBKeyFilePassword\fR (string)
OpenSSL only: Password to decrypt the private key file.
.TP
\fBPorts\fR (list of numbers)
Same as \fBPorts\fR , except that ngIRCd will expect incoming connections
to be SSL/TLS encrypted. Common port numbers for SSL-encrypted IRC are 6669
and 6697. Default: none.
.SH [OPERATOR]
.I [Operator]
sections are used to define IRC Operators. There may be more than one
.I [Operator]
block, one for each local operator.
.TP
\fBName\fR
\fBName\fR (string)
ID of the operator (may be different of the nick name).
.TP
\fBPassword\fR
\fBPassword\fR (string)
Password of the IRC operator.
.TP
\fBMask\fR
\fBMask\fR (string)
Mask that is to be checked before an /OPER for this account is accepted.
Example: nick!ident@*.example.com
.SH [SERVER]
@@ -269,40 +369,40 @@ There may be more than one
.I [Server]
block.
.TP
\fBName\fR
\fBName\fR (string)
IRC name of the remote server.
.TP
\fBHost\fR
\fBHost\fR (string)
Internet host name (or IP address) of the peer.
.TP
\fBBind\fR
\fBBind\fR (string)
IP address to use as source IP for the outgoing connection. Default is
to let the operating system decide.
.TP
\fBPort\fR
\fBPort\fR (number)
Port of the remote server to which ngIRCd should connect (active).
If no port is assigned to a configured server, the daemon only waits for
incoming connections (passive, default).
.TP
\fBMyPassword\fR
\fBMyPassword\fR (string)
Own password for this connection. This password has to be configured as
\fBPeerPassword\fR on the other server. Must not have ':' as first character.
.TP
\fBPeerPassword\fR
\fBPeerPassword\fR (string)
Foreign password for this connection. This password has to be configured as
\fBMyPassword\fR on the other server.
.TP
\fBGroup\fR
\fBGroup\fR (number)
Group of this server (optional).
.TP
\fBPassive\fR
\fBPassive\fR (boolean)
Disable automatic connection even if port value is specified. Default: false.
You can use the IRC Operator command CONNECT later on to create the link.
.TP
\fBSSLConnect\fR
\fBSSLConnect\fR (boolean)
Connect to the remote server using TLS/SSL. Default: false.
.TP
\fBServiceMask\fR
\fBServiceMask\fR (string)
Define a (case insensitive) mask matching nick names that should be treated as
IRC services when introduced via this remote server. REGULAR SERVERS DON'T NEED
this parameter, so leave it empty (which is the default).
@@ -324,19 +424,19 @@ There may be more than one
.I [Channel]
block.
.TP
\fBName\fR
\fBName\fR (string)
Name of the channel, including channel prefix ("#" or "&").
.TP
\fBTopic\fR
\fBTopic\fR (string)
Topic for this channel.
.TP
\fBModes\fR
\fBModes\fR (string)
Initial channel modes.
.TP
\fBKey\fR
\fBKey\fR (string)
Sets initial channel key (only relevant if channel mode "k" is set).
.TP
\fBKeyFile\fR
\fBKeyFile\fR (string)
Path and file name of a "key file" containing individual channel keys for
different users. The file consists of plain text lines with the following
syntax (without spaces!):
@@ -379,7 +479,7 @@ without problems, but moving or deleting the file will have not effect until
the daemon re-reads its configuration!
.RE
.TP
\fBMaxUsers\fR
\fBMaxUsers\fR (number)
Set maximum user limit for this channel (only relevant if channel mode "l"
is set).
.SH HINTS
@@ -388,13 +488,11 @@ after changing it. See
.BR ngircd (8)
for details.
.SH AUTHOR
Alexander Barton,
.UR mailto:alex@barton.de
.UE
Alexander Barton, <alex@barton.de>
.br
Homepage:
.UR http://ngircd.barton.de/
.UE
Florian Westphal, <fw@strlen.de>
.PP
Homepage: http://ngircd.barton.de/
.SH "SEE ALSO"
.BR ngircd (8)
.\"

View File

@@ -1,11 +1,14 @@
/*
* Functions for AF_ agnostic ipv4/ipv6 handling.
*
* (c) 2008 Florian Westphal <fw@strlen.de>, public domain.
*/
#include "portab.h"
/**
* @file
* Functions for AF_ agnostic ipv4/ipv6 handling.
*/
#include <assert.h>
#include <stdio.h>
#include <string.h>

View File

@@ -1,6 +1,4 @@
/*
* Functions for AF_ agnostic ipv4/ipv6 handling.
*
* (c) 2008 Florian Westphal <fw@strlen.de>, public domain.
*/
@@ -8,6 +6,12 @@
#define NG_IPADDR_HDR
#include "portab.h"
/**
* @file
* Functions for AF_ agnostic ipv4/ipv6 handling (header).
*/
#include <assert.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -102,8 +106,11 @@ GLOBAL const char *ng_ipaddr_tostr PARAMS((const ng_ipaddr_t *addr));
/* convert struct sockaddr to string. dest must be NG_INET_ADDRSTRLEN bytes long */
GLOBAL bool ng_ipaddr_tostr_r PARAMS((const ng_ipaddr_t *addr, char *dest));
#else
static inline const char *
ng_ipaddr_tostr(const ng_ipaddr_t *addr) { return inet_ntoa(addr->sin4.sin_addr); }
static inline const char*
ng_ipaddr_tostr(const ng_ipaddr_t *addr)
{
return inet_ntoa(addr->sin4.sin_addr);
}
static inline bool
ng_ipaddr_tostr_r(const ng_ipaddr_t *addr, char *d)

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
# Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -8,8 +8,6 @@
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: Makefile.am,v 1.51 2008/02/26 22:04:17 fw Exp $
#
AUTOMAKE_OPTIONS = ../portab/ansi2knr
@@ -23,7 +21,7 @@ sbin_PROGRAMS = ngircd
ngircd_SOURCES = ngircd.c array.c channel.c client.c conf.c conn.c conn-func.c \
conn-ssl.c conn-zip.c hash.c io.c irc.c irc-channel.c irc-info.c irc-login.c \
irc-mode.c irc-op.c irc-oper.c irc-server.c irc-write.c lists.c log.c \
match.c op.c numeric.c parse.c rendezvous.c resolve.c
match.c op.c numeric.c pam.c parse.c proc.c resolve.c sighandlers.c
ngircd_LDFLAGS = -L../portab -L../tool -L../ipaddr
@@ -32,8 +30,8 @@ ngircd_LDADD = -lngportab -lngtool -lngipaddr
noinst_HEADERS = ngircd.h array.h channel.h client.h conf.h conf-ssl.h conn.h \
conn-func.h conn-ssl.h conn-zip.h hash.h io.h irc.h irc-channel.h \
irc-info.h irc-login.h irc-mode.h irc-op.h irc-oper.h irc-server.h \
irc-write.h lists.h log.h match.h numeric.h op.h parse.h rendezvous.h \
resolve.h defines.h messages.h
irc-write.h lists.h log.h match.h numeric.h op.h pam.h parse.h proc.h \
resolve.h sighandlers.h defines.h messages.h
clean-local:
rm -f check-version check-help lint.out

View File

@@ -5,17 +5,18 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* functions to dynamically allocate arrays.
* libarray - dynamically allocate arrays.
* Copyright (c) 2005 Florian Westphal (westphal@foo.fh-furtwangen.de)
*
*/
/**
* @file
* Functions to dynamically allocate arrays.
*/
#include "array.h"
static char UNUSED id[] = "$Id: array.c,v 1.15 2007/11/18 15:05:35 alex Exp $";
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -24,13 +25,7 @@ static char UNUSED id[] = "$Id: array.c,v 1.15 2007/11/18 15:05:35 alex Exp $";
/* Enable more Debug messages in alloc / append / memmove code. */
/* #define DEBUG_ARRAY */
#define array_UNUSABLE(x) ( !(x)->mem || (0 == (x)->allocated) )
#define ALIGN_32U(x) (((x)+(unsigned)31 ) & ~((unsigned)31))
#define ALIGN_1024U(x) (((x)+(unsigned)1023) & ~((unsigned)1023))
#define ALIGN_4096U(x) (((x)+(unsigned)4095) & ~((unsigned)4095))
#define array_UNUSABLE(x) ( !(x)->mem )
static bool
@@ -61,7 +56,6 @@ void *
array_alloc(array * a, size_t size, size_t pos)
{
size_t alloc, pos_plus1 = pos + 1;
size_t aligned = 0;
char *tmp;
assert(size > 0);
@@ -70,43 +64,22 @@ array_alloc(array * a, size_t size, size_t pos)
return NULL;
if (a->allocated < alloc) {
if (alloc < 128) {
aligned = ALIGN_32U(alloc);
} else {
if (alloc < 4096) {
aligned = ALIGN_1024U(alloc);
} else {
aligned = ALIGN_4096U(alloc);
}
}
#ifdef DEBUG_ARRAY
Log(LOG_DEBUG, "array_alloc(): rounded %u to %u bytes.", alloc, aligned);
#endif
assert(aligned >= alloc);
if (aligned < alloc) /* rounding overflow */
return NULL;
alloc = aligned;
#ifdef DEBUG_ARRAY
Log(LOG_DEBUG, "array_alloc(): changing size from %u to %u bytes.",
a->allocated, aligned);
a->allocated, alloc);
#endif
tmp = realloc(a->mem, alloc);
if (!tmp)
return NULL;
a->mem = tmp;
a->allocated = alloc;
assert(a->allocated > a->used);
memset(a->mem + a->used, 0, a->allocated - a->used);
a->used = alloc;
}
assert(a->allocated >= a->used);
return a->mem + (pos * size);
}
@@ -121,6 +94,7 @@ array_length(const array * const a, size_t membersize)
if (array_UNUSABLE(a))
return 0;
assert(a->allocated);
return membersize ? a->used / membersize : 0;
}
@@ -132,6 +106,7 @@ array_copy(array * dest, const array * const src)
if (array_UNUSABLE(src))
return false;
assert(src->allocated);
return array_copyb(dest, src->mem, src->used);
}

View File

@@ -7,13 +7,16 @@
*
* libarray - dynamically allocate arrays.
* Copyright (c) 2005 Florian Westphal (westphal@foo.fh-furtwangen.de)
*
* $Id: array.h,v 1.4 2005/08/30 13:36:32 fw Exp $
*/
#ifndef array_h_included
#define array_h_included
/**
* @file
* Functions to dynamically allocate arrays (header).
*/
#include "portab.h"
typedef struct {

View File

@@ -1,22 +1,23 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
* Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Channel management
*/
#define __channel_c__
#include "portab.h"
/**
* @file
* Channel management
*/
#include "imp.h"
#include <assert.h>
#include <stdlib.h>
@@ -27,14 +28,12 @@
#include "defines.h"
#include "conn-func.h"
#include "client.h"
#include "exp.h"
#include "channel.h"
#include "imp.h"
#include "irc-write.h"
#include "resolve.h"
#include "conf.h"
#include "hash.h"
#include "lists.h"
@@ -264,6 +263,9 @@ Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Rea
return false;
}
if (Conf_MorePrivacy)
Reason = "";
/* Part client from channel */
if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true))
return false;
@@ -332,6 +334,9 @@ Channel_Quit( CLIENT *Client, const char *Reason )
assert( Client != NULL );
assert( Reason != NULL );
if (Conf_MorePrivacy)
Reason = "";
IRC_WriteStrRelatedPrefix( Client, Client, false, "QUIT :%s", Reason );
c = My_Channels;
@@ -699,6 +704,14 @@ Channel_TopicWho(CHANNEL *Chan)
return Chan->topic_who;
} /* Channel_TopicWho */
GLOBAL unsigned int
Channel_CreationTime(CHANNEL *Chan)
{
assert(Chan != NULL);
return (unsigned int) Chan->creation_time;
} /* Channel_CreationTime */
#endif
@@ -836,6 +849,9 @@ Channel_Create( const char *Name )
strlcpy( c->name, Name, sizeof( c->name ));
c->hash = Hash( c->name );
c->next = My_Channels;
#ifndef STRICT_RFC
c->creation_time = time(NULL);
#endif
My_Channels = c;
LogDebug("Created new channel structure for \"%s\".", Name);
return c;
@@ -951,6 +967,9 @@ Remove_Client( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const ch
Client_Mask( Client ), c->name, Client_ID(Origin), Reason);
break;
default: /* PART */
if (Conf_MorePrivacy)
Reason = "";
if (InformServer)
IRC_WriteStrServersPrefix(Origin, Client, "PART %s :%s", c->name, Reason);
@@ -980,6 +999,7 @@ GLOBAL bool
Channel_AddBan(CHANNEL *c, const char *mask )
{
struct list_head *h = Channel_GetListBans(c);
LogDebug("Adding \"%s\" to \"%s\" %s list", mask, Channel_Name(c), "ban");
return Lists_Add(h, mask, false);
}
@@ -988,6 +1008,7 @@ GLOBAL bool
Channel_AddInvite(CHANNEL *c, const char *mask, bool onlyonce)
{
struct list_head *h = Channel_GetListInvites(c);
LogDebug("Adding \"%s\" to \"%s\" %s list", mask, Channel_Name(c), "invite");
return Lists_Add(h, mask, onlyonce);
}
@@ -1070,10 +1091,10 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const char *Key)
if (!strchr(Chan->modes, 'k'))
return true;
if (strcmp(Chan->key, Key) == 0)
return true;
if (*Key == '\0')
return false;
if (strcmp(Chan->key, Key) == 0)
return true;
file_name = array_start(&Chan->keyfile);
if (!file_name)
@@ -1108,6 +1129,64 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const char *Key)
} /* Channel_CheckKey */
/**
* Check wether a client is allowed to administer a channel or not.
*
* @param Chan The channel to test.
* @param Client The client from which the command has been received.
* @param Origin The originator of the command (or NULL).
* @param OnChannel Set to true if the originator is member of the channel.
* @param AdminOk Set to true if the client is allowed to do
* administrative tasks on this channel.
* @param UseServerMode Set to true if ngIRCd should emulate "server mode",
* that is send commands as if originating from a server
* and not the originator of the command.
*/
GLOBAL void
Channel_CheckAdminRights(CHANNEL *Chan, CLIENT *Client, CLIENT *Origin,
bool *OnChannel, bool *AdminOk, bool *UseServerMode)
{
assert (Chan != NULL);
assert (Client != NULL);
assert (OnChannel != NULL);
assert (AdminOk != NULL);
assert (UseServerMode != NULL);
/* Use the client as origin, if no origin has been given (no prefix?) */
if (!Origin)
Origin = Client;
*OnChannel = false;
*AdminOk = false;
*UseServerMode = false;
if (Client_Type(Client) != CLIENT_USER
&& Client_Type(Client) != CLIENT_SERVER
&& Client_Type(Client) != CLIENT_SERVICE)
return;
/* Allow channel administration if the client is a server or service */
if (Client_Type(Client) != CLIENT_USER) {
*AdminOk = true;
return;
}
*OnChannel = Channel_IsMemberOf(Chan, Origin);
if (*OnChannel && strchr(Channel_UserModes(Chan, Origin), 'o')) {
/* User is a channel operator */
*AdminOk = true;
} else if (Conf_OperCanMode) {
/* IRC operators are allowed to administer channels as well */
if (Client_OperByMe(Origin)) {
*AdminOk = true;
if (Conf_OperServerMode)
*UseServerMode = true;
}
}
} /* Channel_CheckAdminRights */
static CL2CHAN *
Get_First_Cl2Chan( CLIENT *Client, CHANNEL *Chan )
{

View File

@@ -1,20 +1,21 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2008 by Alexander Barton (alex@barton.de)
* Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Channel management (header)
*/
#ifndef __channel_h__
#define __channel_h__
/**
* @file
* Channel management (header)
*/
#if defined(__channel_c__) | defined(S_SPLINT_S)
@@ -30,6 +31,7 @@ typedef struct _CHANNEL
char modes[CHANNEL_MODE_LEN]; /* Channel modes */
array topic; /* Topic of the channel */
#ifndef STRICT_RFC
time_t creation_time; /* Channel creation time */
time_t topic_time; /* Time when topic was set */
char topic_who[CLIENT_NICK_LEN];/* Nickname of user that set topic */
#endif
@@ -118,6 +120,7 @@ GLOBAL CHANNEL *Channel_Create PARAMS(( const char *Name ));
#ifndef STRICT_RFC
GLOBAL unsigned int Channel_TopicTime PARAMS(( CHANNEL *Chan ));
GLOBAL char *Channel_TopicWho PARAMS(( CHANNEL *Chan ));
GLOBAL unsigned int Channel_CreationTime PARAMS(( CHANNEL *Chan ));
#endif
GLOBAL bool Channel_AddInvite PARAMS((CHANNEL *c, const char *Mask, bool OnlyOnce ));
@@ -131,6 +134,10 @@ GLOBAL void Channel_LogServer PARAMS((const char *msg));
GLOBAL bool Channel_CheckKey PARAMS((CHANNEL *Chan, CLIENT *Client,
const char *Key));
GLOBAL void Channel_CheckAdminRights PARAMS((CHANNEL *Chan, CLIENT *Client,
CLIENT *Origin, bool *OnChannel,
bool *AdminOk, bool *UseServerMode));
#define Channel_IsLocal(c) (Channel_Name(c)[0] == '&')
#define Channel_IsModeless(c) (Channel_Name(c)[0] == '+')

View File

@@ -7,16 +7,17 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Client management.
*/
#define __client_c__
#include "portab.h"
/**
* @file
* Client management.
*/
#include "imp.h"
#include <assert.h>
#include <unistd.h>
@@ -35,7 +36,6 @@
#include <imp.h>
#include "ngircd.h"
#include "channel.h"
#include "resolve.h"
#include "conf.h"
#include "hash.h"
#include "irc-write.h"
@@ -44,10 +44,8 @@
#include <exp.h>
#define GETID_LEN (CLIENT_NICK_LEN-1) + 1 + (CLIENT_USER_LEN-1) + 1 + (CLIENT_HOST_LEN-1) + 1
static CLIENT *This_Server, *My_Clients;
static WHOWAS My_Whowas[MAX_WHOWAS];
@@ -94,7 +92,7 @@ Client_Init( void )
This_Server->hops = 0;
gethostname( This_Server->host, CLIENT_HOST_LEN );
if (!Conf_NoDNS) {
if (Conf_DNS) {
h = gethostbyname( This_Server->host );
if (h) strlcpy(This_Server->host, h->h_name, sizeof(This_Server->host));
}
@@ -201,8 +199,10 @@ Init_New_Client(CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer,
client->type = Type;
if (ID)
Client_SetID(client, ID);
if (User)
if (User) {
Client_SetUser(client, User, Idented);
Client_SetOrigUser(client, User);
}
if (Hostname)
Client_SetHostname(client, Hostname);
if (Info)
@@ -319,7 +319,11 @@ Client_SetHostname( CLIENT *Client, const char *Hostname )
assert( Client != NULL );
assert( Hostname != NULL );
strlcpy( Client->host, Hostname, sizeof( Client->host ));
if (strlen(Conf_CloakHost)) {
strlcpy( Client->host, Conf_CloakHost, sizeof( Client->host ));
} else {
strlcpy( Client->host, Hostname, sizeof( Client->host ));
}
} /* Client_SetHostname */
@@ -331,6 +335,11 @@ Client_SetID( CLIENT *Client, const char *ID )
strlcpy( Client->id, ID, sizeof( Client->id ));
if (Conf_CloakUserToNick) {
strlcpy( Client->user, ID, sizeof( Client->user ));
strlcpy( Client->info, ID, sizeof( Client->info ));
}
/* Hash */
Client->hash = Hash( Client->id );
} /* Client_SetID */
@@ -344,7 +353,9 @@ Client_SetUser( CLIENT *Client, const char *User, bool Idented )
assert( Client != NULL );
assert( User != NULL );
if (Idented) {
if (Conf_CloakUserToNick) {
strlcpy(Client->user, Client->id, sizeof(Client->user));
} else if (Idented) {
strlcpy(Client->user, User, sizeof(Client->user));
} else {
Client->user[0] = '~';
@@ -353,6 +364,26 @@ Client_SetUser( CLIENT *Client, const char *User, bool Idented )
} /* Client_SetUser */
/**
* Set "original" user name of a client.
* This function saves the "original" user name, the user name specified by
* the peer using the USER command, into the CLIENT structure. This user
* name may be used for authentication, for example.
* @param Client The client.
* @param User User name to set.
*/
GLOBAL void
Client_SetOrigUser(CLIENT UNUSED *Client, const char UNUSED *User)
{
assert(Client != NULL);
assert(User != NULL);
#if defined(PAM) && defined(IDENTAUTH)
strlcpy(Client->orig_user, User, sizeof(Client->orig_user));
#endif
} /* Client_SetOrigUser */
GLOBAL void
Client_SetInfo( CLIENT *Client, const char *Info )
{
@@ -361,7 +392,10 @@ Client_SetInfo( CLIENT *Client, const char *Info )
assert( Client != NULL );
assert( Info != NULL );
strlcpy(Client->info, Info, sizeof(Client->info));
if (Conf_CloakUserToNick)
strlcpy(Client->info, Client->id, sizeof(Client->info));
else
strlcpy(Client->info, Info, sizeof(Client->info));
} /* Client_SetInfo */
@@ -532,17 +566,19 @@ Client_Search( const char *Nick )
} /* Client_Search */
/**
* Get client structure ("introducer") identfied by a server token.
* @return CLIENT structure or NULL if none could be found.
*/
GLOBAL CLIENT *
Client_GetFromToken( CLIENT *Client, int Token )
{
/* Client-Struktur, die den entsprechenden Introducer (=Client)
* und das gegebene Token hat, liefern. Wird keine gefunden,
* so wird NULL geliefert. */
CLIENT *c;
assert( Client != NULL );
assert( Token > 0 );
if (!Token)
return NULL;
c = My_Clients;
while (c) {
@@ -602,14 +638,61 @@ Client_User( CLIENT *Client )
} /* Client_User */
#ifdef PAM
/**
* Get the "original" user name as supplied by the USER command.
* The user name as given by the client is used for authentication instead
* of the one detected using IDENT requests.
* @param Client The client.
* @return Original user name.
*/
GLOBAL char *
Client_Hostname( CLIENT *Client )
Client_OrigUser(CLIENT *Client) {
#ifndef IDENTAUTH
char *user = Client->user;
if (user[0] == '~')
user++;
return user;
#else
return Client->orig_user;
#endif
} /* Client_OrigUser */
#endif
/**
* Return the hostname of a client.
* @param Client Pointer to client structure
* @return Pointer to client hostname
*/
GLOBAL char *
Client_Hostname(CLIENT *Client)
{
assert( Client != NULL );
assert (Client != NULL);
return Client->host;
} /* Client_Hostname */
/**
* Get potentially cloaked hostname of a client.
* If the client has not enabled cloaking, the real hostname is used.
* @param Client Pointer to client structure
* @return Pointer to client hostname
*/
GLOBAL char *
Client_HostnameCloaked(CLIENT *Client)
{
assert(Client != NULL);
if (Client_HasMode(Client, 'x'))
return Client_ID(Client->introducer);
else
return Client_Hostname(Client);
} /* Client_HostnameCloaked */
GLOBAL char *
Client_Password( CLIENT *Client )
{
@@ -682,23 +765,56 @@ Client_NextHop( CLIENT *Client )
/**
* return Client-ID ("client!user@host"), this ID is needed for e.g.
* prefixes. Returnes pointer to static buffer.
* Return ID of a client: "client!user@host"
* This client ID is used for IRC prefixes, for example.
* Please note that this function uses a global static buffer, so you can't
* nest invocations without overwriting erlier results!
* @param Client Pointer to client structure
* @return Pointer to global buffer containing the client ID
*/
GLOBAL char *
Client_Mask( CLIENT *Client )
{
static char GetID_Buffer[GETID_LEN];
static char Mask_Buffer[GETID_LEN];
assert( Client != NULL );
assert (Client != NULL);
if( Client->type == CLIENT_SERVER ) return Client->id;
/* Servers: return name only, there is no "mask" */
if (Client->type == CLIENT_SERVER)
return Client->id;
snprintf(GetID_Buffer, GETID_LEN, "%s!%s@%s", Client->id, Client->user, Client->host);
return GetID_Buffer;
snprintf(Mask_Buffer, GETID_LEN, "%s!%s@%s",
Client->id, Client->user, Client->host);
return Mask_Buffer;
} /* Client_Mask */
/**
* Return ID of a client with cloaked hostname: "client!user@server-name"
* This client ID is used for IRC prefixes, for example.
* Please note that this function uses a global static buffer, so you can't
* nest invocations without overwriting erlier results!
* If the client has not enabled cloaking, the real hostname is used.
* @param Client Pointer to client structure
* @return Pointer to global buffer containing the client ID
*/
GLOBAL char *
Client_MaskCloaked(CLIENT *Client)
{
static char Mask_Buffer[GETID_LEN];
assert (Client != NULL);
/* Is the client using cloaking at all? */
if (!Client_HasMode(Client, 'x'))
return Client_Mask(Client);
snprintf(Mask_Buffer, GETID_LEN, "%s!%s@%s",
Client->id, Client->user, Client_ID(Client->introducer));
return Mask_Buffer;
} /* Client_MaskCloaked */
GLOBAL CLIENT *
Client_Introducer( CLIENT *Client )
{
@@ -1076,6 +1192,10 @@ Client_RegisterWhowas( CLIENT *Client )
assert( Client != NULL );
/* Don't register WHOWAS information when "MorePrivacy" is enabled. */
if (Conf_MorePrivacy)
return;
now = time(NULL);
/* Don't register clients that were connected less than 30 seconds. */
if( now - Client->starttime < 30 )
@@ -1093,7 +1213,7 @@ Client_RegisterWhowas( CLIENT *Client )
sizeof( My_Whowas[slot].id ));
strlcpy( My_Whowas[slot].user, Client_User( Client ),
sizeof( My_Whowas[slot].user ));
strlcpy( My_Whowas[slot].host, Client_Hostname( Client ),
strlcpy( My_Whowas[slot].host, Client_HostnameCloaked( Client ),
sizeof( My_Whowas[slot].host ));
strlcpy( My_Whowas[slot].info, Client_Info( Client ),
sizeof( My_Whowas[slot].info ));
@@ -1104,7 +1224,7 @@ Client_RegisterWhowas( CLIENT *Client )
} /* Client_RegisterWhowas */
GLOBAL char *
GLOBAL const char *
Client_TypeText(CLIENT *Client)
{
assert(Client != NULL);
@@ -1136,6 +1256,9 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool
"%s \"%s\" unregistered (connection %d): %s",
Client_TypeText(Client), Client_Mask(Client),
Client->conn_id, Txt);
Log_ServerNotice('c', "Client exiting: %s (%s@%s) [%s]",
Client_ID(Client), Client_User(Client),
Client_Hostname(Client), Txt);
if (SendQuit) {
/* Inforam all the other servers */
@@ -1171,4 +1294,26 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool
} /* Destroy_UserOrService */
#ifdef DEBUG
GLOBAL void
Client_DebugDump(void)
{
CLIENT *c;
Log(LOG_DEBUG, "Client status:");
c = My_Clients;
while (c) {
Log(LOG_DEBUG,
" - %s: type=%d, host=%s, user=%s, conn=%d, start=%ld, flags=%s",
Client_ID(c), Client_Type(c), Client_Hostname(c),
Client_User(c), Client_Conn(c), Client_StartTime(c),
Client_Flags(c));
c = (CLIENT *)c->next;
}
} /* Client_DumpClients */
#endif
/* -eof- */

View File

@@ -7,13 +7,16 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Client management (header)
*/
#ifndef __client_h__
#define __client_h__
/**
* @file
* Client management (header)
*/
#define CLIENT_UNKNOWN 1 /* connection of unknown type */
#define CLIENT_GOTPASS 2 /* client did send PASS */
#define CLIENT_GOTNICK 4 /* client did send NICK */
@@ -23,6 +26,9 @@
#define CLIENT_SERVICE 64 /* client is a service */
#define CLIENT_UNKNOWNSERVER 128 /* unregistered server connection */
#define CLIENT_GOTPASS_2813 256 /* client did send PASS, RFC 2813 style */
#ifndef STRICT_RFC
# define CLIENT_WAITAUTHPING 512 /* waiting for AUTH PONG from client */
#endif
#define CLIENT_TYPE int
@@ -43,6 +49,9 @@ typedef struct _CLIENT
char pwd[CLIENT_PASS_LEN]; /* password received of the client */
char host[CLIENT_HOST_LEN]; /* hostname of the client */
char user[CLIENT_USER_LEN]; /* user name ("login") */
#if defined(PAM) && defined(IDENTAUTH)
char orig_user[CLIENT_USER_LEN];/* user name supplied by USER command */
#endif
char info[CLIENT_INFO_LEN]; /* long user name (user) / info text (server) */
char modes[CLIENT_MODE_LEN]; /* client modes */
int hops, token, mytoken; /* "hops" and "Token" (see SERVER command) */
@@ -90,9 +99,14 @@ GLOBAL int Client_Type PARAMS(( CLIENT *Client ));
GLOBAL CONN_ID Client_Conn PARAMS(( CLIENT *Client ));
GLOBAL char *Client_ID PARAMS(( CLIENT *Client ));
GLOBAL char *Client_Mask PARAMS(( CLIENT *Client ));
GLOBAL char *Client_MaskCloaked PARAMS(( CLIENT *Client ));
GLOBAL char *Client_Info PARAMS(( CLIENT *Client ));
GLOBAL char *Client_User PARAMS(( CLIENT *Client ));
#ifdef PAM
GLOBAL char *Client_OrigUser PARAMS(( CLIENT *Client ));
#endif
GLOBAL char *Client_Hostname PARAMS(( CLIENT *Client ));
GLOBAL char *Client_HostnameCloaked PARAMS(( CLIENT *Client ));
GLOBAL char *Client_Password PARAMS(( CLIENT *Client ));
GLOBAL char *Client_Modes PARAMS(( CLIENT *Client ));
GLOBAL char *Client_Flags PARAMS(( CLIENT *Client ));
@@ -111,6 +125,7 @@ GLOBAL bool Client_HasMode PARAMS(( CLIENT *Client, char Mode ));
GLOBAL void Client_SetHostname PARAMS(( CLIENT *Client, const char *Hostname ));
GLOBAL void Client_SetID PARAMS(( CLIENT *Client, const char *Nick ));
GLOBAL void Client_SetUser PARAMS(( CLIENT *Client, const char *User, bool Idented ));
GLOBAL void Client_SetOrigUser PARAMS(( CLIENT *Client, const char *User ));
GLOBAL void Client_SetInfo PARAMS(( CLIENT *Client, const char *Info ));
GLOBAL void Client_SetPassword PARAMS(( CLIENT *Client, const char *Pwd ));
GLOBAL void Client_SetType PARAMS(( CLIENT *Client, int Type ));
@@ -146,7 +161,11 @@ GLOBAL int Client_GetLastWhowasIndex PARAMS(( void ));
GLOBAL void Client_RegisterWhowas PARAMS(( CLIENT *Client ));
GLOBAL char * Client_TypeText PARAMS((CLIENT *Client));
GLOBAL const char *Client_TypeText PARAMS((CLIENT *Client));
#ifdef DEBUG
GLOBAL void Client_DebugDump PARAMS((void));
#endif
#endif

View File

@@ -1,11 +1,15 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* SSL defines.
*/
#ifndef conf_ssl_h
#define conf_ssl_h
/**
* @file
* SSL related definitions
*/
#ifdef HAVE_LIBSSL
#define SSL_SUPPORT
#include <openssl/ssl.h>
@@ -39,7 +43,8 @@ bool
ConnSSL_InitLibrary(void);
#else
static inline bool
ConnSSL_InitLibrary(void) { return true; }
ConnSSL_InitLibrary(void)
{ return true; }
#endif /* SSL_SUPPORT */
#endif /* conf_ssl_h */

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1,22 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
* Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Configuration management (header)
*/
#ifndef __conf_h__
#define __conf_h__
/**
* @file
* Configuration management (header)
*/
#include <time.h>
#include "defines.h"
@@ -22,57 +24,69 @@
#include "portab.h"
#include "tool.h"
#include "ng_ipaddr.h"
#include "resolve.h"
#include "proc.h"
#include "conf-ssl.h"
/**
* Configured IRC operator.
* Please note the the name of the IRC operaor and his nick have nothing to
* do with each other! The IRC operator is only identified by the name and
* password configured in this structure.
*/
struct Conf_Oper {
char name[CLIENT_PASS_LEN]; /* Name (ID) of IRC operator */
char pwd[CLIENT_PASS_LEN]; /* Password */
char *mask; /* allowed host mask */
char name[CLIENT_PASS_LEN]; /**< Name (ID) */
char pwd[CLIENT_PASS_LEN]; /**< Password */
char *mask; /**< Allowed host mask */
};
/**
* Configured server.
* Peers to which this daemon should establish an outgoing server link must
* have set a port number; all other servers are allowed to connect to this one.
*/
typedef struct _Conf_Server
{
char host[HOST_LEN]; /* Hostname */
char name[CLIENT_ID_LEN]; /* IRC-Client-ID */
char pwd_in[CLIENT_PASS_LEN]; /* Password which must be received */
char pwd_out[CLIENT_PASS_LEN]; /* Password to send to peer */
UINT16 port; /* Server port */
int group; /* Group of server */
time_t lasttry; /* Last connect attempt */
RES_STAT res_stat; /* Status of the resolver */
int flags; /* Flags */
CONN_ID conn_id; /* ID of server connection or NONE */
ng_ipaddr_t bind_addr; /* source address to use for outgoing
connections */
ng_ipaddr_t dst_addr[2]; /* list of addresses to connect to */
char host[HOST_LEN]; /**< Hostname */
char name[CLIENT_ID_LEN]; /**< IRC client ID */
char pwd_in[CLIENT_PASS_LEN]; /**< Password which must be received */
char pwd_out[CLIENT_PASS_LEN]; /**< Password to send to the peer */
UINT16 port; /**< Server port to connect to */
int group; /**< Group ID of this server */
time_t lasttry; /**< Time of last connection attempt */
PROC_STAT res_stat; /**< Status of the resolver */
int flags; /**< Server flags */
CONN_ID conn_id; /**< ID of server connection or NONE */
ng_ipaddr_t bind_addr; /**< Source address to use for outgoing
connections */
ng_ipaddr_t dst_addr[2]; /**< List of addresses to connect to */
#ifdef SSL_SUPPORT
bool SSLConnect; /* connect() using SSL? */
bool SSLConnect; /**< Establish connection using SSL? */
#endif
char svs_mask[CLIENT_ID_LEN]; /* Mask of nick names that are
services */
char svs_mask[CLIENT_ID_LEN]; /**< Mask of nick names that should be
treated and counted as services */
} CONF_SERVER;
#ifdef SSL_SUPPORT
/** Configuration options required for SSL support */
struct SSLOptions {
char *KeyFile;
char *CertFile;
char *DHFile;
array ListenPorts;
array KeyFilePassword;
char *KeyFile; /**< SSL key file */
char *CertFile; /**< SSL certificate file */
char *DHFile; /**< File containing DH parameters */
array ListenPorts; /**< Array of listening SSL ports */
array KeyFilePassword; /**< Key file password */
};
#endif
/** Pre-defined channels */
struct Conf_Channel {
char name[CHANNEL_NAME_LEN]; /* Name of the channel */
char modes[CHANNEL_MODE_LEN]; /* Initial channel modes */
char key[CLIENT_PASS_LEN]; /* Channel key ("password", mode "k" ) */
char topic[COMMAND_LEN]; /* Initial topic */
char keyfile[512]; /* Path and name of channel key file */
unsigned long maxusers; /* maximum usercount for this channel, mode "l" */
char name[CHANNEL_NAME_LEN]; /**< Name of the channel */
char modes[CHANNEL_MODE_LEN]; /**< Initial channel modes */
char key[CLIENT_PASS_LEN]; /**< Channel key ("password", mode "k" ) */
char topic[COMMAND_LEN]; /**< Initial topic */
char keyfile[512]; /**< Path and name of channel key file */
unsigned long maxusers; /**< User limit for this channel, mode "l" */
};
@@ -80,77 +94,98 @@ struct Conf_Channel {
#define CONF_SFLAG_DISABLED 2 /* This server configuration entry is disabled */
/* Name ("Nick") of the servers */
/** Name (ID, "nick") of this server */
GLOBAL char Conf_ServerName[CLIENT_ID_LEN];
/* Server info text */
/** Server info text */
GLOBAL char Conf_ServerInfo[CLIENT_INFO_LEN];
/* Global server passwort */
/** Global server passwort */
GLOBAL char Conf_ServerPwd[CLIENT_PASS_LEN];
/* Administrative information */
/** Administrative information */
GLOBAL char Conf_ServerAdmin1[CLIENT_INFO_LEN];
GLOBAL char Conf_ServerAdmin2[CLIENT_INFO_LEN];
GLOBAL char Conf_ServerAdminMail[CLIENT_INFO_LEN];
/* File with MOTD text */
GLOBAL char Conf_MotdFile[FNAME_LEN];
/** Message of the day (MOTD) of this server */
GLOBAL array Conf_Motd;
/* Phrase with MOTD text */
GLOBAL char Conf_MotdPhrase[LINE_LEN];
/* Ports the server should listen on */
/** Array of ports this server should listen on */
GLOBAL array Conf_ListenPorts;
/* Address to which the socket should be bound or empty (=all) */
/** Address to which sockets should be bound to or empty (=all) */
GLOBAL char *Conf_ListenAddress;
/* User and group ID the server should run with */
/** User and group ID this daemon should run with */
GLOBAL uid_t Conf_UID;
GLOBAL gid_t Conf_GID;
/* A directory to chroot() in */
/** The directory to chroot() into */
GLOBAL char Conf_Chroot[FNAME_LEN];
/* File with PID of daemon */
/** Full path and name of a file to which the PID of daemon should be written */
GLOBAL char Conf_PidFile[FNAME_LEN];
/* Timeouts for PING and PONG */
/** Timeout (in seconds) for PING commands */
GLOBAL int Conf_PingTimeout;
/** Timeout (in seconds) for PONG replies */
GLOBAL int Conf_PongTimeout;
/* Seconds between connect attempts to other servers */
/** Seconds between connection attempts to other servers */
GLOBAL int Conf_ConnectRetry;
/* Operators */
/** Array of configured IRC operators */
GLOBAL array Conf_Opers;
/* Servers */
/** Array of configured IRC servers */
GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS];
/* Pre-defined channels */
/** Array of pre-defined channels */
GLOBAL array Conf_Channels;
/* Pre-defined channels only */
/** Flag indicating if only pre-defined channels are allowed (true) or not */
GLOBAL bool Conf_PredefChannelsOnly;
/* Are IRC operators allowed to always use MODE? */
/** Flag indicating if IRC operators are allowed to always use MODE (true) */
GLOBAL bool Conf_OperCanMode;
/* If an IRC op gives chanop privileges without being a chanop,
* ircd2 will ignore the command. This enables a workaround:
* It masks the command as coming from the server */
/**
* If true, mask channel MODE commands of IRC operators to the server.
* Background: ircd2 will ignore channel MODE commands if an IRC operator
* gives chanel operator privileges to someone without being a channel operator
* himself. This enables a workaround: it masks the MODE command as coming
* from the IRC server and not the IRC operator.
*/
GLOBAL bool Conf_OperServerMode;
/* Are remote IRC operators allowed to manage this server? */
/** Flag indicating if remote IRC operators are allowed to manage this server */
GLOBAL bool Conf_AllowRemoteOper;
/* Disable all DNS functions? */
GLOBAL bool Conf_NoDNS;
/** Cloaked hostname of the clients */
GLOBAL char Conf_CloakHost[CLIENT_ID_LEN];
/* Disable IDENT lookups, even when compiled with support for it */
GLOBAL bool Conf_NoIdent;
/** Use nick name as user name? */
GLOBAL bool Conf_CloakUserToNick;
/** Enable all DNS functions? */
GLOBAL bool Conf_DNS;
/** Enable IDENT lookups, even when compiled with support for it */
GLOBAL bool Conf_Ident;
/** Enable "more privacy" mode and "censor" some user-related information */
GLOBAL bool Conf_MorePrivacy;
/** Enable NOTICE AUTH messages on connect */
GLOBAL bool Conf_NoticeAuth;
/** Enable all usage of PAM, even when compiled with support for it */
GLOBAL bool Conf_PAM;
/** Disable all CTCP commands except for /me ? */
GLOBAL bool Conf_ScrubCTCP;
/*
* try to connect to remote systems using the ipv6 protocol,
@@ -158,21 +193,35 @@ GLOBAL bool Conf_NoIdent;
*/
GLOBAL bool Conf_ConnectIPv6;
/* same as above, but for ipv4 hosts, default: yes */
/** Try to connect to remote systems using the IPv4 protocol (true) */
GLOBAL bool Conf_ConnectIPv4;
/* Maximum number of connections to this server */
/** Maximum number of simultaneous connections to this server */
GLOBAL long Conf_MaxConnections;
/* Maximum number of channels a user can join */
/** Maximum number of channels a user can join */
GLOBAL int Conf_MaxJoins;
/* Maximum number of connections per IP address */
/** Maximum number of connections per IP address */
GLOBAL int Conf_MaxConnectionsIP;
/* Maximum length of a nick name */
/** Maximum length of a nick name */
GLOBAL unsigned int Conf_MaxNickLength;
#ifndef STRICT_RFC
/** Require "AUTH PING-PONG" on login */
GLOBAL bool Conf_AuthPing;
#endif
#ifdef SYSLOG
/* Syslog "facility" */
GLOBAL int Conf_SyslogFacility;
#endif
GLOBAL void Conf_Init PARAMS((void));
GLOBAL bool Conf_Rehash PARAMS((void));
GLOBAL int Conf_Test PARAMS((void));
@@ -191,6 +240,10 @@ GLOBAL bool Conf_IsService PARAMS((int ConfServer, const char *Nick));
/* Password required by WEBIRC command */
GLOBAL char Conf_WebircPwd[CLIENT_PASS_LEN];
#ifdef DEBUG
GLOBAL void Conf_DebugDump PARAMS((void));
#endif
#endif

View File

@@ -7,15 +7,17 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Connection management: Global functions
*/
#define CONN_MODULE
#include "portab.h"
/**
* @file
* Connection management: Global functions
*/
#include "imp.h"
#include <assert.h>
#include <string.h>
@@ -273,6 +275,16 @@ Conn_RecvBytes( CONN_ID Idx )
return My_Connections[Idx].bytes_in;
} /* Conn_RecvBytes */
/**
* Return the remote IP address of this connection as string.
*/
GLOBAL const char *
Conn_IPA(CONN_ID Idx)
{
assert (Idx > NONE);
return ng_ipaddr_tostr(&My_Connections[Idx].addr);
}
GLOBAL void
Conn_ResetWCounter( void )

View File

@@ -7,14 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Connection management: Global functions (header)
*/
#ifndef __conn_func_h__
#define __conn_func_h__
/**
* @file
* Connection management: Global functions (header)
*/
/* Include the header conn.h if this header is _not_ included by any module
* containing connection handling functions. So other modules must only
@@ -39,6 +40,7 @@ GLOBAL long Conn_SendMsg PARAMS(( CONN_ID Idx ));
GLOBAL long Conn_RecvMsg PARAMS(( CONN_ID Idx ));
GLOBAL long Conn_SendBytes PARAMS(( CONN_ID Idx ));
GLOBAL long Conn_RecvBytes PARAMS(( CONN_ID Idx ));
GLOBAL const char *Conn_IPA PARAMS(( CONN_ID Idx ));
GLOBAL void Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds ));
GLOBAL void Conn_ResetPenalty PARAMS(( CONN_ID Idx ));

View File

@@ -1,11 +1,15 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
*
* SSL wrapper functions.
* Copyright (c) 2005-2008 Florian Westphal <fw@strlen.de>
*/
#include "portab.h"
/**
* @file
* SSL wrapper functions
*/
#include "imp.h"
#include "conf-ssl.h"
@@ -47,10 +51,11 @@ static bool ConnSSL_LoadServerKey_openssl PARAMS(( SSL_CTX *c ));
#include <unistd.h>
#include <gnutls/x509.h>
#define DH_BITS 1024
#define DH_BITS 2048
#define DH_BITS_MIN 1024
static gnutls_certificate_credentials_t x509_cred;
static gnutls_dh_params_t dh_params;
static bool ConnSSL_LoadServerKey_gnutls PARAMS(( void ));
#endif
@@ -383,9 +388,10 @@ ConnSSL_Init_SSL(CONNECTION *c)
int ret;
assert(c != NULL);
#ifdef HAVE_LIBSSL
if (!ssl_ctx) /* NULL when library initialization failed */
if (!ssl_ctx) {
Log(LOG_ERR, "Cannot init ssl_ctx: OpenSSL initialization failed at startup");
return false;
}
assert(c->ssl_state.ssl == NULL);
c->ssl_state.ssl = SSL_new(ssl_ctx);
@@ -421,7 +427,7 @@ ConnSSL_Init_SSL(CONNECTION *c)
ConnSSL_Free(c);
return false;
}
gnutls_dh_set_prime_bits(c->ssl_state.gnutls_session, DH_BITS);
gnutls_dh_set_prime_bits(c->ssl_state.gnutls_session, DH_BITS_MIN);
#endif
Conn_OPTION_ADD(c, CONN_SSL);
return true;

View File

@@ -1,11 +1,15 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* SSL wrapper functions. (header)
*/
#ifndef conn_ssl_h
#define conn_ssl_h
/**
* @file
* SSL wrapper functions (header)
*/
#include "conf-ssl.h"
#include "conn.h"
#include "conf.h"

View File

@@ -7,12 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Connection compression using ZLIB
*/
#include "portab.h"
/**
* @file
* Connection compression using ZLIB
*/
#define CONN_MODULE
#ifdef ZLIB
@@ -105,8 +108,8 @@ Zip_Buffer( CONN_ID Idx, const char *Data, size_t Len )
* otherwise the zip wbuf would grow too large */
buflen = array_bytes(&My_Connections[Idx].zip.wbuf);
if (buflen + Len >= WRITEBUFFER_SLINK_LEN) {
Log(LOG_ALERT, "Zip Write Buffer overflow: %lu bytes\n", buflen + Len);
Conn_Close(Idx, "Zip Write buffer overflow", NULL, false);
Log(LOG_ALERT, "Zip Write buffer space exhausted: %lu bytes", buflen + Len);
Conn_Close(Idx, "Zip Write buffer space exhausted", NULL, false);
return false;
}
return array_catb(&My_Connections[Idx].zip.wbuf, Data, Len);
@@ -155,7 +158,7 @@ Zip_Flush( CONN_ID Idx )
if (out->avail_out <= 0) {
/* Not all data was compressed, because data became
* bigger while compressing it. */
Log (LOG_ALERT, "Compression error: buffer overvlow!?");
Log(LOG_ALERT, "Compression error: buffer overflow!?");
Conn_Close(Idx, "Compression error!", NULL, false);
return false;
}

View File

@@ -7,18 +7,17 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: conn-zip.h,v 1.4 2006/05/10 21:24:01 alex Exp $
*
* Connection compression using ZLIB (header)
*/
#ifdef ZLIB
#ifndef __conn_zip_h__
#define __conn_zip_h__
/**
* @file
* Connection compression using ZLIB (header)
*/
GLOBAL bool Zip_InitConn PARAMS(( CONN_ID Idx ));
@@ -29,10 +28,8 @@ GLOBAL bool Unzip_Buffer PARAMS(( CONN_ID Idx ));
GLOBAL long Zip_SendBytes PARAMS(( CONN_ID Idx ));
GLOBAL long Zip_RecvBytes PARAMS(( CONN_ID Idx ));
#endif /* __conn_zip_h__ */
#endif /* ZLIB */
/* -eof- */

File diff suppressed because it is too large Load Diff

View File

@@ -7,14 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Connection management (header)
*/
#ifndef __conn_h__
#define __conn_h__
/**
* @file
* Connection management (header)
*/
#include <time.h> /* for time_t, see below */
@@ -44,11 +45,11 @@
typedef long CONN_ID;
#include "client.h"
#include "proc.h"
#ifdef CONN_MODULE
#include "defines.h"
#include "resolve.h"
#include "array.h"
#include "tool.h"
#include "ng_ipaddr.h"
@@ -69,7 +70,7 @@ typedef struct _Connection
{
int sock; /* Socket handle */
ng_ipaddr_t addr; /* Client address */
RES_STAT res_stat; /* Status of resolver process */
PROC_STAT proc_stat; /* Status of resolver process */
char host[HOST_LEN]; /* Hostname */
array rbuf; /* Read buffer */
array wbuf; /* Write buffer */
@@ -90,6 +91,9 @@ typedef struct _Connection
#ifdef SSL_SUPPORT
struct ConnSSL_State ssl_state; /* SSL/GNUTLS state information */
#endif
#ifndef STRICT_RFC
long auth_ping; /** PING response expected on login */
#endif
} CONNECTION;
GLOBAL CONNECTION *My_Connections;
@@ -102,29 +106,44 @@ GLOBAL long WCounter;
GLOBAL void Conn_Init PARAMS((void ));
GLOBAL void Conn_Exit PARAMS(( void ));
GLOBAL void Conn_CloseAllSockets PARAMS((void));
GLOBAL unsigned int Conn_InitListeners PARAMS(( void ));
GLOBAL void Conn_ExitListeners PARAMS(( void ));
GLOBAL void Conn_Handler PARAMS(( void ));
GLOBAL bool Conn_WriteStr PARAMS(( CONN_ID Idx, char *Format, ... ));
GLOBAL bool Conn_WriteStr PARAMS(( CONN_ID Idx, const char *Format, ... ));
GLOBAL void Conn_Close PARAMS(( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClient ));
GLOBAL void Conn_SyncServerStruct PARAMS(( void ));
GLOBAL CONN_ID Conn_GetFromProc PARAMS((int fd));
GLOBAL CLIENT* Conn_GetClient PARAMS((CONN_ID i));
GLOBAL PROC_STAT* Conn_GetProcStat PARAMS((CONN_ID i));
#ifdef SSL_SUPPORT
GLOBAL bool Conn_GetCipherInfo PARAMS((CONN_ID Idx, char *buf, size_t len));
GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx));
#else
static inline bool Conn_UsesSSL(UNUSED CONN_ID Idx) { return false; }
#endif
static inline bool
Conn_UsesSSL(UNUSED CONN_ID Idx)
{ return false; }
#endif
GLOBAL long Conn_Count PARAMS((void));
GLOBAL long Conn_CountMax PARAMS((void));
GLOBAL long Conn_CountAccepted PARAMS((void));
#ifndef STRICT_RFC
GLOBAL long Conn_GetAuthPing PARAMS((CONN_ID Idx));
GLOBAL void Conn_SetAuthPing PARAMS((CONN_ID Idx, long ID));
#endif
#ifdef DEBUG
GLOBAL void Conn_DebugDump PARAMS((void));
#endif
#endif
/* -eof- */

View File

@@ -9,7 +9,6 @@
* Please read the file COPYING, README and AUTHORS for more information.
*/
#ifndef __defines_h__
#define __defines_h__
@@ -59,9 +58,12 @@
#define READBUFFER_LEN 2048 /* Size of the read buffer of a
connection in bytes. */
#define WRITEBUFFER_LEN 4096 /* Size of the write buffer of a
#define WRITEBUFFER_FLUSH_LEN 4096 /* Size of a write buffer that triggers
buffer flushing if more space is
needed for storing data. */
#define WRITEBUFFER_MAX_LEN 32768 /* Maximum size of the write buffer of a
connection in bytes. */
#define WRITEBUFFER_SLINK_LEN 51200 /* Size of the write buffer of a
#define WRITEBUFFER_SLINK_LEN 65536 /* Maximum size of the write buffer of a
server link connection in bytes. */
#define PROTOVER "0210" /* Implemented IRC protocol version,
@@ -80,8 +82,8 @@
#define RECONNECT_DELAY 3 /* Time to delay re-connect attempts
in seconds. */
#define USERMODES "aiorsw" /* Supported user modes. */
#define CHANMODES "biIklmnoPstvz" /* Supported channel modes. */
#define USERMODES "aciorswx" /* Supported user modes. */
#define CHANMODES "biIklmnoOPstvz" /* Supported channel modes. */
#define CONNECTED true /* Internal status codes. */
#define DISCONNECTED false
@@ -93,7 +95,6 @@
#define CONFIG_FILE "/ngircd.conf" /* Configuration file name. */
#define MOTD_FILE "/ngircd.motd" /* Name of the MOTD file. */
#define MOTD_PHRASE "" /* Default MOTD phrase string. */
#define CHROOT_DIR "" /* Default chroot() directory. */
#define PID_FILE "" /* Default file for the process ID. */
@@ -109,12 +110,6 @@
#define CUT_TXTSUFFIX "[CUT]" /* Suffix for oversized messages that
have been shortened and cut off. */
#ifdef ZEROCONF
#define MDNS_TYPE "_ircu._tcp." /* Service type to register with mDNS */
#endif
#endif
/* -eof- */

View File

@@ -1,20 +1,20 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Hash calculation
*/
#include "portab.h"
static char UNUSED id[] = "$Id: hash.c,v 1.13 2006/10/06 21:23:47 fw Exp $";
/**
* @file
* Hash calculation
*/
#include "imp.h"
#include <assert.h>
@@ -26,15 +26,17 @@ static char UNUSED id[] = "$Id: hash.c,v 1.13 2006/10/06 21:23:47 fw Exp $";
#include "exp.h"
#include "hash.h"
static UINT32 jenkins_hash PARAMS((UINT8 *k, UINT32 length, UINT32 initval));
static UINT32 jenkins_hash PARAMS(( register UINT8 *k, register UINT32 length, register UINT32 initval ));
/**
* Calculate hash value for a given string.
*
* @param String Input string
* @return 32 bit hash value
*/
GLOBAL UINT32
Hash( const char *String )
{
/* Hash-Wert ueber String berechnen */
char buffer[LINE_LEN];
strlcpy(buffer, String, sizeof(buffer));
@@ -42,70 +44,75 @@ Hash( const char *String )
(UINT32)strlen(buffer), 42);
} /* Hash */
/*
* Die hier verwendete Hash-Funktion stammt aus lookup2.c von Bob Jenkins
* (URL: <http://burtleburtle.net/bob/c/lookup2.c>). Aus dem Header:
* This hash function originates from lookup3.c of Bob Jenkins
* (URL: <http://burtleburtle.net/bob/c/lookup3.c>):
* --------------------------------------------------------------------
* lookup2.c, by Bob Jenkins, December 1996, Public Domain.
* hash(), hash2(), hash3, and mix() are externally useful functions.
* Routines to test the hash are included if SELF_TEST is defined.
* You can use this free for any purpose. It has no warranty.
* lookup3.c, by Bob Jenkins, May 2006, Public Domain.
* These are functions for producing 32-bit hashes for hash table lookup.
* hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
* are externally useful functions. Routines to test the hash are included
* if SELF_TEST is defined. You can use this free for any purpose. It's in
* the public domain. It has no warranty.
* --------------------------------------------------------------------
* nicht alle seiner Funktionen werden hier genutzt.
* Not all of his functions are used here.
*/
#define hashsize(n) ((UINT32)1<<(n))
#define hashmask(n) (hashsize(n)-1)
#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
#define mix(a,b,c) \
{ \
a -= b; a -= c; a ^= (c>>13); \
b -= c; b -= a; b ^= (a<<8); \
c -= a; c -= b; c ^= (b>>13); \
a -= b; a -= c; a ^= (c>>12); \
b -= c; b -= a; b ^= (a<<16); \
c -= a; c -= b; c ^= (b>>5); \
a -= b; a -= c; a ^= (c>>3); \
b -= c; b -= a; b ^= (a<<10); \
c -= a; c -= b; c ^= (b>>15); \
a -= c; a ^= rot(c, 4); c += b; \
b -= a; b ^= rot(a, 6); a += c; \
c -= b; c ^= rot(b, 8); b += a; \
a -= c; a ^= rot(c,16); c += b; \
b -= a; b ^= rot(a,19); a += c; \
c -= b; c ^= rot(b, 4); b += a; \
} /* mix */
#define final(a,b,c) \
{ \
c ^= b; c -= rot(b,14); \
a ^= c; a -= rot(c,11); \
b ^= a; b -= rot(a,25); \
c ^= b; c -= rot(b,16); \
a ^= c; a -= rot(c,4); \
b ^= a; b -= rot(a,14); \
c ^= b; c -= rot(b,24); \
}
static UINT32
jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval )
jenkins_hash(UINT8 *k, UINT32 length, UINT32 initval)
{
/* k: the key
* length: length of the key
* initval: the previous hash, or an arbitrary value
*/
register UINT32 a,b,c,len;
UINT32 a,b,c;
/* Set up the internal state */
len = length;
a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
c = initval; /* the previous hash value */
a = b = c = 0xdeadbeef + length + initval;
/* handle most of the key */
while (len >= 12)
{
while (length > 12) {
a += (k[0] +((UINT32)k[1]<<8) +((UINT32)k[2]<<16) +((UINT32)k[3]<<24));
b += (k[4] +((UINT32)k[5]<<8) +((UINT32)k[6]<<16) +((UINT32)k[7]<<24));
c += (k[8] +((UINT32)k[9]<<8) +((UINT32)k[10]<<16)+((UINT32)k[11]<<24));
mix(a,b,c);
k += 12; len -= 12;
length -= 12;
k += 12;
}
/* handle the last 11 bytes */
c += length;
switch( (int)len ) /* all the case statements fall through */
/*-------------------------------- last block: affect all 32 bits of (c) */
switch(length) /* all the case statements fall through */
{
case 11: c+=((UINT32)k[10]<<24);
case 10: c+=((UINT32)k[9]<<16);
case 9 : c+=((UINT32)k[8]<<8);
/* the first byte of c is reserved for the length */
case 12: c+=((UINT32)k[11])<<24;
case 11: c+=((UINT32)k[10]<<16);
case 10: c+=((UINT32)k[9]<<8);
case 9 : c+=k[8];
case 8 : b+=((UINT32)k[7]<<24);
case 7 : b+=((UINT32)k[6]<<16);
case 6 : b+=((UINT32)k[5]<<8);
@@ -114,13 +121,11 @@ jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval
case 3 : a+=((UINT32)k[2]<<16);
case 2 : a+=((UINT32)k[1]<<8);
case 1 : a+=k[0];
/* case 0: nothing left to add */
break;
case 0 : return c;
}
mix(a,b,c);
/* report the result */
final(a,b,c);
return c;
} /* jenkins_hash */
/* -eof- */

View File

@@ -7,20 +7,18 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: hash.h,v 1.6 2006/10/06 21:23:47 fw Exp $
*
* Hash calculation (header)
*/
#ifndef __hash_h__
#define __hash_h__
GLOBAL UINT32 Hash PARAMS((const char *String ));
/**
* @file
* Hash calculation (header)
*/
GLOBAL UINT32 Hash PARAMS((const char *String ));
#endif
/* -eof- */

View File

@@ -5,14 +5,15 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* I/O abstraction interface.
* Copyright (c) 2005 Florian Westphal (westphal@foo.fh-furtwangen.de)
*
*/
#include "portab.h"
static char UNUSED id[] = "$Id: io.c,v 1.31 2008/04/03 20:56:44 fw Exp $";
/**
* @file
* I/O abstraction interface.
*/
#include <assert.h>
#include <stdlib.h>
@@ -104,8 +105,8 @@ static bool io_event_change_devpoll(int fd, short what);
#ifdef IO_USE_SELECT
#include "defines.h" /* for conn.h */
#include "conn.h" /* for CONN_IDX (needed by resolve.h) */
#include "resolve.h" /* for RES_STAT (needed by conf.h) */
#include "proc.h" /* for PROC_STAT (needed by conf.h) */
#include "conn.h" /* for CONN_ID (needed by conf.h) */
#include "conf.h" /* for Conf_MaxConnections */
static fd_set readers;
@@ -115,7 +116,7 @@ static fd_set writers;
* the largest fd registered, plus one.
*/
static int select_maxfd;
static int io_dispatch_select(struct timeval *tv);
static int io_dispatch_select PARAMS((struct timeval *tv));
#ifndef IO_USE_EPOLL
#define io_masterfd -1
@@ -127,12 +128,15 @@ static array io_events;
static void io_docallback PARAMS((int fd, short what));
#ifdef DEBUG_IO
static void io_debug(const char *s, int fd, int what)
static void
io_debug(const char *s, int fd, int what)
{
Log(LOG_DEBUG, "%s: %d, %d\n", s, fd, what);
}
#else
static inline void io_debug(const char UNUSED *s,int UNUSED a, int UNUSED b) {/*NOTHING*/}
static inline void
io_debug(const char UNUSED *s,int UNUSED a, int UNUSED b)
{ /* NOTHING */ }
#endif
static io_event *
@@ -227,8 +231,12 @@ io_library_init_devpoll(unsigned int eventsize)
eventsize, io_masterfd);
}
#else
static inline void io_close_devpoll(int UNUSED x) {/* NOTHING */}
static inline void io_library_init_devpoll(unsigned int UNUSED ev) {/*NOTHING*/}
static inline void
io_close_devpoll(int UNUSED x)
{ /* NOTHING */ }
static inline void
io_library_init_devpoll(unsigned int UNUSED ev)
{ /* NOTHING */ }
#endif
@@ -331,8 +339,12 @@ io_library_init_poll(unsigned int eventsize)
}
}
#else
static inline void io_close_poll(int UNUSED x) {/* NOTHING */}
static inline void io_library_init_poll(unsigned int UNUSED ev) {/*NOTHING*/}
static inline void
io_close_poll(int UNUSED x)
{ /* NOTHING */ }
static inline void
io_library_init_poll(unsigned int UNUSED ev)
{ /* NOTHING */ }
#endif
@@ -340,11 +352,15 @@ static inline void io_library_init_poll(unsigned int UNUSED ev) {/*NOTHING*/}
static int
io_dispatch_select(struct timeval *tv)
{
fd_set readers_tmp = readers;
fd_set writers_tmp = writers;
fd_set readers_tmp;
fd_set writers_tmp;
short what;
int ret, i;
int fds_ready;
readers_tmp = readers;
writers_tmp = writers;
ret = select(select_maxfd + 1, &readers_tmp, &writers_tmp, NULL, tv);
if (ret <= 0)
return ret;
@@ -418,8 +434,12 @@ io_close_select(int fd)
}
}
#else
static inline void io_library_init_select(int UNUSED x) {/* NOTHING */}
static inline void io_close_select(int UNUSED x) {/* NOTHING */}
static inline void
io_library_init_select(int UNUSED x)
{ /* NOTHING */ }
static inline void
io_close_select(int UNUSED x)
{ /* NOTHING */ }
#endif /* SELECT */
@@ -494,7 +514,9 @@ io_library_init_epoll(unsigned int eventsize)
#endif
}
#else
static inline void io_library_init_epoll(unsigned int UNUSED ev) {/* NOTHING */}
static inline void
io_library_init_epoll(unsigned int UNUSED ev)
{ /* NOTHING */ }
#endif /* IO_USE_EPOLL */
@@ -620,7 +642,9 @@ io_library_init_kqueue(unsigned int eventsize)
library_initialized = true;
}
#else
static inline void io_library_init_kqueue(unsigned int UNUSED ev) {/* NOTHING */}
static inline void
io_library_init_kqueue(unsigned int UNUSED ev)
{ /* NOTHING */ }
#endif
@@ -785,6 +809,18 @@ io_setnonblock(int fd)
return fcntl(fd, F_SETFL, flags) == 0;
}
bool
io_setcloexec(int fd)
{
int flags = fcntl(fd, F_GETFD);
if (flags == -1)
return false;
#ifdef FD_CLOEXEC
flags |= FD_CLOEXEC;
#endif
return fcntl(fd, F_SETFD, flags) == 0;
}
bool
io_close(int fd)

View File

@@ -4,15 +4,16 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* I/O abstraction interface header
*
* $Id: io.h,v 1.4 2006/12/25 22:53:52 alex Exp $
*/
#ifndef io_H_included
#define io_H_included
/**
* @file
* I/O abstraction interface (header)
*/
#include "portab.h"
#include <sys/time.h>
@@ -45,6 +46,9 @@ bool io_close PARAMS((int fd));
/* set O_NONBLOCK */
bool io_setnonblock PARAMS((int fd));
/* set O_CLOEXEC */
bool io_setcloexec PARAMS((int fd));
/* watch fds for activity */
int io_dispatch PARAMS((struct timeval *tv));

View File

@@ -7,13 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* IRC channel commands
*/
#include "portab.h"
/**
* @file
* IRC channel commands
*/
#include "imp.h"
#include <assert.h>
#include <stdlib.h>
@@ -22,7 +24,6 @@
#include "defines.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "conn-func.h"
#include "lists.h"
@@ -32,20 +33,24 @@
#include "parse.h"
#include "irc-info.h"
#include "irc-write.h"
#include "resolve.h"
#include "conf.h"
#include "exp.h"
#include "irc-channel.h"
/*
/**
* Part from all channels.
*
* RFC 2812, (3.2.1 Join message Command):
* Note that this message
* accepts a special argument ("0"), which is a special request to leave all
* channels the user is currently a member of. The server will process this
* message as if the user had sent a PART command (See Section 3.2.2) for
* each channel he is a member of.
* Note that this message accepts a special argument ("0"), which is a
* special request to leave all channels the user is currently a member of.
* The server will process this message as if the user had sent a PART
* command (See Section 3.2.2) for each channel he is a member of.
*
* @param client Client that initiated the part request
* @param target Client that should part all joined channels
* @returns CONNECTED or DISCONNECTED
*/
static bool
part_from_all_channels(CLIENT* client, CLIENT *target)
@@ -59,17 +64,18 @@ part_from_all_channels(CLIENT* client, CLIENT *target)
Channel_Part(target, client, Channel_Name(chan), Client_ID(target));
}
return CONNECTED;
}
} /* part_from_all_channels */
/**
* Check weather a local client is allowed to join an already existing
* channel or not.
* @param Client Client that sent the JOIN command
* @param chan Channel to check
* @param channame Name of the channel
* @param key Provided channel key (or NULL if none has been provided)
* @return true if client is allowed to join channel, false otherwise
*
* @param Client Client that sent the JOIN command
* @param chan Channel to check
* @param channame Name of the channel
* @param key Provided channel key (or NULL)
* @returns true if client is allowed to join, false otherwise
*/
static bool
join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame,
@@ -124,10 +130,24 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame,
return false;
}
if (strchr(channel_modes, 'O') && !Client_OperByMe(Client)) {
/* Only IRC operators are allowed! */
IRC_WriteStrClient(Client, ERR_OPONLYCHANNEL_MSG,
Client_ID(Client), channame);
return false;
}
return true;
}
} /* join_allowed */
/**
* Set user channel modes.
*
* @param chan Channel
* @param target User to set modes for
* @param flags Channel modes to add
*/
static void
join_set_channelmodes(CHANNEL *chan, CLIENT *target, const char *flags)
{
@@ -141,9 +161,22 @@ join_set_channelmodes(CHANNEL *chan, CLIENT *target, const char *flags)
/* If channel persistent and client is ircop: make client chanop */
if (strchr(Channel_Modes(chan), 'P') && strchr(Client_Modes(target), 'o'))
Channel_UserModeAdd(chan, target, 'o');
}
} /* join_set_channelmodes */
/**
* Forward JOIN command to a specific server
*
* This function diffentiates between servers using RFC 2813 mode that
* support the JOIN command with appended ASCII 7 character and channel
* modes, and servers using RFC 1459 protocol which require separate JOIN
* and MODE commands.
*
* @param To Forward JOIN (and MODE) command to this peer server
* @param Prefix Client used to prefix the genrated commands
* @param Data Parameters of JOIN command to forward, probably
* containing channel modes separated by ASCII 7.
*/
static void
cb_join_forward(CLIENT *To, CLIENT *Prefix, void *Data)
{
@@ -168,12 +201,25 @@ cb_join_forward(CLIENT *To, CLIENT *Prefix, void *Data)
} /* cb_join_forward */
/**
* Forward JOIN command to all servers
*
* This function calls cb_join_forward(), which differentiates between
* protocol implementations (e.g. RFC 2812, RFC 1459).
*
* @param Client Client used to prefix the genrated commands
* @param target Forward JOIN (and MODE) command to this peer server
* @param chan Channel structure
* @param channame Channel name
*/
static void
join_forward(CLIENT *Client, CLIENT *target, CHANNEL *chan,
const char *channame)
{
char modes[CHANNEL_MODE_LEN], str[COMMAND_LEN];
/* RFC 2813, 4.2.1: channel modes are separated from the channel
* name with ASCII 7, if any, and not spaces: */
strlcpy(&modes[1], Channel_UserModes(chan, target), sizeof(modes) - 1);
if (modes[1])
modes[0] = 0x7;
@@ -200,6 +246,14 @@ join_forward(CLIENT *Client, CLIENT *target, CHANNEL *chan,
} /* join_forward */
/**
* Aknowledge user JOIN request and send "channel info" numerics.
*
* @param Client Client used to prefix the genrated commands
* @param target Forward commands/numerics to this user
* @param chan Channel structure
* @param channame Channel name
*/
static bool
join_send_topic(CLIENT *Client, CLIENT *target, CHANNEL *chan,
const char *channame)
@@ -230,10 +284,20 @@ join_send_topic(CLIENT *Client, CLIENT *target, CHANNEL *chan,
/* send list of channel members to client */
if (!IRC_Send_NAMES(Client, chan))
return false;
return IRC_WriteStrClient(Client, RPL_ENDOFNAMES_MSG, Client_ID(Client), Channel_Name(chan));
}
return IRC_WriteStrClient(Client, RPL_ENDOFNAMES_MSG, Client_ID(Client),
Channel_Name(chan));
} /* join_send_topic */
/**
* Handler for the IRC "JOIN" command.
*
* See RFC 2812, 3.2.1 "Join message"; RFC 2813, 4.2.1 "Join message".
*
* @param Client The client from which this command has been received
* @param Req Request structure with prefix and all parameters
* @returns CONNECTED or DISCONNECTED
*/
GLOBAL bool
IRC_JOIN( CLIENT *Client, REQUEST *Req )
{
@@ -358,6 +422,12 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
/**
* Handler for the IRC "PART" command.
*
* See RFC 2812, 3.2.2: "Part message".
*
* @param Client The client from which this command has been received
* @param Req Request structure with prefix and all parameters
* @returns CONNECTED or DISCONNECTED
*/
GLOBAL bool
IRC_PART(CLIENT * Client, REQUEST * Req)
@@ -403,55 +473,81 @@ IRC_PART(CLIENT * Client, REQUEST * Req)
} /* IRC_PART */
/**
* Handler for the IRC "TOPIC" command.
*
* See RFC 2812, 3.2.4 "Topic message".
*
* @param Client The client from which this command has been received
* @param Req Request structure with prefix and all parameters
* @returns CONNECTED or DISCONNECTED
*/
GLOBAL bool
IRC_TOPIC( CLIENT *Client, REQUEST *Req )
{
CHANNEL *chan;
CLIENT *from;
char *topic;
bool r;
bool onchannel, topicok, use_servermode, r;
assert( Client != NULL );
assert( Req != NULL );
if ((Req->argc < 1) || (Req->argc > 2))
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command);
if (Req->argc < 1 || Req->argc > 2)
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
else from = Client;
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
if (Client_Type(Client) == CLIENT_SERVER)
from = Client_Search(Req->prefix);
else
from = Client;
/* Welcher Channel? */
chan = Channel_Search( Req->argv[0] );
if( ! chan ) return IRC_WriteStrClient( from, ERR_NOSUCHCHANNEL_MSG, Client_ID( from ), Req->argv[0] );
if (!from)
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), Req->prefix);
/* Ist der User Mitglied in dem Channel? */
if( ! Channel_IsMemberOf( chan, from )) return IRC_WriteStrClient( from, ERR_NOTONCHANNEL_MSG, Client_ID( from ), Req->argv[0] );
chan = Channel_Search(Req->argv[0]);
if (!chan)
return IRC_WriteStrClient(from, ERR_NOSUCHCHANNEL_MSG,
Client_ID(from), Req->argv[0]);
if( Req->argc == 1 )
{
Channel_CheckAdminRights(chan, Client, from,
&onchannel, &topicok, &use_servermode);
if (!onchannel && !topicok)
return IRC_WriteStrClient(from, ERR_NOTONCHANNEL_MSG,
Client_ID(from), Req->argv[0]);
if (Req->argc == 1) {
/* Request actual topic */
topic = Channel_Topic(chan);
if (*topic) {
r = IRC_WriteStrClient(from, RPL_TOPIC_MSG,
Client_ID(Client), Channel_Name(chan), topic);
Client_ID(Client),
Channel_Name(chan), topic);
#ifndef STRICT_RFC
if (!r)
return r;
r = IRC_WriteStrClient(from, RPL_TOPICSETBY_MSG,
Client_ID(Client), Channel_Name(chan),
Channel_TopicWho(chan),
Channel_TopicTime(chan));
Client_ID(Client),
Channel_Name(chan),
Channel_TopicWho(chan),
Channel_TopicTime(chan));
#endif
return r;
}
else
return IRC_WriteStrClient(from, RPL_NOTOPIC_MSG,
Client_ID(from), Channel_Name(chan));
return IRC_WriteStrClient(from, RPL_NOTOPIC_MSG,
Client_ID(from),
Channel_Name(chan));
}
if( strchr( Channel_Modes( chan ), 't' ))
{
/* Topic Lock. Ist der User ein Channel Operator? */
if( ! strchr( Channel_UserModes( chan, from ), 'o' )) return IRC_WriteStrClient( from, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( from ), Channel_Name( chan ));
if (strchr(Channel_Modes(chan), 't')) {
/* Topic Lock. Is the user a channel or IRC operator? */
if (!topicok)
return IRC_WriteStrClient(from, ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(from),
Channel_Name(chan));
}
/* Set new topic */
@@ -460,6 +556,9 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
Client_TypeText(from), Client_Mask(from), Channel_Name(chan),
Req->argv[1][0] ? Req->argv[1] : "<none>");
if (use_servermode)
from = Client_ThisServer();
/* Update channel and forward new topic to other servers */
if (!Channel_IsLocal(chan))
IRC_WriteStrServersPrefix(Client, from, "TOPIC %s :%s",
@@ -477,8 +576,15 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
/**
* Handler for the IRC "LIST" command.
*
* See RFC 2812, 3.2.6 "List message".
*
* This implementation handles the local case as well as the forwarding of the
* LIST command to other servers in the IRC network.
*
* @param Client The client from which this command has been received
* @param Req Request structure with prefix and all parameters
* @returns CONNECTED or DISCONNECTED
*/
GLOBAL bool
IRC_LIST( CLIENT *Client, REQUEST *Req )
@@ -562,6 +668,16 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
} /* IRC_LIST */
/**
* Handler for the IRC+ command "CHANINFO".
*
* See doc/Protocol.txt, section II.3:
* "Exchange channel-modes, topics, and persistent channels".
*
* @param Client The client from which this command has been received
* @param Req Request structure with prefix and all parameters
* @returns CONNECTED or DISCONNECTED
*/
GLOBAL bool
IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
{
@@ -574,7 +690,9 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
assert( Req != NULL );
/* Bad number of parameters? */
if(( Req->argc < 2 ) || ( Req->argc == 4 ) || ( Req->argc > 5 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5)
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
/* Compatibility kludge */
if( Req->argc == 5 ) arg_topic = 4;

View File

@@ -7,16 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc-channel.h,v 1.7 2005/03/19 18:43:48 fw Exp $
*
* IRC channel commands (header)
*/
#ifndef __irc_channel_h__
#define __irc_channel_h__
/**
* @file
* IRC channel commands (header)
*/
GLOBAL bool IRC_JOIN PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_PART PARAMS((CLIENT *Client, REQUEST *Req ));
@@ -26,8 +25,6 @@ GLOBAL bool IRC_LIST PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_CHANINFO PARAMS((CLIENT *Client, REQUEST *Req ));
#endif
/* -eof- */

View File

@@ -1,19 +1,21 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
* Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* IRC info commands
*/
#include "portab.h"
/**
* @file
* IRC info commands
*/
#include "imp.h"
#include <assert.h>
#include <errno.h>
@@ -25,9 +27,7 @@
#include "ngircd.h"
#include "conn-func.h"
#include "conn-zip.h"
#include "client.h"
#include "channel.h"
#include "resolve.h"
#include "conf.h"
#include "defines.h"
#include "log.h"
@@ -629,42 +629,51 @@ IRC_TIME( CLIENT *Client, REQUEST *Req )
} /* IRC_TIME */
/**
* Handler for the IRC command "USERHOST".
* See RFC 2812 section 4.8.
*/
GLOBAL bool
IRC_USERHOST( CLIENT *Client, REQUEST *Req )
IRC_USERHOST(CLIENT *Client, REQUEST *Req)
{
char rpl[COMMAND_LEN];
CLIENT *c;
int max, i;
assert( Client != NULL );
assert( Req != NULL );
assert(Client != NULL);
assert(Req != NULL);
if(( Req->argc < 1 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
if ((Req->argc < 1))
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
if( Req->argc > 5 ) max = 5;
else max = Req->argc;
if (Req->argc > 5)
max = 5;
else
max = Req->argc;
strlcpy( rpl, RPL_USERHOST_MSG, sizeof rpl );
for( i = 0; i < max; i++ )
{
c = Client_Search( Req->argv[i] );
if( c && ( Client_Type( c ) == CLIENT_USER ))
{
strlcpy(rpl, RPL_USERHOST_MSG, sizeof rpl);
for (i = 0; i < max; i++) {
c = Client_Search(Req->argv[i]);
if (c && (Client_Type(c) == CLIENT_USER)) {
/* This Nick is "online" */
strlcat( rpl, Client_ID( c ), sizeof( rpl ));
if( Client_HasMode( c, 'o' )) strlcat( rpl, "*", sizeof( rpl ));
strlcat( rpl, "=", sizeof( rpl ));
if( Client_HasMode( c, 'a' )) strlcat( rpl, "-", sizeof( rpl ));
else strlcat( rpl, "+", sizeof( rpl ));
strlcat( rpl, Client_User( c ), sizeof( rpl ));
strlcat( rpl, "@", sizeof( rpl ));
strlcat( rpl, Client_Hostname( c ), sizeof( rpl ));
strlcat( rpl, " ", sizeof( rpl ));
strlcat(rpl, Client_ID(c), sizeof(rpl));
if (Client_HasMode(c, 'o'))
strlcat(rpl, "*", sizeof(rpl));
strlcat(rpl, "=", sizeof(rpl));
if (Client_HasMode(c, 'a'))
strlcat(rpl, "-", sizeof(rpl));
else
strlcat(rpl, "+", sizeof(rpl));
strlcat(rpl, Client_User(c), sizeof(rpl));
strlcat(rpl, "@", sizeof(rpl));
strlcat(rpl, Client_HostnameCloaked(c), sizeof(rpl));
strlcat(rpl, " ", sizeof(rpl));
}
}
ngt_TrimLastChr( rpl, ' ');
ngt_TrimLastChr(rpl, ' ');
return IRC_WriteStrClient( Client, rpl, Client_ID( Client ) );
return IRC_WriteStrClient(Client, rpl, Client_ID(Client));
} /* IRC_USERHOST */
@@ -721,9 +730,11 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
static bool
write_whoreply(CLIENT *Client, CLIENT *c, const char *channelname, const char *flags)
{
return IRC_WriteStrClient(Client, RPL_WHOREPLY_MSG, Client_ID(Client), channelname,
Client_User(c), Client_Hostname(c), Client_ID(Client_Introducer(c)), Client_ID(c),
flags, Client_Hops(c), Client_Info(c));
return IRC_WriteStrClient(Client, RPL_WHOREPLY_MSG, Client_ID(Client),
channelname, Client_User(c),
Client_HostnameCloaked(c),
Client_ID(Client_Introducer(c)), Client_ID(c),
flags, Client_Hops(c), Client_Info(c));
}
@@ -905,58 +916,43 @@ IRC_WHO( CLIENT *Client, REQUEST *Req )
} /* IRC_WHO */
GLOBAL bool
IRC_WHOIS( CLIENT *Client, REQUEST *Req )
/**
* Generate WHOIS reply of one actual client.
*
* @param Client The client from which this command has been received.
* @param from The client requesting the information ("originator").
* @param c The client of which information should be returned.
* @returns CONNECTED or DISCONNECTED.
*/
static bool
IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
{
CLIENT *from, *target, *c;
char str[LINE_LEN + 1];
CL2CHAN *cl2chan;
CHANNEL *chan;
assert( Client != NULL );
assert( Req != NULL );
/* Bad number of parameters? */
if(( Req->argc < 1 ) || ( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Search client */
c = Client_Search( Req->argv[Req->argc - 1] );
if(( ! c ) || ( Client_Type( c ) != CLIENT_USER )) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[Req->argc - 1] );
/* Search sender of the WHOIS */
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
else from = Client;
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
/* Forward to other server? */
if( Req->argc > 1 )
{
/* Search target server (can be specified as nick of that server!) */
target = Client_Search( Req->argv[0] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
}
else target = Client_ThisServer( );
assert( target != NULL );
if(( Client_NextHop( target ) != Client_ThisServer( )) && ( Client_Type( Client_NextHop( target )) == CLIENT_SERVER )) return IRC_WriteStrClientPrefix( target, from, "WHOIS %s :%s", Req->argv[0], Req->argv[1] );
/* Nick, user and name */
if( ! IRC_WriteStrClient( from, RPL_WHOISUSER_MSG, Client_ID( from ), Client_ID( c ), Client_User( c ), Client_Hostname( c ), Client_Info( c ))) return DISCONNECTED;
/* Nick, user, hostname and client info */
if (!IRC_WriteStrClient(from, RPL_WHOISUSER_MSG, Client_ID(from),
Client_ID(c), Client_User(c),
Client_HostnameCloaked(c), Client_Info(c)))
return DISCONNECTED;
/* Server */
if( ! IRC_WriteStrClient( from, RPL_WHOISSERVER_MSG, Client_ID( from ), Client_ID( c ), Client_ID( Client_Introducer( c )), Client_Info( Client_Introducer( c )))) return DISCONNECTED;
if (!IRC_WriteStrClient(from, RPL_WHOISSERVER_MSG, Client_ID(from),
Client_ID(c), Client_ID(Client_Introducer(c)),
Client_Info(Client_Introducer(c))))
return DISCONNECTED;
/* Channels */
snprintf( str, sizeof( str ), RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
cl2chan = Channel_FirstChannelOf( c );
while( cl2chan )
{
chan = Channel_GetChannel( cl2chan );
assert( chan != NULL );
snprintf(str, sizeof(str), RPL_WHOISCHANNELS_MSG,
Client_ID(from), Client_ID(c));
cl2chan = Channel_FirstChannelOf(c);
while (cl2chan) {
chan = Channel_GetChannel(cl2chan);
assert(chan != NULL);
/* next */
cl2chan = Channel_NextChannelOf( c, cl2chan );
cl2chan = Channel_NextChannelOf(c, cl2chan);
/* Secret channel? */
if (strchr(Channel_Modes(chan), 's')
@@ -969,47 +965,168 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
continue;
/* Concatenate channel names */
if( str[strlen( str ) - 1] != ':' ) strlcat( str, " ", sizeof( str ));
if( strchr( Channel_UserModes( chan, c ), 'o' )) strlcat( str, "@", sizeof( str ));
else if( strchr( Channel_UserModes( chan, c ), 'v' )) strlcat( str, "+", sizeof( str ));
strlcat( str, Channel_Name( chan ), sizeof( str ));
if (str[strlen(str) - 1] != ':')
strlcat(str, " ", sizeof(str));
if( strlen( str ) > ( LINE_LEN - CHANNEL_NAME_LEN - 4 ))
{
strlcat(str, who_flags_qualifier(Channel_UserModes(chan, c)),
sizeof(str));
strlcat(str, Channel_Name(chan), sizeof(str));
if (strlen(str) > (LINE_LEN - CHANNEL_NAME_LEN - 4)) {
/* Line becomes too long: send it! */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
snprintf( str, sizeof( str ), RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
if (!IRC_WriteStrClient(Client, "%s", str))
return DISCONNECTED;
snprintf(str, sizeof(str), RPL_WHOISCHANNELS_MSG,
Client_ID(from), Client_ID(c));
}
}
if( str[strlen( str ) - 1] != ':')
{
if(str[strlen(str) - 1] != ':') {
/* There is data left to send: */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
if (!IRC_WriteStrClient(Client, "%s", str))
return DISCONNECTED;
}
/* IRC-Operator? */
if( Client_HasMode( c, 'o' ))
{
if( ! IRC_WriteStrClient( from, RPL_WHOISOPERATOR_MSG, Client_ID( from ), Client_ID( c ))) return DISCONNECTED;
}
if (Client_HasMode(c, 'o') &&
!IRC_WriteStrClient(from, RPL_WHOISOPERATOR_MSG,
Client_ID(from), Client_ID(c)))
return DISCONNECTED;
/* Connected using SSL? */
if (Conn_UsesSSL(Client_Conn(c)) &&
!IRC_WriteStrClient(from, RPL_WHOISSSL_MSG,
Client_ID(from), Client_ID(c)))
return DISCONNECTED;
/* Idle and signon time (local clients only!) */
if (Client_Conn(c) > NONE ) {
if (! IRC_WriteStrClient(from, RPL_WHOISIDLE_MSG,
Client_ID(from), Client_ID(c),
(unsigned long)Conn_GetIdle(Client_Conn(c)),
(unsigned long)Conn_GetSignon(Client_Conn(c))))
return DISCONNECTED;
}
if (!Conf_MorePrivacy && Client_Conn(c) > NONE &&
!IRC_WriteStrClient(from, RPL_WHOISIDLE_MSG,
Client_ID(from), Client_ID(c),
(unsigned long)Conn_GetIdle(Client_Conn(c)),
(unsigned long)Conn_GetSignon(Client_Conn(c))))
return DISCONNECTED;
/* Away? */
if( Client_HasMode( c, 'a' ))
{
if( ! IRC_WriteStrClient( from, RPL_AWAY_MSG, Client_ID( from ), Client_ID( c ), Client_Away( c ))) return DISCONNECTED;
}
if (Client_HasMode(c, 'a') &&
!IRC_WriteStrClient(from, RPL_AWAY_MSG,
Client_ID(from), Client_ID(c),
Client_Away(c)))
return DISCONNECTED;
/* End of Whois */
return IRC_WriteStrClient( from, RPL_ENDOFWHOIS_MSG, Client_ID( from ), Client_ID( c ));
return IRC_WriteStrClient(from, RPL_ENDOFWHOIS_MSG,
Client_ID(from), Client_ID(c));
} /* IRC_WHOIS_SendReply */
/**
* Handler for the IRC "WHOIS" command.
*
* See RFC 2812, 3.6.2 "Whois query".
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @return CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_WHOIS( CLIENT *Client, REQUEST *Req )
{
CLIENT *from, *target, *c;
unsigned int match_count = 0, found = 0;
bool has_wildcards, is_remote;
bool got_wildcard = false;
const char *query;
assert( Client != NULL );
assert( Req != NULL );
/* Bad number of parameters? */
if (Req->argc < 1 || Req->argc > 2)
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
/* Search sender of the WHOIS */
if (Client_Type(Client) == CLIENT_SERVER) {
from = Client_Search(Req->prefix);
} else {
IRC_SetPenalty(Client, 1);
from = Client;
}
if (!from)
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), Req->prefix);
/* Get target server for this command */
if (Req->argc > 1) {
/* Search the target server, which can be specified as a
* nick name on that server as well: */
target = Client_Search(Req->argv[0]);
if (!target)
return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG,
Client_ID(from), Req->argv[0]);
} else
target = Client_ThisServer();
assert(target != NULL);
/* Forward to other server? */
if (Client_NextHop(target) != Client_ThisServer() &&
Client_Type(Client_NextHop(target)) == CLIENT_SERVER)
return IRC_WriteStrClientPrefix(target, from,
"WHOIS %s :%s",
Req->argv[0], Req->argv[1]);
is_remote = Client_Conn(from) < 0;
for (query = strtok(Req->argv[Req->argc - 1], ",");
query && found < 3;
query = strtok(NULL, ","), found++)
{
has_wildcards = query[strcspn(query, "*?")] != 0;
/*
* follows ircd 2.10 implementation:
* - handle up to 3 targets
* - no wildcards for remote clients
* - only one wildcard target per local client
*
* also, at most ten matches are returned.
*/
if (!has_wildcards || is_remote) {
c = Client_Search(query);
if (c) {
if (!IRC_WHOIS_SendReply(Client, from, c))
return DISCONNECTED;
} else {
if (!IRC_WriteStrClient(Client,
ERR_NOSUCHNICK_MSG,
Client_ID(Client),
query))
return DISCONNECTED;
}
continue;
}
if (got_wildcard) {
/* we already handled one wildcard query */
if (!IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), query))
return DISCONNECTED;
continue;
}
got_wildcard = true;
IRC_SetPenalty(Client, 3);
for (c = Client_First(); c && match_count < 10; c = Client_Next(c)) {
if (Client_Type(c) != CLIENT_USER)
continue;
if (!MatchCaseInsensitive(query, Client_ID(c)))
continue;
if (!IRC_WHOIS_SendReply(Client, from, c))
return DISCONNECTED;
match_count++;
}
if (match_count == 0)
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), Req->argv[Req->argc - 1]);
}
return CONNECTED;
} /* IRC_WHOIS */
@@ -1046,6 +1163,10 @@ IRC_WHOWAS( CLIENT *Client, REQUEST *Req )
assert( Client != NULL );
assert( Req != NULL );
/* Do not reveal any info on disconnected users? */
if (Conf_MorePrivacy)
return CONNECTED;
/* Wrong number of parameters? */
if (Req->argc > 3)
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
@@ -1220,51 +1341,38 @@ static bool Show_MOTD_SSLInfo(CLIENT *Client)
return ret;
}
#else
static inline bool Show_MOTD_SSLInfo(UNUSED CLIENT *c) { return true; }
static inline bool
Show_MOTD_SSLInfo(UNUSED CLIENT *c)
{ return true; }
#endif
GLOBAL bool
IRC_Show_MOTD( CLIENT *Client )
{
char line[127];
FILE *fd;
const char *line;
size_t len_tot, len_str;
assert( Client != NULL );
if (Conf_MotdPhrase[0]) {
if (!Show_MOTD_Start(Client))
len_tot = array_bytes(&Conf_Motd);
if (len_tot == 0 && !Conn_UsesSSL(Client_Conn(Client)))
return IRC_WriteStrClient(Client, ERR_NOMOTD_MSG, Client_ID(Client));
if (!Show_MOTD_Start(Client))
return DISCONNECTED;
line = array_start(&Conf_Motd);
while (len_tot > 0) {
len_str = strlen(line) + 1;
assert(len_tot >= len_str);
len_tot -= len_str;
if (!Show_MOTD_Sendline(Client, line))
return DISCONNECTED;
if (!Show_MOTD_Sendline(Client, Conf_MotdPhrase))
return DISCONNECTED;
goto out;
line += len_str;
}
fd = fopen( Conf_MotdFile, "r" );
if( ! fd ) {
Log( LOG_WARNING, "Can't read MOTD file \"%s\": %s", Conf_MotdFile, strerror( errno ));
if (Conn_UsesSSL(Client_Conn(Client))) {
if (!Show_MOTD_Start(Client))
return DISCONNECTED;
goto out;
}
return IRC_WriteStrClient( Client, ERR_NOMOTD_MSG, Client_ID( Client ) );
}
if (!Show_MOTD_Start( Client )) {
fclose(fd);
return false;
}
while (fgets( line, (int)sizeof line, fd )) {
ngt_TrimLastChr( line, '\n');
if( ! Show_MOTD_Sendline( Client, line)) {
fclose( fd );
return false;
}
}
fclose(fd);
out:
if (!Show_MOTD_SSLInfo(Client))
return DISCONNECTED;
return Show_MOTD_End(Client);
@@ -1285,6 +1393,10 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
if( Channel_IsMemberOf( Chan, Client )) is_member = true;
else is_member = false;
/* Do not print info on channel memberships to anyone that is not member? */
if (Conf_MorePrivacy && !is_member)
return CONNECTED;
/* Secret channel? */
if( ! is_member && strchr( Channel_Modes( Chan ), 's' )) return CONNECTED;
@@ -1327,14 +1439,13 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
} /* IRC_Send_NAMES */
/**
* Send the ISUPPORT numeric (005).
* This numeric indicates the features that are supported by this server.
* See <http://www.irc.org/tech_docs/005.html> for details.
*/
GLOBAL bool
IRC_Send_ISUPPORT PARAMS((CLIENT * Client))
IRC_Send_ISUPPORT(CLIENT * Client)
{
if (!IRC_WriteStrClient(Client, RPL_ISUPPORT1_MSG, Client_ID(Client),
Conf_MaxJoins))

View File

@@ -7,16 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc-info.h,v 1.6 2008/02/17 13:26:42 alex Exp $
*
* IRC info commands (header)
*/
#ifndef __irc_info_h__
#define __irc_info_h__
/**
* @file
* IRC info commands (header)
*/
GLOBAL bool IRC_ADMIN PARAMS(( CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_INFO PARAMS(( CLIENT *Client, REQUEST *Req ));
@@ -41,8 +40,6 @@ GLOBAL bool IRC_Send_NAMES PARAMS(( CLIENT *Client, CHANNEL *Chan ));
GLOBAL bool IRC_Show_MOTD PARAMS(( CLIENT *Client ));
GLOBAL bool IRC_Send_ISUPPORT PARAMS(( CLIENT *Client ));
#endif
/* -eof- */

View File

@@ -7,28 +7,32 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Login and logout
*/
#include "portab.h"
/**
* @file
* Login and logout
*/
#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <unistd.h>
#include "ngircd.h"
#include "resolve.h"
#include "conn-func.h"
#include "conf.h"
#include "client.h"
#include "channel.h"
#include "io.h"
#include "log.h"
#include "messages.h"
#include "pam.h"
#include "parse.h"
#include "irc.h"
#include "irc-info.h"
@@ -39,15 +43,26 @@
static bool Hello_User PARAMS(( CLIENT *Client ));
static bool Hello_User_PostAuth PARAMS(( CLIENT *Client ));
static void Kill_Nick PARAMS(( char *Nick, char *Reason ));
static void Introduce_Client PARAMS((CLIENT *To, CLIENT *Client, int Type));
static void Reject_Client PARAMS((CLIENT *Client));
static void cb_introduceClient PARAMS((CLIENT *Client, CLIENT *Prefix,
void *i));
#ifdef PAM
static void cb_Read_Auth_Result PARAMS((int r_fd, UNUSED short events));
#endif
/**
* Handler for the IRC command "PASS".
* Handler for the IRC "PASS" command.
*
* See RFC 2813 section 4.1.1, and RFC 2812 section 3.1.1.
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_PASS( CLIENT *Client, REQUEST *Req )
@@ -135,16 +150,17 @@ IRC_PASS( CLIENT *Client, REQUEST *Req )
if (type && strcmp(type, PROTOIRCPLUS) == 0) {
/* The peer seems to be a server which supports the
* IRC+ protocol (see doc/Protocol.txt). */
serverver = ptr + 1;
flags = strchr(serverver, ':');
serverver = ptr ? ptr + 1 : "?";
flags = strchr(ptr ? serverver : impl, ':');
if (flags) {
*flags = '\0';
flags++;
} else
flags = "";
Log(LOG_INFO,
"Peer announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").",
impl, serverver, protohigh, protolow, flags);
"Peer on conenction %d announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").",
Client_Conn(Client), impl, serverver,
protohigh, protolow, flags);
} else {
/* The peer seems to be a server supporting the
* "original" IRC protocol (RFC 2813). */
@@ -153,8 +169,9 @@ IRC_PASS( CLIENT *Client, REQUEST *Req )
else
flags = "";
Log(LOG_INFO,
"Peer announces itself as \"%s\" using protocol %d.%d (flags: \"%s\").",
impl, protohigh, protolow, flags);
"Peer on connection %d announces itself as \"%s\" using protocol %d.%d (flags: \"%s\").",
Client_Conn(Client), impl,
protohigh, protolow, flags);
}
Client_SetFlags(Client, flags);
}
@@ -164,10 +181,17 @@ IRC_PASS( CLIENT *Client, REQUEST *Req )
/**
* IRC "NICK" command.
* Handler for the IRC "NICK" command.
*
* See RFC 2812, 3.1.2 "Nick message", and RFC 2813, 4.1.3 "Nick".
*
* This function implements the IRC command "NICK" which is used to register
* with the server, to change already registered nicknames and to introduce
* new users which are connected to other servers.
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_NICK( CLIENT *Client, REQUEST *Req )
@@ -247,6 +271,17 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
/* Register new nickname of this client */
Client_SetID( target, Req->argv[0] );
#ifndef STRICT_RFC
if (Conf_AuthPing) {
Conn_SetAuthPing(Client_Conn(Client), rand());
IRC_WriteStrClient(Client, "PING :%ld",
Conn_GetAuthPing(Client_Conn(Client)));
LogDebug("Connection %d: sent AUTH PING %ld ...",
Client_Conn(Client),
Conn_GetAuthPing(Client_Conn(Client)));
}
#endif
/* If we received a valid USER command already then
* register the new client! */
if( Client_Type( Client ) == CLIENT_GOTUSER )
@@ -356,7 +391,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
* RFC 1459: announce the new client only after receiving the
* USER command, first we need more information! */
if (Req->argc < 7) {
LogDebug("Client \"%s\" is beeing registered (RFC 1459) ...",
LogDebug("Client \"%s\" is being registered (RFC 1459) ...",
Client_Mask(c));
Client_SetType(c, CLIENT_GOTNICK);
} else
@@ -369,7 +404,13 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
/**
* Handler for the IRC command "USER".
* Handler for the IRC "USER" command.
*
* See RFC 2812, 3.1.3 "User message".
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_USER(CLIENT * Client, REQUEST * Req)
@@ -403,6 +444,7 @@ IRC_USER(CLIENT * Client, REQUEST * Req)
#else
Client_SetUser(Client, Req->argv[0], false);
#endif
Client_SetOrigUser(Client, Req->argv[0]);
/* "Real name" or user info text: Don't set it to the empty
* string, the original ircd can't deal with such "real names"
@@ -435,6 +477,7 @@ IRC_USER(CLIENT * Client, REQUEST * Req)
Req->prefix);
Client_SetUser(c, Req->argv[0], true);
Client_SetOrigUser(c, Req->argv[0]);
Client_SetHostname(c, Req->argv[1]);
Client_SetInfo(c, Req->argv[3]);
@@ -460,12 +503,18 @@ IRC_USER(CLIENT * Client, REQUEST * Req)
/**
* Handler for the IRC command "SERVICE".
* Handler for the IRC "SERVICE" command.
*
* This function implements IRC Services registration using the SERVICE command
* defined in RFC 2812 3.1.6 and RFC 2813 4.1.4.
*
* At the moment ngIRCd doesn't support directly linked services, so this
* function returns ERR_ERRONEUSNICKNAME when the SERVICE command has not been
* received from a peer server.
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED..
*/
GLOBAL bool
IRC_SERVICE(CLIENT *Client, REQUEST *Req)
@@ -558,8 +607,14 @@ IRC_SERVICE(CLIENT *Client, REQUEST *Req)
/**
* Handler for the IRC command "WEBIRC".
* Syntax: WEBIRC <password> <username> <real-hostname> <real-IP-address>
* Handler for the IRC "WEBIRC" command.
*
* See doc/Protocol.txt, section II.4:
* "Update webchat/proxy client information".
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_WEBIRC(CLIENT *Client, REQUEST *Req)
@@ -577,11 +632,21 @@ IRC_WEBIRC(CLIENT *Client, REQUEST *Req)
Client_Conn(Client), Req->argv[1], Req->argv[2], Req->argv[3]);
Client_SetUser(Client, Req->argv[1], true);
Client_SetOrigUser(Client, Req->argv[1]);
Client_SetHostname(Client, Req->argv[2]);
return CONNECTED;
} /* IRC_WEBIRC */
/**
* Handler for the IRC "QUIT" command.
*
* See RFC 2812, 3.1.7 "Quit", and RFC 2813, 4.1.5 "Quit".
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_QUIT( CLIENT *Client, REQUEST *Req )
{
@@ -629,6 +694,38 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req )
} /* IRC_QUIT */
#ifndef STRICT_RFC
/**
* Handler for HTTP command, e.g. GET and POST
*
* We handle these commands here to avoid the quite long timeout when
* some user tries to access this IRC daemon using an web browser ...
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_QUIT_HTTP( CLIENT *Client, REQUEST *Req )
{
Req->argc = 1;
Req->argv[0] = "Oops, HTTP request received? This is IRC!";
return IRC_QUIT(Client, Req);
} /* IRC_QUIT_HTTP */
#endif
/**
* Handler for the IRC "PING" command.
*
* See RFC 2812, 3.7.2 "Ping message".
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_PING(CLIENT *Client, REQUEST *Req)
{
@@ -698,22 +795,45 @@ IRC_PING(CLIENT *Client, REQUEST *Req)
} /* IRC_PING */
/**
* Handler for the IRC "PONG" command.
*
* See RFC 2812, 3.7.3 "Pong message".
*
* @param Client The client from which this command has been received.
* @param Req Request structure with prefix and all parameters.
* @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_PONG(CLIENT *Client, REQUEST *Req)
{
CLIENT *target, *from;
CONN_ID conn;
#ifndef STRICT_RFC
long auth_ping;
#endif
char *s;
assert(Client != NULL);
assert(Req != NULL);
/* Wrong number of arguments? */
if (Req->argc < 1)
return IRC_WriteStrClient(Client, ERR_NOORIGIN_MSG,
Client_ID(Client));
if (Req->argc > 2)
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
if (Req->argc < 1) {
if (Client_Type(Client) == CLIENT_USER)
return IRC_WriteStrClient(Client, ERR_NOORIGIN_MSG,
Client_ID(Client));
else
return CONNECTED;
}
if (Req->argc > 2) {
if (Client_Type(Client) == CLIENT_USER)
return IRC_WriteStrClient(Client,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client),
Req->command);
else
return CONNECTED;
}
/* Forward? */
if (Req->argc == 2 && Client_Type(Client) == CLIENT_SERVER) {
@@ -742,35 +862,197 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
/* The connection timestamp has already been updated when the data has
* been read from so socket, so we don't need to update it here. */
conn = Client_Conn(Client);
#ifndef STRICT_RFC
/* Check authentication PING-PONG ... */
auth_ping = Conn_GetAuthPing(conn);
if (auth_ping) {
LogDebug("AUTH PONG: waiting for token \"%ld\", got \"%s\" ...",
auth_ping, Req->argv[0]);
if (auth_ping == atoi(Req->argv[0])) {
Conn_SetAuthPing(conn, 0);
if (Client_Type(Client) == CLIENT_WAITAUTHPING)
Hello_User(Client);
} else
if (!IRC_WriteStrClient(Client,
"To connect, type /QUOTE PONG %ld",
auth_ping))
return DISCONNECTED;
}
#endif
#ifdef DEBUG
if (Client_Conn(Client) > NONE)
if (conn > NONE)
Log(LOG_DEBUG,
"Connection %d: received PONG. Lag: %ld seconds.",
Client_Conn(Client),
"Connection %d: received PONG. Lag: %ld seconds.", conn,
time(NULL) - Conn_LastPing(Client_Conn(Client)));
else
Log(LOG_DEBUG,
"Connection %d: received PONG.", Client_Conn(Client));
"Connection %d: received PONG.", conn);
#endif
return CONNECTED;
} /* IRC_PONG */
/**
* Initiate client registration.
*
* This function is called after the daemon received the required NICK and
* USER commands of a new client. If the daemon is compiled with support for
* PAM, the authentication sub-processs is forked; otherwise the global server
* password is checked.
*
* @param Client The client logging in.
* @returns CONNECTED or DISCONNECTED.
*/
static bool
Hello_User(CLIENT * Client)
{
assert(Client != NULL);
#ifdef PAM
int pipefd[2], result;
pid_t pid;
#endif
CONN_ID conn;
/* Check password ... */
if (strcmp(Client_Password(Client), Conf_ServerPwd) != 0) {
/* Bad password! */
Log(LOG_ERR,
"Client \"%s\" rejected (connection %d): Bad password!",
Client_Mask(Client), Client_Conn(Client));
Conn_Close(Client_Conn(Client), NULL, "Bad password", true);
assert(Client != NULL);
conn = Client_Conn(Client);
#ifndef STRICT_RFC
if (Conf_AuthPing) {
/* Did we receive the "auth PONG" already? */
if (Conn_GetAuthPing(conn)) {
Client_SetType(Client, CLIENT_WAITAUTHPING);
LogDebug("Connection %d: Waiting for AUTH PONG ...", conn);
return CONNECTED;
}
}
#endif
#ifdef PAM
if (!Conf_PAM) {
/* Don't do any PAM authentication at all, instead emulate
* the beahiour of the daemon compiled without PAM support:
* because there can't be any "server password", all
* passwords supplied are classified as "wrong". */
if(Client_Password(Client)[0] == '\0')
return Hello_User_PostAuth(Client);
Reject_Client(Client);
return DISCONNECTED;
}
/* Fork child process for PAM authentication; and make sure that the
* process timeout is set higher than the login timeout! */
pid = Proc_Fork(Conn_GetProcStat(conn), pipefd,
cb_Read_Auth_Result, Conf_PongTimeout + 1);
if (pid > 0) {
LogDebug("Authenticator for connection %d created (PID %d).",
conn, pid);
return CONNECTED;
} else {
/* Sub process */
Log_Init_Subprocess("Auth");
result = PAM_Authenticate(Client);
if (write(pipefd[1], &result, sizeof(result)) != sizeof(result))
Log_Subprocess(LOG_ERR,
"Failed to pipe result to parent!");
Log_Exit_Subprocess("Auth");
exit(0);
}
#else
/* Check global server password ... */
if (strcmp(Client_Password(Client), Conf_ServerPwd) != 0) {
/* Bad password! */
Reject_Client(Client);
return DISCONNECTED;
}
return Hello_User_PostAuth(Client);
#endif
}
#ifdef PAM
/**
* Read result of the authenticatior sub-process from pipe
*
* @param r_fd File descriptor of the pipe.
* @param events (ignored IO specification)
*/
static void
cb_Read_Auth_Result(int r_fd, UNUSED short events)
{
CONN_ID conn;
CLIENT *client;
int result;
size_t len;
PROC_STAT *proc;
LogDebug("Auth: Got callback on fd %d, events %d", r_fd, events);
conn = Conn_GetFromProc(r_fd);
if (conn == NONE) {
/* Ops, none found? Probably the connection has already
* been closed!? We'll ignore that ... */
io_close(r_fd);
LogDebug("Auth: Got callback for unknown connection!?");
return;
}
proc = Conn_GetProcStat(conn);
client = Conn_GetClient(conn);
/* Read result from pipe */
len = Proc_Read(proc, &result, sizeof(result));
if (len == 0)
return;
if (len != sizeof(result)) {
Log(LOG_CRIT, "Auth: Got malformed result!");
Reject_Client(client);
return;
}
if (result == true) {
Client_SetUser(client, Client_OrigUser(client), true);
(void)Hello_User_PostAuth(client);
} else
Reject_Client(client);
}
#endif
/**
* Reject a client because of wrong password.
*
* This function is called either when the global server password or a password
* checked using PAM has been wrong.
*
* @param Client The client to reject.
*/
static void
Reject_Client(CLIENT *Client)
{
Log(LOG_ERR,
"User \"%s\" rejected (connection %d): Access denied!",
Client_Mask(Client), Client_Conn(Client));
Conn_Close(Client_Conn(Client), NULL,
"Access denied! Bad password?", true);
}
/**
* Finish client registration.
*
* Introduce the new client to the network and send all "hello messages"
* to it after authentication has been succeeded.
*
* @param Client The client logging in.
* @returns CONNECTED or DISCONNECTED.
*/
static bool
Hello_User_PostAuth(CLIENT *Client)
{
Introduce_Client(NULL, Client, CLIENT_USER);
if (!IRC_WriteStrClient
@@ -804,9 +1086,15 @@ Hello_User(CLIENT * Client)
IRC_SetPenalty(Client, 1);
return CONNECTED;
} /* Hello_User */
}
/**
* Kill all users with a specific nick name in the network.
*
* @param Nick Nick name.
* @param Reason Reason for the KILL.
*/
static void
Kill_Nick( char *Nick, char *Reason )
{
@@ -825,6 +1113,13 @@ Kill_Nick( char *Nick, char *Reason )
} /* Kill_Nick */
/**
* Introduce a new user or service client in the network.
*
* @param From Remote server introducing the client or NULL (local).
* @param Client New client.
* @param Type Type of the client (CLIENT_USER or CLIENT_SERVICE).
*/
static void
Introduce_Client(CLIENT *From, CLIENT *Client, int Type)
{
@@ -840,10 +1135,16 @@ Introduce_Client(CLIENT *From, CLIENT *Client, int Type)
Client_Modes(Client), Client_ID(From),
Client_ID(Client_Introducer(Client)),
Client_Hops(Client), Client_Hops(Client) > 1 ? "s": "");
} else
} else {
Log(LOG_NOTICE, "%s \"%s\" registered (connection %d).",
Client_TypeText(Client), Client_Mask(Client),
Client_Conn(Client));
Log_ServerNotice('c', "Client connecting: %s (%s@%s) [%s] - %s",
Client_ID(Client), Client_User(Client),
Client_Hostname(Client),
Conn_IPA(Client_Conn(Client)),
Client_TypeText(Client));
}
/* Inform other servers */
IRC_WriteStrServersPrefixFlag_CB(From,
@@ -852,6 +1153,16 @@ Introduce_Client(CLIENT *From, CLIENT *Client, int Type)
} /* Introduce_Client */
/**
* Introduce a new user or service client to a remote server.
*
* This function differentiates between RFC1459 and RFC2813 server links and
* generates the appropriate commands to register the new user or service.
*
* @param To The remote server to inform.
* @param Prefix Prefix for the generated commands.
* @param data CLIENT structure of the new client.
*/
static void
cb_introduceClient(CLIENT *To, CLIENT *Prefix, void *data)
{

View File

@@ -7,14 +7,16 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Login and logout (header)
*/
#ifndef __irc_login_h__
#define __irc_login_h__
/**
* @file
* Login and logout (header)
*/
GLOBAL bool IRC_PASS PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_NICK PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_USER PARAMS((CLIENT *Client, REQUEST *Req));
@@ -23,8 +25,8 @@ GLOBAL bool IRC_WEBIRC PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_PING PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_PONG PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_QUIT PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_QUIT_HTTP PARAMS((CLIENT *Client, REQUEST *Req));
#endif
/* -eof- */

View File

@@ -1,19 +1,21 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
* Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* IRC commands for mode changes (MODE, AWAY, ...)
*/
#include "portab.h"
/**
* @file
* IRC commands for mode changes (like MODE, AWAY, etc.)
*/
#include "imp.h"
#include <assert.h>
#include <stdio.h>
@@ -22,27 +24,30 @@
#include "defines.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
#include "lists.h"
#include "log.h"
#include "parse.h"
#include "messages.h"
#include "resolve.h"
#include "conf.h"
#include "exp.h"
#include "irc-mode.h"
static bool Client_Mode PARAMS(( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ));
static bool Channel_Mode PARAMS(( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel ));
static bool Client_Mode PARAMS(( CLIENT *Client, REQUEST *Req, CLIENT *Origin,
CLIENT *Target ));
static bool Channel_Mode PARAMS(( CLIENT *Client, REQUEST *Req, CLIENT *Origin,
CHANNEL *Channel ));
static bool Add_Ban_Invite PARAMS((int what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, const char *Pattern));
static bool Del_Ban_Invite PARAMS((int what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, const char *Pattern));
static bool Add_Ban_Invite PARAMS((int what, CLIENT *Prefix, CLIENT *Client,
CHANNEL *Channel, const char *Pattern));
static bool Del_Ban_Invite PARAMS((int what, CLIENT *Prefix, CLIENT *Client,
CHANNEL *Channel, const char *Pattern));
static bool Send_ListChange PARAMS(( char *Mode, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, const char *Mask ));
static bool Send_ListChange PARAMS((const char *Mode, CLIENT *Prefix,
CLIENT *Client, CHANNEL *Channel, const char *Mask));
GLOBAL bool
@@ -172,6 +177,17 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
else ok = IRC_WriteStrClient( Origin, ERR_NOPRIVILEGES_MSG, Client_ID( Origin ));
break;
case 'c': /* Receive connect notices
* (only settable by IRC operators!) */
if(!set || Client_OperByMe(Origin)
|| Client_Type(Client) == CLIENT_SERVER)
x[0] = 'c';
else
ok = IRC_WriteStrClient(Origin,
ERR_NOPRIVILEGES_MSG,
Client_ID(Origin));
break;
case 'o': /* IRC operator (only unsettable!) */
if(( ! set ) || ( Client_Type( Client ) == CLIENT_SERVER ))
{
@@ -186,6 +202,15 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
else ok = IRC_WriteStrClient( Origin, ERR_RESTRICTED_MSG, Client_ID( Origin ));
break;
case 'x': /* Cloak hostname */
if (Client_HasMode(Client, 'r'))
ok = IRC_WriteStrClient(Origin,
ERR_RESTRICTED_MSG,
Client_ID(Origin));
else
x[0] = 'x';
break;
default:
Log( LOG_DEBUG, "Unknown mode \"%c%c\" from \"%s\"!?", set ? '+' : '-', *mode_ptr, Client_ID( Origin ));
if( Client_Type( Client ) != CLIENT_SERVER ) ok = IRC_WriteStrClient( Origin, ERR_UMODEUNKNOWNFLAG2_MSG, Client_ID( Origin ), set ? '+' : '-', *mode_ptr );
@@ -271,8 +296,17 @@ Channel_Mode_Answer_Request(CLIENT *Origin, CHANNEL *Channel)
if (the_args[0])
strlcat(the_modes, the_args, sizeof(the_modes));
return IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG,
Client_ID(Origin), Channel_Name(Channel), the_modes);
if (!IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG,
Client_ID(Origin), Channel_Name(Channel),
the_modes))
return DISCONNECTED;
#ifndef STRICT_RFC
if (!IRC_WriteStrClient(Origin, RPL_CREATIONTIME_MSG,
Client_ID(Origin), Channel_Name(Channel),
Channel_CreationTime(Channel)))
return DISCONNECTED;
#endif
return CONNECTED;
}
@@ -284,7 +318,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
{
char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2],
argadd[CLIENT_PASS_LEN], *mode_ptr;
bool connected, set, modeok = true, skiponce, use_servermode = false, retval;
bool connected, set, skiponce, retval, onchannel, modeok, use_servermode;
int mode_arg, arg_arg;
CLIENT *client;
long l;
@@ -298,25 +332,13 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
if (Req->argc <= 1)
return Channel_Mode_Answer_Request(Origin, Channel);
/* Is the user allowed to change modes? */
if (Client_Type(Client) == CLIENT_USER) {
/* Is the originating user on that channel? */
if (!Channel_IsMemberOf(Channel, Origin))
return IRC_WriteStrClient(Origin, ERR_NOTONCHANNEL_MSG,
Client_ID(Origin), Channel_Name(Channel));
modeok = false;
/* channel operator? */
if (strchr(Channel_UserModes(Channel, Origin), 'o'))
modeok = true;
else if (Conf_OperCanMode) {
/* IRC-Operators can use MODE as well */
if (Client_OperByMe(Origin)) {
modeok = true;
if (Conf_OperServerMode)
use_servermode = true; /* Change Origin to Server */
}
}
}
Channel_CheckAdminRights(Channel, Client, Origin,
&onchannel, &modeok, &use_servermode);
if (!onchannel && !modeok)
return IRC_WriteStrClient(Origin, ERR_NOTONCHANNEL_MSG,
Client_ID(Origin),
Channel_Name(Channel));
mode_arg = 1;
mode_ptr = Req->argv[mode_arg];
@@ -479,6 +501,23 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
goto chan_exit;
}
break;
case 'O': /* IRC operators only */
if (modeok) {
/* Only IRC operators are allowed to
* set the 'O' channel mode! */
if (set && !(Client_OperByMe(Client)
|| Client_Type(Client) == CLIENT_SERVER))
connected = IRC_WriteStrClient(Origin,
ERR_NOPRIVILEGES_MSG,
Client_ID(Origin));
else
x[0] = 'O';
} else
connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin),
Channel_Name(Channel));
break;
case 'P': /* Persistent channel */
if (modeok) {
/* Only IRC operators are allowed to
@@ -748,7 +787,8 @@ Del_Ban_Invite(int what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, const
static bool
Send_ListChange( char *Mode, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, const char *Mask )
Send_ListChange(const char *Mode, CLIENT *Prefix, CLIENT *Client,
CHANNEL *Channel, const char *Mask)
{
bool ok;

View File

@@ -7,22 +7,19 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc-mode.h,v 1.6 2005/03/19 18:43:48 fw Exp $
*
* IRC commands for mode changes (header)
*/
#ifndef __irc_mode_h__
#define __irc_mode_h__
/**
* @file
* IRC commands for mode changes (header)
*/
GLOBAL bool IRC_MODE PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_AWAY PARAMS((CLIENT *Client, REQUEST *Req ));
#endif
/* -eof- */

View File

@@ -7,13 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Channel operator commands
*/
#include "portab.h"
/**
* @file
* Channel operator commands
*/
#include "imp.h"
#include <assert.h>
#include <string.h>
@@ -21,7 +23,6 @@
#include "defines.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
#include "lists.h"

View File

@@ -7,22 +7,19 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc-op.h,v 1.4 2005/03/19 18:43:48 fw Exp $
*
* Channel operator commands (header)
*/
#ifndef __irc_op_h__
#define __irc_op_h__
/**
* @file
* Channel operator commands (header)
*/
GLOBAL bool IRC_KICK PARAMS(( CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_INVITE PARAMS(( CLIENT *Client, REQUEST *Req ));
#endif
/* -eof- */

View File

@@ -7,24 +7,25 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* IRC operator commands
*/
#include "portab.h"
/**
* @file
* IRC operator commands
*/
#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include "ngircd.h"
#include "resolve.h"
#include "conn-func.h"
#include "conf.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
#include "log.h"
@@ -148,8 +149,8 @@ IRC_REHASH( CLIENT *Client, REQUEST *Req )
if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
Log( LOG_NOTICE|LOG_snotice, "Got REHASH command from \"%s\" ...", Client_Mask( Client ));
NGIRCd_SignalRehash = true;
raise(SIGHUP);
return CONNECTED;
} /* IRC_REHASH */

View File

@@ -7,16 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc-oper.h,v 1.12 2007/08/02 10:14:26 fw Exp $
*
* IRC operator commands (header)
*/
#ifndef __irc_oper_h__
#define __irc_oper_h__
/**
* @file
* IRC operator commands (header)
*/
GLOBAL bool IRC_OPER PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_DIE PARAMS((CLIENT *Client, REQUEST *Req ));
@@ -26,8 +25,6 @@ GLOBAL bool IRC_CONNECT PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_DISCONNECT PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_WALLOPS PARAMS(( CLIENT *Client, REQUEST *Req ));
#endif
/* -eof- */

View File

@@ -7,13 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* IRC commands for server links
*/
#include "portab.h"
/**
* @file
* IRC commands for server links
*/
#include "imp.h"
#include <assert.h>
#include <stdio.h>
@@ -22,12 +24,10 @@
#include <strings.h>
#include "defines.h"
#include "resolve.h"
#include "conn.h"
#include "conn-func.h"
#include "conn-zip.h"
#include "conf.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
#include "lists.h"
@@ -277,6 +277,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
char msg[COMMAND_LEN], logmsg[COMMAND_LEN];
CLIENT *from, *target;
CONN_ID con;
int loglevel;
assert(Client != NULL);
assert(Req != NULL);
@@ -301,7 +302,11 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), Req->prefix);
Log(LOG_DEBUG, "Got SQUIT from %s for \"%s\": \"%s\" ...",
if (Client_Type(Client) == CLIENT_USER)
loglevel = LOG_NOTICE | LOG_snotice;
else
loglevel = LOG_DEBUG;
Log(loglevel, "Got SQUIT from %s for \"%s\": \"%s\" ...",
Client_ID(from), Req->argv[0], Req->argv[1]);
target = Client_Search(Req->argv[0]);

View File

@@ -7,16 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc-server.h,v 1.6 2007/11/21 12:16:36 alex Exp $
*
* IRC commands for server links (header)
*/
#ifndef __irc_server_h__
#define __irc_server_h__
/**
* @file
* IRC commands for server links (header)
*/
GLOBAL bool IRC_SERVER PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_NJOIN PARAMS((CLIENT *Client, REQUEST *Req ));
@@ -24,8 +23,6 @@ GLOBAL bool IRC_SQUIT PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL bool IRC_ENDOFMOTD_Server PARAMS((CLIENT *Client));
#endif
/* -eof- */

View File

@@ -7,13 +7,15 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Sending IRC commands over the network
*/
#include "portab.h"
/**
* @file
* Sending IRC commands over the network
*/
#include "imp.h"
#include <assert.h>
#ifdef PROTOTYPES
@@ -26,7 +28,6 @@
#include "defines.h"
#include "conn-func.h"
#include "client.h"
#include "channel.h"
#include "exp.h"
@@ -37,19 +38,20 @@
#define SEND_TO_SERVER 2
static char *Get_Prefix PARAMS((CLIENT *Target, CLIENT *Client));
static const char *Get_Prefix PARAMS((CLIENT *Target, CLIENT *Client));
static void cb_writeStrServersPrefixFlag PARAMS((CLIENT *Client,
CLIENT *Prefix, void *Buffer));
static bool Send_Marked_Connections PARAMS((CLIENT *Prefix, const char *Buffer));
#ifdef PROTOTYPES
GLOBAL bool
IRC_WriteStrClient( CLIENT *Client, char *Format, ... )
IRC_WriteStrClient( CLIENT *Client, const char *Format, ... )
#else
GLOBAL bool
IRC_WriteStrClient( Client, Format, va_alist )
CLIENT *Client;
char *Format;
const char *Format;
va_dcl
#endif
{
@@ -77,13 +79,13 @@ va_dcl
#ifdef PROTOTYPES
GLOBAL bool
IRC_WriteStrClientPrefix( CLIENT *Client, CLIENT *Prefix, char *Format, ... )
IRC_WriteStrClientPrefix(CLIENT *Client, CLIENT *Prefix, const char *Format, ...)
#else
GLOBAL bool
IRC_WriteStrClientPrefix( Client, Prefix, Format, va_alist )
IRC_WriteStrClientPrefix(Client, Prefix, Format, va_alist)
CLIENT *Client;
CLIENT *Prefix;
char *Format;
const char *Format;
va_dcl
#endif
{
@@ -104,20 +106,22 @@ va_dcl
vsnprintf( buffer, 1000, Format, ap );
va_end( ap );
return Conn_WriteStr( Client_Conn( Client_NextHop( Client )), ":%s %s", Get_Prefix( Client_NextHop( Client ), Prefix ), buffer );
return Conn_WriteStr(Client_Conn(Client_NextHop(Client)), ":%s %s",
Get_Prefix(Client_NextHop(Client), Prefix), buffer);
} /* IRC_WriteStrClientPrefix */
#ifdef PROTOTYPES
GLOBAL bool
IRC_WriteStrChannel( CLIENT *Client, CHANNEL *Chan, bool Remote, char *Format, ... )
IRC_WriteStrChannel(CLIENT *Client, CHANNEL *Chan, bool Remote,
const char *Format, ...)
#else
GLOBAL bool
IRC_WriteStrChannel( Client, Chan, Remote, Format, va_alist )
IRC_WriteStrChannel(Client, Chan, Remote, Format, va_alist)
CLIENT *Client;
CHANNEL *Chan;
bool Remote;
char *Format;
const char *Format;
va_dcl
#endif
{
@@ -146,19 +150,19 @@ va_dcl
*/
#ifdef PROTOTYPES
GLOBAL bool
IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, bool Remote, char *Format, ... )
IRC_WriteStrChannelPrefix(CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix,
bool Remote, const char *Format, ...)
#else
GLOBAL bool
IRC_WriteStrChannelPrefix( Client, Chan, Prefix, Remote, Format, va_alist )
IRC_WriteStrChannelPrefix(Client, Chan, Prefix, Remote, Format, va_alist)
CLIENT *Client;
CHANNEL *Chan;
CLIENT *Prefix;
bool Remote;
char *Format;
const char *Format;
va_dcl
#endif
{
bool ok = CONNECTED;
char buffer[1000];
CL2CHAN *cl2chan;
CONN_ID conn;
@@ -200,30 +204,18 @@ va_dcl
}
cl2chan = Channel_NextMember( Chan, cl2chan );
}
conn = Conn_First( );
while( conn != NONE )
{
/* do we need to send data via this connection? */
if( Conn_Flag( conn ) == SEND_TO_SERVER) ok = Conn_WriteStr( conn, ":%s %s", Client_ID( Prefix ), buffer );
else if( Conn_Flag( conn ) == SEND_TO_USER ) ok = Conn_WriteStr( conn, ":%s %s", Client_Mask( Prefix ), buffer );
if( ! ok ) break;
conn = Conn_Next( conn );
}
return ok;
return Send_Marked_Connections(Prefix, buffer);
} /* IRC_WriteStrChannelPrefix */
#ifdef PROTOTYPES
GLOBAL void
IRC_WriteStrServers( CLIENT *ExceptOf, char *Format, ... )
IRC_WriteStrServers(CLIENT *ExceptOf, const char *Format, ...)
#else
GLOBAL void
IRC_WriteStrServers( ExceptOf, Format, va_alist )
IRC_WriteStrServers(ExceptOf, Format, va_alist)
CLIENT *ExceptOf;
char *Format;
const char *Format;
va_dcl
#endif
{
@@ -246,13 +238,14 @@ va_dcl
#ifdef PROTOTYPES
GLOBAL void
IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *Prefix, char *Format, ... )
IRC_WriteStrServersPrefix(CLIENT *ExceptOf, CLIENT *Prefix,
const char *Format, ...)
#else
GLOBAL void
IRC_WriteStrServersPrefix( ExceptOf, Prefix, Format, va_alist )
IRC_WriteStrServersPrefix(ExceptOf, Prefix, Format, va_alist)
CLIENT *ExceptOf;
CLIENT *Prefix;
char *Format;
const char *Format;
va_dcl
#endif
{
@@ -276,14 +269,15 @@ va_dcl
#ifdef PROTOTYPES
GLOBAL void
IRC_WriteStrServersPrefixFlag( CLIENT *ExceptOf, CLIENT *Prefix, char Flag, char *Format, ... )
IRC_WriteStrServersPrefixFlag(CLIENT *ExceptOf, CLIENT *Prefix, char Flag,
const char *Format, ...)
#else
GLOBAL void
IRC_WriteStrServersPrefixFlag( ExceptOf, Prefix, Flag, Format, va_alist )
IRC_WriteStrServersPrefixFlag(ExceptOf, Prefix, Flag, Format, va_alist)
CLIENT *ExceptOf;
CLIENT *Prefix;
char Flag;
char *Format;
const char *Format;
va_dcl
#endif
{
@@ -331,18 +325,18 @@ IRC_WriteStrServersPrefixFlag_CB(CLIENT *ExceptOf, CLIENT *Prefix, char Flag,
*/
#ifdef PROTOTYPES
GLOBAL bool
IRC_WriteStrRelatedPrefix( CLIENT *Client, CLIENT *Prefix, bool Remote, char *Format, ... )
IRC_WriteStrRelatedPrefix(CLIENT *Client, CLIENT *Prefix, bool Remote,
const char *Format, ...)
#else
GLOBAL bool
IRC_WriteStrRelatedPrefix( Client, Prefix, Remote, Format, va_alist )
IRC_WriteStrRelatedPrefix(Client, Prefix, Remote, Format, va_alist)
CLIENT *Client;
CLIENT *Prefix;
bool Remote;
char *Format;
const char *Format;
va_dcl
#endif
{
bool ok = CONNECTED;
CL2CHAN *chan_cl2chan, *cl2chan;
char buffer[1000];
CHANNEL *chan;
@@ -390,18 +384,7 @@ va_dcl
chan_cl2chan = Channel_NextChannelOf( Client, chan_cl2chan );
}
conn = Conn_First( );
while( conn != NONE )
{
/* send data via this connection? */
if( Conn_Flag( conn ) == SEND_TO_SERVER ) ok = Conn_WriteStr( conn, ":%s %s", Client_ID( Prefix ), buffer );
else if( Conn_Flag( conn ) == SEND_TO_USER ) ok = Conn_WriteStr( conn, ":%s %s", Client_Mask( Prefix ), buffer );
if( ! ok ) break;
conn = Conn_Next( conn );
}
return ok;
return Send_Marked_Connections(Prefix, buffer);
} /* IRC_WriteStrRelatedPrefix */
@@ -416,7 +399,7 @@ GLOBAL void
IRC_SendWallops(Client, From, Format, va_alist )
CLIENT *Client;
CLIENT *From;
char *Format;
const char *Format;
va_dcl
#endif
{
@@ -468,14 +451,16 @@ IRC_SetPenalty( CLIENT *Client, time_t Seconds )
} /* IRC_SetPenalty */
static char *
Get_Prefix( CLIENT *Target, CLIENT *Client )
static const char *
Get_Prefix(CLIENT *Target, CLIENT *Client)
{
assert( Target != NULL );
assert( Client != NULL );
assert (Target != NULL);
assert (Client != NULL);
if( Client_Type( Target ) == CLIENT_SERVER ) return Client_ID( Client );
else return Client_Mask( Client );
if (Client_Type(Target) == CLIENT_SERVER)
return Client_ID(Client);
else
return Client_MaskCloaked(Client);
} /* Get_Prefix */
@@ -486,4 +471,29 @@ cb_writeStrServersPrefixFlag(CLIENT *Client, CLIENT *Prefix, void *Buffer)
} /* cb_writeStrServersPrefixFlag */
static bool
Send_Marked_Connections(CLIENT *Prefix, const char *Buffer)
{
CONN_ID conn;
bool ok = CONNECTED;
assert(Prefix != NULL);
assert(Buffer != NULL);
conn = Conn_First();
while (conn != NONE) {
if (Conn_Flag(conn) == SEND_TO_SERVER)
ok = Conn_WriteStr(conn, ":%s %s",
Client_ID(Prefix), Buffer);
else if (Conn_Flag(conn) == SEND_TO_USER)
ok = Conn_WriteStr(conn, ":%s %s",
Client_MaskCloaked(Prefix), Buffer);
if (!ok)
break;
conn = Conn_Next( conn );
}
return ok;
}
/* -eof- */

View File

@@ -7,33 +7,37 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Sending IRC commands over the network (header)
*/
#ifndef __irc_write_h__
#define __irc_write_h__
GLOBAL bool IRC_WriteStrClient PARAMS((CLIENT *Client, char *Format, ...));
/**
* @file
* Sending IRC commands over the network (header)
*/
GLOBAL bool IRC_WriteStrClient PARAMS((CLIENT *Client, const char *Format, ...));
GLOBAL bool IRC_WriteStrClientPrefix PARAMS((CLIENT *Client, CLIENT *Prefix,
char *Format, ...));
const char *Format, ...));
GLOBAL bool IRC_WriteStrChannel PARAMS((CLIENT *Client, CHANNEL *Chan,
bool Remote, char *Format, ...));
bool Remote, const char *Format, ...));
GLOBAL bool IRC_WriteStrChannelPrefix PARAMS((CLIENT *Client, CHANNEL *Chan,
CLIENT *Prefix, bool Remote, char *Format, ...));
CLIENT *Prefix, bool Remote, const char *Format, ...));
GLOBAL void IRC_WriteStrServers PARAMS((CLIENT *ExceptOf, char *Format, ...));
GLOBAL void IRC_WriteStrServers PARAMS((CLIENT *ExceptOf,
const char *Format, ...));
GLOBAL void IRC_WriteStrServersPrefix PARAMS((CLIENT *ExceptOf, CLIENT *Prefix,
char *Format, ...));
const char *Format, ...));
GLOBAL void IRC_WriteStrServersPrefixFlag PARAMS((CLIENT *ExceptOf,
CLIENT *Prefix, char Flag, char *Format, ...));
CLIENT *Prefix, char Flag, const char *Format, ...));
GLOBAL void IRC_WriteStrServersPrefixFlag_CB PARAMS((CLIENT *ExceptOf,
CLIENT *Prefix, char Flag,
void (*callback)(CLIENT *, CLIENT *, void *), void *cb_data));
GLOBAL bool IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix,
bool Remote, char *Format, ...));
bool Remote, const char *Format, ...));
GLOBAL void IRC_SendWallops PARAMS((CLIENT *Client, CLIENT *From,
const char *Format, ...));

View File

@@ -7,14 +7,14 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* IRC commands
*/
#include "portab.h"
static char UNUSED id[] = "$Id: irc.c,v 1.132 2008/01/15 22:28:14 fw Exp $";
/**
* @file
* IRC commands
*/
#include "imp.h"
#include <assert.h>
@@ -22,10 +22,8 @@ static char UNUSED id[] = "$Id: irc.c,v 1.132 2008/01/15 22:28:14 fw Exp $";
#include <string.h>
#include "ngircd.h"
#include "resolve.h"
#include "conn-func.h"
#include "conf.h"
#include "client.h"
#include "channel.h"
#include "defines.h"
#include "irc-write.h"
@@ -70,7 +68,7 @@ IRC_ERROR( CLIENT *Client, REQUEST *Req )
* disconnect clients. It can be used by IRC operators and servers, for example
* to "solve" nick collisions after netsplits.
* Please note that this function is also called internally, without a real
* KILL command beeing received over the network! Client is Client_ThisServer()
* KILL command being received over the network! Client is Client_ThisServer()
* in this case. */
GLOBAL bool
IRC_KILL( CLIENT *Client, REQUEST *Req )
@@ -160,11 +158,15 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
Client_Type( c ), Req->argv[0] );
}
/* Kill client NOW! */
/* Kill the client NOW:
* - Close the local connection (if there is one),
* - Destroy the CLIENT structure for remote clients.
* Note: Conn_Close() removes the CLIENT structure as well. */
conn = Client_Conn( c );
Client_Destroy( c, NULL, reason, false );
if( conn > NONE )
Conn_Close( conn, NULL, reason, true );
if(conn > NONE)
Conn_Close(conn, NULL, reason, true);
else
Client_Destroy(c, NULL, reason, false);
}
else
Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
@@ -410,7 +412,7 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
if (nick != NULL && host != NULL) {
if (strcmp(nick, Client_ID(cl)) == 0 &&
strcmp(user, Client_User(cl)) == 0 &&
strcasecmp(host, Client_Hostname(cl)) == 0)
strcasecmp(host, Client_HostnameCloaked(cl)) == 0)
break;
else
continue;
@@ -418,7 +420,7 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
if (strcasecmp(user, Client_User(cl)) != 0)
continue;
if (host != NULL && strcasecmp(host,
Client_Hostname(cl)) != 0)
Client_HostnameCloaked(cl)) != 0)
continue;
if (server != NULL && strcasecmp(server,
Client_ID(Client_Introducer(cl))) != 0)

View File

@@ -7,13 +7,16 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* IRC commands (header)
*/
#ifndef __irc_h__
#define __irc_h__
/**
* @file
* IRC commands (header)
*/
GLOBAL bool IRC_ERROR PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_KILL PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_NOTICE PARAMS((CLIENT *Client, REQUEST *Req));

View File

@@ -7,19 +7,20 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Management of IRC lists: ban, invite, ...
*/
#include "portab.h"
/**
* @file
* Management of IRC lists: ban, invite, etc.
*/
#include "imp.h"
#include <assert.h>
#include "defines.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "log.h"
#include "match.h"
@@ -86,7 +87,6 @@ Lists_Add(struct list_head *header, const char *Mask, bool OnlyOnce )
newelem->next = e;
header->first = newelem;
LogDebug("Added \"%s\" to invite list", Mask);
return true;
}
@@ -210,7 +210,6 @@ Lists_MakeMask(const char *Pattern)
} /* Lists_MakeMask */
bool
Lists_Check( struct list_head *header, CLIENT *Client)
{

View File

@@ -7,13 +7,16 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Management of IRC lists: ban, invite, ... (header)
*/
#ifndef __lists_h__
#define __lists_h__
/**
* @file
* Management of IRC lists (header)
*/
#include "portab.h"
#include "client.h"
@@ -23,7 +26,6 @@ struct list_head {
struct list_elem *first;
};
GLOBAL struct list_elem *Lists_GetFirst PARAMS((const struct list_head *));
GLOBAL struct list_elem *Lists_GetNext PARAMS((const struct list_elem *));
@@ -41,4 +43,5 @@ GLOBAL const char *Lists_MakeMask PARAMS((const char *Pattern));
GLOBAL const char *Lists_GetMask PARAMS(( const struct list_elem *e ));
#endif
/* -eof- */

View File

@@ -1,19 +1,21 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2005 Alexander Barton (alex@barton.de)
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Logging functions
*/
#include "portab.h"
/**
* @file
* Logging functions
*/
#include "imp.h"
#include <assert.h>
#include <errno.h>
@@ -34,9 +36,9 @@
#include "ngircd.h"
#include "defines.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
#include "conf.h"
#include "exp.h"
#include "log.h"
@@ -45,12 +47,6 @@
static char Init_Txt[127];
static bool Is_Daemon;
#ifdef DEBUG
static char Error_File[FNAME_LEN];
#endif
static void Wall_ServerNotice PARAMS(( char *Msg ));
static void
Log_Message(int Level, const char *msg)
@@ -75,13 +71,10 @@ Log_Init( bool Daemon_Mode )
Is_Daemon = Daemon_Mode;
#ifdef SYSLOG
#ifndef LOG_CONS /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS/LOG_LOCAL5 */
#ifndef LOG_CONS /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS */
#define LOG_CONS 0
#endif
#ifndef LOG_LOCAL5
#define LOG_LOCAL5 0
#endif
openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
#endif
Log( LOG_NOTICE, "%s started.", NGIRCd_Version );
@@ -112,51 +105,14 @@ Log_Init( bool Daemon_Mode )
}
#endif
if( Init_Txt[0] ) Log( LOG_INFO, "Activating: %s.", Init_Txt );
#ifdef DEBUG
Error_File[0] = '\0';
#endif
} /* Log_Init */
#ifdef DEBUG
GLOBAL void
Log_InitErrorfile( void )
{
snprintf( Error_File, sizeof Error_File, "%s/%s-%ld.err", ERROR_DIR, PACKAGE_NAME, (long)getpid( ));
fflush( stderr );
if( ! freopen( Error_File, "w", stderr ))
{
Log( LOG_ERR, "Can't reopen stderr (\"%s\"): %s", Error_File, strerror( errno ));
return;
}
fputs( ctime( &NGIRCd_Start ), stderr );
fprintf( stderr, "%s started.\n", NGIRCd_Version );
fprintf( stderr, "Activating: %s\n\n", Init_Txt[0] ? Init_Txt : "-" );
fflush( stderr );
Log(LOG_DEBUG, "Redirected stderr to \"%s\".", Error_File);
} /* Log_InitErrfile */
#endif
GLOBAL void
Log_Exit( void )
{
/* Good Bye! */
Log(LOG_NOTICE, "%s done%s, served %lu connections.", PACKAGE_NAME,
NGIRCd_SignalRestart ? " (restarting)" : "", Conn_CountAccepted());
#ifdef DEBUG
if( Error_File[0] )
{
/* Error-File (stderr) loeschen */
if( unlink( Error_File ) != 0 ) Log( LOG_ERR, "Can't delete \"%s\": %s", Error_File, strerror( errno ));
}
#endif
#ifdef SYSLOG
closelog();
#endif
@@ -251,102 +207,113 @@ va_dcl
Log_Message(Level, msg);
if (Level <= LOG_CRIT) {
/* log critical messages to stderr */
fprintf(stderr, "%s\n", msg);
fflush(stderr);
}
if (snotice) {
/* Send NOTICE to all local users with mode +s and to the
* local &SERVER channel */
Wall_ServerNotice(msg);
Log_ServerNotice('s', "%s", msg);
Channel_LogServer(msg);
}
} /* Log */
GLOBAL void
Log_Init_Resolver( void )
Log_Init_Subprocess(char UNUSED *Name)
{
#ifdef SYSLOG
openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
#endif
#ifdef DEBUG
Log_Resolver(LOG_DEBUG, "Resolver sub-process starting, PID %ld.", (long)getpid());
Log_Subprocess(LOG_DEBUG, "%s sub-process starting, PID %ld.",
Name, (long)getpid());
#endif
} /* Log_Init_Resolver */
}
GLOBAL void
Log_Exit_Resolver( void )
Log_Exit_Subprocess(char UNUSED *Name)
{
#ifdef DEBUG
Log_Resolver(LOG_DEBUG, "Resolver sub-process %ld done.", (long)getpid());
Log_Subprocess(LOG_DEBUG, "%s sub-process %ld done.",
Name, (long)getpid());
#endif
#ifdef SYSLOG
closelog( );
#endif
} /* Log_Exit_Resolver */
}
#ifdef PROTOTYPES
GLOBAL void
Log_Resolver( const int Level, const char *Format, ... )
Log_Subprocess(const int Level, const char *Format, ...)
#else
GLOBAL void
Log_Resolver( Level, Format, va_alist )
Log_Subprocess(Level, Format, va_alist)
const int Level;
const char *Format;
va_dcl
#endif
{
/* Eintrag des Resolver in Logfile(s) schreiben */
char msg[MAX_LOG_MSG_LEN];
va_list ap;
assert( Format != NULL );
assert(Format != NULL);
#ifdef DEBUG
if(( Level == LOG_DEBUG ) && ( ! NGIRCd_Debug )) return;
if ((Level == LOG_DEBUG) && (!NGIRCd_Debug))
return;
#else
if( Level == LOG_DEBUG ) return;
if (Level == LOG_DEBUG)
return;
#endif
/* String mit variablen Argumenten zusammenbauen ... */
#ifdef PROTOTYPES
va_start( ap, Format );
va_start(ap, Format);
#else
va_start( ap );
va_start(ap);
#endif
vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap );
va_end( ap );
vsnprintf(msg, MAX_LOG_MSG_LEN, Format, ap);
va_end(ap);
Log_Message(Level, msg);
} /* Log_Resolver */
}
/**
* Send log messages to users flagged with the "s" mode.
* @param Msg The message to send.
* Send a log message to all local users flagged with the given user mode.
* @param UserMode User mode which the target user must have set,
* @param Format The format string.
*/
static void
Wall_ServerNotice( char *Msg )
#ifdef PROTOTYPES
GLOBAL void
Log_ServerNotice(const char UserMode, const char *Format, ... )
#else
GLOBAL void
Log_ServerNotice(UserMode, Format, va_alist)
const char UserMode;
const char *Format;
va_dcl
#endif
{
CLIENT *c;
char msg[MAX_LOG_MSG_LEN];
va_list ap;
assert( Msg != NULL );
assert(Format != NULL);
c = Client_First( );
while(c) {
if (Client_Conn(c) > NONE && Client_HasMode(c, 's'))
#ifdef PROTOTYPES
va_start(ap, Format);
#else
va_start(ap);
#endif
vsnprintf(msg, MAX_LOG_MSG_LEN, Format, ap);
va_end(ap);
for(c=Client_First(); c != NULL; c=Client_Next(c)) {
if (Client_Conn(c) > NONE && Client_HasMode(c, UserMode))
IRC_WriteStrClient(c, "NOTICE %s :%s%s", Client_ID(c),
NOTICE_TXTPREFIX, Msg);
c = Client_Next( c );
NOTICE_TXTPREFIX, msg);
}
} /* Wall_ServerNotice */
} /* Log_ServerNotice */
/* -eof- */

Some files were not shown because too many files have changed in this diff Show More