Extended version reporting of CVS builds.

This commit is contained in:
Alexander Barton 2003-12-04 14:05:16 +00:00
parent d329a961bd
commit 05e2c0f048
3 changed files with 34 additions and 8 deletions

View File

@ -8,7 +8,7 @@
# (at your option) any later version. # (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information. # Please read the file COPYING, README and AUTHORS for more information.
# #
# $Id: Makefile.am,v 1.41 2003/09/09 13:24:41 alex Exp $ # $Id: Makefile.am,v 1.42 2003/12/04 14:05:16 alex Exp $
# #
AUTOMAKE_OPTIONS = ../portab/ansi2knr AUTOMAKE_OPTIONS = ../portab/ansi2knr
@ -63,6 +63,10 @@ lint:
ngircd.c: cvs-version.h ngircd.c: cvs-version.h
irc-login.c: cvs-version.h
irc-info.c: cvs-version.h
cvs-version.h: cvs-date cvs-version.h: cvs-date
cvs-date: cvs-date:

View File

@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-info.c,v 1.18 2003/11/05 23:24:48 alex Exp $"; static char UNUSED id[] = "$Id: irc-info.c,v 1.19 2003/12/04 14:05:16 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@ -494,7 +494,7 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
{ {
CLIENT *target, *prefix; CLIENT *target, *prefix;
#ifdef CVSDATE #ifdef CVSDATE
CHAR ver[12]; CHAR ver[12], vertxt[30];
#endif #endif
assert( Client != NULL ); assert( Client != NULL );
@ -528,7 +528,8 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
strlcpy( ver, CVSDATE, sizeof( ver )); strlcpy( ver, CVSDATE, sizeof( ver ));
strncpy( ver + 4, ver + 5, 2 ); strncpy( ver + 4, ver + 5, 2 );
strncpy( ver + 6, ver + 8, 3 ); strncpy( ver + 6, ver + 8, 3 );
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, ver, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( )); 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 #else
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( )); return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( ));
#endif #endif

View File

@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-login.c,v 1.35 2003/11/05 23:24:48 alex Exp $"; static char UNUSED id[] = "$Id: irc-login.c,v 1.36 2003/12/04 14:05:16 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@ -34,6 +34,7 @@ static char UNUSED id[] = "$Id: irc-login.c,v 1.35 2003/11/05 23:24:48 alex Exp
#include "irc.h" #include "irc.h"
#include "irc-info.h" #include "irc-info.h"
#include "irc-write.h" #include "irc-write.h"
#include "cvs-version.h"
#include "exp.h" #include "exp.h"
#include "irc-login.h" #include "irc-login.h"
@ -429,12 +430,16 @@ IRC_PONG( CLIENT *Client, REQUEST *Req )
LOCAL BOOLEAN LOCAL BOOLEAN
Hello_User( CLIENT *Client ) Hello_User( CLIENT *Client )
{ {
#ifdef CVSDATE
CHAR ver[12], vertxt[30];
#endif
assert( Client != NULL ); assert( Client != NULL );
/* Passwort ueberpruefen */ /* Check password ... */
if( strcmp( Client_Password( Client ), Conf_ServerPwd ) != 0 ) if( strcmp( Client_Password( Client ), Conf_ServerPwd ) != 0 )
{ {
/* Falsches Passwort */ /* Bad password! */
Log( LOG_ERR, "User \"%s\" rejected (connection %d): Bad password!", Client_Mask( Client ), Client_Conn( Client )); 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 ); Conn_Close( Client_Conn( Client ), NULL, "Bad password", TRUE );
return DISCONNECTED; return DISCONNECTED;
@ -442,13 +447,29 @@ Hello_User( CLIENT *Client )
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 ));
/* Andere Server informieren */ /* 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; 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 ));
strncpy( ver + 4, ver + 5, 2 );
strncpy( 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; 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; 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; if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, USERMODES, CHANMODES )) return FALSE;
#endif
/* Features */ /* Features */
if( ! IRC_WriteStrClient( Client, RPL_ISUPPORT_MSG, Client_ID( Client ), CLIENT_NICK_LEN - 1, CHANNEL_TOPIC_LEN - 1, CLIENT_AWAY_LEN - 1, Conf_MaxJoins )) return DISCONNECTED; if( ! IRC_WriteStrClient( Client, RPL_ISUPPORT_MSG, Client_ID( Client ), CLIENT_NICK_LEN - 1, CHANNEL_TOPIC_LEN - 1, CLIENT_AWAY_LEN - 1, Conf_MaxJoins )) return DISCONNECTED;