1
0
mirror of https://github.com/osmarks/ngircd.git synced 2026-05-02 20:01:24 +00:00

Compare commits

...

24 Commits

Author SHA1 Message Date
Alexander Barton
f44007f42f ngIRCd 0.12.0 2008-05-13 12:42:59 +02:00
Alexander Barton
1a56c77751 Updated NEWS and ChangeLog for ngIRCd 0.12.0. 2008-05-13 12:42:27 +02:00
Florian Westphal
78257374f0 If bind() fails, also print ip address and not just the port number. 2008-05-13 12:30:41 +02:00
Florian Westphal
fc93044909 Fix complie on FreeBSD 5.4 and AIX.
This is picked from commits

d9c26f3aeb
"ng_ipaddr.h must include netinet/in.h."

and
4e507881f3
"On AIX (for example) socklen_t is defined in sys/socket.h"
2008-05-10 21:53:39 +02:00
Ali Shemiran
2e0c62df91 Fix secret channel information leak
/who on a secret channel that the user is not a member of
now returns proper RPL_ENDOFWHO_MSG instead of nothing.

[picked from 12cd554af1709c44f35024d7d2fc368fb22f133d; without testcase]
2008-05-09 21:52:54 +02:00
Alexander Barton
c5ba599140 ngIRCd 0.12.0-pre2 2008-04-29 23:57:11 +02:00
Alexander Barton
afc67ff323 Merge branch 'master' into branch-0-12-x 2008-04-29 15:36:16 +02:00
Alexander Barton
6cfc56064e Updated NEWS and ChangeLog for ngIRCd 0.12.0-pre2. 2008-04-29 15:34:15 +02:00
Alexander Barton
4a81367dac --configtest: fix missing whitespace at "ConnectIPv4" option. 2008-04-29 15:27:44 +02:00
Alexander Barton
8c425945a2 --enable-ipv6: fix indentation in ./configure --help output. 2008-04-29 15:26:20 +02:00
Alexander Barton
bb6ee46892 Merge branch 'master' of git://git.breakpoint.cc/fw/ngircd-fw 2008-04-29 15:15:28 +02:00
Alexander Barton
6052d04c60 Merge branch 'master' into branch-0-12-x 2008-04-29 14:41:24 +02:00
Florian Westphal
9194319399 Testsuite: remove erroneous ConfUID setting in config file.
The config file for ngircds test suite contained obsolete
ConfUID/ConfGID settings, causing ngircd to needlesly complain when
started as non-root (which is hopefully the _normal_ case...)
2008-04-29 13:32:29 +02:00
Alexander Barton
32bf6d4de0 Merge branch 'master' into branch-0-12-x
Fixed bug 81:
When trying to part a channel ("PART #channel") the client is not member of
the daemon now correctly reports the numeric ERR_NOTONCHANNEL (442) insted
of ERR_NOSUCHCHANNEL (403).
2008-04-25 00:20:35 +02:00
Alexander Barton
33b1204349 Get rid of cvs-version.* and CVSDATE definition.
(cherry picked from commit b187fac244)
2008-04-25 00:14:11 +02:00
Alexander Barton
09968ee843 Documentation: get rid of some more references to CVS, switch to GIT.
(cherry picked from commit 6e9389b86c)
2008-04-25 00:13:07 +02:00
Alexander Barton
523a6fad09 Report ERR_NOTONCHANNEL when trying to part a channel one is not member of.
When trying to part a channel ("PART #channel") the client is not member of
the daemon now correctly reports the numeric ERR_NOTONCHANNEL (442) insted
of ERR_NOSUCHCHANNEL (403).
2008-04-24 23:52:54 +02:00
Alexander Barton
54b17fc201 Channel_Part(): Code and comment cleanup. 2008-04-24 23:47:33 +02:00
Alexander Barton
25f48a2a34 IRC_PART(): code and comment cleanup. 2008-04-24 23:46:59 +02:00
Florian Westphal
22fa782be7 IPv6: Add config options to disabe ipv4/ipv6 support.
This also enables ipv6-only setups.
2008-04-21 00:45:19 +02:00
Alexander Barton
b187fac244 Get rid of cvs-version.* and CVSDATE definition. 2008-04-20 23:10:22 +02:00
Alexander Barton
6e9389b86c Documentation: get rid of some more references to CVS, switch to GIT. 2008-04-20 22:48:05 +02:00
Alexander Barton
2f6d7a649c Don't include doc/CVS.txt in distribution archive, use doc/GIT.txt now!
(cherry picked from commit a8e0eb62e9)
2008-04-20 17:37:21 +02:00
Alexander Barton
7df90846e1 Synchronized branch-0-12-x (ngIRCd 0.12.0-pre1) with master.
(cherry picked from commit 4ea2932967)
2008-04-20 16:20:53 +02:00
22 changed files with 259 additions and 151 deletions

View File

@@ -10,8 +10,22 @@
-- ChangeLog --
ngIRCd 0.12.0-pre1 (2008-04-20)
ngIRCd 0.12.0 (2008-05-13)
- Fix Bug: 85: "WHO #SecretChannel" that user is not a member of now returns
proper RPL_ENDOFWHO_MSG instead of nothing. (Ali Shemiran)
- Fix complie on FreeBSD 5.4 and AIX.
- If bind() fails, also print ip address and not just the port number.
ngIRCd 0.12.0-pre2 (2008-04-29)
- IPv6: Add config options to disabe ipv4/ipv6 support.
- Don't include doc/CVS.txt in distribution archive, use doc/GIT.txt now!
- Documentation: get rid of some more references to CVS, switch to GIT.
- Get rid of cvs-version.* and CVSDATE definition.
- Report ERR_NOTONCHANNEL when trying to part a channel one is not member of.
- Testsuite: remove erroneous ConfUID setting in config file.
ngIRCd 0.12.0-pre1 (2008-04-20)
- Include Mac OS X Xcode project in distribution archives.
- Do not exit on SIGHUP or /REHASH if the config file cannot opened.
- Add IPv6 support.
@@ -758,7 +772,3 @@ ngIRCd 0.0.2, 06.01.2002
ngIRCd 0.0.1, 31.12.2001
- erste oeffentliche Version von ngIRCd als "public preview" :-)
--
$Id: ChangeLog,v 1.345 2008/03/18 20:12:47 fw Exp $

10
INSTALL
View File

@@ -51,9 +51,9 @@ on modern UNIX-like systems that are supported by GNU autoconf and GNU
automake ("configure") should be no problem.
The normal installation procedure after getting (and expanding) the source
files (using a distribution archive or CVS) is as following:
files (using a distribution archive or GIT) is as following:
1) ./autogen.sh [only necessary when using CVS]
1) ./autogen.sh [only necessary when using GIT]
2) ./configure
3) make
4) make install
@@ -77,7 +77,7 @@ doc/ directory: sample-ngircd.conf.
The first step, autogen.sh, is only necessary if the configure-script isn't
already generated. This never happens in official ("stable") releases in
tar.gz-archives, but when using CVS.
tar.gz-archives, but when using GIT.
This step is therefore only interesting for developers.
@@ -244,7 +244,3 @@ These parameters could be passed to the ngIRCd:
Use "--help" to see a short help text describing all available parameters
the server understands, with "--version" the ngIRCd shows its version
number. In both cases the server exits after the output.
--
$Id: INSTALL,v 1.26 2007/04/08 11:39:08 alex Exp $

6
NEWS
View File

@@ -10,8 +10,12 @@
-- NEWS --
ngIRCd 0.12.0-pre1 (2008-04-20)
ngIRCd 0.12.0 (2008-05-13)
ngIRCd 0.12.0-pre2 (2008-04-29)
- IPv6: Add config options to disabe ipv4/ipv6 support.
ngIRCd 0.12.0-pre1 (2008-04-20)
- Add IPv6 support.
- Install a LaunchDaemon script to start/stop ngIRCd on Mac OS X.
- Implemented IRC commands INFO, SUMMON (dummy), and USERS (dummy) and

10
README
View File

@@ -67,9 +67,9 @@ the newest information about the ngIRCd and the most recent ("stable")
releases there.
If you are interested in the latest development versions (which are not
always stable), then please read the section "CVS" on the homepage and
the file "doc/CVS.txt" which describes the use of CVS, the "Concurrent
Versioning System".
always stable), then please read the section about "GIT" on the homepage and
the file "doc/GIT.txt" which describes the use of GIT, the version control
system used by ngIRCd (homepage: http://git.or.cz/).
VI. Bugs
@@ -85,7 +85,3 @@ There you can read about known bugs and limitations, too.
If you have critics, patches or something else, please feel free to post a
mail to the ngIRCd mailing list: <ngircd-ml@arthur.ath.cx> (please see
<http://ngircd.barton.de/#ml> for details).
--
$Id: README,v 1.25 2007/10/04 15:18:48 alex Exp $

View File

@@ -12,7 +12,7 @@
# -- Initialisation --
AC_PREREQ(2.50)
AC_INIT(ngircd, 0.12.0-pre1)
AC_INIT(ngircd, 0.12.0)
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6)
@@ -428,7 +428,7 @@ fi
# enable support for IPv6?
x_ipv6_on=no
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6, enable IPv6 protocol support],
[ --enable-ipv6 enable IPv6 protocol support],
if test "$enableval" = "yes"; then x_ipv6_on=yes; fi
)
if test "$x_ipv6_on" = "yes"; then

View File

@@ -1,3 +1,15 @@
ngircd (0.12.0-0ab0-pre3) unstable; urgency=low
* New "upstream" release ngIRCd 0.12.0.
-- Alexander Barton <alex@barton.de> Tue, 13 May 2008 12:30:31 +0200
ngircd (0.12.0-0ab0-pre2) unstable; urgency=low
* Second prereloease of upcoming new "upstrem" release 0.12.0-pre1.
-- Alexander Barton <alex@barton.de> Tue, 29 Apr 2008 23:06:14 +0200
ngircd (0.12.0-0ab0-pre1) unstable; urgency=low
* Prereloease of upcoming new "upstrem" release 0.12.0-pre1.

View File

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

View File

@@ -103,6 +103,15 @@
# Don't do any DNS lookups when a client connects to the server.
;NoDNS = no
# allow both ipv4 and ipv6 clients to connect by opening both
# ipv4 and ipv6 sockets
;ListenIPv6 = yes
;ListenIPv4 = yes
# try to connect to other irc servers using ipv4 and ipv6, if possible
;ConnectIPv6 = yes
;ConnectIPv4 = yes
# Maximum number of simultaneous connection the server is allowed
# to accept (0: unlimited):
;MaxConnections = 0

View File

@@ -158,6 +158,24 @@ If you configure ngircd to connect to other servers, ngircd may still
perform a DNS lookup if required.
Default: No.
.TP
\fBListenIPv4\fR
Set this to no if you do not want ngircd to accept clients using the standard internet protocol, ipv4.
This allows use of ngircd in ipv6-only setups.
Default: Yes.
.TP
\fBListenIPv6\fR
Set this to no if you do not want ngircd to accept clients using the new internet protocol, ipv6.
Default: Yes.
.TP
\fBConnectIPv4\fR
Set this to no if you do not want ngircd to connect to other irc servers using ipv4.
This allows use of ngircd in ipv6-only setups.
Default: Yes.
.TP
\fBConnectIPv6\fR
Set this to no if you do not want ngircd to connect to other irc servers using ipv6.
Default: Yes.
.TP
\fBMaxConnections\fR
Maximum number of simultaneous connection the server is allowed to accept
(0: unlimited). Default: 0.

View File

@@ -14,9 +14,6 @@
#include <netdb.h>
#include <sys/types.h>
#endif
#include <sys/socket.h>
#include <netinet/in.h>
#include "ng_ipaddr.h"

View File

@@ -8,6 +8,9 @@
#define NG_IPADDR_HDR
#include "portab.h"
#include <sys/socket.h>
#include <netinet/in.h>
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#else

View File

@@ -36,7 +36,7 @@ noinst_HEADERS = ngircd.h array.h channel.h client.h conf.h conn.h conn-func.h \
defines.h messages.h
clean-local:
rm -f check-version check-help lint.out cvs-version.*
rm -f check-version check-help lint.out
maintainer-clean-local:
rm -f Makefile Makefile.in
@@ -77,23 +77,6 @@ lint:
|| echo "Result: no warnings found."; \
echo; [ $$warnings -gt 0 ] && exit 1
ngircd.c: cvs-version.h
irc-login.c: cvs-version.h
irc-info.c: cvs-version.h
cvs-version.h: cvs-date
cvs-date:
grep VERSION ../config.h | grep "CVS" \
&& echo "#define CVSDATE \"$$( grep "\$$Id" $(srcdir)/*.c \
| $(AWK) "{ print \$$9 }" | sort | tail -1 \
| sed -e "s/\//-/g" )\"" > cvs-version.new \
|| echo "" > cvs-version.new
diff cvs-version.h cvs-version.new 2>/dev/null \
|| cp cvs-version.new cvs-version.h
TESTS = check-version check-help
# -eof-

View File

@@ -201,25 +201,38 @@ Channel_Join( CLIENT *Client, char *Name )
} /* Channel_Join */
/**
* Remove client from channel.
* This function lets a client lead a channel. First, the function checks
* if the channel exists and the client is a member of it and sends out
* appropriate error messages if not. The real work is done by the function
* Remove_Client().
*/
GLOBAL bool
Channel_Part( CLIENT *Client, CLIENT *Origin, const char *Name, const char *Reason )
Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Reason)
{
CHANNEL *chan;
assert( Client != NULL );
assert( Name != NULL );
assert( Reason != NULL );
assert(Client != NULL);
assert(Name != NULL);
assert(Reason != NULL);
chan = Channel_Search( Name );
if(( ! chan ) || ( ! Get_Cl2Chan( chan, Client )))
{
IRC_WriteStrClient( Client, ERR_NOSUCHCHANNEL_MSG, Client_ID( Client ), Name );
chan = Channel_Search(Name);
if (!chan) {
IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG,
Client_ID(Client), Name);
return false;
}
if (!Get_Cl2Chan(chan, Client)) {
IRC_WriteStrClient(Client, ERR_NOTONCHANNEL_MSG,
Client_ID(Client), Name);
return false;
}
/* User aus Channel entfernen */
if( ! Remove_Client( REMOVE_PART, chan, Client, Origin, Reason, true)) return false;
else return true;
if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true))
return false;
else
return true;
} /* Channel_Part */

View File

@@ -152,6 +152,15 @@ Conf_Rehash( void )
} /* Config_Rehash */
static const char*
yesno_to_str(int boolean_value)
{
if (boolean_value)
return "yes";
return "no";
}
GLOBAL int
Conf_Test( void )
{
@@ -201,10 +210,17 @@ Conf_Test( void )
printf( " PingTimeout = %d\n", Conf_PingTimeout );
printf( " PongTimeout = %d\n", Conf_PongTimeout );
printf( " ConnectRetry = %d\n", Conf_ConnectRetry );
printf( " OperCanUseMode = %s\n", Conf_OperCanMode == true ? "yes" : "no" );
printf( " OperServerMode = %s\n", Conf_OperServerMode == true? "yes" : "no" );
printf( " PredefChannelsOnly = %s\n", Conf_PredefChannelsOnly == true ? "yes" : "no" );
printf( " NoDNS = %s\n", Conf_NoDNS ? "yes" : "no");
printf( " OperCanUseMode = %s\n", yesno_to_str(Conf_OperCanMode));
printf( " OperServerMode = %s\n", yesno_to_str(Conf_OperServerMode));
printf( " PredefChannelsOnly = %s\n", yesno_to_str(Conf_PredefChannelsOnly));
printf( " NoDNS = %s\n", yesno_to_str(Conf_NoDNS));
#ifdef WANT_IPV6
printf(" ListenIPv6 = %s\n", yesno_to_str(Conf_ListenIPv6));
printf(" ListenIPv4 = %s\n", yesno_to_str(Conf_ListenIPv4));
printf(" ConnectIPv4 = %s\n", yesno_to_str(Conf_ConnectIPv6));
printf(" ConnectIPv6 = %s\n", yesno_to_str(Conf_ConnectIPv4));
#endif
printf( " MaxConnections = %ld\n", Conf_MaxConnections);
printf( " MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
printf( " MaxJoins = %d\n", Conf_MaxJoins>0 ? Conf_MaxJoins : -1);
@@ -449,6 +465,11 @@ Set_Defaults( bool InitServers )
Conf_PredefChannelsOnly = false;
Conf_OperServerMode = false;
Conf_ConnectIPv4 = true;
Conf_ListenIPv4 = true;
Conf_ConnectIPv6 = true;
Conf_ListenIPv6 = true;
Conf_MaxConnections = 0;
Conf_MaxConnectionsIP = 5;
Conf_MaxJoins = 10;
@@ -817,6 +838,33 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
Conf_NoDNS = Check_ArgIsTrue( Arg );
return;
}
#ifdef WANT_IPV6
/* the default setting for all the WANT_IPV6 special options is 'true' */
if( strcasecmp( Var, "ListenIPv6" ) == 0 ) {
/* listen on ipv6 sockets, if available? */
Conf_ListenIPv6 = Check_ArgIsTrue( Arg );
return;
}
if( strcasecmp( Var, "ListenIPv4" ) == 0 ) {
/*
* listen on ipv4 sockets, if available?
* this allows "ipv6-only" setups.
*/
Conf_ListenIPv4 = Check_ArgIsTrue( Arg );
return;
}
if( strcasecmp( Var, "ConnectIPv6" ) == 0 ) {
/* connect to other hosts using ipv6, if they have an AAAA record? */
Conf_ConnectIPv6 = Check_ArgIsTrue( Arg );
return;
}
if( strcasecmp( Var, "ConnectIPv4" ) == 0 ) {
/* connect to other hosts using ipv4.
* again, this can be used for ipv6-only setups */
Conf_ConnectIPv4 = Check_ArgIsTrue( Arg );
return;
}
#endif
if( strcasecmp( Var, "OperCanUseMode" ) == 0 ) {
/* Are IRC operators allowed to use MODE in channels they aren't Op in? */
Conf_OperCanMode = Check_ArgIsTrue( Arg );
@@ -1138,6 +1186,16 @@ Validate_Config(bool Configtest, bool Rehash)
"No administrative information configured but required by RFC!");
}
#ifdef WANT_IPV6
if (!Conf_ListenIPv4 && !Conf_ListenIPv6)
Config_Error(LOG_ALERT,
"Both \"ListenIPv4\" and \"ListenIPv6\" are set to 'no'; no network protocol available!");
if (!Conf_ConnectIPv4 && !Conf_ConnectIPv6)
Config_Error(LOG_ALERT,
"Both \"ConnectIPv4\" and \"ConnectIPv6\" are set to 'no'; ngircd will fail to connect to other irc servers");
#endif
#ifdef DEBUG
servers = servers_once = 0;
for (i = 0; i < MAX_SERVERS; i++) {

View File

@@ -124,11 +124,20 @@ GLOBAL bool Conf_OperCanMode;
/* Disable all DNS functions? */
GLOBAL bool Conf_NoDNS;
/* don't listen for incoming ipv6 connections, even if OS supports it? */
GLOBAL bool Conf_NoListenIpv6;
/* listen for incoming ipv6 connections if OS supports it (default: yes)? */
GLOBAL bool Conf_ListenIPv6;
/* don't connect to remote systems unsign ipv6? */
GLOBAL bool Conf_NoConnectIpv6;
/* listen for incoming ipv4 connections if OS supports it (default: yes)? */
GLOBAL bool Conf_ListenIPv4;
/*
* try to connect to remote systems using the ipv6 protocol,
* if they have an ipv6 address? (default yes)
*/
GLOBAL bool Conf_ConnectIPv6;
/* same as above, but for ipv4 hosts, default: yes */
GLOBAL bool Conf_ConnectIPv4;
/* If an IRC op gives chanop privileges without being a chanop,
* ircd2 will ignore the command. This enables a workaround:

View File

@@ -315,10 +315,11 @@ Conn_InitListeners( void )
}
#ifdef WANT_IPV6
if (!Conf_NoListenIpv6)
if (Conf_ListenIPv6)
created = ports_initlisteners(&Conf_ListenPorts, AF_INET6, cb_listen);
#endif
created += ports_initlisteners(&Conf_ListenPorts, AF_INET, cb_listen);
if (Conf_ListenIPv4)
created += ports_initlisteners(&Conf_ListenPorts, AF_INET, cb_listen);
return created;
} /* Conn_InitListeners */
@@ -414,11 +415,13 @@ NewListener(int af, const UINT16 Port)
set_v6_only(af, sock);
if( ! Init_Socket( sock )) return -1;
if (!Init_Socket(sock))
return -1;
if (bind(sock, (struct sockaddr *)&addr, ng_ipaddr_salen(&addr)) != 0) {
Log( LOG_CRIT, "Can't bind socket (port %d) : %s!", Port, strerror( errno ));
close( sock );
Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s",
ng_ipaddr_tostr(&addr), Port, strerror(errno));
close(sock);
return -1;
}

