ClientHost setting
This commit is contained in:
parent
5417a72536
commit
52f59149ad
|
@ -24,6 +24,9 @@
|
||||||
# (".") and be unique in the IRC network. Required!
|
# (".") and be unique in the IRC network. Required!
|
||||||
Name = irc.the.net
|
Name = irc.the.net
|
||||||
|
|
||||||
|
# Set this hostname for every client instead of the real one
|
||||||
|
;ClientHost = irc.the.net
|
||||||
|
|
||||||
# Info text of the server. This will be shown by WHOIS and
|
# Info text of the server. This will be shown by WHOIS and
|
||||||
# LINKS requests for example.
|
# LINKS requests for example.
|
||||||
Info = Server Info Text
|
Info = Server Info Text
|
||||||
|
|
|
@ -319,7 +319,11 @@ Client_SetHostname( CLIENT *Client, const char *Hostname )
|
||||||
assert( Client != NULL );
|
assert( Client != NULL );
|
||||||
assert( Hostname != NULL );
|
assert( Hostname != NULL );
|
||||||
|
|
||||||
strlcpy( Client->host, Hostname, sizeof( Client->host ));
|
if (strlen(Conf_ClientHost)) {
|
||||||
|
strlcpy( Client->host, Conf_ClientHost, sizeof( Client->host ));
|
||||||
|
} else {
|
||||||
|
strlcpy( Client->host, Hostname, sizeof( Client->host ));
|
||||||
|
}
|
||||||
} /* Client_SetHostname */
|
} /* Client_SetHostname */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -295,6 +295,7 @@ Conf_Test( void )
|
||||||
|
|
||||||
puts( "[GLOBAL]" );
|
puts( "[GLOBAL]" );
|
||||||
printf(" Name = %s\n", Conf_ServerName);
|
printf(" Name = %s\n", Conf_ServerName);
|
||||||
|
printf(" ClientHost = %s\n", Conf_ClientHost);
|
||||||
printf(" Info = %s\n", Conf_ServerInfo);
|
printf(" Info = %s\n", Conf_ServerInfo);
|
||||||
#ifndef PAM
|
#ifndef PAM
|
||||||
printf(" Password = %s\n", Conf_ServerPwd);
|
printf(" Password = %s\n", Conf_ServerPwd);
|
||||||
|
@ -590,6 +591,7 @@ Set_Defaults(bool InitServers)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
strcpy(Conf_ServerName, "");
|
strcpy(Conf_ServerName, "");
|
||||||
|
strcpy(Conf_ClientHost, "");
|
||||||
snprintf(Conf_ServerInfo, sizeof Conf_ServerInfo, "%s %s",
|
snprintf(Conf_ServerInfo, sizeof Conf_ServerInfo, "%s %s",
|
||||||
PACKAGE_NAME, PACKAGE_VERSION);
|
PACKAGE_NAME, PACKAGE_VERSION);
|
||||||
strcpy(Conf_ServerPwd, "");
|
strcpy(Conf_ServerPwd, "");
|
||||||
|
@ -970,6 +972,13 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
|
||||||
Config_Error_TooLong( Line, Var );
|
Config_Error_TooLong( Line, Var );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if( strcasecmp( Var, "ClientHost" ) == 0 ) {
|
||||||
|
/* Client hostname */
|
||||||
|
len = strlcpy( Conf_ClientHost, Arg, sizeof( Conf_ClientHost ));
|
||||||
|
if (len >= sizeof( Conf_ClientHost ))
|
||||||
|
Config_Error_TooLong( Line, Var );
|
||||||
|
return;
|
||||||
|
}
|
||||||
if( strcasecmp( Var, "Info" ) == 0 ) {
|
if( strcasecmp( Var, "Info" ) == 0 ) {
|
||||||
/* Info text of server */
|
/* Info text of server */
|
||||||
len = strlcpy( Conf_ServerInfo, Arg, sizeof( Conf_ServerInfo ));
|
len = strlcpy( Conf_ServerInfo, Arg, sizeof( Conf_ServerInfo ));
|
||||||
|
|
|
@ -97,6 +97,9 @@ struct Conf_Channel {
|
||||||
/** Name (ID, "nick") of this server */
|
/** Name (ID, "nick") of this server */
|
||||||
GLOBAL char Conf_ServerName[CLIENT_ID_LEN];
|
GLOBAL char Conf_ServerName[CLIENT_ID_LEN];
|
||||||
|
|
||||||
|
/** Hostname of the clients */
|
||||||
|
GLOBAL char Conf_ClientHost[CLIENT_ID_LEN];
|
||||||
|
|
||||||
/** Server info text */
|
/** Server info text */
|
||||||
GLOBAL char Conf_ServerInfo[CLIENT_INFO_LEN];
|
GLOBAL char Conf_ServerInfo[CLIENT_INFO_LEN];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue