X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fclient.c;h=5ca99c03570c20b97bb92ab40b58f0c82c6f5f27;hp=cefbd3a3464617506cd4c9d2eb00fd87258de0fb;hb=0d5de60584f094ef3b7c27806d6cd7f79e861d7b;hpb=49385a98b2878ae6f19dd0925e0dc90fcc3d6372 diff --git a/src/ngircd/client.c b/src/ngircd/client.c index cefbd3a3..5ca99c03 100644 --- a/src/ngircd/client.c +++ b/src/ngircd/client.c @@ -331,9 +331,15 @@ Client_SetHostname( CLIENT *Client, const char *Hostname ) assert(Hostname != NULL); if (strlen(Conf_CloakHost)) { + char cloak[GETID_LEN]; + + strlcpy(cloak, Hostname, GETID_LEN); + strlcat(cloak, Conf_CloakHostSalt, GETID_LEN); + snprintf(cloak, GETID_LEN, Conf_CloakHost, Hash(cloak)); + LogDebug("Updating hostname of \"%s\": \"%s\" -> \"%s\"", - Client_ID(Client), Client->host, Conf_CloakHost); - strlcpy(Client->host, Conf_CloakHost, sizeof(Client->host)); + Client_ID(Client), Client->host, cloak); + strlcpy(Client->host, cloak, sizeof(Client->host)); } else { LogDebug("Updating hostname of \"%s\": \"%s\" -> \"%s\"", Client_ID(Client), Client->host, Hostname); @@ -434,18 +440,6 @@ Client_SetFlags( CLIENT *Client, const char *Flags ) } /* Client_SetFlags */ -GLOBAL void -Client_SetPassword( CLIENT *Client, const char *Pwd ) -{ - /* set password sent by client */ - - assert( Client != NULL ); - assert( Pwd != NULL ); - - strlcpy(Client->pwd, Pwd, sizeof(Client->pwd)); -} /* Client_SetPassword */ - - GLOBAL void Client_SetAway( CLIENT *Client, const char *Txt ) { @@ -708,14 +702,6 @@ Client_HostnameCloaked(CLIENT *Client) } /* Client_HostnameCloaked */ -GLOBAL char * -Client_Password( CLIENT *Client ) -{ - assert( Client != NULL ); - return Client->pwd; -} /* Client_Password */ - - GLOBAL char * Client_Modes( CLIENT *Client ) { @@ -826,8 +812,9 @@ Client_MaskCloaked(CLIENT *Client) return Client_Mask(Client); if(*Conf_CloakHostModeX) { - snprintf(Mask_Buffer, GETID_LEN, "%s%s", Client->host, Conf_CloakHostModeXSalt); - snprintf(Cloak_Buffer, GETID_LEN, Conf_CloakHostModeX, Hash(Mask_Buffer)); + strlcpy(Cloak_Buffer, Client->host, GETID_LEN); + strlcat(Cloak_Buffer, Conf_CloakHostSalt, GETID_LEN); + snprintf(Cloak_Buffer, GETID_LEN, Conf_CloakHostModeX, Hash(Cloak_Buffer)); } else { strncpy(Cloak_Buffer, Client_ID(Client->introducer), GETID_LEN); }