View File

@@ -286,29 +286,36 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
} /* IRC_JOIN */
/**
* Handler for the IRC "PART" command.
*/
GLOBAL bool
IRC_PART( CLIENT *Client, REQUEST *Req )
IRC_PART(CLIENT * Client, REQUEST * Req)
{
CLIENT *target;
char *chan;
assert( Client != NULL );
assert( Req != NULL );
assert(Client != NULL);
assert(Req != NULL);
if (Req->argc < 1 || Req->argc > 2)
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
Client_ID(Client), Req->command);
/* Wer ist der Absender? */
if( Client_Type( Client ) == CLIENT_SERVER ) target = Client_Search( Req->prefix );
else target = Client;
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
/* Get the sender */
if (Client_Type(Client) == CLIENT_SERVER)
target = Client_Search(Req->prefix);
else
target = Client;
if (!target)
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), Req->prefix);
/* Channel-Namen durchgehen */
/* Loop over all the given channel names */
chan = strtok(Req->argv[0], ",");
while (chan) {
Channel_Part(target, Client, chan, Req->argc > 1 ? Req->argv[1] : Client_ID(target));
Channel_Part(target, Client, chan,
Req->argc > 1 ? Req->argv[1] : Client_ID(target));
chan = strtok(NULL, ",");
}
return CONNECTED;

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2005 Alexander Barton (alex@barton.de)
* Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,8 +14,6 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-info.c,v 1.44 2008/02/17 13:26:42 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <errno.h>
@@ -25,7 +23,6 @@ static char UNUSED id[] = "$Id: irc-info.c,v 1.44 2008/02/17 13:26:42 alex Exp $
#include <strings.h>
#include "ngircd.h"
#include "cvs-version.h"
#include "conn-func.h"
#include "conn-zip.h"
#include "client.h"
@@ -640,9 +637,6 @@ GLOBAL bool
IRC_VERSION( CLIENT *Client, REQUEST *Req )
{
CLIENT *target, *prefix;
#ifdef CVSDATE
char ver[12], vertxt[30];
#endif
assert( Client != NULL );
assert( Req != NULL );
@@ -669,21 +663,15 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
return CONNECTED;
}
/* mit Versionsinfo antworten */
IRC_SetPenalty( Client, 1 );
#ifdef CVSDATE
strlcpy( ver, CVSDATE, sizeof( ver ));
strncpy( ver + 4, ver + 5, 2 );
strncpy( ver + 6, ver + 8, 3 );
snprintf( vertxt, sizeof( vertxt ), "%s(%s)", PACKAGE_VERSION, ver );
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, vertxt, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition );
#else
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition );
#endif
/* send version information */
IRC_SetPenalty(Client, 1);
return IRC_WriteStrClient(Client, RPL_VERSION_MSG, Client_ID(prefix),
PACKAGE_NAME, PACKAGE_VERSION,
NGIRCd_DebugLevel, Conf_ServerName,
NGIRCd_VersionAddition);
} /* IRC_VERSION */
static bool
write_whoreply(CLIENT *Client, CLIENT *c, const char *channelname, const char *flags)
{
@@ -730,7 +718,7 @@ IRC_Send_WHO(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
/* Secret channel? */
if (!is_member && strchr(Channel_Modes(Chan), 's'))
return CONNECTED;
return IRC_WriteStrClient(Client, RPL_ENDOFWHO_MSG, Client_ID(Client), Channel_Name(Chan));
cl2chan = Channel_FirstMember(Chan);
for (; cl2chan ; cl2chan = Channel_NextMember(Chan, cl2chan)) {

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
* Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,8 +14,6 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-login.c,v 1.55 2008/02/05 11:46:55 fw Exp $";
#include "imp.h"
#include <assert.h>
#include <stdio.h>
@@ -35,7 +33,6 @@ static char UNUSED id[] = "$Id: irc-login.c,v 1.55 2008/02/05 11:46:55 fw Exp $"
#include "irc.h"
#include "irc-info.h"
#include "irc-write.h"
#include "cvs-version.h"
#include "exp.h"
#include "irc-login.h"
@@ -507,7 +504,7 @@ IRC_PING(CLIENT *Client, REQUEST *Req)
Client_ID(from), Client_ID(Client));
#else
/* Some clients depend on the argument being returned in the PONG
* reply (not mentioned in any RFC, though) */
* reply (not mentioned in any RFC, though) */
return IRC_WriteStrClient(Client, "PONG %s :%s",
Client_ID(from), Req->argv[0]);
#endif
@@ -573,61 +570,60 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
static bool
Hello_User( CLIENT *Client )
Hello_User(CLIENT * Client)
{
#ifdef CVSDATE
char ver[12], vertxt[30];
#endif
assert( Client != NULL );
assert(Client != NULL);
/* Check password ... */
if( strcmp( Client_Password( Client ), Conf_ServerPwd ) != 0 )
{
if (strcmp(Client_Password(Client), Conf_ServerPwd) != 0) {
/* Bad password! */
Log( LOG_ERR, "User \"%s\" rejected (connection %d): Bad password!", Client_Mask( Client ), Client_Conn( Client ));
Conn_Close( Client_Conn( Client ), NULL, "Bad password", true);
Log(LOG_ERR,
"User \"%s\" rejected (connection %d): Bad password!",
Client_Mask(Client), Client_Conn(Client));
Conn_Close(Client_Conn(Client), NULL, "Bad password", true);
return DISCONNECTED;
}
Log( LOG_NOTICE, "User \"%s\" registered (connection %d).", Client_Mask( Client ), Client_Conn( Client ));
Log(LOG_NOTICE, "User \"%s\" registered (connection %d).",
Client_Mask(Client), Client_Conn(Client));
/* Inform other servers */
IRC_WriteStrServers( NULL, "NICK %s 1 %s %s 1 +%s :%s", Client_ID( Client ), Client_User( Client ), Client_Hostname( Client ), Client_Modes( Client ), Client_Info( Client ));
IRC_WriteStrServers(NULL, "NICK %s 1 %s %s 1 +%s :%s",
Client_ID(Client), Client_User(Client),
Client_Hostname(Client), Client_Modes(Client),
Client_Info(Client));
/* Welcome :-) */
if( ! IRC_WriteStrClient( Client, RPL_WELCOME_MSG, Client_ID( Client ), Client_Mask( Client ))) return false;
/* Version and system type */
#ifdef CVSDATE
strlcpy( ver, CVSDATE, sizeof( ver ));
memmove( ver + 4, ver + 5, 2 );
memmove( ver + 6, ver + 8, 3 );
snprintf( vertxt, sizeof( vertxt ), "%s(%s)", PACKAGE_VERSION, ver );
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), vertxt, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return false;
#else
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return false;
#endif
if( ! IRC_WriteStrClient( Client, RPL_CREATED_MSG, Client_ID( Client ), NGIRCd_StartStr )) return false;
#ifdef CVSDATE
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), vertxt, USERMODES, CHANMODES )) return false;
#else
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, USERMODES, CHANMODES )) return false;
#endif
if (!IRC_WriteStrClient
(Client, RPL_WELCOME_MSG, Client_ID(Client), Client_Mask(Client)))
return false;
if (!IRC_WriteStrClient
(Client, RPL_YOURHOST_MSG, Client_ID(Client),
Client_ID(Client_ThisServer()), PACKAGE_VERSION, TARGET_CPU,
TARGET_VENDOR, TARGET_OS))
return false;
if (!IRC_WriteStrClient
(Client, RPL_CREATED_MSG, Client_ID(Client), NGIRCd_StartStr))
return false;
if (!IRC_WriteStrClient
(Client, RPL_MYINFO_MSG, Client_ID(Client),
Client_ID(Client_ThisServer()), PACKAGE_VERSION, USERMODES,
CHANMODES))
return false;
/* Features supported by this server (005 numeric, ISUPPORT),
* see <http://www.irc.org/tech_docs/005.html> for details. */
if (! IRC_Send_ISUPPORT(Client))
if (!IRC_Send_ISUPPORT(Client))
return DISCONNECTED;
Client_SetType( Client, CLIENT_USER );
Client_SetType(Client, CLIENT_USER);
if( ! IRC_Send_LUSERS( Client )) return DISCONNECTED;
if( ! IRC_Show_MOTD( Client )) return DISCONNECTED;
if (!IRC_Send_LUSERS(Client))
return DISCONNECTED;
if (!IRC_Show_MOTD(Client))
return DISCONNECTED;
/* Suspend the client for a second ... */
IRC_SetPenalty( Client, 1 );
IRC_SetPenalty(Client, 1);
return CONNECTED;
} /* Hello_User */

