mirror of
https://github.com/osmarks/ngircd.git
synced 2025-10-01 08:22:24 +00:00
Compare commits
139 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
03e6568079 | ||
![]() |
7dacc314f9 | ||
![]() |
24adfb88b4 | ||
![]() |
6ed440a030 | ||
![]() |
c7bbc9a390 | ||
![]() |
6171beb7ab | ||
![]() |
2196e945e4 | ||
![]() |
f16eb1b686 | ||
![]() |
c41f18e3f9 | ||
![]() |
dbfe1beca8 | ||
![]() |
6bdae55177 | ||
![]() |
fb5ae9e844 | ||
![]() |
bd8d4e710c | ||
![]() |
9a931a549b | ||
![]() |
3c30490d54 | ||
![]() |
6250335352 | ||
![]() |
7e14bd3b58 | ||
![]() |
31b3c83c1f | ||
![]() |
6e4235443e | ||
![]() |
cdcf474f15 | ||
![]() |
f33a4067a1 | ||
![]() |
100de3e4cc | ||
![]() |
7b58538074 | ||
![]() |
3f436e1810 | ||
![]() |
967deebacd | ||
![]() |
74262a4093 | ||
![]() |
be88707027 | ||
![]() |
7d7eb735f0 | ||
![]() |
fa7fac88d2 | ||
![]() |
84ff5a6eb9 | ||
![]() |
bf2eae3249 | ||
![]() |
ffad2da835 | ||
![]() |
3f1547ecde | ||
![]() |
7893dc5241 | ||
![]() |
896d45471a | ||
![]() |
01c3552140 | ||
![]() |
ce3c4074ba | ||
![]() |
40ed94a1f2 | ||
![]() |
c1f180b87b | ||
![]() |
f5944a17e4 | ||
![]() |
06920df4bb | ||
![]() |
e864b1f33e | ||
![]() |
3f807e1045 | ||
![]() |
39b8fc65b6 | ||
![]() |
3de972e0bd | ||
![]() |
ec2bf5c5a2 | ||
![]() |
70160b3a5b | ||
![]() |
a90004b913 | ||
![]() |
9e79ed8605 | ||
![]() |
cdd6b961af | ||
![]() |
bfc727ce49 | ||
![]() |
dee824a3f0 | ||
![]() |
f5ae1dd36c | ||
![]() |
794cb51e4b | ||
![]() |
dd4b74e29b | ||
![]() |
daed2467dd | ||
![]() |
d314c75a37 | ||
![]() |
5009ab3e8c | ||
![]() |
5713c49c84 | ||
![]() |
35f1db5f28 | ||
![]() |
4c2acd55c6 | ||
![]() |
f547981188 | ||
![]() |
b35f8916a5 | ||
![]() |
3d7aa9f906 | ||
![]() |
a534e71e8d | ||
![]() |
a13bb78b1e | ||
![]() |
b130b35f48 | ||
![]() |
37090a28e8 | ||
![]() |
67256f9da1 | ||
![]() |
7b10a0e4ee | ||
![]() |
259c314d14 | ||
![]() |
51396f8f1c | ||
![]() |
6238196dac | ||
![]() |
43fb18f2f5 | ||
![]() |
a4ed90ba9a | ||
![]() |
af9161a9bc | ||
![]() |
485d0aec81 | ||
![]() |
abf280d5bd | ||
![]() |
ccc9e1baa4 | ||
![]() |
755562d147 | ||
![]() |
384b27cee0 | ||
![]() |
6496fa4655 | ||
![]() |
20b52fe33d | ||
![]() |
0fc822d8c4 | ||
![]() |
2e168c7809 | ||
![]() |
14a84dfca5 | ||
![]() |
4cb36e370e | ||
![]() |
e273bd226a | ||
![]() |
3b24ebf122 | ||
![]() |
599cfd0944 | ||
![]() |
90062111f7 | ||
![]() |
e747fe9277 | ||
![]() |
0f85c4c6a7 | ||
![]() |
e73d70ce6f | ||
![]() |
2560e5f156 | ||
![]() |
1f5508d049 | ||
![]() |
97b4fd8a08 | ||
![]() |
fe73835666 | ||
![]() |
5b4b7e2f55 | ||
![]() |
8ae2cdfce9 | ||
![]() |
6685ae063f | ||
![]() |
e2b85ccde3 | ||
![]() |
7b358a57ac | ||
![]() |
5d88030bd1 | ||
![]() |
8872653ef6 | ||
![]() |
4d4512cd72 | ||
![]() |
bc098794ee | ||
![]() |
788da901ee | ||
![]() |
2a40112f09 | ||
![]() |
61b7932e82 | ||
![]() |
f024a4992a | ||
![]() |
d38747d951 | ||
![]() |
18070e5381 | ||
![]() |
d913323ca9 | ||
![]() |
9230f2fff1 | ||
![]() |
86bdf6e1d4 | ||
![]() |
1a628fff51 | ||
![]() |
bd33bd770d | ||
![]() |
b8433e9261 | ||
![]() |
5a424f60da | ||
![]() |
444308ccde | ||
![]() |
1ad536eeed | ||
![]() |
c68ae1a9f5 | ||
![]() |
df7ea9e7b4 | ||
![]() |
34824abe0d | ||
![]() |
ae00c100ac | ||
![]() |
61d1c864c5 | ||
![]() |
8d25044ce5 | ||
![]() |
c3c719b978 | ||
![]() |
9ee3760493 | ||
![]() |
344185b1bd | ||
![]() |
fcf61e9e02 | ||
![]() |
9f236c4b91 | ||
![]() |
00249f3c80 | ||
![]() |
925b4de298 | ||
![]() |
48ea69d778 | ||
![]() |
80d0613bf2 | ||
![]() |
4ab688c5e8 | ||
![]() |
2e93129877 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,11 +8,13 @@ ar-lib
|
||||
autom4te.cache
|
||||
build-stamp-ngircd*
|
||||
compile
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
configure.ac
|
||||
configure.lineno
|
||||
cov-int
|
||||
cscope.out
|
||||
debian
|
||||
depcomp
|
||||
|
2
AUTHORS
2
AUTHORS
@@ -2,7 +2,7 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2014 Alexander Barton and Contributors.
|
||||
(c)2001-2015 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
|
154
ChangeLog
154
ChangeLog
@@ -2,13 +2,127 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2014 Alexander Barton and Contributors.
|
||||
(c)2001-2015 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
-- ChangeLog --
|
||||
|
||||
|
||||
ngIRCd 22.1 (2015-04-06)
|
||||
|
||||
- Update doc/Platforms.txt and doc/FAQ.txt.
|
||||
- Fix spelling of RPL_WHOISBOT message text.
|
||||
- Don't send nick name as default PART reason: No other IRC daemon seems
|
||||
to do this (today?). Closes #185.
|
||||
Reported by Cahata in #ngircd, thanks!
|
||||
- Fix "WHO #<chan>" showing invisible users and hiding all visible, the
|
||||
logic was reversed! This bug has been introduced by commit c74115f2,
|
||||
"Simplify mode checking on channels and users within a channel", ngIRCd
|
||||
releases 21, 21.1, and 22 are affected :-( Problem reported by Cahata
|
||||
in #ngircd, Thanks!
|
||||
- Fix typo in src/testsuite/README
|
||||
- Auth PING: Fix our information text for manual sending of "PONG". Up to
|
||||
now, ngIRCd doesn't send a valid IRC command at all, oops!
|
||||
- Auth PING: Fix internal time stamp conversion and don't send a prefix in
|
||||
our PING command. The prefix confuses WeeChat, at least, which doesn't
|
||||
send an appropriate PONG in the case ...
|
||||
Debugging and patch by "wowaname" on #ngircd, thanks!
|
||||
- Fix syntax of ERR_LISTFULL_MSG(478) numeric. Pointed out by "wowaname"
|
||||
in #ngircd, thanks!
|
||||
- Enhance debug messages while sending CHANINFO commands.
|
||||
- Reset "last try" timer when enabling a passive server. This results in
|
||||
a new connection attempt as soon as possible.
|
||||
- Change log message for "Can't resolve address" and for IP address
|
||||
forgeries.
|
||||
- doc/HowToRelease.txt: Add note about the bug tracker.
|
||||
- Update "CipherList" to not enable SSLv3 by default. Idea, initial patch,
|
||||
and testing by Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de>.
|
||||
- Change ngIRCd test suite not to use DNS lookups: Different operating
|
||||
systems do behave quite differently when doing DNS lookups, for example
|
||||
"127.0.0.1" sometimes resolves to "localhost" and sometimes to
|
||||
"localhost.localdomain" (for example OpenBSD). And other OS resolve
|
||||
"localhost" to the real host name (for example Cygwin). So not using
|
||||
DNS at all makes the test site much more portable.
|
||||
|
||||
ngIRCd 22 (2014-10-11)
|
||||
|
||||
- Match all list patterns case-insensitive: this affects the invite-,
|
||||
ban-, and except lists, as well as G-Lines an K-Lines.
|
||||
Problem pointed out by "wowaname" on #ngircd, thanks!
|
||||
|
||||
ngIRCd 22~rc1 (2014-09-29)
|
||||
- Sync "except lists" between servers: Up to now, ban, invite, and G-Line
|
||||
lists have been synced between servers while linking -- but obviously
|
||||
nobody noticed that except list have been missing ever since. Until now.
|
||||
Thanks to "j4jackj", who reported this issue in #ngircd.
|
||||
- Allow longer user names (up to 63 characters) for authentication.
|
||||
- Correctly check that a server has a valid hostname and port, thanks to
|
||||
David Binderman <dcb314@hotmail.com> who reported this bug.
|
||||
- Fix the function which generates complete "IRC masks" from user input,
|
||||
don't destroy the source buffer and use all provided parts (nick, user,
|
||||
host name). This fixes GLINEs/KLINEs from not working in some situations.
|
||||
- Increase MAX_SERVERS from 16 to 64: There are installations out there
|
||||
that would like to configure more than 16 links per server, so increase
|
||||
this limit. Best would be to get rid of MAX_SERVERS altogether and make
|
||||
if fully dynamic, but start with this quick and dirty hack ...
|
||||
- Debian: Don't adjust path names that are correct by default and correctly
|
||||
set and use "docdir".
|
||||
- Update config.guess and config.sub to recent versions.
|
||||
- Test suite/platformtest.sh: Detect when tests have been skipped.
|
||||
- doc/Bopm.txt: Update "connregex" and "kline" for current ngIRCd.
|
||||
- Allow "DefaultUserModes" to set all possible modes, including modes only
|
||||
settable by IRC Operators.
|
||||
- Spoofed prefixes: Really kill connection on non-server links.
|
||||
- Implement user mode "F": "relaxed flood protection". Clients with mode
|
||||
"F" set are allowed to rapidly send data to the daemon. This mode is only
|
||||
settable by IRC Operators and can cause problems in the network -- so be
|
||||
careful and only set it on "trusted" clients!
|
||||
User mode "F" is used by Bahamut for this purpose, for example.
|
||||
- Handle "throttling" in a single function: ngIRCd implements "command
|
||||
throttling" and "bps throttling" (bytes per second). The states are
|
||||
detected in different functions, Conn_Handler() and Read_Request(), but
|
||||
handle the actual "throttling" in a common function: this enables us to
|
||||
guarantee consistent behavior and to disable throttling for special
|
||||
connections in only one place
|
||||
- Use server password when PAM is compiled in but disabled.
|
||||
- Streamline punctuation of log messages.
|
||||
- Return ISUPPORT(005) numerics on "VERSION". This is how ircd-seven,
|
||||
Charybdis, Hybrid, and InspIRCd behave, for example.
|
||||
- configure: Only link "contrib/Debian" if it exists, which isn't the case
|
||||
on "VPATH builds", for example.
|
||||
- Show the account name in WHOIS. This uses the same numeric as Charybdis
|
||||
and ircu families: WHOISLOGGEDIN(330).
|
||||
- Pattern matching: Remove "range matching" in our pattern matching code
|
||||
using the "[...]" syntax, because [ and ] are valid characters in nick
|
||||
names and one has to quote them currently using the "\" character, which
|
||||
is quite unexpected for users.
|
||||
- platformtest.sh: New option "-x", don't regenerate build system and
|
||||
allow using separate source and build trees.
|
||||
- Test suite: explicitly enable glibc memory checking.
|
||||
- Make "MODE -k" handling more robust and compatible, send "fake '*' key"
|
||||
in all replies.
|
||||
- Update configure.ng: ngIRCd requires GNU autoconf 2.61 for generating its
|
||||
build system, so update the build system accordingly and implement all
|
||||
changes that autoupdate(1) suggests: Update AC_PREREQ and AC_INIT, use
|
||||
AC_LINK_IFELSE, AC_RUN_IFELSE, and AC_COMPILE_IFELSE, and remove
|
||||
AC_TYPE_SIGNAL (we don't use RETSIGTYPE).
|
||||
- portabtest: Actually test the functions snprintf(), strlcpy(), strlcat(),
|
||||
and vsnprintf() for correctness, not only existence (which was quite
|
||||
useless, because if they weren't available, the program could not have
|
||||
been linked at all ...).
|
||||
- Implement new configuration option "Network": it is used to set the
|
||||
(completely optional) "network name", to which this instance of the
|
||||
daemon belongs. When set, this name is used in the ISUPPORT(005) numeric
|
||||
which is sent to all clients connecting to the server after logging in.
|
||||
- Update doc/Platforms.txt.
|
||||
- Various code cleanups, remove unused code, streamline error handling.
|
||||
Remove all imp.h and exp.h header files, support non-standard vsnprintf()
|
||||
return codes, and fix some K&R C portability issues. Streamline
|
||||
DEBUG_ARRAY, DEBUG_BUFFER, DEBUG_IO, DEBUG_ZIP definitions.
|
||||
- Increase penalty time to 10 seconds when handling OPER commands with an
|
||||
invalid password.
|
||||
|
||||
ngIRCd 21.1 (2014-03-25)
|
||||
|
||||
- Don't ignore but use the server password when PAM is compiled in but
|
||||
@@ -420,7 +534,7 @@ ngIRCd 20 (2012-12-17)
|
||||
the hash function. When "CloakHostSalt" is not set (the default), a
|
||||
random salt will be generated after each server restart. (Closes #133)
|
||||
|
||||
ngIRCd Release 19.2 (2012-06-19)
|
||||
ngIRCd 19.2 (2012-06-19)
|
||||
|
||||
- doc/Capabilities.txt: document "multi-prefix" capability
|
||||
|
||||
@@ -450,7 +564,7 @@ ngIRCd Release 19.2 (2012-06-19)
|
||||
- Fix: Don't ignore "permission denied" errors when enabling chroot.
|
||||
- FAQ: enhance description of chroot setup.
|
||||
|
||||
ngIRCd Release 19.1 (2012-03-19)
|
||||
ngIRCd 19.1 (2012-03-19)
|
||||
|
||||
- Fix gcc warning (v4.6.3), initialize "list" variable to NULL.
|
||||
- Fix typos: "recieved" -> "received", "Please not" -> "Please note",
|
||||
@@ -460,7 +574,7 @@ ngIRCd Release 19.1 (2012-03-19)
|
||||
- getpid.sh: Fix test case error for Debian using sbuild(1).
|
||||
- Don't log "ngIRCd hello message" two times when starting up.
|
||||
|
||||
ngIRCd Release 19 (2012-02-29)
|
||||
ngIRCd 19 (2012-02-29)
|
||||
|
||||
- Update build system: bump config.guess and config.sub files used by
|
||||
GNU autoconf/automake to recent versions.
|
||||
@@ -610,7 +724,7 @@ ngIRCd Release 19 (2012-02-29)
|
||||
asynchronous nature of the IRC protocol. So don't break server-
|
||||
links, only log a message and ignore the command. (Closes #113)
|
||||
|
||||
ngIRCd Release 18 (2011-07-10)
|
||||
ngIRCd 18 (2011-07-10)
|
||||
|
||||
- Update timestamp of ngircd(8) manual page.
|
||||
- Add preliminary ngIRCd protocol module for Anope 1.9 to contrib/Anope/.
|
||||
@@ -720,7 +834,7 @@ ngIRCd Release 18 (2011-07-10)
|
||||
only relevant when a trusted server on a server-server link sends invalid
|
||||
commands).
|
||||
|
||||
ngIRCd Release 17.1 (2010-12-19)
|
||||
ngIRCd 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
|
||||
@@ -736,7 +850,7 @@ ngIRCd Release 17.1 (2010-12-19)
|
||||
- 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)
|
||||
ngIRCd 17 (2010-11-07)
|
||||
|
||||
- doc: change path names in sample-ngircd.conf depending on sysconfdir
|
||||
- Fix up generation and distribution of sample-ngircd.conf
|
||||
@@ -817,7 +931,7 @@ ngIRCd Release 17 (2010-11-07)
|
||||
- Fix "beeing" typo ...
|
||||
- SSL/TLS: fix bogus "socket closed" error message.
|
||||
|
||||
ngIRCd Release 16 (2010-05-02)
|
||||
ngIRCd 16 (2010-05-02)
|
||||
|
||||
- doc/SSL: remove line continuation marker
|
||||
|
||||
@@ -857,7 +971,7 @@ ngIRCd Release 16 (2010-05-02)
|
||||
every channel, and c) remote clients using a server not supporting this
|
||||
mode are not checked either and therefore always allowed to join.
|
||||
|
||||
ngIRCd Release 15 (2009-11-07)
|
||||
ngIRCd 15 (2009-11-07)
|
||||
|
||||
- "ngircd --configtest": print SSL configuration options even when unset.
|
||||
|
||||
@@ -883,7 +997,7 @@ ngIRCd Release 15 (2009-11-07)
|
||||
- Fix a few error handling glitches for SSL/TLS connections.
|
||||
- Minor fixes to manual pages and documentation.
|
||||
|
||||
ngIRCd Release 14.1 (2009-05-05)
|
||||
ngIRCd 14.1 (2009-05-05)
|
||||
|
||||
- Security: fix remotely triggerable crash in SSL/TLS code.
|
||||
- BSD start script contrib/ngircd.sh has been renamed to ngircd-bsd.sh.
|
||||
@@ -896,7 +1010,7 @@ ngIRCd Release 14.1 (2009-05-05)
|
||||
- Fix server list announcement.
|
||||
- Do not remove host names from info text.
|
||||
|
||||
ngIRCd Release 14 (2009-04-20)
|
||||
ngIRCd 14 (2009-04-20)
|
||||
|
||||
- Display IPv6 addresses as "[<addr>]" when accepting connections.
|
||||
|
||||
@@ -920,7 +1034,7 @@ ngIRCd Release 14 (2009-04-20)
|
||||
- Fix handling of channels containing dots.
|
||||
(closes ug #93, reported by Gonosz Csiga)
|
||||
|
||||
ngIRCd Release 13 (2008-12-25)
|
||||
ngIRCd 13 (2008-12-25)
|
||||
|
||||
- Updated documentation, especially doc/Services.txt and doc/SSL.txt.
|
||||
- Make the test suite work on OpenSolaris.
|
||||
@@ -1011,7 +1125,7 @@ ngIRCd 0.11.0 (2008-01-15)
|
||||
ngIRCd 0.11.0-pre2 (2008-01-07)
|
||||
- SECURITY: IRC_PART could reference invalid memory, causing
|
||||
ngircd to crash [from HEAD]. (CVE-2008-0285)
|
||||
|
||||
|
||||
ngIRCd 0.11.0-pre1 (2008-01-02)
|
||||
- Use dotted-decimal IP address if host name is >= 64.
|
||||
- Add support for /STAT u (server uptime) command.
|
||||
@@ -1045,7 +1159,7 @@ ngIRCd 0.10.4 (2008-01-07)
|
||||
|
||||
- SECURITY: IRC_PART could reference invalid memory, causing
|
||||
ngircd to crash [from HEAD]. (CVE-2008-0285)
|
||||
|
||||
|
||||
ngIRCd 0.10.3 (2007-08-01)
|
||||
|
||||
- SECURITY: Fixed a severe bug in handling JOIN commands, which could
|
||||
@@ -1351,7 +1465,7 @@ ngIRCd 0.7.0 (2003-05-01)
|
||||
- Documentation is now installed in $(datadir)/doc/ngircd.
|
||||
- Enhanced handling of NJOIN in case of nick collisions.
|
||||
|
||||
ngIRCd 0.6.1, 2003-01-21
|
||||
ngIRCd 0.6.1 (2003-01-21)
|
||||
|
||||
- Fixed KILL: you can't crash the server by killing yourself any more,
|
||||
ngIRCd no longer sends a QUIT to other servers after the KILL, and you
|
||||
@@ -1372,15 +1486,15 @@ ngIRCd 0.6.1, 2003-01-21
|
||||
|
||||
Older changes (sorry, only available in german language):
|
||||
|
||||
ngIRCd 0.6.0, 2002-12-24
|
||||
ngIRCd 0.6.0, 24.12.2002
|
||||
|
||||
ngIRCd 0.6.0-pre2, 2002-12-23
|
||||
ngIRCd 0.6.0-pre2, 23.12.2002
|
||||
- neuer Numeric 005 ("Features") beim Connect.
|
||||
- LUSERS erweitert: nun wird die maximale Anzahl der lokalen und globalen
|
||||
Clients, die dem Server bzw. im Netzwerk seit dem letzten (Re-)Start
|
||||
dem Server gleichzeitig bekannt waren, angezeigt.
|
||||
|
||||
ngIRCd 0.6.0-pre1, 2002-12-18
|
||||
ngIRCd 0.6.0-pre1, 18.12.2002
|
||||
- beim Schliessen einer Verbindung zeigt der Server nun vor dem ERROR
|
||||
noch eine Statistik ueber die empfangene und gesendete Datenmenge an.
|
||||
- der Server wartet bei einer eingehenden Verbindung nun laenger auf den
|
||||
@@ -1431,7 +1545,7 @@ ngIRCd 0.6.0, 2002-12-24
|
||||
|
||||
ngIRCd 0.5.4, 24.11.2002
|
||||
|
||||
- Fehler-Handling von connect() gefixed: der Server kann sich nun auch
|
||||
- Fehler-Handling von connect() gefixed: der Server kann sich nun auch
|
||||
unter A/UX wieder zu anderen verbinden.
|
||||
- in den Konfigurationsvariablen ServerUID und ServerGID kann nun nicht
|
||||
nur die numerische ID, sondern auch der Name des Users bzw. der Gruppe
|
||||
@@ -1543,7 +1657,7 @@ ngIRCd 0.5.0, 20.09.2002
|
||||
- ADMIN-Befehl implementiert. Die Daten hierzu werden in der Konfig-Datei
|
||||
im [Global]-Abschnitt mit den Variablen "AdminInfo1", "AdminInfo2" und
|
||||
"AdminEMail" konfiguriert.
|
||||
|
||||
|
||||
ngIRCd 0.4.3, 11.06.2002
|
||||
|
||||
- Bei PRIVMSG und NOTICE hat der ngIRCd nicht ueberpruft, ob das Ziel
|
||||
|
29
INSTALL
29
INSTALL
@@ -2,7 +2,7 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2014 Alexander Barton and Contributors.
|
||||
(c)2001-2015 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
@@ -12,12 +12,21 @@
|
||||
I. Upgrade Information
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Differences to version 22.x
|
||||
|
||||
- The default value of the SSL "CipherList" variable has been changed to
|
||||
"HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) and "SECURE128:-VERS-SSL3.0"
|
||||
(GnuTLS) to disable the old SSLv3 protocol by default.
|
||||
To enable connections of clients still requiring the weak SSLv3 protocol,
|
||||
the "CipherList" must be set to its old value (not recommended!), which
|
||||
was "HIGH:!aNULL:@STRENGTH" (OpenSSL) and "SECURE128" (GnuTLS), see below.
|
||||
|
||||
Differences to version 20.x
|
||||
|
||||
- Starting with ngIRCd 21, the ciphers used by SSL are configurable and
|
||||
default to HIGH:!aNULL:@STRENGTH (OpenSSL) or SECURE128 (GnuTLS).
|
||||
Previous version were using the OpenSSL or GnuTLS defaults, DEFAULT
|
||||
and NORMAL respectively.
|
||||
default to "HIGH:!aNULL:@STRENGTH" (OpenSSL) or "SECURE128" (GnuTLS).
|
||||
Previous version were using the OpenSSL or GnuTLS defaults, "DEFAULT"
|
||||
and "NORMAL" respectively.
|
||||
|
||||
- When adding GLINE's or KLINE's to ngIRCd 21 (or newer), all clients matching
|
||||
the new mask will be KILL'ed. This was not the case with earlier versions
|
||||
@@ -170,7 +179,7 @@ autogen.sh produces the Makefile.in's, which are necessary for the configure
|
||||
script itself, and some more files for make. To run autogen.sh you'll need
|
||||
GNU autoconf and GNU automake: at least autoconf 2.61 and automake 1.10 are
|
||||
requird, newer is better. But don't use automake 1.12 or newer for creating
|
||||
distribution archives: it will work but lack "de-ANSI-fucation" support in the
|
||||
distribution archives: it will work but lack "de-ANSI-fication" support in the
|
||||
generated Makefile's! Stick with automake 1.11.x for this purpose ...
|
||||
So automake 1.11.x and autoconf 2.67+ is recommended.
|
||||
|
||||
@@ -226,7 +235,7 @@ which will be used to search for the required libraries and header files in
|
||||
the given paths ("<path>/lib/...", "<path>/include/...") in addition to the
|
||||
standard locations.
|
||||
|
||||
* Syslog Logging (autodetected by default):
|
||||
* Syslog Logging (autodetected by default):
|
||||
--with-syslog[=<path>] / --without-syslog
|
||||
|
||||
Enable (disable) support for logging to "syslog", which should be
|
||||
@@ -237,13 +246,13 @@ standard locations.
|
||||
|
||||
Enable (disable) support for compressed server-server links.
|
||||
The Z compression library ("libz") is required for this option.
|
||||
|
||||
|
||||
* IO Backend (autodetected by default):
|
||||
--with-select[=<path>] / --without-select
|
||||
--with-poll[=<path>] / --without-poll
|
||||
--with-devpoll[=<path>] / --without-devpoll
|
||||
--with-epoll[=<path>] / --without-epoll
|
||||
--with-kqueue[=<path>] / --without-kqueue
|
||||
--with-kqueue[=<path>] / --without-kqueue
|
||||
|
||||
ngIRCd can use different IO "backends": the "old school" select() and poll()
|
||||
API which should be supported by most UNIX-like operating systems, or the
|
||||
@@ -261,7 +270,7 @@ standard locations.
|
||||
required for this option.
|
||||
|
||||
* TCP-Wrappers:
|
||||
--with-tcp-wrappers[=<path>]
|
||||
--with-tcp-wrappers[=<path>]
|
||||
|
||||
Include support for Wietse Venemas "TCP Wrappers" to limit client access
|
||||
to the daemon, for example by using "/etc/hosts.{allow|deny}".
|
||||
@@ -318,7 +327,7 @@ 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
|
||||
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(5) manual page.
|
||||
|
96
NEWS
96
NEWS
@@ -2,13 +2,81 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2014 Alexander Barton and Contributors.
|
||||
(c)2001-2015 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
-- NEWS --
|
||||
|
||||
|
||||
ngIRCd 22.1 (2015-04-06)
|
||||
|
||||
- Update "CipherList" to not enable SSLv3 by default. Idea, initial patch,
|
||||
and testing by Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de>.
|
||||
- Change ngIRCd test suite not to use DNS lookups: Different operating
|
||||
systems do behave quite differently when doing DNS lookups, for example
|
||||
"127.0.0.1" sometimes resolves to "localhost" and sometimes to
|
||||
"localhost.localdomain" (for example OpenBSD). And other OS resolve
|
||||
"localhost" to the real host name (for example Cygwin). So not using
|
||||
DNS at all makes the test site much more portable.
|
||||
|
||||
ngIRCd 22 (2014-10-11)
|
||||
|
||||
- Match all list patterns case-insensitive: this affects the invite-,
|
||||
ban-, and except lists, as well as G-Lines an K-Lines.
|
||||
Problem pointed out by "wowaname" on #ngircd, thanks!
|
||||
|
||||
ngIRCd 22~rc1 (2014-09-29)
|
||||
- Sync "except lists" between servers: Up to now, ban, invite, and G-Line
|
||||
lists have been synced between servers while linking -- but obviously
|
||||
nobody noticed that except list have been missing ever since. Until now.
|
||||
Thanks to "j4jackj", who reported this issue in #ngircd.
|
||||
- Allow longer user names (up to 63 characters) for authentication.
|
||||
- Increase MAX_SERVERS from 16 to 64: There are installations out there
|
||||
that would like to configure more than 16 links per server, so increase
|
||||
this limit. Best would be to get rid of MAX_SERVERS altogether and make
|
||||
if fully dynamic, but start with this quick and dirty hack ...
|
||||
- Test suite/platformtest.sh: Detect when tests have been skipped.
|
||||
- Allow "DefaultUserModes" to set all possible modes, including modes only
|
||||
settable by IRC Operators.
|
||||
- Implement user mode "F": "relaxed flood protection". Clients with mode
|
||||
"F" set are allowed to rapidly send data to the daemon. This mode is only
|
||||
settable by IRC Operators and can cause problems in the network -- so be
|
||||
careful and only set it on "trusted" clients!
|
||||
User mode "F" is used by Bahamut for this purpose, for example.
|
||||
- Use server password when PAM is compiled in but disabled.
|
||||
- Streamline punctuation of log messages.
|
||||
- Return ISUPPORT(005) numerics on "VERSION". This is how ircd-seven,
|
||||
Charybdis, Hybrid, and InspIRCd behave, for example.
|
||||
- configure: Only link "contrib/Debian" if it exists, which isn't the case
|
||||
on "VPATH builds", for example.
|
||||
- Show the account name in WHOIS. This uses the same numeric as Charybdis
|
||||
and ircu families: WHOISLOGGEDIN(330).
|
||||
- Pattern matching: Remove "range matching" in our pattern matching code
|
||||
using the "[...]" syntax, because [ and ] are valid characters in nick
|
||||
names and one has to quote them currently using the "\" character, which
|
||||
is quite unexpected for users.
|
||||
- platformtest.sh: New option "-x", don't regenerate build system and
|
||||
allow using separate source and build trees.
|
||||
- Test suite: explicitly enable glibc memory checking.
|
||||
- Make "MODE -k" handling more robust and compatible, send "fake '*' key"
|
||||
in all replies.
|
||||
- portabtest: Actually test the functions snprintf(), strlcpy(), strlcat(),
|
||||
and vsnprintf() for correctness, not only existence (which was quite
|
||||
useless, because if they weren't available, the program could not have
|
||||
been linked at all ...).
|
||||
- Implement new configuration option "Network": it is used to set the
|
||||
(completely optional) "network name", to which this instance of the
|
||||
daemon belongs. When set, this name is used in the ISUPPORT(005) numeric
|
||||
which is sent to all clients connecting to the server after logging in.
|
||||
- Update doc/Platforms.txt.
|
||||
- Various code cleanups, remove unused code, streamline error handling.
|
||||
Remove all imp.h and exp.h header files, support non-standard vsnprintf()
|
||||
return codes, and fix some K&R C portability issues. Streamline
|
||||
DEBUG_ARRAY, DEBUG_BUFFER, DEBUG_IO, DEBUG_ZIP definitions.
|
||||
- Increase penalty time to 10 seconds when handling OPER commands with an
|
||||
invalid password.
|
||||
|
||||
ngIRCd 21.1 (2014-03-25)
|
||||
|
||||
- Don't ignore but use the server password when PAM is compiled in but
|
||||
@@ -208,7 +276,7 @@ ngIRCd 20 (2012-12-17)
|
||||
the hash function. When "CloakHostSalt" is not set (the default), a
|
||||
random salt will be generated after each server restart.
|
||||
|
||||
ngIRCd Release 19.2 (2012-06-19)
|
||||
ngIRCd 19.2 (2012-06-19)
|
||||
|
||||
ngIRCd 19.2~rc1 (2012-06-13)
|
||||
- New configuration option "CloakHostModeX" to configure the hostname
|
||||
@@ -220,12 +288,12 @@ ngIRCd Release 19.2 (2012-06-19)
|
||||
and capablity "multi-prefix" which allows both the NAME and WHO command
|
||||
handlers to return more than one "class prefix" to the client.
|
||||
|
||||
ngIRCd Release 19.1 (2012-03-19)
|
||||
ngIRCd 19.1 (2012-03-19)
|
||||
|
||||
- Really include _all_ patches to build the Anope module into the
|
||||
distribution archive ... ooops!
|
||||
|
||||
ngIRCd Release 19 (2012-02-29)
|
||||
ngIRCd 19 (2012-02-29)
|
||||
|
||||
ngIRCd 19~rc1 (2012-02-12)
|
||||
- Update preliminary ngIRCd protocol module for Anope 1.9.6, which now
|
||||
@@ -293,7 +361,7 @@ ngIRCd Release 19 (2012-02-29)
|
||||
argument. Like unknown user and channel modes, these modes are saved
|
||||
and forwarded to other servers, but ignored otherwise.
|
||||
|
||||
ngIRCd Release 18 (2011-07-10)
|
||||
ngIRCd 18 (2011-07-10)
|
||||
|
||||
- Add preliminary ngIRCd protocol module for Anope 1.9 to contrib/Anope/.
|
||||
|
||||
@@ -368,13 +436,13 @@ ngIRCd Release 18 (2011-07-10)
|
||||
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)
|
||||
ngIRCd 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)
|
||||
ngIRCd 17 (2010-11-07)
|
||||
|
||||
- doc: change path names in sample-ngircd.conf depending on sysconfdir
|
||||
|
||||
@@ -412,7 +480,7 @@ ngIRCd Release 17 (2010-11-07)
|
||||
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)
|
||||
ngIRCd 16 (2010-05-02)
|
||||
|
||||
ngIRCd 16~rc2 (2010-04-25)
|
||||
- Enhace connection statistics counters: display total number of served
|
||||
@@ -432,7 +500,7 @@ ngIRCd Release 16 (2010-05-02)
|
||||
every channel, and c) remote clients using a server not supporting this
|
||||
mode are not checked either and therefore always allowed to join.
|
||||
|
||||
ngIRCd Release 15 (2009-11-07)
|
||||
ngIRCd 15 (2009-11-07)
|
||||
|
||||
ngIRCd 15~rc1 (2009-10-15)
|
||||
- Do not add default listening port (6667) if SSL ports were specified, so
|
||||
@@ -446,13 +514,13 @@ ngIRCd Release 15 (2009-11-07)
|
||||
a throttling scheme: an IRC client can send up to 3 commands or 256 bytes
|
||||
per second before a one second pause is enforced.
|
||||
|
||||
ngIRCd Release 14.1 (2009-05-05)
|
||||
ngIRCd 14.1 (2009-05-05)
|
||||
|
||||
- Security: fix remotely triggerable crash in SSL/TLS code.
|
||||
- Debian: build ngircd-full-dbg package.
|
||||
- Allow ping timeout quit messages to show the timeout value.
|
||||
|
||||
ngIRCd Release 14 (2009-04-20)
|
||||
ngIRCd 14 (2009-04-20)
|
||||
|
||||
ngIRCd 14~rc1 (2009-03-29)
|
||||
- Allow creation of persistent modeless channels.
|
||||
@@ -463,7 +531,7 @@ ngIRCd Release 14 (2009-04-20)
|
||||
individual channel keys for different users.
|
||||
- Remove limit on maximum number of predefined channels in ngircd.conf.
|
||||
|
||||
ngIRCd Release 13 (2008-12-25)
|
||||
ngIRCd 13 (2008-12-25)
|
||||
|
||||
ngIRCd 13~rc1 (2008-11-21):
|
||||
- New version number scheme :-)
|
||||
@@ -595,7 +663,7 @@ ngIRCd 0.7.5 (2003-07-11)
|
||||
(DoS), the default is 5 connections per client IP.
|
||||
- Added new configuration variable "Listen" to bind all listening
|
||||
sockets of the server to a single IP address.
|
||||
|
||||
|
||||
ngIRCd 0.7.1 (2003-07-18)
|
||||
|
||||
- Added support for GNU/Hurd.
|
||||
@@ -622,7 +690,7 @@ ngIRCd 0.7.0 (2003-05-01)
|
||||
|
||||
Older news (sorry, only available in german language):
|
||||
|
||||
ngIRCd 0.6.0, 2002-12-24
|
||||
ngIRCd 0.6.0, 24.12.2002
|
||||
|
||||
- beim Schliessen einer Verbindung zeigt der Server nun vor dem ERROR
|
||||
noch eine Statistik ueber die empfangene und gesendete Datenmenge an.
|
||||
|
2
README
2
README
@@ -2,7 +2,7 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2014 Alexander Barton and Contributors.
|
||||
(c)2001-2015 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
|
331
config.guess
vendored
331
config.guess
vendored
@@ -1,14 +1,12 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2012-08-14'
|
||||
timestamp='2014-03-23'
|
||||
|
||||
# This file 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
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
@@ -22,19 +20,17 @@ timestamp='2012-08-14'
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Originally written by Per Bothner. Please send patches (context
|
||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
|
||||
# entry.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
# Originally written by Per Bothner.
|
||||
#
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
#
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
|
||||
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
@@ -54,9 +50,7 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
|
||||
Free Software Foundation, Inc.
|
||||
Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
case "${UNAME_SYSTEM}" in
|
||||
Linux|GNU|GNU/*)
|
||||
# If the system lacks a compiler, then just pick glibc.
|
||||
# We could probably try harder.
|
||||
LIBC=gnu
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat <<-EOF > $dummy.c
|
||||
#include <features.h>
|
||||
#if defined(__UCLIBC__)
|
||||
LIBC=uclibc
|
||||
#elif defined(__dietlibc__)
|
||||
LIBC=dietlibc
|
||||
#else
|
||||
LIBC=gnu
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
|
||||
;;
|
||||
esac
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
@@ -306,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
arm:riscos:*:*|arm:RISCOS:*:*)
|
||||
arm*:riscos:*:*|arm*:RISCOS:*:*)
|
||||
echo arm-unknown-riscos
|
||||
exit ;;
|
||||
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
|
||||
@@ -811,7 +826,7 @@ EOF
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:MSYS*:*)
|
||||
*:MSYS*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msys
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
@@ -859,21 +874,21 @@ EOF
|
||||
exit ;;
|
||||
*:GNU:*:*)
|
||||
# the GNU system
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit ;;
|
||||
*:GNU/*:*:*)
|
||||
# other systems with GNU libc and userland
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
|
||||
exit ;;
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
aarch64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
aarch64_be:Linux:*:*)
|
||||
UNAME_MACHINE=aarch64_be
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
@@ -886,59 +901,54 @@ EOF
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arc:Linux:*:* | arceb:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
else
|
||||
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_PCS_VFP
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
crisv32:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
hexagon:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
LIBC=gnu
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
@@ -957,54 +967,63 @@ EOF
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
openrisc*:Linux:*:*)
|
||||
echo or1k-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
or32:Linux:*:* | or1k*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
echo sparc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
echo hppa64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
PA7*) echo hppa1.1-unknown-linux-gnu ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-gnu ;;
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
|
||||
*) echo hppa-unknown-linux-${LIBC} ;;
|
||||
esac
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
echo powerpc64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
echo powerpc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc64le:Linux:*:*)
|
||||
echo powerpc64le-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppcle:Linux:*:*)
|
||||
echo powerpcle-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
|
||||
exit ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
tile*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
@@ -1237,19 +1256,31 @@ EOF
|
||||
exit ;;
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386)
|
||||
eval $set_cc_for_build
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
UNAME_PROCESSOR="x86_64"
|
||||
fi
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
eval $set_cc_for_build
|
||||
if test "$UNAME_PROCESSOR" = unknown ; then
|
||||
UNAME_PROCESSOR=powerpc
|
||||
fi
|
||||
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
case $UNAME_PROCESSOR in
|
||||
i386) UNAME_PROCESSOR=x86_64 ;;
|
||||
powerpc) UNAME_PROCESSOR=powerpc64 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
elif test "$UNAME_PROCESSOR" = i386 ; then
|
||||
# Avoid executing cc on OS X 10.9, as it ships with a stub
|
||||
# that puts up a graphical alert prompting to install
|
||||
# developer tools. Any system running Mac OS X 10.7 or
|
||||
# later (Darwin 11 and later) is required to have a 64-bit
|
||||
# processor. This is not true of the ARM version of Darwin
|
||||
# that Apple uses in portable devices.
|
||||
UNAME_PROCESSOR=x86_64
|
||||
fi
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
@@ -1340,154 +1371,6 @@ EOF
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
#if defined (MIPSEB)
|
||||
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||
I don't know.... */
|
||||
printf ("mips-sony-bsd\n"); exit (0);
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||
printf ("arm-acorn-riscix\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (hp300) && !defined (hpux)
|
||||
printf ("m68k-hp-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (NeXT)
|
||||
#if !defined (__ARCHITECTURE__)
|
||||
#define __ARCHITECTURE__ "m68k"
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
if (version < 4)
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
else
|
||||
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (MULTIMAX) || defined (n16)
|
||||
#if defined (UMAXV)
|
||||
printf ("ns32k-encore-sysv\n"); exit (0);
|
||||
#else
|
||||
#if defined (CMU)
|
||||
printf ("ns32k-encore-mach\n"); exit (0);
|
||||
#else
|
||||
printf ("ns32k-encore-bsd\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__386BSD__)
|
||||
printf ("i386-pc-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (sequent)
|
||||
#if defined (i386)
|
||||
printf ("i386-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#if defined (ns32000)
|
||||
printf ("ns32k-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_SEQUENT_)
|
||||
struct utsname un;
|
||||
|
||||
uname(&un);
|
||||
|
||||
if (strncmp(un.version, "V2", 2) == 0) {
|
||||
printf ("i386-sequent-ptx2\n"); exit (0);
|
||||
}
|
||||
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
||||
printf ("i386-sequent-ptx1\n"); exit (0);
|
||||
}
|
||||
printf ("i386-sequent-ptx\n"); exit (0);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (vax)
|
||||
# if !defined (ultrix)
|
||||
# include <sys/param.h>
|
||||
# if defined (BSD)
|
||||
# if BSD == 43
|
||||
printf ("vax-dec-bsd4.3\n"); exit (0);
|
||||
# else
|
||||
# if BSD == 199006
|
||||
printf ("vax-dec-bsd4.3reno\n"); exit (0);
|
||||
# else
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
# endif
|
||||
# else
|
||||
printf ("vax-dec-ultrix\n"); exit (0);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (alliant) && defined (i860)
|
||||
printf ("i860-alliant-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
exit (1);
|
||||
}
|
||||
EOF
|
||||
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
|
||||
{ echo "$SYSTEM_NAME"; exit; }
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
|
||||
|
||||
# Convex versions that predate uname can use getsysinfo(1)
|
||||
|
||||
if [ -x /usr/convex/getsysinfo ]
|
||||
then
|
||||
case `getsysinfo -f cpu_type` in
|
||||
c1*)
|
||||
echo c1-convex-bsd
|
||||
exit ;;
|
||||
c2*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit ;;
|
||||
c34*)
|
||||
echo c34-convex-bsd
|
||||
exit ;;
|
||||
c38*)
|
||||
echo c38-convex-bsd
|
||||
exit ;;
|
||||
c4*)
|
||||
echo c4-convex-bsd
|
||||
exit ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
cat >&2 <<EOF
|
||||
$0: unable to guess system type
|
||||
|
||||
|
94
config.sub
vendored
94
config.sub
vendored
@@ -1,24 +1,18 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2012-08-18'
|
||||
timestamp='2014-05-01'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file 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
|
||||
# This file 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 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
@@ -26,11 +20,12 @@ timestamp='2012-08-18'
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
|
||||
Free Software Foundation, Inc.
|
||||
Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -156,7 +149,7 @@ case $os in
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
-apple | -axis | -knuth | -cray | -microblaze*)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
@@ -259,10 +252,12 @@ case $basic_machine in
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| be32 | be64 \
|
||||
| arc | arceb \
|
||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||
| avr | avr32 \
|
||||
| be32 | be64 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| c4x | c8051 | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| epiphany \
|
||||
| fido | fr30 | frv \
|
||||
@@ -270,10 +265,11 @@ case $basic_machine in
|
||||
| hexagon \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| k1om \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@@ -287,20 +283,22 @@ case $basic_machine in
|
||||
| mips64vr5900 | mips64vr5900el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa32r6 | mipsisa32r6el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64r6 | mipsisa64r6el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
| ns16k | ns32k \
|
||||
| open8 \
|
||||
| or32 \
|
||||
| open8 | or1k | or1knd | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pyramid \
|
||||
@@ -328,7 +326,7 @@ case $basic_machine in
|
||||
c6x)
|
||||
basic_machine=tic6x-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
@@ -370,13 +368,13 @@ case $basic_machine in
|
||||
| aarch64-* | aarch64_be-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| be32-* | be64-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| c8051-* | clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
@@ -385,11 +383,13 @@ case $basic_machine in
|
||||
| hexagon-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| k1om-* \
|
||||
| le32-* | le64-* \
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| microblaze-* | microblazeel-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
@@ -403,18 +403,22 @@ case $basic_machine in
|
||||
| mips64vr5900-* | mips64vr5900el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa32r6-* | mipsisa32r6el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64r6-* | mipsisa64r6el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipsr5900-* | mipsr5900el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nds32-* | nds32le-* | nds32be-* \
|
||||
| nios-* | nios2-* \
|
||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| or1k*-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||
@@ -788,7 +792,7 @@ case $basic_machine in
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
microblaze*)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw64)
|
||||
@@ -796,7 +800,7 @@ case $basic_machine in
|
||||
os=-mingw64
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
@@ -832,7 +836,7 @@ case $basic_machine in
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
msys)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-msys
|
||||
;;
|
||||
mvs)
|
||||
@@ -1023,7 +1027,11 @@ case $basic_machine in
|
||||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
rdos | rdos64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rdos32)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
@@ -1350,7 +1358,7 @@ case $os in
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* \
|
||||
| -sym* | -kopensolaris* | -plan9* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
@@ -1372,7 +1380,7 @@ case $os in
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@@ -1496,9 +1504,6 @@ case $os in
|
||||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
@@ -1547,6 +1552,9 @@ case $basic_machine in
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c8051-*)
|
||||
os=-elf
|
||||
;;
|
||||
hexagon-*)
|
||||
os=-elf
|
||||
;;
|
||||
|
55
configure.ng
55
configure.ng
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# ngIRCd -- The Next Generation IRC Daemon
|
||||
# Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors
|
||||
# Copyright (c)2001-2014 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
|
||||
@@ -23,8 +23,7 @@ m4_ifdef([AM_SILENT_RULES],
|
||||
# -- Initialisation --
|
||||
|
||||
AC_PREREQ([2.61])
|
||||
AC_INIT([ngIRCd], VERSION_ID,
|
||||
[ngircd-ml@ngircd.barton.de], [ngircd], [http://ngircd.barton.de/])
|
||||
AC_INIT([ngIRCd],[VERSION_ID],[ngircd-ml@ngircd.barton.de],[ngircd],[http://ngircd.barton.de/])
|
||||
|
||||
AC_CONFIG_SRCDIR([src/ngircd/ngircd.c])
|
||||
AC_CONFIG_HEADER([src/config.h])
|
||||
@@ -76,27 +75,28 @@ AC_C_CONST
|
||||
AC_C_INLINE
|
||||
__ng_PROTOTYPES__
|
||||
|
||||
# -- Hard coded system and compiler dependencies/features/options ... --
|
||||
# -- Function Definitions --
|
||||
|
||||
AC_DEFUN([GCC_STACK_PROTECT_CC],[
|
||||
ssp_cc=yes
|
||||
# we use -fstack-protector-all for the test to enfoce the use of the guard variable
|
||||
AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
|
||||
ssp_old_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fstack-protector-all"
|
||||
AC_TRY_LINK(,,, ssp_cc=no)
|
||||
echo $ssp_cc
|
||||
CFLAGS="$ssp_old_cflags"
|
||||
if test "X$ssp_cc" = "Xyes"; then
|
||||
CFLAGS="$CFLAGS -fstack-protector"
|
||||
AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
|
||||
fi
|
||||
ssp_cc=yes
|
||||
# Use -fstack-protector-all for the test to enfoce the use of the
|
||||
# guard variable
|
||||
AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
|
||||
ssp_old_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fstack-protector-all"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],[],[ssp_cc=no])
|
||||
echo $ssp_cc
|
||||
CFLAGS="$ssp_old_cflags"
|
||||
if test "X$ssp_cc" = "Xyes"; then
|
||||
CFLAGS="$CFLAGS -fstack-protector"
|
||||
AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WORKING_GETADDRINFO],[
|
||||
AC_CHECK_FUNCS([getaddrinfo],[
|
||||
AC_MSG_CHECKING([whether getaddrinfo() works])
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -113,15 +113,19 @@ main(int argc, char **argv)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
]])],[
|
||||
AC_DEFINE([HAVE_WORKING_GETADDRINFO], 1, [getaddrinfo(0)])
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
# -- Hard coded system and compiler dependencies/features/options ... --
|
||||
|
||||
if test "$GCC" = "yes"; then
|
||||
# We are using the GNU C compiler. Good!
|
||||
CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes"
|
||||
@@ -151,7 +155,7 @@ AC_HEADER_TIME
|
||||
# Required header files
|
||||
AC_CHECK_HEADERS([ \
|
||||
fcntl.h netdb.h netinet/in.h stdlib.h string.h \
|
||||
strings.h sys/socket.h sys/time.h unistd.h \
|
||||
strings.h sys/socket.h sys/time.h sys/types.h unistd.h \
|
||||
],,AC_MSG_ERROR([required C header missing!]))
|
||||
|
||||
# Optional header files
|
||||
@@ -163,20 +167,19 @@ AC_CHECK_HEADERS_ONCE([ \
|
||||
# -- Datatypes --
|
||||
|
||||
AC_MSG_CHECKING(whether socklen_t exists)
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
],[
|
||||
]],[[
|
||||
socklen_t a, b;
|
||||
a = 2; b = 4; a += b;
|
||||
],[
|
||||
]])],[
|
||||
AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SSIZE_T
|
||||
AC_TYPE_UID_T
|
||||
@@ -467,15 +470,15 @@ AC_ARG_WITH(tcp-wrappers,
|
||||
saved_LIBS="$LIBS"
|
||||
LIBS="-lwrap $LIBS"
|
||||
LIBS_END="-lwrap $LIBS_END"
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <tcpd.h>
|
||||
int allow_severity = 0;
|
||||
int deny_severity = 0;
|
||||
],[
|
||||
]],[[
|
||||
tcpd_warn("link test");
|
||||
],[
|
||||
]])],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(TCPWRAP, 1)
|
||||
x_tcpwrap_on=yes
|
||||
|
@@ -1,3 +1,29 @@
|
||||
ngircd (22.1-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release: ngIRCd 22.1.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Mon, 06 Apr 2015 14:34:50 +0200
|
||||
|
||||
ngircd (22-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release: ngIRCd 22.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Sat, 11 Oct 2014 20:29:03 +0200
|
||||
|
||||
ngircd (22~rc1-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release candidate 1 for ngIRCd Release 22.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Mon, 29 Sep 2014 17:07:55 +0200
|
||||
|
||||
ngircd (21.1-0ab2) unstable; urgency=low
|
||||
|
||||
* Use correct package name in pathname to "HelpFile" (Command.txt)
|
||||
in "ngircd-full" and "ngircd-full-dbg" packages.
|
||||
* Don't adjust path names that are correct by default.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Mon, 14 Jul 2014 11:20:17 +0200
|
||||
|
||||
ngircd (21.1-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release: ngIRCd 21.1.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/make -f
|
||||
#
|
||||
# ngIRCd -- The Next Generation IRC Daemon
|
||||
# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors
|
||||
# Copyright (c)2001-2014 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
|
||||
@@ -42,6 +42,7 @@ configure-ngircd: configure
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/ngircd \
|
||||
--mandir=\$${prefix}/share/man \
|
||||
--docdir=\$${prefix}/share/doc/ngircd \
|
||||
--with-syslog --with-zlib
|
||||
|
||||
configure-ngircd-full: configure
|
||||
@@ -52,6 +53,7 @@ configure-ngircd-full: configure
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/ngircd \
|
||||
--mandir=\$${prefix}/share/man \
|
||||
--docdir=\$${prefix}/share/doc/ngircd-full \
|
||||
--with-syslog --with-zlib \
|
||||
--with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
|
||||
--with-pam \
|
||||
@@ -65,6 +67,7 @@ configure-ngircd-full-dbg: configure
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/ngircd \
|
||||
--mandir=\$${prefix}/share/man \
|
||||
--docdir=\$${prefix}/share/doc/ngircd-full-dbg \
|
||||
--enable-debug --enable-sniffer \
|
||||
--with-syslog --with-zlib \
|
||||
--with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
|
||||
@@ -141,7 +144,6 @@ install-ngircd: build-ngircd
|
||||
cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
|
||||
sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
|
||||
sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
|
||||
sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = |/etc/ngircd/ngircd.motd|g" | \
|
||||
sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
|
||||
>$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
|
||||
touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
|
||||
@@ -153,16 +155,12 @@ install-ngircd-full: build-ngircd-full
|
||||
|
||||
# Add here commands to install the "full" package into debian/ngircd-full:
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
|
||||
rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/INSTALL*
|
||||
rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/COPYING*
|
||||
mv $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd \
|
||||
$(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full
|
||||
rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/INSTALL*
|
||||
rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/COPYING*
|
||||
mkdir -p $(CURDIR)/debian/ngircd-full/var/run/ircd
|
||||
cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \
|
||||
sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
|
||||
sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
|
||||
sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = /etc/ngircd/ngircd.motd|g" | \
|
||||
sed -e "s|;HelpFile = /usr/share/doc/ngircd/Commands.txt|HelpFile = /usr/share/doc/ngircd-full/Commands.txt|g" | \
|
||||
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
|
||||
@@ -176,16 +174,12 @@ install-ngircd-full-dbg: build-ngircd-full-dbg
|
||||
|
||||
# Add here commands to install the "full" package into debian/ngircd-full:
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full-dbg
|
||||
rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/INSTALL*
|
||||
rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/COPYING*
|
||||
mv $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd \
|
||||
$(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg
|
||||
rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/INSTALL*
|
||||
rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/COPYING*
|
||||
mkdir -p $(CURDIR)/debian/ngircd-full-dbg/var/run/ircd
|
||||
cat $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/sample-ngircd.conf | \
|
||||
sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
|
||||
sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
|
||||
sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = /etc/ngircd/ngircd.motd|g" | \
|
||||
sed -e "s|;HelpFile = /usr/share/doc/ngircd/Commands.txt|HelpFile = /usr/share/doc/ngircd-full-dbg/Commands.txt|g" | \
|
||||
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
|
||||
|
@@ -138,8 +138,6 @@
|
||||
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>"; };
|
||||
FA322D110CEF74B1001761B3 /* ansi2knr.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = ansi2knr.c; sourceTree = "<group>"; };
|
||||
FA322D120CEF74B1001761B3 /* exp.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = exp.h; sourceTree = "<group>"; };
|
||||
FA322D130CEF74B1001761B3 /* imp.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = imp.h; sourceTree = "<group>"; };
|
||||
FA322D150CEF74B1001761B3 /* portab.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = portab.h; sourceTree = "<group>"; };
|
||||
FA322D160CEF74B1001761B3 /* portabtest.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = portabtest.c; sourceTree = "<group>"; };
|
||||
FA322D170CEF74B1001761B3 /* splint.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = splint.h; sourceTree = "<group>"; };
|
||||
@@ -423,8 +421,6 @@
|
||||
FA18A64716CEE14900132F66 /* Makefile.ng */,
|
||||
FA322D100CEF74B1001761B3 /* ansi2knr.1 */,
|
||||
FA322D110CEF74B1001761B3 /* ansi2knr.c */,
|
||||
FA322D120CEF74B1001761B3 /* exp.h */,
|
||||
FA322D130CEF74B1001761B3 /* imp.h */,
|
||||
FA322D150CEF74B1001761B3 /* portab.h */,
|
||||
FA322D160CEF74B1001761B3 /* portabtest.c */,
|
||||
FA322D170CEF74B1001761B3 /* splint.h */,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
%define name ngircd
|
||||
%define version 21.1
|
||||
%define version 22.1
|
||||
%define release 1
|
||||
%define prefix %{_prefix}
|
||||
|
||||
|
@@ -16,6 +16,7 @@
|
||||
|
||||
NAME=`basename "$0"`
|
||||
VERBOSE=
|
||||
CLEAN=1
|
||||
|
||||
PLATFORM=
|
||||
COMPILER="unknown"
|
||||
@@ -26,8 +27,12 @@ COMMENT=
|
||||
R_CONFIGURE=
|
||||
R_MAKE=
|
||||
R_CHECK=
|
||||
R_CHECK_Y="?"
|
||||
R_RUN=
|
||||
|
||||
SRC_D=`dirname "$0"`
|
||||
MY_D="$PWD"
|
||||
|
||||
[ -n "$MAKE" ] || MAKE="make"
|
||||
export MAKE CC
|
||||
|
||||
@@ -36,43 +41,56 @@ while [ $# -gt 0 ]; do
|
||||
"-v")
|
||||
VERBOSE=1
|
||||
;;
|
||||
"-x")
|
||||
CLEAN=
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $NAME [-v]"
|
||||
echo "Usage: $NAME [-v] [-x]"
|
||||
echo
|
||||
echo " -v Verbose output"
|
||||
echo " -x Don't regenerate build system, even when possible"
|
||||
echo
|
||||
exit 2
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
echo "$NAME: Checking ngIRCd base source directory ..."
|
||||
grep "ngIRCd" ./ChangeLog >/dev/null 2>&1
|
||||
grep "ngIRCd" "$SRC_D/ChangeLog" >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
grep "ngIRCd" ../ChangeLog >/dev/null 2>&1
|
||||
grep "ngIRCd" "$SRC_D/../ChangeLog" >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$NAME: ngIRCd base source directory not found!?"
|
||||
exit 1
|
||||
fi
|
||||
cd ..
|
||||
SRC_D="$SRC_D/.."
|
||||
fi
|
||||
echo "$NAME: - source directory: $SRC_D"
|
||||
echo "$NAME: - working directory: $MY_D"
|
||||
|
||||
echo "$NAME: Checking for GIT tree ..."
|
||||
if [ -d .git ]; then
|
||||
if [ -d "$SRC_D/.git" ]; then
|
||||
echo "$NAME: Checking for \"git\" command ..."
|
||||
git version >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
if [ $? -eq 0 -a -n "$CLEAN" ]; then
|
||||
echo "$NAME: Running \"git clean\" ..."
|
||||
cd "$SRC_D" || exit 1
|
||||
[ -n "$VERBOSE" ] && git clean -dxf || git clean -dxf >/dev/null
|
||||
cd "$MY_D" || exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$NAME: Checking for \"./configure\" script ..."
|
||||
if [ ! -r ./configure ]; then
|
||||
echo "$NAME: Running \"./autogen.sh\" ..."
|
||||
echo "$NAME: Checking for \"$SRC_D/configure\" script ..."
|
||||
if [ ! -r "$SRC_D/configure" ]; then
|
||||
echo "$NAME: Running \"$SRC_D/autogen.sh\" ..."
|
||||
cd "$SRC_D" || exit 1
|
||||
[ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null
|
||||
cd "$MY_D" || exit 1
|
||||
fi
|
||||
|
||||
if [ -r ./configure ]; then
|
||||
echo "$NAME: Running \"./configure\" script ..."
|
||||
[ -n "$VERBOSE" ] && ./configure || ./configure >/dev/null
|
||||
if [ -r "$SRC_D/configure" ]; then
|
||||
echo "$NAME: Running \"$SRC_D/configure\" script ..."
|
||||
[ -n "$VERBOSE" ] && "$SRC_D/configure" -C || "$SRC_D/configure" -C >/dev/null
|
||||
if [ $? -eq 0 -a -r ./Makefile ]; then
|
||||
R_CONFIGURE=1
|
||||
echo "$NAME: Running \"$MAKE\" ..."
|
||||
@@ -84,6 +102,8 @@ if [ -r ./configure ]; then
|
||||
if [ $? -eq 0 ]; then
|
||||
R_CHECK=1
|
||||
R_RUN=$R_CHECK
|
||||
[ -r ./src/testsuite/tests-skipped.lst ] \
|
||||
&& R_CHECK_Y="y" || R_CHECK_Y="Y"
|
||||
else
|
||||
./src/ngircd/ngircd --help 2>/dev/null \
|
||||
| grep "^ngIRCd" >/dev/null
|
||||
@@ -143,8 +163,8 @@ fi
|
||||
# Get ngIRCd version information
|
||||
eval $(grep "^VERSION = " Makefile | sed -e 's/ //g')
|
||||
case "$VERSION" in
|
||||
*-*-*)
|
||||
VERSION=`echo "$VERSION" | cut -d'-' -f3 | cut -b2-`
|
||||
*~*-*)
|
||||
VERSION=`echo "$VERSION" | cut -b1-10`
|
||||
;;
|
||||
esac
|
||||
[ -n "$VERSION" ] || VERSION="unknown"
|
||||
@@ -163,7 +183,7 @@ fi
|
||||
|
||||
[ -n "$R_CONFIGURE" ] && C="Y" || C="N"
|
||||
[ -n "$R_MAKE" ] && M="Y" || M="N"
|
||||
[ -n "$R_CHECK" ] && T="Y" || T="N"
|
||||
[ -n "$R_CHECK" ] && T="$R_CHECK_Y" || T="N"
|
||||
[ -n "$R_RUN" ] && R="Y" || R="N"
|
||||
[ -n "$COMMENT" ] && COMMENT=" $COMMENT"
|
||||
|
||||
@@ -177,11 +197,15 @@ echo "Platform Compiler ngIRCd Date Tester C M
|
||||
echo "--------------------------- ------------ ---------- -------- -------- - - - - -"
|
||||
type printf >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
printf "%-27s %-12s %-10s %s %-8s %s %s %s %s%s" \
|
||||
printf "%-27s %-12s %-10s %s %-8s %s %s %s %s%s\n" \
|
||||
"$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
|
||||
echo
|
||||
if [ "$R_CHECK_Y" = "y" ]; then
|
||||
echo "$NAME: Warning: Some tests have been skipped!"
|
||||
echo
|
||||
fi
|
||||
|
16
doc/Bopm.txt
16
doc/Bopm.txt
@@ -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-2014 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
@@ -18,7 +17,7 @@ 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
|
||||
Starting with Release 17, ngIRCd supports all required log messages that
|
||||
BOPM requires to be useful.
|
||||
|
||||
II. Installation
|
||||
@@ -37,11 +36,12 @@ a) BOPM "IRC" section:
|
||||
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).
|
||||
"Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*";
|
||||
and comment out all the other "connregex" examples (that is, prepend a
|
||||
"#" character).
|
||||
|
||||
5) Set "kline" to "KILL %n :Open proxy found on your host!"; for example,
|
||||
and comment all the other "kline" examples.
|
||||
5) Set "kline" to "GLINE *@%h :Open proxy found on your host!";
|
||||
and comment out all the other "kline" examples.
|
||||
|
||||
b) BOPM "scanner" section:
|
||||
|
||||
|
@@ -89,6 +89,11 @@ 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.
|
||||
|
||||
Q: How can I "auto-op" users in channels?
|
||||
A: ngIRCd can't do this: you would have to use some "IRC Services", like
|
||||
Atheme (<http://atheme.net/atheme.html>) or Anope (<http://www.anope.org>).
|
||||
See "doc/Services.txt" for setup instructions.
|
||||
|
||||
|
||||
IV. Bugs!?
|
||||
~~~~~~~~~~
|
||||
|
@@ -74,4 +74,6 @@ l) Upload and distribute the newly generated ngIRCd release archive(s)
|
||||
|
||||
m) Write an announcement to the mailing list, freshmeat, Twitter, ...
|
||||
|
||||
n) Relax :-)
|
||||
n) Update the list of releases in our bug tracker.
|
||||
|
||||
o) Relax :-)
|
||||
|
@@ -2,7 +2,7 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2012 Alexander Barton and Contributors.
|
||||
(c)2001-2014 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
@@ -26,6 +26,7 @@ channels he is using at the moment.
|
||||
B 20 User is flagged as a "bot".
|
||||
c 17 IRC operator wants to receive connect/disconnect NOTICEs.
|
||||
C 19 Only users that share a channel are allowed to send messages.
|
||||
F 22 Relaxed flood protection (only settable by IRC Operators).
|
||||
i 0.0.1 User is "invisible".
|
||||
o 0.0.1 User is IRC operator.
|
||||
q 20 User is protected, can not be kicked from a channel.
|
||||
|
@@ -30,8 +30,10 @@ alpha/unknown/netbsd3.0 gcc 3.3.3 CVSHEAD 06-05-07 fw Y Y Y Y 3
|
||||
armv6l/unk./linux-gnueabi gcc 4.7.2 20.2 13-03-08 goetz Y Y Y Y 5
|
||||
armv6l/unk./linux-gnueabihf gcc 4.6.3 21~rc2 13-10-26 pi Y Y Y Y 5
|
||||
armv7l/unk./linux-gnueabi gcc 4.4.3 19.1 12-04-29 goetz Y Y Y Y 5
|
||||
armv7l/unk./linux-gnueabihf gcc 4.6.3 22~rc1-3 14-10-10 alex Y Y Y Y 5
|
||||
armv7l/unk./linux-gnueabihf gcc 4.8.2 21.1 14-07-15 goetz Y Y Y Y 5
|
||||
hppa/unknown/openbsd3.5 gcc 2.95.3 CVSHEAD 04-05-25 alex Y Y Y Y
|
||||
hppa/unknown/openbsd5.4 gcc 4.2.1 21 13-11-10 alex Y Y Y Y 3
|
||||
hppa/unknown/openbsd5.4 gcc 4.2.1 22~rc1-3 14-10-10 alex Y Y y Y 3
|
||||
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
|
||||
@@ -45,7 +47,7 @@ i386/unknown/freebsd6.2 gcc 3.4.6 20~rc1 12-11-13 alex Y Y Y Y 3
|
||||
i386/unknown/freebsd7.3 gcc 4.2.1 20~rc1 12-11-13 alex Y Y Y Y 3
|
||||
i686/pc/minix gcc 4.4.6 21~rc2 13-10-27 alex Y Y N N
|
||||
i686/unknown/gnu0.3 gcc 4.4.5 19 12-02-29 alex Y Y Y Y
|
||||
i686/unknown/gnu0.5 gcc 4.8.2 21 14-02-09 alex Y Y Y Y
|
||||
i686/unknown/gnu0.5 gcc 4.9.1 22~rc1-3 14-10-11 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.5.2 egcs-1.1.2 21 13-11-25 goetz Y Y N Y
|
||||
i386/unknown/netbsdelf1.6.2 gcc 2.95.3 18 11-07-10 goetz Y Y Y Y
|
||||
@@ -59,11 +61,12 @@ i386/unknown/openbsd5.3 gcc 4.2.1 21 13-11-28 goetz Y Y Y Y 3
|
||||
i386/unknown/openbsd5.4 gcc 4.2.1 21 13-11-28 goetz Y Y Y Y 3
|
||||
i586/pc/haiku gcc 2.95.3 19.2~138 12-10-11 user Y Y N N
|
||||
i586/pc/interix3.5 gcc 3.3 19 12-02-29 alex Y Y N Y
|
||||
i686/pc/cygwin gcc 4.8.2 21 14-01-02 alex Y Y N Y
|
||||
i686/pc/cygwin gcc 4.8.3 22~rc1-3 14-10-10 alex Y Y N Y
|
||||
i686/pc/linux-gnu gcc 2.7.2 21~38 14-01-06 goetz Y Y Y Y 1
|
||||
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
|
||||
i386/pc/linux-gnu gcc 4.4.5 22~rc1-3 14-10-10 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.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
|
||||
@@ -74,7 +77,7 @@ 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
|
||||
mipsel/unknown/linux-gnu gcc 4.4.5 21 13-11-24 goetz Y Y Y Y 1
|
||||
powerpc/apple/darwin6.8 gcc 3.1 21 14-01-03 goetz Y Y Y Y
|
||||
powerpc/apple/darwin7.9.0 gcc 3.3 21 14-01-11 goetz Y Y Y Y 3
|
||||
powerpc/apple/darwin7.9.0 gcc 3.3 22 15-03-22 goetz Y Y Y Y 3
|
||||
powerpc/apple/darwin8.11.0 gcc 4.0.1 18 11-07-02 goetz Y Y Y Y 3
|
||||
powerpc/apple/darwin9.8.0 gcc 4.0.1 21 14-01-04 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
|
||||
@@ -82,22 +85,30 @@ 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
|
||||
sparc/unknown/openbsd5.5 gcc 4.2.1 21.1 14-05-03 goetz Y Y Y Y 3
|
||||
x86_64/apple/darwin10.8.0 gcc 4.2.1 21~rc2 13-10-30 alex Y Y Y Y 3
|
||||
x86_64/apple/darwin12.3.0 gcc 4.2.1 20.2 13-04-01 alex Y Y Y Y 3
|
||||
x86_64/apple/darwin13.0.0 A-clang 5.0 21 14-01-02 alex Y Y Y Y 3
|
||||
x86_64/apple/darwin14.0.0 A-clang 6.0 22~rc1-3 14-10-10 alex Y Y Y Y 3
|
||||
x86_64/unknown/dragonfly3.4 gcc 4.7.2 21 13-11-12 goetz Y Y N Y 3
|
||||
x86_64/unknown/freebsd8.4 gcc 4.2.1 21 14-01-02 alex Y Y Y Y 3
|
||||
x86_64/unknown/freebsd9.1 gcc 4.2.1 21 14-01-02 alex Y Y Y Y 3
|
||||
x86_64/unknown/freebsd8.4 gcc 4.2.1 22~rc1-3 14-10-10 alex Y Y y Y 3
|
||||
x86_64/unknown/freebsd9.2 gcc 4.2.1 22~rc1-3 14-10-10 alex Y Y Y Y 3
|
||||
x86_64/unknown/freebsd10.0 F-clang 3.3 22~rc1-3 14-10-10 alex Y Y Y Y 3
|
||||
x86_64/unkn./freebsd8.1-gnu gcc 4.4.5 19 12-02-26 alex Y Y Y Y 3
|
||||
x86_64/unknown/linux-gnu clang 3.3 21 14-01-07 alex Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu clang 3.4 22~rc1-3 14-10-11 alex Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu gcc 4.4.5 22~rc1-3 14-10-10 alex Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu gcc 4.7.2 22~rc1-3 14-10-10 alex Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu gcc 4.8.2 21 13-12-29 alex Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu gcc 4.9.1 22~rc1-3 14-10-10 alex Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu nwcc 0.8.2 21 13-12-01 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu Open64 21 13-11-30 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu Sun C 5.12 21 13-11-22 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu tcc 0.9.25 21 13-11-30 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu Open64 21.1 14-03-27 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu Sun C 5.12 21.1 14-03-27 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu tcc 0.9.25 21.1 14-03-27 goetz Y Y Y Y 1
|
||||
x86_64/unknown/openbsd4.7 gcc 3.3.5 20~rc1 12-02-26 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd4.8 gcc 4.2.1 21 13-12-28 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd4.8 gcc 4.2.1 22~rc1-3 14-10-10 alex Y Y y Y 3
|
||||
x86_64/unknown/openbsd5.1 gcc 4.2.1 21 13-12-28 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd5.5 gcc 4.2.1 22~rc1-3 14-10-10 alex Y Y Y Y 3
|
||||
|
||||
|
||||
* Notes
|
||||
|
@@ -22,7 +22,7 @@ The following software packages are needed:
|
||||
- GNU sed
|
||||
Source:
|
||||
http://www.rezepte-im-web.de/appleux/sed-3.02.tar.gz
|
||||
ftp://arthur.barton.de/pub/unix/aux/tools/sed-3.02.tar.gz
|
||||
http://arthur.barton.de/pub/unix/aux/tools/sed-3.02.tar.gz
|
||||
|
||||
A/UX comes with /bin/sed which isn't supporting all functions needed
|
||||
by GNU automake/autoconf.
|
||||
@@ -34,7 +34,7 @@ The following software packages are needed:
|
||||
- libUTIL.a
|
||||
Source:
|
||||
ftp://ftp.mayn.de/pub/really_old_stuff/apple/apple_unix/Sys_stuff/libUTIL-2.1.tar.gz>
|
||||
ftp://arthur.barton.de/pub/unix/aux/libraries/libUTIL-2.1.tar.gz
|
||||
http://arthur.barton.de/pub/unix/aux/libraries/libUTIL-2.1.tar.gz
|
||||
|
||||
This library contains functions that are common on other UNIX
|
||||
systems but not on A/UX e.g. memmove(), strerror() and strdup().
|
||||
@@ -50,7 +50,7 @@ A few hints in case of errors:
|
||||
(so 'configure' uses its own shell script) or use a fully functionable one.
|
||||
There's at least one binary "out there" causing problems. The one
|
||||
of the GNU fileutils works fine:
|
||||
ftp://arthur.barton.de/pub/unix/aux/tools/fileutils-4.0.tar.gz
|
||||
http://arthur.barton.de/pub/unix/aux/tools/fileutils-4.0.tar.gz
|
||||
|
||||
- The precompiled binary of the old 'bash' shouldn't be installed within
|
||||
/bin (better do this in /usr/local/bin) because 'configure' would
|
||||
|
@@ -123,7 +123,7 @@ Please note that versions up to and including 5.1.3 contain a bug that
|
||||
sometimes causes IRC Services to hang on startup. There are two workarounds:
|
||||
a) send the services process a HUP signal ("killall -HUP ircservices")
|
||||
b) apply this patch to the IRC Services source tree:
|
||||
<ftp://ngircd.barton.de/ngircd/contrib/IRCServices513-FlushBuffer.patch>
|
||||
<http://arthur.barton.de/pub/ngircd/contrib/IRCServices513-FlushBuffer.patch>
|
||||
|
||||
At least the following settings have to be tweaked, in addition to all the
|
||||
settings marked as required by IRC Services:
|
||||
|
@@ -54,6 +54,12 @@
|
||||
# A simple Phrase (<256 chars) if you don't want to use a motd file.
|
||||
;MotdPhrase = "Hello world!"
|
||||
|
||||
# The name of the IRC network to which this server belongs. This name
|
||||
# is optional, should only contain ASCII characters, and can't contain
|
||||
# spaces. It is only used to inform clients. The default is empty,
|
||||
# so no network name is announced to clients.
|
||||
;Network = aIRCnetwork
|
||||
|
||||
# Global password for all users needed to connect to the server.
|
||||
# (Default: not set)
|
||||
;Password = abc
|
||||
@@ -166,8 +172,8 @@
|
||||
;ConnectIPv4 = yes
|
||||
|
||||
# Default user mode(s) to set on new local clients. Please note that
|
||||
# only modes can be set that the client could set on itself, you can't
|
||||
# set "a" (away) or "o" (IRC Op), for example! Default: none.
|
||||
# only modes can be set that the client could set using regular MODE
|
||||
# commands, you can't set "a" (away) for example! Default: none.
|
||||
;DefaultUserModes = i
|
||||
|
||||
# Do DNS lookups when a client connects to the server.
|
||||
@@ -253,9 +259,9 @@
|
||||
# See 'man 1ssl ciphers' (OpenSSL) or 'man 3 gnutls_priority_init'
|
||||
# (GnuTLS) for details.
|
||||
# For OpenSSL:
|
||||
;CipherList = HIGH:!aNULL:@STRENGTH
|
||||
;CipherList = HIGH:!aNULL:@STRENGTH:!SSLv3
|
||||
# For GnuTLS:
|
||||
;CipherList = SECURE128
|
||||
;CipherList = SECURE128:-VERS-SSL3.0
|
||||
|
||||
# Diffie-Hellman parameters
|
||||
;DHFile = :ETCDIR:/ssl/dhparams.pem
|
||||
|
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" ngircd.conf(5) manual page template
|
||||
.\"
|
||||
.TH ngircd.conf 5 "Oct 2013" ngIRCd "ngIRCd Manual"
|
||||
.TH ngircd.conf 5 "Oct 2014" ngIRCd "ngIRCd Manual"
|
||||
.SH NAME
|
||||
ngircd.conf \- configuration file of ngIRCd
|
||||
.SH SYNOPSIS
|
||||
@@ -60,7 +60,7 @@ The main configuration of the server is stored in the
|
||||
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.
|
||||
in the other sections can be left on their defaults very often.
|
||||
.PP
|
||||
Options in the
|
||||
.I [Limits]
|
||||
@@ -82,12 +82,13 @@ sections. And
|
||||
blocks are used to configure pre-defined ("persistent") IRC channels.
|
||||
.PP
|
||||
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.
|
||||
configuration file, one for each operator, server, and channel. [Global],
|
||||
[Limits], [Options], and [SSL] sections can occure multiple times, too, but
|
||||
each variable overwrites itself, only the last assignment is relevant.
|
||||
.SH [GLOBAL]
|
||||
The
|
||||
.I [Global]
|
||||
section of this file is used to define the main configuration of the server,
|
||||
section 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!
|
||||
@@ -126,6 +127,12 @@ configuration file.
|
||||
\fBMotdPhrase\fR (string)
|
||||
A simple Phrase (<256 chars) if you don't want to use a MOTD file.
|
||||
.TP
|
||||
\fBNetwork\fR (string)
|
||||
The name of the IRC network to which this server belongs. This name is
|
||||
optional, should only contain ASCII characters, and can't contain spaces.
|
||||
It is only used to inform clients. The default is empty, so no network
|
||||
name is announced to clients.
|
||||
.TP
|
||||
\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
|
||||
@@ -133,16 +140,16 @@ if ngIRCd is using PAM!
|
||||
.TP
|
||||
\fBPidFile\fR (string)
|
||||
This tells ngIRCd to write its current process ID to a file. Note that the
|
||||
"PID file" is written AFTER chroot and switching the user ID, e.g. the directory
|
||||
the file resides in must be writable by the ngIRCd user and exist in the
|
||||
chroot directory (if configured, see above).
|
||||
"PID file" is written AFTER chroot and switching the user ID, therefore the
|
||||
directory the file 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 for unencrypted connections. There
|
||||
may be more than one port, separated with commas (","). Default: 6667.
|
||||
Port number(s) on which the server should listen for unencrypted connections.
|
||||
There may be more than one port, separated with commas (","). Default: 6667.
|
||||
.TP
|
||||
\fBServerGID\fR (string or number)
|
||||
Group ID under which the ngIRCd should run; you can use the name of the
|
||||
Group ID under which the ngIRCd daemon should run; you can use the name of the
|
||||
group or the numerical ID.
|
||||
.PP
|
||||
.RS
|
||||
@@ -152,8 +159,8 @@ For this to work the server must have been started with root privileges!
|
||||
.RE
|
||||
.TP
|
||||
\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.
|
||||
User ID under which the ngIRCd daemon should run; you can use the name of the
|
||||
user or the numerical ID.
|
||||
.PP
|
||||
.RS
|
||||
.B Attention:
|
||||
@@ -163,8 +170,8 @@ 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 :-)
|
||||
This section is used to 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
|
||||
@@ -206,8 +213,8 @@ 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.
|
||||
ngIRCd are configured in this section. If you want to get started quickly, you
|
||||
most probably don't have to make changes here -- they are all optional.
|
||||
.TP
|
||||
\fBAllowedChannelTypes\fR (string)
|
||||
List of allowed channel types (channel prefixes) for newly created channels
|
||||
@@ -216,9 +223,9 @@ Set this variable to the empty string to disallow creation of new channels
|
||||
by local clients at all. Default: #&+
|
||||
.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.
|
||||
If this option is active, IRC operators connected to remote servers are allowed
|
||||
to control this local server using administrative commands, for example like
|
||||
CONNECT, DIE, SQUIT etc. Default: no.
|
||||
.TP
|
||||
\fBChrootDir\fR (string)
|
||||
A directory to chroot in when everything is initialized. It doesn't need
|
||||
@@ -260,8 +267,8 @@ Default: yes.
|
||||
.TP
|
||||
\fBDefaultUserModes\fR (string)
|
||||
Default user mode(s) to set on new local clients. Please note that only modes
|
||||
can be set that the client could set on itself, you can't set "a" (away) or
|
||||
"o" (IRC Op), for example!
|
||||
can be set that the client could set using regular MODE commands, you can't
|
||||
set "a" (away) for example!
|
||||
Default: none.
|
||||
.TP
|
||||
\fBDNS\fR (boolean)
|
||||
@@ -277,11 +284,11 @@ Users identified using IDENT are registered without the "~" character
|
||||
prepended to their user name.
|
||||
Default: yes.
|
||||
.TP
|
||||
.TP
|
||||
\fBIncludeDir\fR (string)
|
||||
Directory containing configuration snippets (*.conf), that should be read in
|
||||
after parsing the current configuration file.
|
||||
Default: none.
|
||||
.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
|
||||
@@ -368,7 +375,7 @@ SSL Certificate file of the private server key.
|
||||
.TP
|
||||
\fBCipherList\fR (string)
|
||||
Select cipher suites allowed for SSL/TLS connections. This defaults to
|
||||
"HIGH:!aNULL:@STRENGTH" (OpenSSL) or "SECURE128" (GnuTLS).
|
||||
"HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) or "SECURE128:-VERS-SSL3.0" (GnuTLS).
|
||||
Please see 'man 1ssl ciphers' (OpenSSL) and 'man 3 gnutls_priority_init'
|
||||
(GnuTLS) for details.
|
||||
.TP
|
||||
|
@@ -4,6 +4,7 @@
|
||||
|
||||
#ifndef NG_IPADDR_HDR
|
||||
#define NG_IPADDR_HDR
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
/**
|
||||
@@ -12,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
|
@@ -14,16 +14,19 @@
|
||||
* Functions to dynamically allocate arrays.
|
||||
*/
|
||||
|
||||
/* Additionan debug messages related to array handling: 0=off / 1=on */
|
||||
#define DEBUG_ARRAY 0
|
||||
|
||||
#include "array.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "log.h"
|
||||
|
||||
/* Enable more Debug messages in alloc / append / memmove code. */
|
||||
/* #define DEBUG_ARRAY */
|
||||
#if DEBUG_ARRAY
|
||||
# include "log.h"
|
||||
#endif
|
||||
|
||||
#define array_UNUSABLE(x) ( !(x)->mem )
|
||||
|
||||
@@ -64,7 +67,7 @@ array_alloc(array * a, size_t size, size_t pos)
|
||||
return NULL;
|
||||
|
||||
if (a->allocated < alloc) {
|
||||
#ifdef DEBUG_ARRAY
|
||||
#if DEBUG_ARRAY
|
||||
Log(LOG_DEBUG, "array_alloc(): changing size from %u to %u bytes.",
|
||||
a->allocated, alloc);
|
||||
#endif
|
||||
@@ -165,7 +168,7 @@ array_catb(array * dest, const char *src, size_t len)
|
||||
|
||||
assert(ptr != NULL);
|
||||
|
||||
#ifdef DEBUG_ARRAY
|
||||
#if DEBUG_ARRAY
|
||||
Log(LOG_DEBUG,
|
||||
"array_catb(): appending %u bytes to array (now %u bytes in array).",
|
||||
len, tmp);
|
||||
@@ -245,7 +248,7 @@ void
|
||||
array_free(array * a)
|
||||
{
|
||||
assert(a != NULL);
|
||||
#ifdef DEBUG_ARRAY
|
||||
#if DEBUG_ARRAY
|
||||
Log(LOG_DEBUG,
|
||||
"array_free(): %u bytes free'd (%u bytes still used at time of free()).",
|
||||
a->allocated, a->used);
|
||||
@@ -311,7 +314,7 @@ array_moveleft(array * a, size_t membersize, size_t pos)
|
||||
if (!bytepos)
|
||||
return; /* nothing to do */
|
||||
|
||||
#ifdef DEBUG_ARRAY
|
||||
#if DEBUG_ARRAY
|
||||
Log(LOG_DEBUG,
|
||||
"array_moveleft(): %u bytes used in array, starting at position %u.",
|
||||
a->used, bytepos);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -18,41 +18,32 @@
|
||||
* Channel management
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <strings.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn-func.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "channel.h"
|
||||
|
||||
#include "imp.h"
|
||||
#include "irc-write.h"
|
||||
#include "conf.h"
|
||||
#include "hash.h"
|
||||
#include "lists.h"
|
||||
#include "log.h"
|
||||
#include "messages.h"
|
||||
#include "match.h"
|
||||
|
||||
#include "exp.h"
|
||||
|
||||
|
||||
#define REMOVE_PART 0
|
||||
#define REMOVE_QUIT 1
|
||||
#define REMOVE_KICK 2
|
||||
|
||||
|
||||
static CHANNEL *My_Channels;
|
||||
static CL2CHAN *My_Cl2Chan;
|
||||
|
||||
|
||||
static CL2CHAN *Get_Cl2Chan PARAMS(( CHANNEL *Chan, CLIENT *Client ));
|
||||
static CL2CHAN *Add_Client PARAMS(( CHANNEL *Chan, CLIENT *Client ));
|
||||
static bool Remove_Client PARAMS(( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const char *Reason, bool InformServer ));
|
||||
|
@@ -16,19 +16,13 @@
|
||||
* User class management.
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "array.h"
|
||||
#include "conn.h"
|
||||
#include "client.h"
|
||||
#include "lists.h"
|
||||
#include "match.h"
|
||||
#include "stdio.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "class.h"
|
||||
|
||||
struct list_head My_Classes[CLASS_COUNT];
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -18,15 +18,11 @@
|
||||
* Functions to deal with IRC Capabilities
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "client.h"
|
||||
#include "log.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "client-cap.h"
|
||||
|
||||
GLOBAL int
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -18,22 +18,16 @@
|
||||
* Client management.
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <time.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "client.h"
|
||||
|
||||
#include <imp.h>
|
||||
#include "ngircd.h"
|
||||
#include "channel.h"
|
||||
#include "conf.h"
|
||||
@@ -44,8 +38,6 @@
|
||||
#include "match.h"
|
||||
#include "messages.h"
|
||||
|
||||
#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;
|
||||
@@ -345,7 +337,7 @@ Client_SetHostname( CLIENT *Client, const char *Hostname )
|
||||
assert(Client != NULL);
|
||||
assert(Hostname != NULL);
|
||||
|
||||
if (strlen(Conf_CloakHost)) {
|
||||
if (Conf_CloakHost[0]) {
|
||||
char cloak[GETID_LEN];
|
||||
|
||||
strlcpy(cloak, Hostname, GETID_LEN);
|
||||
@@ -435,7 +427,7 @@ Client_SetOrigUser(CLIENT UNUSED *Client, const char UNUSED *User)
|
||||
assert(Client != NULL);
|
||||
assert(User != NULL);
|
||||
|
||||
#if defined(PAM) && defined(IDENTAUTH)
|
||||
#if defined(PAM)
|
||||
strlcpy(Client->orig_user, User, sizeof(Client->orig_user));
|
||||
#endif
|
||||
} /* Client_SetOrigUser */
|
||||
@@ -739,15 +731,7 @@ Client_User( CLIENT *Client )
|
||||
*/
|
||||
GLOBAL char *
|
||||
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
|
||||
|
@@ -52,8 +52,9 @@ typedef struct _CLIENT
|
||||
char *cloaked; /* cloaked hostname of the client */
|
||||
char *ipa_text; /* textual representaton of IP address */
|
||||
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 */
|
||||
#if defined(PAM)
|
||||
char orig_user[CLIENT_AUTHUSER_LEN];
|
||||
/* original 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 */
|
||||
|
@@ -16,9 +16,7 @@
|
||||
* Configuration management (reading, parsing & validation)
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#ifdef PROTOTYPES
|
||||
# include <stdarg.h>
|
||||
@@ -29,23 +27,19 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#include "array.h"
|
||||
#include "ngircd.h"
|
||||
#include "conn.h"
|
||||
#include "channel.h"
|
||||
#include "defines.h"
|
||||
#include "log.h"
|
||||
#include "match.h"
|
||||
#include "tool.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "conf.h"
|
||||
|
||||
|
||||
@@ -94,10 +88,10 @@ static void Init_Server_Struct PARAMS(( CONF_SERVER *Server ));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBSSL
|
||||
#define DEFAULT_CIPHERS "HIGH:!aNULL:@STRENGTH"
|
||||
#define DEFAULT_CIPHERS "HIGH:!aNULL:@STRENGTH:!SSLv3"
|
||||
#endif
|
||||
#ifdef HAVE_LIBGNUTLS
|
||||
#define DEFAULT_CIPHERS "SECURE128"
|
||||
#define DEFAULT_CIPHERS "SECURE128:-VERS-SSL3.0"
|
||||
#endif
|
||||
|
||||
#ifdef SSL_SUPPORT
|
||||
@@ -369,6 +363,7 @@ Conf_Test( void )
|
||||
printf(" MotdPhrase = %s\n", array_bytes(&Conf_Motd)
|
||||
? (const char*) array_start(&Conf_Motd) : "");
|
||||
}
|
||||
printf(" Network = %s\n", Conf_Network);
|
||||
if (!Conf_PAM)
|
||||
printf(" Password = %s\n", Conf_ServerPwd);
|
||||
printf(" PidFile = %s\n", Conf_PidFile);
|
||||
@@ -623,6 +618,7 @@ Conf_EnablePassiveServer(const char *Name)
|
||||
&& (Conf_Server[i].port > 0)) {
|
||||
/* BINGO! Enable server */
|
||||
Conf_Server[i].flags &= ~CONF_SFLAG_DISABLED;
|
||||
Conf_Server[i].lasttry = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -748,6 +744,7 @@ Set_Defaults(bool InitServers)
|
||||
strcpy(Conf_ServerAdminMail, "");
|
||||
snprintf(Conf_ServerInfo, sizeof Conf_ServerInfo, "%s %s",
|
||||
PACKAGE_NAME, PACKAGE_VERSION);
|
||||
strcpy(Conf_Network, "");
|
||||
free(Conf_ListenAddress);
|
||||
Conf_ListenAddress = NULL;
|
||||
array_free(&Conf_ListenPorts);
|
||||
@@ -810,8 +807,8 @@ Set_Defaults(bool InitServers)
|
||||
Conf_PAM = false;
|
||||
#endif
|
||||
Conf_PAMIsOptional = false;
|
||||
#ifdef SYSLOG
|
||||
Conf_ScrubCTCP = false;
|
||||
#ifdef SYSLOG
|
||||
#ifdef LOG_LOCAL5
|
||||
Conf_SyslogFacility = LOG_LOCAL5;
|
||||
#else
|
||||
@@ -1412,6 +1409,7 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
|
||||
struct group *grp;
|
||||
size_t len;
|
||||
const char *section;
|
||||
char *ptr;
|
||||
|
||||
assert(File != NULL);
|
||||
assert(Line > 0);
|
||||
@@ -1494,6 +1492,19 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
|
||||
Using_MotdFile = false;
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "Network") == 0) {
|
||||
len = strlcpy(Conf_Network, Arg, sizeof(Conf_Network));
|
||||
if (len >= sizeof(Conf_Network))
|
||||
Config_Error_TooLong(File, Line, Var);
|
||||
ptr = strchr(Conf_Network, ' ');
|
||||
if (ptr) {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: \"Network\" can't contain spaces!",
|
||||
File, Line);
|
||||
*ptr = '\0';
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(strcasecmp(Var, "Password") == 0) {
|
||||
len = strlcpy(Conf_ServerPwd, Arg, sizeof(Conf_ServerPwd));
|
||||
if (len >= sizeof(Conf_ServerPwd))
|
||||
|
@@ -109,6 +109,9 @@ GLOBAL char Conf_ServerAdmin1[CLIENT_INFO_LEN];
|
||||
GLOBAL char Conf_ServerAdmin2[CLIENT_INFO_LEN];
|
||||
GLOBAL char Conf_ServerAdminMail[CLIENT_INFO_LEN];
|
||||
|
||||
/** Network name (optional, no spaces allowed) */
|
||||
GLOBAL char Conf_Network[CLIENT_INFO_LEN];
|
||||
|
||||
/** Message of the day (MOTD) of this server */
|
||||
GLOBAL array Conf_Motd;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -20,25 +20,21 @@
|
||||
* Functions to deal with character encodings and conversions
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "log.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "conn-encoding.h"
|
||||
|
||||
#ifdef ICONV
|
||||
|
||||
#include "log.h"
|
||||
#include "conn-encoding.h"
|
||||
|
||||
char Encoding_Buffer[COMMAND_LEN];
|
||||
|
||||
char *Convert_Message PARAMS((iconv_t Handle, char *Message));
|
||||
|
||||
|
||||
/**
|
||||
* Set client character encoding on a connection.
|
||||
*
|
||||
@@ -133,7 +129,7 @@ Convert_Message(iconv_t Handle, char *Message)
|
||||
return Encoding_Buffer;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* ICONV */
|
||||
|
||||
/**
|
||||
* Convert encoding of a message received from a connection.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -18,18 +18,16 @@
|
||||
* Connection management: Global functions
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "log.h"
|
||||
#include <time.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
# include "log.h"
|
||||
#endif
|
||||
#include "conn.h"
|
||||
#include "client.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "conn-func.h"
|
||||
|
||||
|
||||
/**
|
||||
* Update "idle timestamp", the time of the last visible user action
|
||||
* (e. g. like sending messages, joining or leaving channels).
|
||||
@@ -73,7 +71,6 @@ Conn_GetIdle( CONN_ID Idx )
|
||||
return time( NULL ) - My_Connections[Idx].lastprivmsg;
|
||||
} /* Conn_GetIdle */
|
||||
|
||||
|
||||
GLOBAL time_t
|
||||
Conn_LastPing( CONN_ID Idx )
|
||||
{
|
||||
@@ -81,7 +78,6 @@ Conn_LastPing( CONN_ID Idx )
|
||||
return My_Connections[Idx].lastping;
|
||||
} /* Conn_LastPing */
|
||||
|
||||
|
||||
/**
|
||||
* Add "penalty time" for a connection.
|
||||
*
|
||||
@@ -116,7 +112,6 @@ Conn_SetPenalty(CONN_ID Idx, time_t Seconds)
|
||||
#endif
|
||||
} /* Conn_SetPenalty */
|
||||
|
||||
|
||||
GLOBAL void
|
||||
Conn_ClearFlags( void )
|
||||
{
|
||||
@@ -125,7 +120,6 @@ Conn_ClearFlags( void )
|
||||
for( i = 0; i < Pool_Size; i++ ) My_Connections[i].flag = 0;
|
||||
} /* Conn_ClearFlags */
|
||||
|
||||
|
||||
GLOBAL int
|
||||
Conn_Flag( CONN_ID Idx )
|
||||
{
|
||||
@@ -133,7 +127,6 @@ Conn_Flag( CONN_ID Idx )
|
||||
return My_Connections[Idx].flag;
|
||||
} /* Conn_Flag */
|
||||
|
||||
|
||||
GLOBAL void
|
||||
Conn_SetFlag( CONN_ID Idx, int Flag )
|
||||
{
|
||||
@@ -141,7 +134,6 @@ Conn_SetFlag( CONN_ID Idx, int Flag )
|
||||
My_Connections[Idx].flag = Flag;
|
||||
} /* Conn_SetFlag */
|
||||
|
||||
|
||||
GLOBAL CONN_ID
|
||||
Conn_First( void )
|
||||
{
|
||||
@@ -154,7 +146,6 @@ Conn_First( void )
|
||||
return NONE;
|
||||
} /* Conn_First */
|
||||
|
||||
|
||||
GLOBAL CONN_ID
|
||||
Conn_Next( CONN_ID Idx )
|
||||
{
|
||||
@@ -169,7 +160,6 @@ Conn_Next( CONN_ID Idx )
|
||||
return NONE;
|
||||
} /* Conn_Next */
|
||||
|
||||
|
||||
GLOBAL UINT16
|
||||
Conn_Options( CONN_ID Idx )
|
||||
{
|
||||
@@ -177,7 +167,6 @@ Conn_Options( CONN_ID Idx )
|
||||
return My_Connections[Idx].options;
|
||||
} /* Conn_Options */
|
||||
|
||||
|
||||
/**
|
||||
* Set connection option.
|
||||
*/
|
||||
@@ -188,7 +177,6 @@ Conn_SetOption(CONN_ID Idx, int Option)
|
||||
Conn_OPTION_ADD(&My_Connections[Idx], Option);
|
||||
} /* Conn_SetOption */
|
||||
|
||||
|
||||
/**
|
||||
* Get the start time of the connection.
|
||||
* The result is the start time in seconds since 1970-01-01, as reported
|
||||
@@ -224,7 +212,6 @@ Conn_SendQ( CONN_ID Idx )
|
||||
return array_bytes(&My_Connections[Idx].wbuf);
|
||||
} /* Conn_SendQ */
|
||||
|
||||
|
||||
/**
|
||||
* return number of messages sent on this connection so far
|
||||
*/
|
||||
@@ -236,7 +223,6 @@ Conn_SendMsg( CONN_ID Idx )
|
||||
return My_Connections[Idx].msg_out;
|
||||
} /* Conn_SendMsg */
|
||||
|
||||
|
||||
/**
|
||||
* return number of (uncompressed) bytes sent
|
||||
* on this connection so far
|
||||
@@ -248,7 +234,6 @@ Conn_SendBytes( CONN_ID Idx )
|
||||
return My_Connections[Idx].bytes_out;
|
||||
} /* Conn_SendBytes */
|
||||
|
||||
|
||||
/**
|
||||
* return number of bytes pending in read buffer
|
||||
*/
|
||||
@@ -264,7 +249,6 @@ Conn_RecvQ( CONN_ID Idx )
|
||||
return array_bytes(&My_Connections[Idx].rbuf);
|
||||
} /* Conn_RecvQ */
|
||||
|
||||
|
||||
/**
|
||||
* return number of messages received on this connection so far
|
||||
*/
|
||||
@@ -275,7 +259,6 @@ Conn_RecvMsg( CONN_ID Idx )
|
||||
return My_Connections[Idx].msg_in;
|
||||
} /* Conn_RecvMsg */
|
||||
|
||||
|
||||
/**
|
||||
* return number of (uncompressed) bytes received on this
|
||||
* connection so far
|
||||
@@ -297,19 +280,16 @@ Conn_IPA(CONN_ID Idx)
|
||||
return ng_ipaddr_tostr(&My_Connections[Idx].addr);
|
||||
}
|
||||
|
||||
|
||||
GLOBAL void
|
||||
Conn_ResetWCounter( void )
|
||||
{
|
||||
WCounter = 0;
|
||||
} /* Conn_ResetWCounter */
|
||||
|
||||
|
||||
GLOBAL long
|
||||
Conn_WCounter( void )
|
||||
{
|
||||
return WCounter;
|
||||
} /* Conn_WCounter */
|
||||
|
||||
|
||||
/* -eof- */
|
||||
|
@@ -1,6 +1,13 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c) 2005-2008 Florian Westphal <fw@strlen.de>
|
||||
* Copyright (c)2005-2008 Florian Westphal (fw@strlen.de).
|
||||
* Copyright (c)2008-2014 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.
|
||||
*/
|
||||
|
||||
#include "portab.h"
|
||||
@@ -10,7 +17,6 @@
|
||||
* SSL wrapper functions
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include "conf-ssl.h"
|
||||
|
||||
#ifdef SSL_SUPPORT
|
||||
@@ -29,7 +35,6 @@
|
||||
#include "conn-ssl.h"
|
||||
#include "log.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "defines.h"
|
||||
|
||||
extern struct SSLOptions Conf_SSLOptions;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2007 Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2014 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,6 +9,8 @@
|
||||
* Please read the file COPYING, README and AUTHORS for more information.
|
||||
*/
|
||||
|
||||
#define CONN_MODULE
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
/**
|
||||
@@ -16,14 +18,11 @@
|
||||
* Connection compression using ZLIB
|
||||
*/
|
||||
|
||||
#define CONN_MODULE
|
||||
/* Additionan debug messages related to ZIP compression: 0=off / 1=on */
|
||||
#define DEBUG_ZIP 0
|
||||
|
||||
#ifdef ZLIB
|
||||
|
||||
/* enable more zlib related debug messages: */
|
||||
/* #define DEBUG_ZLIB */
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h>
|
||||
@@ -31,9 +30,8 @@
|
||||
#include "conn.h"
|
||||
#include "conn-func.h"
|
||||
#include "log.h"
|
||||
|
||||
#include "array.h"
|
||||
#include "exp.h"
|
||||
|
||||
#include "conn-zip.h"
|
||||
|
||||
|
||||
@@ -143,7 +141,7 @@ Zip_Flush( CONN_ID Idx )
|
||||
out->next_out = zipbuf;
|
||||
out->avail_out = (uInt)sizeof zipbuf;
|
||||
|
||||
#ifdef DEBUG_ZIP
|
||||
#if DEBUG_ZIP
|
||||
Log(LOG_DEBUG, "out->avail_in %d, out->avail_out %d",
|
||||
out->avail_in, out->avail_out);
|
||||
#endif
|
||||
@@ -166,7 +164,7 @@ Zip_Flush( CONN_ID Idx )
|
||||
assert(out->avail_out <= WRITEBUFFER_SLINK_LEN);
|
||||
|
||||
zipbuf_used = WRITEBUFFER_SLINK_LEN - out->avail_out;
|
||||
#ifdef DEBUG_ZIP
|
||||
#if DEBUG_ZIP
|
||||
Log(LOG_DEBUG, "zipbuf_used: %d", zipbuf_used);
|
||||
#endif
|
||||
if (!array_catb(&My_Connections[Idx].wbuf,
|
||||
@@ -218,7 +216,7 @@ Unzip_Buffer( CONN_ID Idx )
|
||||
in->next_out = unzipbuf;
|
||||
in->avail_out = (uInt)sizeof unzipbuf;
|
||||
|
||||
#ifdef DEBUG_ZIP
|
||||
#if DEBUG_ZIP
|
||||
Log(LOG_DEBUG, "in->avail_in %d, in->avail_out %d",
|
||||
in->avail_in, in->avail_out);
|
||||
#endif
|
||||
@@ -233,7 +231,7 @@ Unzip_Buffer( CONN_ID Idx )
|
||||
assert(z_rdatalen >= in->avail_in);
|
||||
in_len = z_rdatalen - in->avail_in;
|
||||
unzipbuf_used = READBUFFER_LEN - in->avail_out;
|
||||
#ifdef DEBUG_ZIP
|
||||
#if DEBUG_ZIP
|
||||
Log(LOG_DEBUG, "unzipbuf_used: %d - %d = %d", READBUFFER_LEN,
|
||||
in->avail_out, unzipbuf_used);
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -53,7 +53,7 @@
|
||||
/* Size of structures */
|
||||
|
||||
/** Max. count of configurable servers. */
|
||||
#define MAX_SERVERS 16
|
||||
#define MAX_SERVERS 64
|
||||
|
||||
/** Max. number of WHOWAS list items that can be stored. */
|
||||
#define MAX_WHOWAS 64
|
||||
@@ -109,6 +109,10 @@
|
||||
#else
|
||||
# define CLIENT_USER_LEN 10
|
||||
#endif
|
||||
/** Max. length of user names saved for authentication (used by PAM) */
|
||||
#ifdef PAM
|
||||
# define CLIENT_AUTHUSER_LEN 64
|
||||
#endif
|
||||
|
||||
/** Max. length of "real names" (including NULL). */
|
||||
#define CLIENT_NAME_LEN 32
|
||||
@@ -173,7 +177,7 @@
|
||||
#endif
|
||||
|
||||
/** Supported user modes. */
|
||||
#define USERMODES "abBcCioqrRswx"
|
||||
#define USERMODES "abBcCFioqrRswx"
|
||||
|
||||
/** Supported channel modes. */
|
||||
#define CHANMODES "abehiIklmMnoOPqQrRstvVz"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,14 +16,12 @@
|
||||
* Hash calculation
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "tool.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "hash.h"
|
||||
|
||||
static UINT32 jenkins_hash PARAMS((UINT8 *k, UINT32 length, UINT32 initval));
|
||||
|
@@ -1,11 +1,13 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2005-2006 Florian Westphal (westphal@foo.fh-furtwangen.de)
|
||||
* Copyright (c)2006-2014 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.
|
||||
*
|
||||
* Copyright (c) 2005 Florian Westphal (westphal@foo.fh-furtwangen.de)
|
||||
*/
|
||||
|
||||
#include "portab.h"
|
||||
@@ -15,21 +17,20 @@
|
||||
* I/O abstraction interface.
|
||||
*/
|
||||
|
||||
/* Extra debug messages in event add/delete/callback code: 0=off / 1=on */
|
||||
#define DEBUG_IO 0
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "array.h"
|
||||
#include "io.h"
|
||||
#include "log.h"
|
||||
|
||||
/* Enables extra debug messages in event add/delete/callback code. */
|
||||
/* #define DEBUG_IO */
|
||||
|
||||
typedef struct {
|
||||
#ifdef PROTOTYPES
|
||||
void (*callback)(int, short);
|
||||
@@ -119,6 +120,7 @@ static bool io_event_change_devpoll(int fd, short what);
|
||||
#endif
|
||||
|
||||
#ifdef IO_USE_SELECT
|
||||
#include <sys/time.h>
|
||||
#include "defines.h" /* for conn.h */
|
||||
#include "proc.h" /* for PROC_STAT (needed by conf.h) */
|
||||
#include "conn.h" /* for CONN_ID (needed by conf.h) */
|
||||
@@ -142,7 +144,7 @@ static array io_events;
|
||||
|
||||
static void io_docallback PARAMS((int fd, short what));
|
||||
|
||||
#ifdef DEBUG_IO
|
||||
#if DEBUG_IO
|
||||
static void
|
||||
io_debug(const char *s, int fd, int what)
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,22 +16,19 @@
|
||||
* Handler for IRC capability ("CAP") commands
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "channel.h"
|
||||
#include "client-cap.h"
|
||||
#include "irc-macros.h"
|
||||
#include "irc-write.h"
|
||||
#include "log.h"
|
||||
#include "login.h"
|
||||
#include "messages.h"
|
||||
#include "parse.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-cap.h"
|
||||
|
||||
/* Local functions */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2015 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
|
||||
@@ -16,13 +16,11 @@
|
||||
* IRC channel commands
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "channel.h"
|
||||
#include "conn-func.h"
|
||||
@@ -37,7 +35,6 @@
|
||||
#include "irc-write.h"
|
||||
#include "conf.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-channel.h"
|
||||
|
||||
/**
|
||||
@@ -323,11 +320,9 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
|
||||
channame = strtok_r(channame, ",", &lastchan);
|
||||
|
||||
/* Make sure that "channame" is not the empty string ("JOIN :") */
|
||||
if (!channame) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
if (!channame)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
||||
while (channame) {
|
||||
flags = NULL;
|
||||
@@ -447,15 +442,13 @@ IRC_PART(CLIENT * Client, REQUEST * Req)
|
||||
chan = strtok(Req->argv[0], ",");
|
||||
|
||||
/* Make sure that "chan" is not the empty string ("PART :") */
|
||||
if (!chan) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
if (!chan)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
||||
while (chan) {
|
||||
Channel_Part(target, Client, chan,
|
||||
Req->argc > 1 ? Req->argv[1] : Client_ID(target));
|
||||
Req->argc > 1 ? Req->argv[1] : "");
|
||||
chan = strtok(NULL, ",");
|
||||
}
|
||||
|
||||
@@ -484,8 +477,6 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
|
||||
assert( Client != NULL );
|
||||
assert( Req != NULL );
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
|
||||
chan = Channel_Search(Req->argv[0]);
|
||||
@@ -582,8 +573,6 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 2);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
|
||||
if (Req->argc > 0)
|
||||
@@ -669,11 +658,9 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
|
||||
assert( Req != NULL );
|
||||
|
||||
/* Bad number of parameters? */
|
||||
if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
||||
/* Compatibility kludge */
|
||||
if (Req->argc == 5)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,7 +16,8 @@
|
||||
* IRC encoding commands
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#ifdef ICONV
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -28,11 +29,8 @@
|
||||
#include "parse.h"
|
||||
#include "tool.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-encoding.h"
|
||||
|
||||
#ifdef ICONV
|
||||
|
||||
/**
|
||||
* Handler for the IRC+ "CHARCONV" command.
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,13 +16,12 @@
|
||||
* IRC info commands
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "ngircd.h"
|
||||
#include "conn-func.h"
|
||||
@@ -30,12 +29,9 @@
|
||||
#include "channel.h"
|
||||
#include "class.h"
|
||||
#include "conf.h"
|
||||
#include "defines.h"
|
||||
#include "lists.h"
|
||||
#include "log.h"
|
||||
#include "messages.h"
|
||||
#include "match.h"
|
||||
#include "tool.h"
|
||||
#include "parse.h"
|
||||
#include "irc.h"
|
||||
#include "irc-macros.h"
|
||||
@@ -43,7 +39,6 @@
|
||||
#include "client-cap.h"
|
||||
#include "op.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-info.h"
|
||||
|
||||
/* Local functions */
|
||||
@@ -152,8 +147,6 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
|
||||
assert( Client != NULL );
|
||||
assert( Chan != NULL );
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
is_member = Channel_IsMemberOf(Chan, Client);
|
||||
|
||||
/* Secret channel? */
|
||||
@@ -169,7 +162,7 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
|
||||
if (OnlyOps && !is_ircop)
|
||||
continue;
|
||||
|
||||
is_visible = Client_HasMode(c, 'i');
|
||||
is_visible = !Client_HasMode(c, 'i');
|
||||
if (is_member || is_visible) {
|
||||
memset(flags, 0, sizeof(flags));
|
||||
|
||||
@@ -191,7 +184,7 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
|
||||
}
|
||||
}
|
||||
|
||||
/* If there are a lot of clients, augment penalty a bit */
|
||||
/* If there are a lot of clients, increase the penalty a bit */
|
||||
if (count > MAX_RPL_WHO)
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
@@ -403,6 +396,13 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
|
||||
Client_ID(from), Client_ID(c)))
|
||||
return DISCONNECTED;
|
||||
|
||||
/* Account name metadata? */
|
||||
if (Client_AccountName(c) &&
|
||||
!IRC_WriteStrClient(from, RPL_WHOISLOGGEDIN_MSG,
|
||||
Client_ID(from), Client_ID(c),
|
||||
Client_AccountName(c)))
|
||||
return DISCONNECTED;
|
||||
|
||||
/* Local client and requester is the user itself or an IRC Op? */
|
||||
if (Client_Conn(c) > NONE &&
|
||||
(from == c || (!Conf_MorePrivacy && Client_HasMode(from, 'o')))) {
|
||||
@@ -500,8 +500,6 @@ IRC_ADMIN(CLIENT *Client, REQUEST *Req )
|
||||
assert( Client != NULL );
|
||||
assert( Req != NULL );
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(prefix, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, prefix)
|
||||
|
||||
@@ -544,8 +542,6 @@ IRC_INFO(CLIENT * Client, REQUEST * Req)
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 2);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(prefix, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, prefix)
|
||||
|
||||
@@ -631,8 +627,6 @@ IRC_LINKS(CLIENT *Client, REQUEST *Req)
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
|
||||
/* Get pointer to server mask or "*", if none given */
|
||||
@@ -685,8 +679,6 @@ IRC_LUSERS( CLIENT *Client, REQUEST *Req )
|
||||
assert( Client != NULL );
|
||||
assert( Req != NULL );
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 1, from)
|
||||
|
||||
@@ -716,8 +708,6 @@ IRC_SERVLIST(CLIENT *Client, REQUEST *Req)
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
if (Req->argc < 2 || strcmp(Req->argv[1], "0") == 0) {
|
||||
for (c = Client_First(); c!= NULL; c = Client_Next(c)) {
|
||||
if (Client_Type(c) != CLIENT_SERVICE)
|
||||
@@ -753,8 +743,6 @@ IRC_MOTD( CLIENT *Client, REQUEST *Req )
|
||||
assert( Client != NULL );
|
||||
assert( Req != NULL );
|
||||
|
||||
IRC_SetPenalty(Client, 3);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, from)
|
||||
|
||||
@@ -785,8 +773,6 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
|
||||
assert( Client != NULL );
|
||||
assert( Req != NULL );
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 1, from)
|
||||
|
||||
@@ -871,8 +857,6 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 2);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 1, from)
|
||||
|
||||
@@ -1013,8 +997,6 @@ IRC_TIME( CLIENT *Client, REQUEST *Req )
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, from)
|
||||
|
||||
@@ -1048,8 +1030,6 @@ IRC_USERHOST(CLIENT *Client, REQUEST *Req)
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
if (Req->argc > 5)
|
||||
max = 5;
|
||||
else
|
||||
@@ -1110,8 +1090,6 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
|
||||
assert( Client != NULL );
|
||||
assert( Req != NULL );
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(prefix, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, prefix)
|
||||
|
||||
@@ -1123,10 +1101,19 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
|
||||
}
|
||||
|
||||
/* send version information */
|
||||
return IRC_WriteStrClient(Client, RPL_VERSION_MSG, Client_ID(prefix),
|
||||
PACKAGE_NAME, PACKAGE_VERSION,
|
||||
NGIRCd_DebugLevel, Conf_ServerName,
|
||||
NGIRCd_VersionAddition);
|
||||
if (!IRC_WriteStrClient(Client, RPL_VERSION_MSG, Client_ID(prefix),
|
||||
PACKAGE_NAME, PACKAGE_VERSION,
|
||||
NGIRCd_DebugLevel, Conf_ServerName,
|
||||
NGIRCd_VersionAddition))
|
||||
return DISCONNECTED;
|
||||
|
||||
#ifndef STRICT_RFC
|
||||
/* send RPL_ISUPPORT(005) numerics */
|
||||
if (!IRC_Send_ISUPPORT(prefix))
|
||||
return DISCONNECTED;
|
||||
#endif
|
||||
|
||||
return CONNECTED;
|
||||
} /* IRC_VERSION */
|
||||
|
||||
/**
|
||||
@@ -1145,15 +1132,12 @@ IRC_WHO(CLIENT *Client, REQUEST *Req)
|
||||
assert (Client != NULL);
|
||||
assert (Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
only_ops = false;
|
||||
if (Req->argc == 2) {
|
||||
if (strcmp(Req->argv[1], "o") == 0)
|
||||
only_ops = true;
|
||||
#ifdef STRICT_RFC
|
||||
else {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
return IRC_WriteErrClient(Client,
|
||||
ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client),
|
||||
@@ -1177,7 +1161,6 @@ IRC_WHO(CLIENT *Client, REQUEST *Req)
|
||||
}
|
||||
|
||||
/* No channel or (valid) mask given */
|
||||
IRC_SetPenalty(Client, 2);
|
||||
return IRC_WHO_Mask(Client, NULL, only_ops);
|
||||
} /* IRC_WHO */
|
||||
|
||||
@@ -1200,8 +1183,6 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
|
||||
assert( Client != NULL );
|
||||
assert( Req != NULL );
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
|
||||
/* Wrong number of parameters? */
|
||||
if (Req->argc < 1)
|
||||
return IRC_WriteErrClient(Client, ERR_NONICKNAMEGIVEN_MSG,
|
||||
@@ -1263,6 +1244,7 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
|
||||
continue;
|
||||
}
|
||||
got_wildcard = true;
|
||||
/* Increase penalty for wildcard queries */
|
||||
IRC_SetPenalty(Client, 3);
|
||||
|
||||
for (c = Client_First(); c; c = Client_Next(c)) {
|
||||
@@ -1568,6 +1550,10 @@ IRC_Send_NAMES(CLIENT * Client, CHANNEL * Chan)
|
||||
GLOBAL bool
|
||||
IRC_Send_ISUPPORT(CLIENT * Client)
|
||||
{
|
||||
if (Conf_Network[0] && !IRC_WriteStrClient(Client, RPL_ISUPPORTNET_MSG,
|
||||
Client_ID(Client),
|
||||
Conf_Network))
|
||||
return DISCONNECTED;
|
||||
if (!IRC_WriteStrClient(Client, RPL_ISUPPORT1_MSG, Client_ID(Client),
|
||||
CHANTYPES, CHANTYPES, Conf_MaxJoins))
|
||||
return DISCONNECTED;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,15 +16,14 @@
|
||||
* Login and logout
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "conn-func.h"
|
||||
#include "class.h"
|
||||
#include "conf.h"
|
||||
#include "channel.h"
|
||||
#include "log.h"
|
||||
@@ -32,11 +31,9 @@
|
||||
#include "messages.h"
|
||||
#include "parse.h"
|
||||
#include "irc.h"
|
||||
#include "irc-info.h"
|
||||
#include "irc-macros.h"
|
||||
#include "irc-write.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-login.h"
|
||||
|
||||
static void Change_Nick PARAMS((CLIENT * Origin, CLIENT * Target, char *NewNick,
|
||||
@@ -80,7 +77,6 @@ IRC_PASS( CLIENT *Client, REQUEST *Req )
|
||||
} else if (Client_Type(Client) == CLIENT_UNKNOWN ||
|
||||
Client_Type(Client) == CLIENT_UNKNOWNSERVER) {
|
||||
/* Unregistered connection, but wrong number of arguments: */
|
||||
IRC_SetPenalty(Client, 2);
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
} else {
|
||||
@@ -247,7 +243,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
|
||||
#else
|
||||
Conn_SetAuthPing(Client_Conn(Client), rand());
|
||||
#endif
|
||||
IRC_WriteStrClient(Client, "PING :%ld",
|
||||
Conn_WriteStr(Client_Conn(Client), "PING :%ld",
|
||||
Conn_GetAuthPing(Client_Conn(Client)));
|
||||
LogDebug("Connection %d: sent AUTH PING %ld ...",
|
||||
Client_Conn(Client),
|
||||
@@ -274,11 +270,9 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
|
||||
/* Server or service introduces new client */
|
||||
|
||||
/* Bad number of parameters? */
|
||||
if (Req->argc != 2 && Req->argc != 7) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
if (Req->argc != 2 && Req->argc != 7)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
||||
if (Req->argc >= 7) {
|
||||
/* RFC 2813 compatible syntax */
|
||||
@@ -375,10 +369,9 @@ IRC_SVSNICK(CLIENT *Client, REQUEST *Req)
|
||||
|
||||
/* Search the target */
|
||||
target = Client_Search(Req->argv[0]);
|
||||
if (!target || Client_Type(target) != CLIENT_USER) {
|
||||
if (!target || Client_Type(target) != CLIENT_USER)
|
||||
return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
|
||||
Client_ID(Client), Req->argv[0]);
|
||||
}
|
||||
|
||||
if (Client_Conn(target) <= NONE) {
|
||||
/* We have to forward the message to the server handling
|
||||
@@ -839,14 +832,14 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
|
||||
if (auth_ping) {
|
||||
LogDebug("AUTH PONG: waiting for token \"%ld\", got \"%s\" ...",
|
||||
auth_ping, Req->argv[0]);
|
||||
if (auth_ping == atoi(Req->argv[0])) {
|
||||
if (auth_ping == atol(Req->argv[0])) {
|
||||
Conn_SetAuthPing(conn, 0);
|
||||
if (Client_Type(Client) == CLIENT_WAITAUTHPING)
|
||||
Login_User(Client);
|
||||
} else
|
||||
if (!IRC_WriteStrClient(Client,
|
||||
"To connect, type /QUOTE PONG %ld",
|
||||
auth_ping))
|
||||
"NOTICE %s :To connect, type /QUOTE PONG %ld",
|
||||
Client_ID(Client), auth_ping))
|
||||
return DISCONNECTED;
|
||||
}
|
||||
#endif
|
||||
|
@@ -25,8 +25,7 @@
|
||||
*/
|
||||
#define _IRC_ARGC_EQ_OR_RETURN_(Client, Req, Count) \
|
||||
if (Req->argc != Count) { \
|
||||
IRC_SetPenalty(Client, 2); \
|
||||
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
|
||||
Client_ID(Client), Req->command); \
|
||||
}
|
||||
|
||||
@@ -38,8 +37,7 @@ if (Req->argc != Count) { \
|
||||
*/
|
||||
#define _IRC_ARGC_LE_OR_RETURN_(Client, Req, Max) \
|
||||
if (Req->argc > Max) { \
|
||||
IRC_SetPenalty(Client, 2); \
|
||||
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
|
||||
Client_ID(Client), Req->command); \
|
||||
}
|
||||
|
||||
@@ -51,8 +49,7 @@ if (Req->argc > Max) { \
|
||||
*/
|
||||
#define _IRC_ARGC_GE_OR_RETURN_(Client, Req, Min) \
|
||||
if (Req->argc < Min) { \
|
||||
IRC_SetPenalty(Client, 2); \
|
||||
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
|
||||
Client_ID(Client), Req->command); \
|
||||
}
|
||||
|
||||
@@ -64,8 +61,7 @@ if (Req->argc < Min) { \
|
||||
*/
|
||||
#define _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, Min, Max) \
|
||||
if (Req->argc < Min || Req->argc > Max) { \
|
||||
IRC_SetPenalty(Client, 2); \
|
||||
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
|
||||
Client_ID(Client), Req->command); \
|
||||
}
|
||||
|
||||
@@ -82,7 +78,7 @@ if (Req->argc < Min || Req->argc > Max) { \
|
||||
else \
|
||||
Sender = Client; \
|
||||
if (!Sender) \
|
||||
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, \
|
||||
return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, \
|
||||
Client_ID(Client), Req->prefix);
|
||||
|
||||
/**
|
||||
@@ -101,7 +97,7 @@ if (Req->argc < Min || Req->argc > Max) { \
|
||||
if (!Target) \
|
||||
Target = Client_SearchServer(Req->argv[Argc]); \
|
||||
if (!Target) \
|
||||
return IRC_WriteStrClient(From, ERR_NOSUCHSERVER_MSG, \
|
||||
return IRC_WriteErrClient(From, ERR_NOSUCHSERVER_MSG, \
|
||||
Client_ID(From), Req->argv[Argc]); \
|
||||
if (Client_Type(Target) != CLIENT_SERVER) \
|
||||
Target = Client_Introducer(Target); \
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -18,21 +18,17 @@
|
||||
* IRC metadata commands
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "conn-func.h"
|
||||
#include "channel.h"
|
||||
#include "conn-encoding.h"
|
||||
#include "irc-write.h"
|
||||
#include "log.h"
|
||||
#include "messages.h"
|
||||
#include "parse.h"
|
||||
#include "tool.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-metadata.h"
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,13 +16,11 @@
|
||||
* IRC commands for mode changes (like MODE, AWAY, etc.)
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "channel.h"
|
||||
#include "irc-macros.h"
|
||||
@@ -33,7 +31,6 @@
|
||||
#include "messages.h"
|
||||
#include "conf.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-mode.h"
|
||||
|
||||
static bool Client_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
|
||||
@@ -71,6 +68,13 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(origin, Req, Client)
|
||||
|
||||
/* Test for "fake" MODE commands injected by this local instance,
|
||||
* for example when handling the "DefaultUserModes" settings.
|
||||
* This doesn't harm real commands, because prefixes of regular
|
||||
* clients are checked in Validate_Prefix() and can't be faked. */
|
||||
if (Req->prefix && Client_Search(Req->prefix) == Client_ThisServer())
|
||||
Client = Client_Search(Req->prefix);
|
||||
|
||||
/* Channel or user mode? */
|
||||
cl = NULL; chan = NULL;
|
||||
if (Client_IsValidNick(Req->argv[0]))
|
||||
@@ -225,6 +229,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
|
||||
break;
|
||||
case 'c': /* Receive connect notices */
|
||||
case 'q': /* KICK-protected user */
|
||||
case 'F': /* disable flood protection */
|
||||
/* (only settable by IRC operators!) */
|
||||
if (!set || Client_Type(Client) == CLIENT_SERVER
|
||||
|| Client_HasMode(Origin, 'o'))
|
||||
@@ -357,7 +362,6 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
|
||||
Client_Modes(Target));
|
||||
}
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
return ok;
|
||||
} /* Client_Mode */
|
||||
|
||||
@@ -583,9 +587,13 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
goto chan_exit;
|
||||
if (!set) {
|
||||
if (is_oper || is_machine || is_owner ||
|
||||
is_admin || is_op || is_halfop)
|
||||
is_admin || is_op || is_halfop) {
|
||||
x[0] = *mode_ptr;
|
||||
else
|
||||
if (Channel_HasMode(Channel, 'k'))
|
||||
strlcpy(argadd, "*", sizeof(argadd));
|
||||
if (arg_arg > mode_arg)
|
||||
arg_arg++;
|
||||
} else
|
||||
connected = IRC_WriteErrClient(Origin,
|
||||
ERR_CHANOPRIVSNEEDED_MSG,
|
||||
Client_ID(Origin),
|
||||
@@ -613,7 +621,6 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
#ifdef STRICT_RFC
|
||||
/* Only send error message in "strict" mode,
|
||||
* this is how ircd2.11 and others behave ... */
|
||||
IRC_SetPenalty(Origin, 2);
|
||||
connected = IRC_WriteErrClient(Origin,
|
||||
ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Origin), Req->command);
|
||||
@@ -658,7 +665,6 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
#ifdef STRICT_RFC
|
||||
/* Only send error message in "strict" mode,
|
||||
* this is how ircd2.11 and others behave ... */
|
||||
IRC_SetPenalty(Origin, 2);
|
||||
connected = IRC_WriteErrClient(Origin,
|
||||
ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Origin), Req->command);
|
||||
@@ -760,7 +766,6 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
* mode, because most other servers don't do
|
||||
* it as well and some clients send "wired"
|
||||
* MODE commands like "MODE #chan -ooo nick". */
|
||||
IRC_SetPenalty(Origin, 2);
|
||||
connected = IRC_WriteErrClient(Origin,
|
||||
ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Origin), Req->command);
|
||||
@@ -921,7 +926,6 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
}
|
||||
}
|
||||
|
||||
IRC_SetPenalty(Client, 1);
|
||||
return connected;
|
||||
} /* Channel_Mode */
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,12 +16,9 @@
|
||||
* Channel operator commands
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "channel.h"
|
||||
#include "irc-macros.h"
|
||||
@@ -31,7 +28,6 @@
|
||||
#include "messages.h"
|
||||
#include "parse.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-op.h"
|
||||
|
||||
/* Local functions */
|
||||
@@ -122,7 +118,6 @@ IRC_KICK(CLIENT *Client, REQUEST *Req)
|
||||
nickCount--;
|
||||
}
|
||||
} else {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
@@ -171,7 +166,8 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req)
|
||||
|
||||
/* Is the channel "invite-only"? */
|
||||
if (Channel_HasMode(chan, 'i')) {
|
||||
/* Yes. The user must be channel owner/admin/operator/halfop! */
|
||||
/* Yes. The user issuing the INVITE command must be
|
||||
* channel owner/admin/operator/halfop! */
|
||||
if (!Channel_UserHasMode(chan, from, 'q') &&
|
||||
!Channel_UserHasMode(chan, from, 'a') &&
|
||||
!Channel_UserHasMode(chan, from, 'o') &&
|
||||
@@ -205,21 +201,22 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req)
|
||||
Req->argv[0], Req->argv[1]);
|
||||
|
||||
/*
|
||||
* RFC 2812 says:
|
||||
* 'There is no requirement that the channel [..] must exist or be a valid channel'
|
||||
* The problem with this is that this allows the "channel" to contain spaces,
|
||||
* in which case we must prefix its name with a colon to make it clear that
|
||||
* it is only a single argument.
|
||||
* RFC 2812 states:
|
||||
* 'There is no requirement that the channel [..] must exist or be a
|
||||
* valid channel'. The problem with this is that this allows the
|
||||
* "channel" to contain spaces, in which case we must prefix its name
|
||||
* with a colon to make it clear that it is only a single argument.
|
||||
*/
|
||||
colon_if_necessary = strchr(Req->argv[1], ' ') ? ":":"";
|
||||
/* Inform target client */
|
||||
IRC_WriteStrClientPrefix(target, from, "INVITE %s %s%s", Req->argv[0],
|
||||
colon_if_necessary, Req->argv[1]);
|
||||
colon_if_necessary, Req->argv[1]);
|
||||
|
||||
if (Client_Conn(target) > NONE) {
|
||||
/* The target user is local, so we have to send the status code */
|
||||
if (!IRC_WriteStrClientPrefix(from, target, RPL_INVITING_MSG,
|
||||
Client_ID(from), Req->argv[0], colon_if_necessary, Req->argv[1]))
|
||||
Client_ID(from), Req->argv[0],
|
||||
colon_if_necessary, Req->argv[1]))
|
||||
return DISCONNECTED;
|
||||
|
||||
if (Client_HasMode(target, 'a') &&
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,12 +16,12 @@
|
||||
* IRC operator commands
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "ngircd.h"
|
||||
#include "conn-func.h"
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "class.h"
|
||||
#include "parse.h"
|
||||
#include "irc.h"
|
||||
#include "irc-macros.h"
|
||||
#include "irc-write.h"
|
||||
#include "lists.h"
|
||||
#include "log.h"
|
||||
@@ -38,7 +37,6 @@
|
||||
#include "messages.h"
|
||||
#include "op.h"
|
||||
|
||||
#include <exp.h>
|
||||
#include "irc-oper.h"
|
||||
|
||||
/**
|
||||
@@ -48,9 +46,11 @@
|
||||
static bool
|
||||
Bad_OperPass(CLIENT *Client, char *errtoken, char *errmsg)
|
||||
{
|
||||
Log(LOG_WARNING, "Got invalid OPER from \"%s\": \"%s\" -- %s",
|
||||
Log(LOG_WARNING, "Got invalid OPER from \"%s\": \"%s\" -- %s!",
|
||||
Client_Mask(Client), errtoken, errmsg);
|
||||
return IRC_WriteErrClient(Client, ERR_PASSWDMISMATCH_MSG,
|
||||
/* Increase penalty to slow down possible brute force attacks */
|
||||
IRC_SetPenalty(Client, 10);
|
||||
return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG,
|
||||
Client_ID(Client));
|
||||
} /* Bad_OperPass */
|
||||
|
||||
@@ -208,18 +208,14 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req)
|
||||
|
||||
/* Bad number of parameters? */
|
||||
if (Req->argc != 1 && Req->argc != 2 && Req->argc != 3 &&
|
||||
Req->argc != 5 && Req->argc != 6) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
Req->argc != 5 && Req->argc != 6)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
||||
/* Invalid port number? */
|
||||
if ((Req->argc > 1) && atoi(Req->argv[1]) < 1) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
if ((Req->argc > 1) && atoi(Req->argv[1]) < 1)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
||||
if (Client_Type(Client) != CLIENT_SERVER
|
||||
&& !Client_HasMode(Client, 'o'))
|
||||
@@ -396,11 +392,9 @@ IRC_xLINE(CLIENT *Client, REQUEST *Req)
|
||||
assert(Req != NULL);
|
||||
|
||||
/* Bad number of parameters? */
|
||||
if (Req->argc != 1 && Req->argc != 3) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
if (Req->argc != 1 && Req->argc != 3)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
||||
from = Op_Check(Client, Req);
|
||||
if (!from)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,31 +16,25 @@
|
||||
* IRC commands for server links
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "conn-func.h"
|
||||
#include "conn-zip.h"
|
||||
#include "conf.h"
|
||||
#include "channel.h"
|
||||
#include "lists.h"
|
||||
#include "log.h"
|
||||
#include "messages.h"
|
||||
#include "parse.h"
|
||||
#include "numeric.h"
|
||||
#include "ngircd.h"
|
||||
#include "irc-info.h"
|
||||
#include "irc-macros.h"
|
||||
#include "irc-write.h"
|
||||
#include "op.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-server.h"
|
||||
|
||||
/**
|
||||
@@ -72,12 +66,10 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
|
||||
LogDebug("Connection %d: got SERVER command (new server link) ...",
|
||||
Client_Conn(Client));
|
||||
|
||||
if (Req->argc != 2 && Req->argc != 3) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
if (Req->argc != 2 && Req->argc != 3)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client),
|
||||
Req->command);
|
||||
}
|
||||
|
||||
/* Get configuration index of new remote server ... */
|
||||
for (i = 0; i < MAX_SERVERS; i++)
|
||||
@@ -185,11 +177,9 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
|
||||
{
|
||||
/* New server is being introduced to the network */
|
||||
|
||||
if (Req->argc != 4) {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
if (Req->argc != 4)
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
||||
/* check for existing server with same ID */
|
||||
if (!Client_CheckID(Client, Req->argv[0]))
|
||||
@@ -235,11 +225,9 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
|
||||
Client_MyToken(c), Client_Info(c));
|
||||
|
||||
return CONNECTED;
|
||||
} else {
|
||||
IRC_SetPenalty(Client, 2);
|
||||
} else
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
} /* IRC_SERVER */
|
||||
|
||||
/*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,7 +16,6 @@
|
||||
* Sending IRC commands over the network
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#ifdef PROTOTYPES
|
||||
# include <stdarg.h>
|
||||
@@ -24,13 +23,10 @@
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn-func.h"
|
||||
#include "channel.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-write.h"
|
||||
|
||||
#define SEND_TO_USER 1
|
||||
@@ -70,7 +66,7 @@ va_dcl
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
vsnprintf(buffer, 1000, Format, ap);
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end(ap);
|
||||
|
||||
IRC_SetPenalty(Client, 2);
|
||||
@@ -107,7 +103,7 @@ va_dcl
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
vsnprintf(buffer, 1000, Format, ap);
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return IRC_WriteStrClientPrefix(Client, Client_ThisServer(),
|
||||
@@ -148,7 +144,7 @@ va_dcl
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( buffer, 1000, Format, ap );
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end( ap );
|
||||
|
||||
return Conn_WriteStr(Client_Conn(Client_NextHop(Client)), ":%s %s",
|
||||
@@ -190,7 +186,7 @@ va_dcl
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( buffer, 1000, Format, ap );
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end( ap );
|
||||
|
||||
IRC_WriteStrChannelPrefix(Client, Chan, Client_ThisServer(),
|
||||
@@ -239,7 +235,7 @@ va_dcl
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( buffer, 1000, Format, ap );
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end( ap );
|
||||
|
||||
Conn_ClearFlags( );
|
||||
@@ -296,7 +292,7 @@ va_dcl
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( buffer, 1000, Format, ap );
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end( ap );
|
||||
|
||||
IRC_WriteStrServersPrefix(ExceptOf, Client_ThisServer(), "%s", buffer);
|
||||
@@ -333,7 +329,7 @@ va_dcl
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( buffer, 1000, Format, ap );
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end( ap );
|
||||
|
||||
IRC_WriteStrServersPrefixFlag( ExceptOf, Prefix, '\0', "%s", buffer );
|
||||
@@ -373,7 +369,7 @@ va_dcl
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( buffer, 1000, Format, ap );
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end( ap );
|
||||
|
||||
IRC_WriteStrServersPrefixFlag_CB(ExceptOf, Prefix, Flag,
|
||||
@@ -451,7 +447,7 @@ va_dcl
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( buffer, 1000, Format, ap );
|
||||
vsnprintf(buffer, sizeof(buffer), Format, ap);
|
||||
va_end( ap );
|
||||
|
||||
Conn_ClearFlags( );
|
||||
@@ -513,7 +509,7 @@ va_dcl
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
vsnprintf(msg, 1000, Format, ap);
|
||||
vsnprintf(msg, sizeof(msg), Format, ap);
|
||||
va_end(ap);
|
||||
|
||||
for (to=Client_First(); to != NULL; to=Client_Next(to)) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,17 +16,19 @@
|
||||
* IRC commands
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "ngircd.h"
|
||||
#include "conn-func.h"
|
||||
#include "conf.h"
|
||||
#include "channel.h"
|
||||
#include "conn-encoding.h"
|
||||
#include "defines.h"
|
||||
#ifdef ICONV
|
||||
# include "conn-encoding.h"
|
||||
#endif
|
||||
#include "irc-macros.h"
|
||||
#include "irc-write.h"
|
||||
#include "log.h"
|
||||
@@ -34,9 +36,7 @@
|
||||
#include "messages.h"
|
||||
#include "parse.h"
|
||||
#include "op.h"
|
||||
#include "tool.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc.h"
|
||||
|
||||
static char *Option_String PARAMS((CONN_ID Idx));
|
||||
@@ -224,8 +224,6 @@ IRC_TRACE(CLIENT *Client, REQUEST *Req)
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 3);
|
||||
|
||||
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, from)
|
||||
|
||||
@@ -301,8 +299,6 @@ IRC_HELP(CLIENT *Client, REQUEST *Req)
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
IRC_SetPenalty(Client, 2);
|
||||
|
||||
if ((Req->argc == 0 && array_bytes(&Conf_Helptext) > 0)
|
||||
|| (Req->argc >= 1 && strcasecmp(Req->argv[0], "Commands") != 0)) {
|
||||
/* Help text available and requested */
|
||||
@@ -526,7 +522,6 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
|
||||
if (Req->argc > 2) {
|
||||
if (!SendErrors)
|
||||
return CONNECTED;
|
||||
IRC_SetPenalty(Client, 2);
|
||||
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Client), Req->command);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,22 +16,16 @@
|
||||
* Management of IRC lists: ban, invite, etc.
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "channel.h"
|
||||
#include "log.h"
|
||||
#include "match.h"
|
||||
#include "messages.h"
|
||||
#include "irc-write.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "conn.h"
|
||||
#include "log.h"
|
||||
#include "match.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "lists.h"
|
||||
|
||||
struct list_elem {
|
||||
@@ -291,6 +285,7 @@ Lists_MakeMask(const char *Pattern, char *mask, size_t len)
|
||||
strlcpy(mask, Pattern, len - 5);
|
||||
strlcat(mask, "!*@", len);
|
||||
strlcat(mask, at, len);
|
||||
at--; *at = '@';
|
||||
} else {
|
||||
/* All parts (nick, user and domain name) are given */
|
||||
strlcpy(mask, Pattern, len);
|
||||
@@ -331,7 +326,7 @@ Lists_CheckReason(struct list_head *h, CLIENT *Client, char *reason, size_t len)
|
||||
|
||||
while (e) {
|
||||
next = e->next;
|
||||
if (Match(e->mask, Client_MaskCloaked(Client))) {
|
||||
if (MatchCaseInsensitive(e->mask, Client_MaskCloaked(Client))) {
|
||||
if (len && e->reason)
|
||||
strlcpy(reason, e->reason, len);
|
||||
if (e->valid_until == 1) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2012 Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,34 +16,29 @@
|
||||
* Logging functions
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#ifdef PROTOTYPES
|
||||
# include <stdarg.h>
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef SYSLOG
|
||||
#include <syslog.h>
|
||||
# include <syslog.h>
|
||||
#endif
|
||||
|
||||
#include "ngircd.h"
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "channel.h"
|
||||
#include "irc-write.h"
|
||||
#include "conf.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "log.h"
|
||||
|
||||
|
||||
static bool Is_Daemon;
|
||||
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,36 +16,34 @@
|
||||
* Functions to deal with client logins
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "class.h"
|
||||
#include "client.h"
|
||||
#include "client-cap.h"
|
||||
#include "channel.h"
|
||||
#include "conf.h"
|
||||
#include "io.h"
|
||||
#include "parse.h"
|
||||
#include "log.h"
|
||||
#include "messages.h"
|
||||
#include "ngircd.h"
|
||||
#include "pam.h"
|
||||
#include "irc-info.h"
|
||||
#include "irc-mode.h"
|
||||
#include "irc-write.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "login.h"
|
||||
|
||||
#ifdef PAM
|
||||
|
||||
#include "io.h"
|
||||
#include "pam.h"
|
||||
|
||||
static void cb_Read_Auth_Result PARAMS((int r_fd, UNUSED short events));
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -194,7 +192,7 @@ Login_User_PostAuth(CLIENT *Client)
|
||||
/* Set default user modes */
|
||||
if (Conf_DefaultUserModes[0]) {
|
||||
snprintf(modes, sizeof(modes), "+%s", Conf_DefaultUserModes);
|
||||
Req.prefix = Client_ThisServer();
|
||||
Req.prefix = Client_ID(Client_ThisServer());
|
||||
Req.command = "MODE";
|
||||
Req.argc = 2;
|
||||
Req.argv[0] = Client_ID(Client);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,15 +16,13 @@
|
||||
* Wildcard pattern matching
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "exp.h"
|
||||
#include "match.h"
|
||||
#include "defines.h"
|
||||
#include "tool.h"
|
||||
|
||||
#include "match.h"
|
||||
|
||||
/*
|
||||
* The pattern matching functions [Matche(), Matche_After_Star()] are based
|
||||
@@ -32,11 +30,9 @@
|
||||
* "public domain": <http://c.snippets.org/snip_lister.php?fname=match.c>
|
||||
*/
|
||||
|
||||
|
||||
static int Matche PARAMS(( const char *p, const char *t ));
|
||||
static int Matche_After_Star PARAMS(( const char *p, const char *t ));
|
||||
|
||||
|
||||
#define MATCH_PATTERN 6 /**< bad pattern */
|
||||
#define MATCH_LITERAL 5 /**< match failure on literal match */
|
||||
#define MATCH_RANGE 4 /**< match failure on [..] construct */
|
||||
@@ -44,7 +40,6 @@ static int Matche_After_Star PARAMS(( const char *p, const char *t ));
|
||||
#define MATCH_END 2 /**< premature end of pattern string */
|
||||
#define MATCH_VALID 1 /**< valid match */
|
||||
|
||||
|
||||
/**
|
||||
* Match string with pattern.
|
||||
*
|
||||
@@ -59,7 +54,6 @@ Match( const char *Pattern, const char *String )
|
||||
else return false;
|
||||
} /* Match */
|
||||
|
||||
|
||||
/**
|
||||
* Match string with pattern case-insensitive.
|
||||
*
|
||||
@@ -76,7 +70,6 @@ MatchCaseInsensitive(const char *Pattern, const char *String)
|
||||
return Match(Pattern, ngt_LowerStr(haystack));
|
||||
} /* MatchCaseInsensitive */
|
||||
|
||||
|
||||
/**
|
||||
* Match string with pattern case-insensitive.
|
||||
*
|
||||
@@ -105,15 +98,9 @@ MatchCaseInsensitiveList(const char *Pattern, const char *String,
|
||||
return false;
|
||||
} /* MatchCaseInsensitive */
|
||||
|
||||
|
||||
static int
|
||||
Matche( const char *p, const char *t )
|
||||
{
|
||||
register char range_start, range_end;
|
||||
bool invert;
|
||||
bool member_match;
|
||||
bool loop;
|
||||
|
||||
for( ; *p; p++, t++ )
|
||||
{
|
||||
/* if this is the end of the text then this is the end of the match */
|
||||
@@ -131,118 +118,7 @@ Matche( const char *p, const char *t )
|
||||
case '*': /* multiple any character match */
|
||||
return Matche_After_Star( p, t );
|
||||
|
||||
case '[': /* [..] construct, single member/exclusion character match */
|
||||
/* move to beginning of range */
|
||||
p++;
|
||||
|
||||
/* check if this is a member match or exclusion match */
|
||||
invert = false;
|
||||
if( *p == '!' || *p == '^' )
|
||||
{
|
||||
invert = true;
|
||||
p++;
|
||||
}
|
||||
|
||||
/* if closing bracket here or at range start then we have a malformed pattern */
|
||||
if ( *p == ']' ) return MATCH_PATTERN;
|
||||
|
||||
member_match = false;
|
||||
loop = true;
|
||||
|
||||
while( loop )
|
||||
{
|
||||
/* if end of construct then loop is done */
|
||||
if( *p == ']' )
|
||||
{
|
||||
loop = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* matching a '!', '^', '-', '\' or a ']' */
|
||||
if( *p == '\\' ) range_start = range_end = *++p;
|
||||
else range_start = range_end = *p;
|
||||
|
||||
/* if end of pattern then bad pattern (Missing ']') */
|
||||
if( ! *p ) return MATCH_PATTERN;
|
||||
|
||||
/* check for range bar */
|
||||
if( *++p == '-' )
|
||||
{
|
||||
/* get the range end */
|
||||
range_end = *++p;
|
||||
|
||||
/* if end of pattern or construct then bad pattern */
|
||||
if( range_end == '\0' || range_end == ']' ) return MATCH_PATTERN;
|
||||
|
||||
/* special character range end */
|
||||
if( range_end == '\\' )
|
||||
{
|
||||
range_end = *++p;
|
||||
|
||||
/* if end of text then we have a bad pattern */
|
||||
if ( ! range_end ) return MATCH_PATTERN;
|
||||
}
|
||||
|
||||
/* move just beyond this range */
|
||||
p++;
|
||||
}
|
||||
|
||||
/* if the text character is in range then match found. make sure the range
|
||||
* letters have the proper relationship to one another before comparison */
|
||||
if( range_start < range_end )
|
||||
{
|
||||
if( *t >= range_start && *t <= range_end )
|
||||
{
|
||||
member_match = true;
|
||||
loop = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( *t >= range_end && *t <= range_start )
|
||||
{
|
||||
member_match = true;
|
||||
loop = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* if there was a match in an exclusion set then no match */
|
||||
/* if there was no match in a member set then no match */
|
||||
if(( invert && member_match ) || ! ( invert || member_match )) return MATCH_RANGE;
|
||||
|
||||
/* if this is not an exclusion then skip the rest of the [...]
|
||||
* construct that already matched. */
|
||||
if( member_match )
|
||||
{
|
||||
while( *p != ']' )
|
||||
{
|
||||
/* bad pattern (Missing ']') */
|
||||
if( ! *p ) return MATCH_PATTERN;
|
||||
|
||||
/* skip exact match */
|
||||
if( *p == '\\' )
|
||||
{
|
||||
p++;
|
||||
|
||||
/* if end of text then we have a bad pattern */
|
||||
if( ! *p ) return MATCH_PATTERN;
|
||||
}
|
||||
|
||||
/* move to next pattern char */
|
||||
p++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '\\': /* next character is quoted and must match exactly */
|
||||
/* move pattern pointer to quoted char and fall through */
|
||||
p++;
|
||||
|
||||
/* if end of text then we have a bad pattern */
|
||||
if( ! *p ) return MATCH_PATTERN;
|
||||
|
||||
/* must match this character exactly */
|
||||
default:
|
||||
default: /* must match this character exactly */
|
||||
if( *p != *t ) return MATCH_LITERAL;
|
||||
}
|
||||
}
|
||||
@@ -252,7 +128,6 @@ Matche( const char *p, const char *t )
|
||||
else return MATCH_VALID;
|
||||
} /* Matche */
|
||||
|
||||
|
||||
static int
|
||||
Matche_After_Star( const char *p, const char *t )
|
||||
{
|
||||
@@ -302,5 +177,4 @@ Matche_After_Star( const char *p, const char *t )
|
||||
return match;
|
||||
} /* Matche_After_Star */
|
||||
|
||||
|
||||
/* -eof- */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -21,6 +21,7 @@
|
||||
#define RPL_YOURHOST_MSG "002 %s :Your host is %s, running version ngircd-%s (%s/%s/%s)"
|
||||
#define RPL_CREATED_MSG "003 %s :This server has been started %s"
|
||||
#define RPL_MYINFO_MSG "004 %s %s ngircd-%s %s %s"
|
||||
#define RPL_ISUPPORTNET_MSG "005 %s NETWORK=%s :is my network name"
|
||||
#define RPL_ISUPPORT1_MSG "005 %s RFC2812 IRCD=ngIRCd CHARSET=UTF-8 CASEMAPPING=ascii PREFIX=(qaohv)~&@%%+ CHANTYPES=%s CHANMODES=beI,k,l,imMnOPQRstVz CHANLIMIT=%s:%d :are supported on this server"
|
||||
#define RPL_ISUPPORT2_MSG "005 %s CHANNELLEN=%d NICKLEN=%d TOPICLEN=%d AWAYLEN=%d KICKLEN=%d MODES=%d MAXLIST=beI:%d EXCEPTS=e INVEX=I PENALTY :are supported on this server"
|
||||
|
||||
@@ -70,10 +71,11 @@
|
||||
#define RPL_LISTEND_MSG "323 %s :End of LIST"
|
||||
#define RPL_CHANNELMODEIS_MSG "324 %s %s +%s"
|
||||
#define RPL_CREATIONTIME_MSG "329 %s %s %ld"
|
||||
#define RPL_WHOISLOGGEDIN_MSG "330 %s %s %s :is logged in as"
|
||||
#define RPL_NOTOPIC_MSG "331 %s %s :No topic is set"
|
||||
#define RPL_TOPIC_MSG "332 %s %s :%s"
|
||||
#define RPL_TOPICSETBY_MSG "333 %s %s %s %u"
|
||||
#define RPL_WHOISBOT_MSG "335 %s %s :is a IRC Bot"
|
||||
#define RPL_WHOISBOT_MSG "335 %s %s :is an IRC Bot"
|
||||
#define RPL_INVITING_MSG "341 %s %s %s%s"
|
||||
#define RPL_INVITELIST_MSG "346 %s %s %s"
|
||||
#define RPL_ENDOFINVITELIST_MSG "347 %s %s :End of channel invite list"
|
||||
@@ -139,7 +141,7 @@
|
||||
#define ERR_BADCHANNELKEY_MSG "475 %s %s :Cannot join channel (+k) -- Wrong channel key"
|
||||
#define ERR_NOCHANMODES_MSG "477 %s %s :Channel doesn't support modes"
|
||||
#define ERR_NEEDREGGEDNICK_MSG "477 %s %s :Cannot send to channel (+M) -- You need to be identified to a registered account to message this channel"
|
||||
#define ERR_LISTFULL_MSG "478 %s %s %s: Channel list is full (%d)"
|
||||
#define ERR_LISTFULL_MSG "478 %s %s %s :Channel list is full (%d)"
|
||||
#define ERR_NOPRIVILEGES_MSG "481 %s :Permission denied"
|
||||
#define ERR_CHANOPRIVSNEEDED_MSG "482 %s %s :You are not channel operator"
|
||||
#define ERR_CHANOPPRIVTOOLOW_MSG "482 %s %s :Your privileges are too low"
|
||||
|
@@ -17,12 +17,10 @@
|
||||
* by the loader of the operating system.
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
@@ -36,23 +34,16 @@
|
||||
#include <mcheck.h>
|
||||
#endif
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "class.h"
|
||||
#include "conf-ssl.h"
|
||||
#include "channel.h"
|
||||
#include "conf.h"
|
||||
#include "lists.h"
|
||||
#include "log.h"
|
||||
#include "parse.h"
|
||||
#include "sighandlers.h"
|
||||
#include "io.h"
|
||||
#include "irc.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "ngircd.h"
|
||||
|
||||
|
||||
static void Show_Version PARAMS(( void ));
|
||||
static void Show_Help PARAMS(( void ));
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,29 +16,23 @@
|
||||
* Handlers for IRC numerics sent to the server
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "conn.h"
|
||||
#include "conf.h"
|
||||
#include "conn.h"
|
||||
#include "conn-func.h"
|
||||
#include "conf.h"
|
||||
#include "channel.h"
|
||||
#include "class.h"
|
||||
#include "irc-write.h"
|
||||
#include "lists.h"
|
||||
#include "log.h"
|
||||
#include "messages.h"
|
||||
#include "parse.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "numeric.h"
|
||||
|
||||
|
||||
/**
|
||||
* Announce a channel and its users in the network.
|
||||
*/
|
||||
@@ -117,7 +111,6 @@ Announce_Channel(CLIENT *Client, CHANNEL *Chan)
|
||||
return CONNECTED;
|
||||
} /* Announce_Channel */
|
||||
|
||||
|
||||
/**
|
||||
* Announce new server in the network
|
||||
* @param Client New server
|
||||
@@ -149,11 +142,30 @@ Announce_Server(CLIENT * Client, CLIENT * Server)
|
||||
Client_MyToken(Server), Client_Info(Server));
|
||||
} /* Announce_Server */
|
||||
|
||||
|
||||
#ifdef IRCPLUS
|
||||
|
||||
/**
|
||||
* Synchronize invite, ban, G- and K-Line lists between servers.
|
||||
* Send a specific list to a remote server.
|
||||
*/
|
||||
static bool
|
||||
Send_List(CLIENT *Client, CHANNEL *Chan, struct list_head *Head, char Type)
|
||||
{
|
||||
struct list_elem *elem;
|
||||
|
||||
elem = Lists_GetFirst(Head);
|
||||
while (elem) {
|
||||
if (!IRC_WriteStrClient(Client, "MODE %s +%c %s",
|
||||
Channel_Name(Chan), Type,
|
||||
Lists_GetMask(elem))) {
|
||||
return DISCONNECTED;
|
||||
}
|
||||
elem = Lists_GetNext(elem);
|
||||
}
|
||||
return CONNECTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronize invite, ban, except, and G-Line lists between servers.
|
||||
*
|
||||
* @param Client New server.
|
||||
* @return CONNECTED or DISCONNECTED.
|
||||
@@ -181,36 +193,17 @@ Synchronize_Lists(CLIENT * Client)
|
||||
|
||||
c = Channel_First();
|
||||
while (c) {
|
||||
/* ban list */
|
||||
head = Channel_GetListBans(c);
|
||||
elem = Lists_GetFirst(head);
|
||||
while (elem) {
|
||||
if (!IRC_WriteStrClient(Client, "MODE %s +b %s",
|
||||
Channel_Name(c),
|
||||
Lists_GetMask(elem))) {
|
||||
return DISCONNECTED;
|
||||
}
|
||||
elem = Lists_GetNext(elem);
|
||||
}
|
||||
|
||||
/* invite list */
|
||||
head = Channel_GetListInvites(c);
|
||||
elem = Lists_GetFirst(head);
|
||||
while (elem) {
|
||||
if (!IRC_WriteStrClient(Client, "MODE %s +I %s",
|
||||
Channel_Name(c),
|
||||
Lists_GetMask(elem))) {
|
||||
return DISCONNECTED;
|
||||
}
|
||||
elem = Lists_GetNext(elem);
|
||||
}
|
||||
|
||||
if (!Send_List(Client, c, Channel_GetListExcepts(c), 'e'))
|
||||
return DISCONNECTED;
|
||||
if (!Send_List(Client, c, Channel_GetListBans(c), 'b'))
|
||||
return DISCONNECTED;
|
||||
if (!Send_List(Client, c, Channel_GetListInvites(c), 'I'))
|
||||
return DISCONNECTED;
|
||||
c = Channel_Next(c);
|
||||
}
|
||||
return CONNECTED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send CHANINFO commands to a new server (inform it about existing channels).
|
||||
* @param Client New server
|
||||
@@ -223,7 +216,8 @@ Send_CHANINFO(CLIENT * Client, CHANNEL * Chan)
|
||||
bool has_k, has_l;
|
||||
|
||||
#ifdef DEBUG
|
||||
Log(LOG_DEBUG, "Sending CHANINFO commands ...");
|
||||
Log(LOG_DEBUG, "Sending CHANINFO commands for \"%s\" ...",
|
||||
Channel_Name(Chan));
|
||||
#endif
|
||||
|
||||
modes = Channel_Modes(Chan);
|
||||
@@ -255,7 +249,6 @@ Send_CHANINFO(CLIENT * Client, CHANNEL * Chan)
|
||||
|
||||
#endif /* IRCPLUS */
|
||||
|
||||
|
||||
/**
|
||||
* Handle ENDOFMOTD (376) numeric and login remote server.
|
||||
* The peer is either an IRC server (no IRC+ protocol), or we got the
|
||||
@@ -349,7 +342,6 @@ IRC_Num_ENDOFMOTD(CLIENT * Client, UNUSED REQUEST * Req)
|
||||
return CONNECTED;
|
||||
} /* IRC_Num_ENDOFMOTD */
|
||||
|
||||
|
||||
/**
|
||||
* Handle ISUPPORT (005) numeric.
|
||||
*/
|
||||
@@ -385,5 +377,4 @@ IRC_Num_ISUPPORT(CLIENT * Client, REQUEST * Req)
|
||||
return CONNECTED;
|
||||
} /* IRC_Num_ISUPPORT */
|
||||
|
||||
|
||||
/* -eof- */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,9 +16,7 @@
|
||||
* IRC operator functions
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "conn.h"
|
||||
#include "channel.h"
|
||||
@@ -28,10 +26,8 @@
|
||||
#include "messages.h"
|
||||
#include "irc-write.h"
|
||||
|
||||
#include <exp.h>
|
||||
#include "op.h"
|
||||
|
||||
|
||||
/**
|
||||
* Return and log a "no privileges" message.
|
||||
*/
|
||||
@@ -44,19 +40,18 @@ Op_NoPrivileges(CLIENT * Client, REQUEST * Req)
|
||||
from = Client_Search(Req->prefix);
|
||||
|
||||
if (from) {
|
||||
Log(LOG_NOTICE, "No privileges: client \"%s\" (%s), command \"%s\"",
|
||||
Log(LOG_NOTICE, "No privileges: client \"%s\" (%s), command \"%s\"!",
|
||||
Req->prefix, Client_Mask(Client), Req->command);
|
||||
return IRC_WriteErrClient(from, ERR_NOPRIVILEGES_MSG,
|
||||
Client_ID(from));
|
||||
} else {
|
||||
Log(LOG_NOTICE, "No privileges: client \"%s\", command \"%s\"",
|
||||
Log(LOG_NOTICE, "No privileges: client \"%s\", command \"%s\"!",
|
||||
Client_Mask(Client), Req->command);
|
||||
return IRC_WriteErrClient(Client, ERR_NOPRIVILEGES_MSG,
|
||||
Client_ID(Client));
|
||||
}
|
||||
} /* Op_NoPrivileges */
|
||||
|
||||
|
||||
/**
|
||||
* Check that the originator of a request is an IRC operator and allowed
|
||||
* to administer this server.
|
||||
@@ -94,5 +89,4 @@ Op_Check(CLIENT * Client, REQUEST * Req)
|
||||
return c;
|
||||
} /* Op_Check */
|
||||
|
||||
|
||||
/* -eof- */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de).
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -18,26 +18,21 @@
|
||||
* PAM User Authentication
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_SECURITY_PAM_APPL_H
|
||||
# include <security/pam_appl.h>
|
||||
#endif
|
||||
#ifdef HAVE_PAM_PAM_APPL_H
|
||||
# include <pam/pam_appl.h>
|
||||
#endif
|
||||
|
||||
#include "defines.h"
|
||||
#include "log.h"
|
||||
#include "conn.h"
|
||||
#include "client.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_SECURITY_PAM_APPL_H
|
||||
#include <security/pam_appl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PAM_PAM_APPL_H
|
||||
#include <pam/pam_appl.h>
|
||||
#endif
|
||||
|
||||
#include "exp.h"
|
||||
#include "pam.h"
|
||||
|
||||
static char *password;
|
||||
@@ -87,7 +82,7 @@ static struct pam_conv conv = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Authenticate a connectiong client using PAM.
|
||||
* Authenticate a connecting client using PAM.
|
||||
* @param Client The client to authenticate.
|
||||
* @return true when authentication succeeded, false otherwise.
|
||||
*/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,29 +16,26 @@
|
||||
* IRC command parser and validator.
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "ngircd.h"
|
||||
#include "defines.h"
|
||||
#include "conn-func.h"
|
||||
#include "conf.h"
|
||||
#include "channel.h"
|
||||
#include "log.h"
|
||||
#include "messages.h"
|
||||
#include "tool.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "parse.h"
|
||||
|
||||
#include "imp.h"
|
||||
#include "irc.h"
|
||||
#include "irc-cap.h"
|
||||
#include "irc-channel.h"
|
||||
#include "irc-encoding.h"
|
||||
#ifdef ICONV
|
||||
# include "irc-encoding.h"
|
||||
#endif
|
||||
#include "irc-info.h"
|
||||
#include "irc-login.h"
|
||||
#include "irc-metadata.h"
|
||||
@@ -49,9 +46,6 @@
|
||||
#include "irc-write.h"
|
||||
#include "numeric.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "conf.h"
|
||||
|
||||
struct _NUMERIC {
|
||||
int numeric;
|
||||
bool (*function) PARAMS(( CLIENT *Client, REQUEST *Request ));
|
||||
@@ -60,78 +54,81 @@ struct _NUMERIC {
|
||||
|
||||
static COMMAND My_Commands[] =
|
||||
{
|
||||
{ "ADMIN", IRC_ADMIN, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
|
||||
{ "AWAY", IRC_AWAY, CLIENT_USER, 0, 1, 0, 0, 0 },
|
||||
{ "CAP", IRC_CAP, CLIENT_ANY, 1, 2, 0, 0, 0 },
|
||||
{ "CONNECT", IRC_CONNECT, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
#define _CMD(name, func, type, min, max, penalty) \
|
||||
{ (name), (func), (type), (min), (max), (penalty), 0, 0, 0 }
|
||||
_CMD("ADMIN", IRC_ADMIN, CLIENT_USER|CLIENT_SERVER, 0, 1, 1),
|
||||
_CMD("AWAY", IRC_AWAY, CLIENT_USER, 0, 1, 0),
|
||||
_CMD("CAP", IRC_CAP, CLIENT_ANY, 1, 2, 0),
|
||||
_CMD("CONNECT", IRC_CONNECT, CLIENT_USER|CLIENT_SERVER, 0, -1, 0),
|
||||
#ifdef STRICT_RFC
|
||||
{ "DIE", IRC_DIE, CLIENT_USER, 0, 0, 0, 0, 0 },
|
||||
_CMD("DIE", IRC_DIE, CLIENT_USER, 0, 0, 0),
|
||||
#else
|
||||
{ "DIE", IRC_DIE, CLIENT_USER, 0, 1, 0, 0, 0 },
|
||||
_CMD("DIE", IRC_DIE, CLIENT_USER, 0, 1, 0),
|
||||
#endif
|
||||
{ "DISCONNECT", IRC_DISCONNECT, CLIENT_USER, 1, 1, 0, 0, 0 },
|
||||
{ "ERROR", IRC_ERROR, CLIENT_ANY, 0, -1, 0, 0, 0 },
|
||||
{ "GLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
{ "HELP", IRC_HELP, CLIENT_USER, 0, 1, 0, 0, 0 },
|
||||
{ "INFO", IRC_INFO, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
|
||||
{ "INVITE", IRC_INVITE, CLIENT_USER|CLIENT_SERVER, 2, 2, 0, 0, 0 },
|
||||
{ "ISON", IRC_ISON, CLIENT_USER, 1, -1, 0, 0, 0 },
|
||||
{ "JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 1, 2, 0, 0, 0 },
|
||||
{ "KICK", IRC_KICK, CLIENT_USER|CLIENT_SERVER, 2, 3, 0, 0, 0 },
|
||||
{ "KILL", IRC_KILL, CLIENT_USER|CLIENT_SERVER, 2, 2, 0, 0, 0 },
|
||||
{ "KLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
{ "LINKS", IRC_LINKS, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
|
||||
{ "LIST", IRC_LIST, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
|
||||
{ "LUSERS", IRC_LUSERS, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
|
||||
{ "METADATA", IRC_METADATA, CLIENT_SERVER, 3, 3, 0, 0, 0 },
|
||||
{ "MODE", IRC_MODE, CLIENT_USER|CLIENT_SERVER, 1, -1, 0, 0, 0 },
|
||||
{ "MOTD", IRC_MOTD, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
|
||||
{ "NAMES", IRC_NAMES, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
|
||||
{ "NICK", IRC_NICK, CLIENT_ANY, 0, -1, 0, 0, 0 },
|
||||
{ "NJOIN", IRC_NJOIN, CLIENT_SERVER, 2, 2, 0, 0, 0 },
|
||||
{ "NOTICE", IRC_NOTICE, CLIENT_ANY, 0, -1, 0, 0, 0 },
|
||||
{ "OPER", IRC_OPER, CLIENT_USER, 2, 2, 0, 0, 0 },
|
||||
{ "PART", IRC_PART, CLIENT_USER|CLIENT_SERVER, 1, 2, 0, 0, 0 },
|
||||
{ "PASS", IRC_PASS, CLIENT_ANY, 0, -1, 0, 0, 0 },
|
||||
{ "PING", IRC_PING, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
{ "PONG", IRC_PONG, CLIENT_ANY, 0, -1, 0, 0, 0 },
|
||||
{ "PRIVMSG", IRC_PRIVMSG, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
|
||||
{ "QUIT", IRC_QUIT, CLIENT_ANY, 0, 1, 0, 0, 0 },
|
||||
{ "REHASH", IRC_REHASH, CLIENT_USER, 0, 0, 0, 0, 0 },
|
||||
{ "RESTART", IRC_RESTART, CLIENT_USER, 0, 0, 0, 0, 0 },
|
||||
{ "SERVER", IRC_SERVER, CLIENT_ANY, 0, -1, 0, 0, 0 },
|
||||
{ "SERVICE", IRC_SERVICE, CLIENT_ANY, 6, 6, 0, 0, 0 },
|
||||
{ "SERVLIST", IRC_SERVLIST, CLIENT_USER, 0, 2, 0, 0, 0 },
|
||||
{ "SQUERY", IRC_SQUERY, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
|
||||
{ "SQUIT", IRC_SQUIT, CLIENT_USER|CLIENT_SERVER, 2, 2, 0, 0, 0 },
|
||||
{ "STATS", IRC_STATS, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
|
||||
{ "SVSNICK", IRC_SVSNICK, CLIENT_SERVER, 2, 2, 0, 0, 0 },
|
||||
{ "SUMMON", IRC_SUMMON, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
{ "TIME", IRC_TIME, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
|
||||
{ "TOPIC", IRC_TOPIC, CLIENT_USER|CLIENT_SERVER, 1, 2, 0, 0, 0 },
|
||||
{ "TRACE", IRC_TRACE, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
|
||||
{ "USER", IRC_USER, CLIENT_ANY, 0, -1, 0, 0, 0 },
|
||||
{ "USERHOST", IRC_USERHOST, CLIENT_USER, 1, -1, 0, 0, 0 },
|
||||
{ "USERS", IRC_USERS, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
{ "VERSION", IRC_VERSION, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
|
||||
{ "WALLOPS", IRC_WALLOPS, CLIENT_USER|CLIENT_SERVER, 1, 1, 0, 0, 0 },
|
||||
{ "WEBIRC", IRC_WEBIRC, CLIENT_UNKNOWN, 4, 4, 0, 0, 0 },
|
||||
{ "WHO", IRC_WHO, CLIENT_USER, 0, 2, 0, 0, 0 },
|
||||
{ "WHOIS", IRC_WHOIS, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
{ "WHOWAS", IRC_WHOWAS, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
_CMD("DISCONNECT", IRC_DISCONNECT, CLIENT_USER, 1, 1, 0),
|
||||
_CMD("ERROR", IRC_ERROR, CLIENT_ANY, 0, -1, 0),
|
||||
_CMD("GLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, -1, 0),
|
||||
_CMD("HELP", IRC_HELP, CLIENT_USER, 0, 1, 2),
|
||||
_CMD("INFO", IRC_INFO, CLIENT_USER|CLIENT_SERVER, 0, 1, 2),
|
||||
_CMD("INVITE", IRC_INVITE, CLIENT_USER|CLIENT_SERVER, 2, 2, 0),
|
||||
_CMD("ISON", IRC_ISON, CLIENT_USER, 1, -1, 0),
|
||||
_CMD("JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 1, 2, 0),
|
||||
_CMD("KICK", IRC_KICK, CLIENT_USER|CLIENT_SERVER, 2, 3, 0),
|
||||
_CMD("KILL", IRC_KILL, CLIENT_USER|CLIENT_SERVER, 2, 2, 0),
|
||||
_CMD("KLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, -1, 0),
|
||||
_CMD("LINKS", IRC_LINKS, CLIENT_USER|CLIENT_SERVER, 0, 2, 1),
|
||||
_CMD("LIST", IRC_LIST, CLIENT_USER|CLIENT_SERVER, 0, 2, 2),
|
||||
_CMD("LUSERS", IRC_LUSERS, CLIENT_USER|CLIENT_SERVER, 0, 2, 1),
|
||||
_CMD("METADATA", IRC_METADATA, CLIENT_SERVER, 3, 3, 0),
|
||||
_CMD("MODE", IRC_MODE, CLIENT_USER|CLIENT_SERVER, 1, -1, 1),
|
||||
_CMD("MOTD", IRC_MOTD, CLIENT_USER|CLIENT_SERVER, 0, 1, 3),
|
||||
_CMD("NAMES", IRC_NAMES, CLIENT_USER|CLIENT_SERVER, 0, 2, 1),
|
||||
_CMD("NICK", IRC_NICK, CLIENT_ANY, 0, -1, 0),
|
||||
_CMD("NJOIN", IRC_NJOIN, CLIENT_SERVER, 2, 2, 0),
|
||||
_CMD("NOTICE", IRC_NOTICE, CLIENT_ANY, 0, -1, 0),
|
||||
_CMD("OPER", IRC_OPER, CLIENT_USER, 2, 2, 0),
|
||||
_CMD("PART", IRC_PART, CLIENT_USER|CLIENT_SERVER, 1, 2, 0),
|
||||
_CMD("PASS", IRC_PASS, CLIENT_ANY, 0, -1, 0),
|
||||
_CMD("PING", IRC_PING, CLIENT_USER|CLIENT_SERVER, 0, -1, 0),
|
||||
_CMD("PONG", IRC_PONG, CLIENT_ANY, 0, -1, 0),
|
||||
_CMD("PRIVMSG", IRC_PRIVMSG, CLIENT_USER|CLIENT_SERVER, 0, 2, 0),
|
||||
_CMD("QUIT", IRC_QUIT, CLIENT_ANY, 0, 1, 0),
|
||||
_CMD("REHASH", IRC_REHASH, CLIENT_USER, 0, 0, 0),
|
||||
_CMD("RESTART", IRC_RESTART, CLIENT_USER, 0, 0, 0),
|
||||
_CMD("SERVER", IRC_SERVER, CLIENT_ANY, 0, -1, 0),
|
||||
_CMD("SERVICE", IRC_SERVICE, CLIENT_ANY, 6, 6, 0),
|
||||
_CMD("SERVLIST", IRC_SERVLIST, CLIENT_USER, 0, 2, 1),
|
||||
_CMD("SQUERY", IRC_SQUERY, CLIENT_USER|CLIENT_SERVER, 0, 2, 0),
|
||||
_CMD("SQUIT", IRC_SQUIT, CLIENT_USER|CLIENT_SERVER, 2, 2, 0),
|
||||
_CMD("STATS", IRC_STATS, CLIENT_USER|CLIENT_SERVER, 0, 2, 2),
|
||||
_CMD("SVSNICK", IRC_SVSNICK, CLIENT_SERVER, 2, 2, 0),
|
||||
_CMD("SUMMON", IRC_SUMMON, CLIENT_USER|CLIENT_SERVER, 0, -1, 0),
|
||||
_CMD("TIME", IRC_TIME, CLIENT_USER|CLIENT_SERVER, 0, 1, 1),
|
||||
_CMD("TOPIC", IRC_TOPIC, CLIENT_USER|CLIENT_SERVER, 1, 2, 1),
|
||||
_CMD("TRACE", IRC_TRACE, CLIENT_USER|CLIENT_SERVER, 0, 1, 3),
|
||||
_CMD("USER", IRC_USER, CLIENT_ANY, 0, -1, 0),
|
||||
_CMD("USERHOST", IRC_USERHOST, CLIENT_USER, 1, -1, 1),
|
||||
_CMD("USERS", IRC_USERS, CLIENT_USER|CLIENT_SERVER, 0, -1, 0),
|
||||
_CMD("VERSION", IRC_VERSION, CLIENT_USER|CLIENT_SERVER, 0, 1, 1),
|
||||
_CMD("WALLOPS", IRC_WALLOPS, CLIENT_USER|CLIENT_SERVER, 1, 1, 0),
|
||||
_CMD("WEBIRC", IRC_WEBIRC, CLIENT_UNKNOWN, 4, 4, 0),
|
||||
_CMD("WHO", IRC_WHO, CLIENT_USER, 0, 2, 1),
|
||||
_CMD("WHOIS", IRC_WHOIS, CLIENT_USER|CLIENT_SERVER, 0, -1, 1),
|
||||
_CMD("WHOWAS", IRC_WHOWAS, CLIENT_USER|CLIENT_SERVER, 0, -1, 0),
|
||||
|
||||
#ifdef IRCPLUS
|
||||
{ "CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, -1, 0, 0, 0 },
|
||||
_CMD("CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, -1, 0),
|
||||
# ifdef ICONV
|
||||
{ "CHARCONV", IRC_CHARCONV, CLIENT_USER, 1, 1, 0, 0, 0 },
|
||||
_CMD("CHARCONV", IRC_CHARCONV, CLIENT_USER, 1, 1, 0),
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef STRICT_RFC
|
||||
{ "GET", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1, 0, 0, 0 },
|
||||
{ "POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1, 0, 0, 0 },
|
||||
_CMD("GET", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1, 0),
|
||||
_CMD("POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1, 0),
|
||||
#endif
|
||||
{ NULL, NULL, 0x0, 0, 0, 0, 0, 0 } /* End-Mark */
|
||||
_CMD(NULL, NULL, 0, 0, 0, 0) /* End-Mark */
|
||||
#undef _CMD
|
||||
};
|
||||
|
||||
static void Init_Request PARAMS(( REQUEST *Req ));
|
||||
@@ -530,12 +527,13 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
|
||||
Client_ID(client));
|
||||
}
|
||||
|
||||
if (cmd->penalty)
|
||||
IRC_SetPenalty(client, cmd->penalty);
|
||||
|
||||
if (Req->argc < cmd->min_argc ||
|
||||
(cmd->max_argc != -1 && Req->argc > cmd->max_argc)) {
|
||||
IRC_SetPenalty(client, 2);
|
||||
return IRC_WriteStrClient(client, ERR_NEEDMOREPARAMS_MSG,
|
||||
(cmd->max_argc != -1 && Req->argc > cmd->max_argc))
|
||||
return IRC_WriteErrClient(client, ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(client), Req->command);
|
||||
}
|
||||
|
||||
/* Command is allowed for this client: call it and count
|
||||
* generated bytes in output */
|
||||
|
@@ -37,6 +37,7 @@ typedef struct _COMMAND
|
||||
CLIENT_TYPE type; /**< Valid client types (bit mask) */
|
||||
int min_argc; /**< Min parameters */
|
||||
int max_argc; /**< Max parameters */
|
||||
int penalty; /**< Penalty for this command */
|
||||
long lcount, rcount; /**< Number of local and remote calls */
|
||||
long bytes; /**< Number of bytes created */
|
||||
} COMMAND;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,20 +16,19 @@
|
||||
* Process management
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "io.h"
|
||||
#include "conn.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "sighandlers.h"
|
||||
|
||||
#include "proc.h"
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -18,16 +18,16 @@
|
||||
* Asynchronous resolver
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef IDENTAUTH
|
||||
#ifdef HAVE_IDENT_H
|
||||
@@ -35,17 +35,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "array.h"
|
||||
#include "conn.h"
|
||||
#include "conf.h"
|
||||
#include "defines.h"
|
||||
#include "log.h"
|
||||
#include "ng_ipaddr.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "resolve.h"
|
||||
#include "io.h"
|
||||
|
||||
|
||||
static void Do_ResolveAddr PARAMS(( const ng_ipaddr_t *Addr, int Sock, int w_fd ));
|
||||
static void Do_ResolveName PARAMS(( const char *Host, int w_fd ));
|
||||
@@ -222,8 +217,8 @@ ReverseLookup(const ng_ipaddr_t *IpAddr, char *resbuf, size_t reslen)
|
||||
assert(reslen >= NG_INET_ADDRSTRLEN);
|
||||
ng_ipaddr_tostr_r(IpAddr, tmp_ip_str);
|
||||
|
||||
Log_Subprocess(LOG_WARNING, "%s: Can't resolve address \"%s\": %s",
|
||||
funcname, tmp_ip_str, errmsg);
|
||||
Log_Subprocess(LOG_WARNING, "Can't resolve address \"%s\": %s [%s].",
|
||||
tmp_ip_str, errmsg, funcname);
|
||||
strlcpy(resbuf, tmp_ip_str, reslen);
|
||||
return false;
|
||||
}
|
||||
@@ -339,14 +334,16 @@ static void
|
||||
Log_Forgery_NoIP(const char *ip, const char *host)
|
||||
{
|
||||
Log_Subprocess(LOG_WARNING,
|
||||
"Possible forgery: %s resolved to %s (which has no ip address)", ip, host);
|
||||
"Possible forgery: %s resolved to \"%s\", which has no IP address!",
|
||||
ip, host);
|
||||
}
|
||||
|
||||
static void
|
||||
Log_Forgery_WrongIP(const char *ip, const char *host)
|
||||
{
|
||||
Log_Subprocess(LOG_WARNING,
|
||||
"Possible forgery: %s resolved to %s (which points to different address)", ip, host);
|
||||
"Possible forgery: %s resolved to \"%s\", which points to a different address!",
|
||||
ip, host);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -24,15 +24,15 @@
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "imp.h"
|
||||
#include "conn.h"
|
||||
#include "conf-ssl.h"
|
||||
#include "channel.h"
|
||||
#include "conf.h"
|
||||
#include "io.h"
|
||||
#include "log.h"
|
||||
#include "ngircd.h"
|
||||
|
||||
#include "sighandlers.h"
|
||||
|
||||
static int signalpipe[2];
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# ngIRCd -- The Next Generation IRC Daemon
|
||||
# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors
|
||||
# Copyright (c)2001-2014 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
|
||||
@@ -25,7 +25,7 @@ portabtest_LDFLAGS = -L.
|
||||
|
||||
portabtest_LDADD = -lngportab
|
||||
|
||||
noinst_HEADERS = imp.h exp.h portab.h splint.h
|
||||
noinst_HEADERS = portab.h splint.h
|
||||
|
||||
maintainer-clean-local:
|
||||
rm -f Makefile Makefile.in Makefile.am
|
||||
|
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001,2002 by 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
|
||||
* herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
|
||||
* der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
|
||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* "Export Header" which makes sure, that global functions are not "extern".
|
||||
*/
|
||||
|
||||
#undef GLOBAL
|
||||
#define GLOBAL
|
||||
|
||||
/* -eof- */
|
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001,2002 by 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
|
||||
* herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
|
||||
* der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
|
||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* "Import Header" which makes sure that global functions are defined "extern".
|
||||
*/
|
||||
|
||||
#undef GLOBAL
|
||||
#define GLOBAL extern
|
||||
|
||||
/* -eof- */
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -23,28 +23,6 @@
|
||||
# define NDEBUG
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
# define NGIRC_GOT_INTTYPES
|
||||
#else
|
||||
# ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
# define NGIRC_GOT_INTTYPES
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
/* compiler features */
|
||||
|
||||
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7))
|
||||
@@ -63,9 +41,24 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* datatypes */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
# define NGIRC_GOT_INTTYPES
|
||||
#else
|
||||
# ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
# define NGIRC_GOT_INTTYPES
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef PROTOTYPES
|
||||
# ifndef signed
|
||||
# define signed
|
||||
@@ -84,55 +77,55 @@ typedef unsigned short UINT16;
|
||||
typedef unsigned int UINT32;
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STDBOOL_H
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#else
|
||||
typedef unsigned char bool;
|
||||
#define true (bool)1
|
||||
#define false (bool)0
|
||||
# define true (bool)1
|
||||
# define false (bool)0
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef PROTOTYPES
|
||||
# define NULL (void *)0
|
||||
#else
|
||||
# define NULL 0L
|
||||
#endif
|
||||
# ifdef PROTOTYPES
|
||||
# define NULL (void *)0
|
||||
# else
|
||||
# define NULL 0L
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef NeXT
|
||||
#define S_IRUSR 0000400 /* read permission, owner */
|
||||
#define S_IWUSR 0000200 /* write permission, owner */
|
||||
#define S_IRGRP 0000040 /* read permission, group */
|
||||
#define S_IROTH 0000004 /* read permission, other */
|
||||
#define ssize_t int
|
||||
# define S_IRUSR 0000400 /* read permission, owner */
|
||||
# define S_IWUSR 0000200 /* write permission, owner */
|
||||
# define S_IRGRP 0000040 /* read permission, group */
|
||||
# define S_IROTH 0000004 /* read permission, other */
|
||||
# define ssize_t int
|
||||
#endif
|
||||
|
||||
#undef GLOBAL
|
||||
#define GLOBAL
|
||||
|
||||
|
||||
/* SPLint */
|
||||
|
||||
#ifdef S_SPLINT_S
|
||||
#include "splint.h"
|
||||
# include "splint.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* target constants */
|
||||
|
||||
#ifndef HOST_OS
|
||||
#define HOST_OS "unknown"
|
||||
# define HOST_OS "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef HOST_CPU
|
||||
#define HOST_CPU "unknown"
|
||||
# define HOST_CPU "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef HOST_VENDOR
|
||||
#define HOST_VENDOR "unknown"
|
||||
# define HOST_VENDOR "unknown"
|
||||
#endif
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#define SINGLE_USER_OS
|
||||
# define SINGLE_USER_OS
|
||||
#endif
|
||||
|
||||
/* configure options */
|
||||
@@ -171,19 +164,17 @@ extern int vsnprintf PARAMS(( char *str, size_t count, const char *fmt, va_list
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GAI_STRERROR
|
||||
#define gai_strerror(r) "unknown error"
|
||||
# define gai_strerror(r) "unknown error"
|
||||
#endif
|
||||
|
||||
#ifndef PACKAGE_NAME
|
||||
#define PACKAGE_NAME PACKAGE
|
||||
# define PACKAGE_NAME PACKAGE
|
||||
#endif
|
||||
|
||||
#ifndef PACKAGE_VERSION
|
||||
#define PACKAGE_VERSION VERSION
|
||||
# define PACKAGE_VERSION VERSION
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* -eof- */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,50 +16,188 @@
|
||||
* Test program for portab.h and friends ;-)
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "exp.h"
|
||||
|
||||
int allow_severity = 0, deny_severity = 0;
|
||||
|
||||
|
||||
static void Panic PARAMS (( char *Reason, int Code ));
|
||||
|
||||
|
||||
GLOBAL int
|
||||
main( void )
|
||||
{
|
||||
/* validate datatypes */
|
||||
if( false != 0 ) Panic( "false", 1 );
|
||||
if( true != 1 ) Panic( "true", 1 );
|
||||
if( sizeof( UINT8 ) != 1 ) Panic( "UINT8", 1 );
|
||||
if( sizeof( UINT16 ) != 2 ) Panic( "UINT16", 1 );
|
||||
if( sizeof( UINT32 ) != 4 ) Panic( "UINT32", 1 );
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
/* check functions */
|
||||
if( ! snprintf ) Panic( "snprintf", 2 );
|
||||
if( ! vsnprintf ) Panic( "vsnprintf", 2 );
|
||||
if( ! strlcpy ) Panic( "strlcpy", 2 );
|
||||
if( ! strlcat ) Panic( "strlcat", 2 );
|
||||
#endif
|
||||
|
||||
/* ok, no error */
|
||||
return 0;
|
||||
} /* portab_check_types */
|
||||
|
||||
|
||||
static void
|
||||
Panic( char *Reason, int Code )
|
||||
Panic(char *Reason)
|
||||
{
|
||||
/* Oops, something failed!? */
|
||||
fprintf( stderr, "Oops, test for %s failed!?", Reason );
|
||||
exit( Code );
|
||||
fprintf(stderr, "Oops, test for %s failed!?\n", Reason);
|
||||
exit(1);
|
||||
} /* Panic */
|
||||
|
||||
static void
|
||||
Check_snprintf(void)
|
||||
{
|
||||
char str[5];
|
||||
|
||||
snprintf(str, sizeof(str), "%s", "1234567890");
|
||||
if (str[4] != '\0')
|
||||
Panic("snprintf NULL byte");
|
||||
if (strlen(str) != 4)
|
||||
Panic("snprintf string length");
|
||||
}
|
||||
|
||||
static void
|
||||
Check_strdup(void)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
ptr = strdup("1234567890");
|
||||
if (!ptr)
|
||||
Panic("strdup");
|
||||
if (ptr[10] != '\0')
|
||||
Panic("strdup NULL byte");
|
||||
if (strlen(ptr) != 10)
|
||||
Panic("strdup string length");
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
static void
|
||||
Check_strndup(void)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
ptr = strndup("1234567890", 5);
|
||||
if (!ptr)
|
||||
Panic("strndup");
|
||||
if (ptr[5] != '\0')
|
||||
Panic("strndup NULL byte");
|
||||
if (strlen(ptr) != 5)
|
||||
Panic("strndup string length");
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
static void
|
||||
Check_strlcpy(void)
|
||||
{
|
||||
char str[5];
|
||||
|
||||
if (strlcpy(str, "1234567890", sizeof(str)) != 10)
|
||||
Panic("strlcpy return code");
|
||||
if (str[4] != '\0')
|
||||
Panic("strlcpy NULL byte");
|
||||
if (strlen(str) != 4)
|
||||
Panic("strlcpy string length");
|
||||
}
|
||||
|
||||
static void
|
||||
Check_strlcat(void)
|
||||
{
|
||||
char str[5];
|
||||
|
||||
if (strlcpy(str, "12", sizeof(str)) != 2)
|
||||
Panic("strlcpy for strlcat");
|
||||
if (strlcat(str, "1234567890", sizeof(str)) != 12)
|
||||
Panic("strlcat return code");
|
||||
if (str[4] != '\0')
|
||||
Panic("strlcat NULL byte");
|
||||
if (strlen(str) != 4)
|
||||
Panic("strlcat string length");
|
||||
}
|
||||
|
||||
static void
|
||||
Check_strtok_r(void)
|
||||
{
|
||||
char *ptr, *last;
|
||||
|
||||
ptr = strdup("12,abc");
|
||||
|
||||
ptr = strtok_r(ptr, ",", &last);
|
||||
if (!ptr)
|
||||
Panic("strtok_r result #1");
|
||||
if (strcmp(ptr, "12") != 0)
|
||||
Panic("strtok_r token #1");
|
||||
|
||||
ptr = strtok_r(NULL, ",", &last);
|
||||
if (!ptr)
|
||||
Panic("strtok_r result #2");
|
||||
if (strcmp(ptr, "abc") != 0)
|
||||
Panic("strtok_r token #2");
|
||||
|
||||
ptr = strtok_r(NULL, ",", &last);
|
||||
if (ptr)
|
||||
Panic("strtok_r result #3");
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
static void
|
||||
Check_vsnprintf(const int Len, const char *Format, ...)
|
||||
#else
|
||||
static void
|
||||
Check_vsnprintf(Len, Format, va_alist)
|
||||
const int Len;
|
||||
const char *Format;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
char str[5];
|
||||
va_list ap;
|
||||
int r;
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
va_start(ap, Format);
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
r = vsnprintf(str, sizeof(str), Format, ap);
|
||||
va_end(ap);
|
||||
if (r != Len) {
|
||||
/* C99 states that vsnprintf() "returns the number of
|
||||
* characters that would have been printed if the n were
|
||||
* unlimited", but according to the Linux manual page "glibc
|
||||
* until 2.0.6 would return -1 when the output was truncated",
|
||||
* and other implementations (libUTIL on A/UX) even return the
|
||||
* number of characters processed ... so we only test our own
|
||||
* implementation and warn on errors otherwise :-/ */
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
fprintf(stderr,
|
||||
"\n ** WARNING: The vsnprintf() function of this system isn't standard\n");
|
||||
fprintf(stderr,
|
||||
" ** conformant and returns a WRONG result: %d (should be %d)! The test\n",
|
||||
r, Len);
|
||||
fprintf(stderr,
|
||||
" ** result has been ignored but may lead to errors during execution!\n\n");
|
||||
#else
|
||||
Panic("vsnprintf return code");
|
||||
#endif
|
||||
}
|
||||
if (str[4] != '\0')
|
||||
Panic("vsnprintf NULL byte");
|
||||
if (strlen(str) != 4)
|
||||
Panic("vsnprintf string length");
|
||||
}
|
||||
|
||||
GLOBAL int
|
||||
main(void)
|
||||
{
|
||||
/* validate datatypes */
|
||||
if (false != 0)
|
||||
Panic("false");
|
||||
if (true != 1)
|
||||
Panic("true");
|
||||
if (sizeof(UINT8) != 1)
|
||||
Panic("UINT8");
|
||||
if (sizeof(UINT16) != 2)
|
||||
Panic("UINT16");
|
||||
if (sizeof(UINT32) != 4)
|
||||
Panic("UINT32");
|
||||
|
||||
/* check functions */
|
||||
Check_snprintf();
|
||||
Check_strdup();
|
||||
Check_strndup();
|
||||
Check_strlcpy();
|
||||
Check_strlcat();
|
||||
Check_strtok_r();
|
||||
Check_vsnprintf(2+10, "%s%s", "ab", "1234567890");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -eof- */
|
||||
|
@@ -11,26 +11,24 @@
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
|
||||
#include "imp.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "exp.h"
|
||||
|
||||
GLOBAL char *
|
||||
strdup( const char *s )
|
||||
strdup(const char *s)
|
||||
{
|
||||
char *dup;
|
||||
size_t len = strlen( s );
|
||||
size_t alloc = len + 1;
|
||||
char *dup;
|
||||
size_t len = strlen(s);
|
||||
size_t alloc = len + 1;
|
||||
|
||||
if (len >= alloc ) return NULL;
|
||||
dup = malloc( alloc );
|
||||
if (dup) strlcpy(dup, s, alloc );
|
||||
if (len >= alloc)
|
||||
return NULL;
|
||||
dup = malloc(alloc);
|
||||
if (dup)
|
||||
strlcpy(dup, s, alloc );
|
||||
|
||||
return dup;
|
||||
return dup;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2005 Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -22,13 +22,9 @@
|
||||
* <http://cvs.samba.org/cgi-bin/cvsweb/rsync/lib/compat.c>
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "exp.h"
|
||||
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
|
||||
GLOBAL size_t
|
||||
@@ -52,7 +48,6 @@ strlcat( char *dst, const char *src, size_t size )
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
|
||||
GLOBAL size_t
|
||||
@@ -74,5 +69,4 @@ strlcpy( char *dst, const char *src, size_t size )
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* -eof- */
|
||||
|
@@ -11,13 +11,10 @@
|
||||
|
||||
#ifndef HAVE_STRNDUP
|
||||
|
||||
#include "imp.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "exp.h"
|
||||
|
||||
GLOBAL char *
|
||||
strndup(const char *s, size_t maxlen)
|
||||
{
|
||||
@@ -30,8 +27,8 @@ strndup(const char *s, size_t maxlen)
|
||||
dup = malloc(len);
|
||||
if (dup)
|
||||
strlcpy(dup, s, len);
|
||||
|
||||
return dup;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -72,7 +72,6 @@
|
||||
* removed [v]asprintf() and C99 tests: not needed by ngIRCd.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
@@ -88,7 +87,6 @@
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF)
|
||||
/* only include stdio.h if we are not re-defining snprintf or vsnprintf */
|
||||
#include <stdio.h>
|
||||
@@ -647,14 +645,6 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue,
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if (max == 0) ufvalue += 0.5; /* if max = 0 we must round */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Sorry, we only support 16 digits past the decimal because of our
|
||||
* conversion method
|
||||
@@ -806,138 +796,4 @@ va_dcl
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef TEST_SNPRINTF
|
||||
int sprintf(char *str,const char *fmt,...);
|
||||
int main (void)
|
||||
{
|
||||
char buf1[1024];
|
||||
char buf2[1024];
|
||||
char *fp_fmt[] = {
|
||||
"%1.1f",
|
||||
"%-1.5f",
|
||||
"%1.5f",
|
||||
"%123.9f",
|
||||
"%10.5f",
|
||||
"% 10.5f",
|
||||
"%+22.9f",
|
||||
"%+4.9f",
|
||||
"%01.3f",
|
||||
"%4f",
|
||||
"%3.1f",
|
||||
"%3.2f",
|
||||
"%.0f",
|
||||
"%f",
|
||||
"-16.16f",
|
||||
NULL
|
||||
};
|
||||
double fp_nums[] = { 6442452944.1234, -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
|
||||
0.9996, 1.996, 4.136, 0};
|
||||
char *int_fmt[] = {
|
||||
"%-1.5d",
|
||||
"%1.5d",
|
||||
"%123.9d",
|
||||
"%5.5d",
|
||||
"%10.5d",
|
||||
"% 10.5d",
|
||||
"%+22.33d",
|
||||
"%01.3d",
|
||||
"%4d",
|
||||
"%d",
|
||||
NULL
|
||||
};
|
||||
long int_nums[] = { -1, 134, 91340, 341, 0203, 0};
|
||||
char *str_fmt[] = {
|
||||
"10.5s",
|
||||
"5.10s",
|
||||
"10.1s",
|
||||
"0.10s",
|
||||
"10.0s",
|
||||
"1.10s",
|
||||
"%s",
|
||||
"%.1s",
|
||||
"%.10s",
|
||||
"%10s",
|
||||
NULL
|
||||
};
|
||||
char *str_vals[] = {"hello", "a", "", "a longer string", NULL};
|
||||
int x, y;
|
||||
int fail = 0;
|
||||
int num = 0;
|
||||
|
||||
printf ("Testing snprintf format codes against system sprintf...\n");
|
||||
|
||||
for (x = 0; fp_fmt[x] ; x++) {
|
||||
for (y = 0; fp_nums[y] != 0 ; y++) {
|
||||
int l1 = snprintf(NULL, 0, fp_fmt[x], fp_nums[y]);
|
||||
int l2 = snprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]);
|
||||
sprintf (buf2, fp_fmt[x], fp_nums[y]);
|
||||
if (strcmp (buf1, buf2)) {
|
||||
printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n",
|
||||
fp_fmt[x], buf1, buf2);
|
||||
fail++;
|
||||
}
|
||||
if (l1 != l2) {
|
||||
printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, fp_fmt[x]);
|
||||
fail++;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
for (x = 0; int_fmt[x] ; x++) {
|
||||
for (y = 0; int_nums[y] != 0 ; y++) {
|
||||
int l1 = snprintf(NULL, 0, int_fmt[x], int_nums[y]);
|
||||
int l2 = snprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]);
|
||||
sprintf (buf2, int_fmt[x], int_nums[y]);
|
||||
if (strcmp (buf1, buf2)) {
|
||||
printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n",
|
||||
int_fmt[x], buf1, buf2);
|
||||
fail++;
|
||||
}
|
||||
if (l1 != l2) {
|
||||
printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, int_fmt[x]);
|
||||
fail++;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
for (x = 0; str_fmt[x] ; x++) {
|
||||
for (y = 0; str_vals[y] != 0 ; y++) {
|
||||
int l1 = snprintf(NULL, 0, str_fmt[x], str_vals[y]);
|
||||
int l2 = snprintf(buf1, sizeof(buf1), str_fmt[x], str_vals[y]);
|
||||
sprintf (buf2, str_fmt[x], str_vals[y]);
|
||||
if (strcmp (buf1, buf2)) {
|
||||
printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n",
|
||||
str_fmt[x], buf1, buf2);
|
||||
fail++;
|
||||
}
|
||||
if (l1 != l2) {
|
||||
printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, str_fmt[x]);
|
||||
fail++;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
printf ("%d tests failed out of %d.\n", fail, num);
|
||||
|
||||
printf("seeing how many digits we support\n");
|
||||
{
|
||||
double v0 = 0.12345678901234567890123456789012345678901;
|
||||
for (x=0; x<100; x++) {
|
||||
snprintf(buf1, sizeof(buf1), "%1.1f", v0*pow(10, x));
|
||||
sprintf(buf2, "%1.1f", v0*pow(10, x));
|
||||
if (strcmp(buf1, buf2)) {
|
||||
printf("we seem to support %d digits\n", x-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* SNPRINTF_TEST */
|
||||
|
||||
|
||||
/* -eof- */
|
||||
|
@@ -12,13 +12,10 @@
|
||||
|
||||
#ifndef HAVE_WAITPID
|
||||
|
||||
#include "imp.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "exp.h"
|
||||
|
||||
GLOBAL int
|
||||
waitpid(pid, stat_loc, options)
|
||||
int pid, *stat_loc, options;
|
||||
|
1
src/testsuite/.gitignore
vendored
1
src/testsuite/.gitignore
vendored
@@ -21,3 +21,4 @@ ngircd-test1.motd
|
||||
ngircd-test2.motd
|
||||
logs
|
||||
tests
|
||||
tests-skipped.lst
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# ngIRCd -- The Next Generation IRC Daemon
|
||||
# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors
|
||||
# Copyright (c)2001-2014 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
|
||||
@@ -27,7 +27,7 @@ EXTRA_DIST = \
|
||||
all:
|
||||
|
||||
clean-local:
|
||||
rm -rf logs tests *-test ngircd-test*.log procs.tmp \
|
||||
rm -rf logs tests *-test ngircd-test*.log procs.tmp tests-skipped.lst \
|
||||
T-ngircd1 ngircd-test1.motd T-ngircd2 ngircd-test2.motd
|
||||
|
||||
maintainer-clean-local:
|
||||
@@ -39,6 +39,7 @@ ngircd-TEST-Binary:
|
||||
cp ../ngircd/ngircd T-ngircd1
|
||||
cp ../ngircd/ngircd T-ngircd2
|
||||
[ -f getpid.sh ] || ln -s $(srcdir)/getpid.sh .
|
||||
rm -f tests-skipped.lst
|
||||
|
||||
connect-test: tests.sh
|
||||
rm -f connect-test
|
||||
|
@@ -50,7 +50,7 @@ start-server.sh [<id>]
|
||||
and that no other instance of the test binary is already running.
|
||||
The exit code is 0 if the test binary could be started.
|
||||
|
||||
stop-server.sha [<id>]
|
||||
stop-server.sh [<id>]
|
||||
|
||||
This script uses getpid.sh to detect a running test binary
|
||||
"T-ngircd<id>" and then shuts it down using the TERM signal.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# $Id: channel-test.e,v 1.4 2008/02/05 13:31:51 fw Exp $
|
||||
# ngIRCd test suite
|
||||
# Channel test
|
||||
|
||||
spawn telnet localhost 6789
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -63,10 +64,10 @@ expect {
|
||||
"323 nick :End of LIST"
|
||||
}
|
||||
|
||||
send "part #channel\r"
|
||||
send "part #channel :bye bye\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"@* PART #channel :nick"
|
||||
"@* PART #channel :bye bye"
|
||||
}
|
||||
|
||||
send "join #channel\r"
|
||||
@@ -92,11 +93,11 @@ expect {
|
||||
send "join 0\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"@* PART #channel2 :nick"
|
||||
"@* PART #channel2 :"
|
||||
}
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"@* PART #channel :nick"
|
||||
"@* PART #channel :"
|
||||
}
|
||||
|
||||
send "quit\r"
|
||||
@@ -104,5 +105,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# $Id: check-idle.e,v 1.2 2004/09/04 14:22:13 alex Exp $
|
||||
# ngIRCd test suite
|
||||
# Idle test
|
||||
|
||||
spawn telnet localhost 6789
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -28,5 +29,3 @@ expect {
|
||||
}
|
||||
|
||||
exit $r
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# $Id: connect-test.e,v 1.1 2002/09/09 10:16:24 alex Exp $
|
||||
# ngIRCd test suite
|
||||
# Server connect test
|
||||
|
||||
spawn telnet localhost 6789
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -17,5 +18,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,4 +1,7 @@
|
||||
spawn telnet localhost 6789
|
||||
# ngIRCd test suite
|
||||
# INVITE test
|
||||
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -79,7 +82,7 @@ expect {
|
||||
send "part #channel\r"
|
||||
expect {
|
||||
timeout { exit 1}
|
||||
-re "PART #channel :?nick"
|
||||
"@* PART #channel :"
|
||||
}
|
||||
|
||||
send "invite nick :parameter with spaces\r"
|
||||
@@ -109,5 +112,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,4 +1,7 @@
|
||||
spawn telnet localhost 6789
|
||||
# ngIRCd test suite
|
||||
# JOIN test
|
||||
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -64,5 +67,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,4 +1,7 @@
|
||||
spawn telnet localhost 6789
|
||||
# ngIRCd test suite
|
||||
# KICK test
|
||||
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -108,5 +111,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,4 +1,7 @@
|
||||
spawn telnet localhost 6789
|
||||
# ngIRCd test suite
|
||||
# PRIVMSG and NOTICE test
|
||||
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -69,24 +72,17 @@ expect {
|
||||
"MODE nick :-b"
|
||||
}
|
||||
|
||||
# The following two tests using "localhost" as host name
|
||||
# had to be disabled, because there are operating systems
|
||||
# out there, that use "localhost.<domain>" as host name
|
||||
# for 127.0.0.1 instead of just "localhost".
|
||||
# (for example OpenBSD 4, OpenSolaris, ...)
|
||||
#
|
||||
#send "privmsg ~user\%localhost :test\r"
|
||||
#expect {
|
||||
# timeout { exit 1 }
|
||||
# "@* PRIVMSG nick :test"
|
||||
#}
|
||||
#
|
||||
#send "privmsg Nick!~User@LocalHost :test\r"
|
||||
#expect {
|
||||
# timeout { exit 1 }
|
||||
# "@* PRIVMSG nick :test"
|
||||
# "401"
|
||||
#}
|
||||
send "privmsg ~user\%127.0.0.1 :test\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"@* PRIVMSG nick :test"
|
||||
}
|
||||
|
||||
send "privmsg Nick!~User@127.0.0.1 :test\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"@* PRIVMSG nick :test"
|
||||
}
|
||||
|
||||
send "away :away\r"
|
||||
expect {
|
||||
@@ -138,12 +134,8 @@ expect {
|
||||
"401"
|
||||
}
|
||||
|
||||
#cannot test host mask since localhost has no '.' as RFC requires
|
||||
|
||||
send "quit\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# $Id: misc-test.e,v 1.2 2008/02/17 13:51:00 alex Exp $
|
||||
# ngIRCd test suite
|
||||
# Misc test
|
||||
|
||||
spawn telnet localhost 6789
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -129,7 +130,7 @@ expect {
|
||||
send "userhost nick\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
-re ":ngircd.test.server 302 nick :?nick=+.*@(localhos.*|127.0.0.1)"
|
||||
-re ":ngircd.test.server 302 nick :?nick=+.*@127.0.0.1"
|
||||
}
|
||||
|
||||
send "userhost doesnotexist\r"
|
||||
@@ -141,7 +142,7 @@ expect {
|
||||
send "userhost nick doesnotexist nick doesnotexist\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
-re ":ngircd.test.server 302 nick :nick=+.*@(localhos.*|127.0.0.1) nick=+.*@(localhos.*|127.0.0.1)"
|
||||
-re ":ngircd.test.server 302 nick :nick=+.*@127.0.0.1 nick=+.*@127.0.0.1"
|
||||
}
|
||||
|
||||
send "away :testing\r"
|
||||
@@ -153,7 +154,7 @@ expect {
|
||||
send "userhost nick nick nick nick nick nick\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
-re ":ngircd.test.server 302 nick :nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1)\r"
|
||||
-re ":ngircd.test.server 302 nick :nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1\r"
|
||||
}
|
||||
|
||||
send "quit\r"
|
||||
@@ -161,5 +162,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"ERROR"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# $Id: mode-test.e,v 1.7 2008/02/16 11:27:49 fw Exp $
|
||||
# ngIRCd test suite
|
||||
# MODE test
|
||||
|
||||
spawn telnet localhost 6789
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -172,5 +173,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -17,6 +17,7 @@
|
||||
OperCanUseMode = yes
|
||||
Ident = no
|
||||
IncludeDir = /var/empty
|
||||
DNS = no
|
||||
PAM = no
|
||||
|
||||
[Operator]
|
||||
|
@@ -17,6 +17,7 @@
|
||||
OperCanUseMode = yes
|
||||
Ident = no
|
||||
IncludeDir = /var/empty
|
||||
DNS = no
|
||||
PAM = no
|
||||
|
||||
[Operator]
|
||||
|
@@ -1,4 +1,7 @@
|
||||
spawn telnet localhost 6789
|
||||
# ngIRCd test suite
|
||||
# Op-less channel test
|
||||
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -28,5 +31,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# ngIRCd test suite
|
||||
# server-server link test
|
||||
|
||||
spawn telnet localhost 6790
|
||||
spawn telnet 127.0.0.1 6790
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -48,5 +48,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"ERROR"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -35,6 +35,10 @@ fi
|
||||
# generate MOTD for test-server
|
||||
echo "This is an ngIRCd Test Server" > ngircd-test${id}.motd
|
||||
|
||||
# glibc memory checking, see malloc(3)
|
||||
MALLOC_CHECK_=3
|
||||
export MALLOC_CHECK_
|
||||
|
||||
# starting up test-server ...
|
||||
./T-ngircd${id} -n -f ${srcdir}/ngircd-test${id}.conf $* \
|
||||
>ngircd-test${id}.log 2>&1 &
|
||||
|
@@ -1,11 +1,10 @@
|
||||
# $Id: stress-A.e,v 1.2 2005/08/12 21:35:12 alex Exp $
|
||||
# ngIRCd test suite
|
||||
# "Stress" header
|
||||
|
||||
set timeout 30
|
||||
|
||||
spawn telnet localhost 6789
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,4 +1,5 @@
|
||||
# $Id: stress-B.e,v 1.3 2005/12/30 22:12:28 alex Exp $
|
||||
# ngIRCd test suite
|
||||
# "Stress" body
|
||||
|
||||
send "user user . . :User\r"
|
||||
expect {
|
||||
@@ -73,5 +74,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ngIRCd Test Suite
|
||||
# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
|
||||
# Copyright (c)2001-2014 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
|
||||
@@ -18,6 +18,7 @@ test=`echo ${name} | cut -d '.' -f 1`
|
||||
[ -d logs ] || mkdir logs
|
||||
|
||||
if [ ! -r "$test" ]; then
|
||||
echo "$test: test not found" >>tests-skipped.lst
|
||||
echo "${name}: test \"$test\" not found!"; exit 77
|
||||
exit 1
|
||||
fi
|
||||
@@ -27,10 +28,12 @@ fi
|
||||
|
||||
type expect > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$test: \"expect\" not found" >>tests-skipped.lst
|
||||
echo "${name}: \"expect\" not found."; exit 77
|
||||
fi
|
||||
type telnet > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$test: \"telnet\" not found" >>tests-skipped.lst
|
||||
echo "${name}: \"telnet\" not found."; exit 77
|
||||
fi
|
||||
|
||||
|
@@ -1,4 +1,7 @@
|
||||
spawn telnet localhost 6789
|
||||
# ngIRCd test suite
|
||||
# WHO test
|
||||
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -59,7 +62,7 @@ expect {
|
||||
":ngircd.test.server 352 nick #channel * * ngircd.test.server nick G@ :0 Real Name"
|
||||
}
|
||||
|
||||
send "who localhos*\r"
|
||||
send "who 127.0.0.*\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
":ngircd.test.server 352 nick \* * * ngircd.test.server nick G :0 Real Name"
|
||||
@@ -86,7 +89,7 @@ expect {
|
||||
send "part #channel\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"@* PART #channel :nick"
|
||||
"@* PART #channel :"
|
||||
}
|
||||
|
||||
send "who Real?Name\r"
|
||||
@@ -117,7 +120,7 @@ expect {
|
||||
"305 nick"
|
||||
}
|
||||
|
||||
send "who ??cal*ho*\r"
|
||||
send "who ??7.*0*\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
":ngircd.test.server 352 nick \* * * ngircd.test.server nick H* :0 Real Name"
|
||||
@@ -198,5 +201,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"Connection closed"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# ngIRCd test suite
|
||||
# WHOIS test
|
||||
|
||||
spawn telnet localhost 6789
|
||||
spawn telnet 127.0.0.1 6789
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"Connected"
|
||||
@@ -17,7 +17,7 @@ expect {
|
||||
send "whois nick\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"311 nick nick ~user localhost* \* :Real Name\r"
|
||||
"311 nick nick ~user 127.0.0.1 \* :Real Name\r"
|
||||
}
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
@@ -27,25 +27,25 @@ expect {
|
||||
send "whois *\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"311 nick nick ~user localhost* \* :Real Name\r"
|
||||
"311 nick nick ~user 127.0.0.1* \* :Real Name\r"
|
||||
}
|
||||
|
||||
send "whois n*\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"311 nick nick ~user localhost* \* :Real Name\r"
|
||||
"311 nick nick ~user 127.0.0.1* \* :Real Name\r"
|
||||
}
|
||||
|
||||
send "whois ?ick\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"311 nick nick ~user localhost* \* :Real Name\r"
|
||||
"311 nick nick ~user 127.0.0.1* \* :Real Name\r"
|
||||
}
|
||||
|
||||
send "whois ????,n?*k\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
"311 nick nick ~user localhost* \* :Real Name\r"
|
||||
"311 nick nick ~user 127.0.0.1* \* :Real Name\r"
|
||||
}
|
||||
|
||||
send "whois unknown\r"
|
||||
@@ -61,7 +61,7 @@ expect {
|
||||
send "whois ngircd.test.server2 nick\r"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
":ngircd.test.server2 311 nick nick ~user localhost* \* :Real Name\r"
|
||||
":ngircd.test.server2 311 nick nick ~user 127.0.0.1* \* :Real Name\r"
|
||||
}
|
||||
|
||||
send "whois nosuchserver unknown\r"
|
||||
@@ -75,5 +75,3 @@ expect {
|
||||
timeout { exit 1 }
|
||||
"ERROR"
|
||||
}
|
||||
|
||||
# -eof-
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2014 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
|
||||
@@ -16,7 +16,6 @@
|
||||
* Tool functions
|
||||
*/
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
@@ -31,7 +30,6 @@
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
|
||||
#include "exp.h"
|
||||
#include "tool.h"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user