View File

@@ -40,7 +40,6 @@
#include "client.h"
#include "channel.h"
#include "conf.h"
#include "cvs-version.h"
#include "lists.h"
#include "log.h"
#include "parse.h"
@@ -410,12 +409,9 @@ Fill_Version( void )
strlcat( NGIRCd_VersionAddition, "/", sizeof( NGIRCd_VersionAddition ));
strlcat( NGIRCd_VersionAddition, TARGET_OS, sizeof( NGIRCd_VersionAddition ));
#ifdef CVSDATE
snprintf( NGIRCd_Version, sizeof NGIRCd_Version,"%s %s(%s)-%s", PACKAGE_NAME, PACKAGE_VERSION, CVSDATE, NGIRCd_VersionAddition);
#else
snprintf( NGIRCd_Version, sizeof NGIRCd_Version, "%s %s-%s", PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_VersionAddition);
#endif
} /* Fill_Version */
snprintf(NGIRCd_Version, sizeof NGIRCd_Version, "%s %s-%s",
PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_VersionAddition);
} /* Fill_Version */
/**

View File

@@ -45,6 +45,10 @@ 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 ));
static bool register_callback PARAMS((RES_STAT *s, void (*cbfunc)(int, short)));
#ifdef WANT_IPV6
extern bool Conf_ConnectIPv4;
extern bool Conf_ConnectIPv6;
#endif
static pid_t
Resolver_fork(int *pipefds)
@@ -270,7 +274,7 @@ ForwardLookup(const char *hostname, array *IpAddr)
#ifdef HAVE_GETADDRINFO
int res;
struct addrinfo *a, *ai_results;
static const struct addrinfo hints = {
static struct addrinfo hints = {
#ifndef WANT_IPV6
.ai_family = AF_INET,
#endif
@@ -280,6 +284,14 @@ ForwardLookup(const char *hostname, array *IpAddr)
.ai_socktype = SOCK_STREAM,
.ai_protocol = IPPROTO_TCP
};
#ifdef WANT_IPV6
assert(Conf_ConnectIPv6 || Conf_ConnectIPv4);
if (!Conf_ConnectIPv6)
hints.ai_family = AF_INET;
if (!Conf_ConnectIPv4)
hints.ai_family = AF_INET6;
#endif
res = getaddrinfo(hostname, NULL, &hints, &ai_results);
switch (res) {
case 0: break;

View File

@@ -7,8 +7,6 @@
MotdFile = ngircd-test.motd
AdminEMail = admin@irc.server
MaxConnectionsIP = 0
ServerUID = 1
ServerGID = 1
OperCanUseMode = yes
[Operator]