git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6019
d7cf8633-e32d-0410-b094-
e92efae38249
*/
void Host_Rcon_f (void) // credit: taken from QuakeWorld
{
+ int i;
lhnetaddress_t to;
lhnetsocket_t *mysocket;
- if (!rcon_password.string)
+ if (!rcon_password.string || !rcon_password.string[0])
{
Con_Printf ("You must set rcon_password before issuing an rcon command.\n");
return;
}
+ for (i = 0;rcon_password.string[i];i++)
+ {
+ if (rcon_password.string[i] <= ' ')
+ {
+ Con_Printf("rcon_password is not allowed to have any whitespace.\n");
+ return;
+ }
+ }
+
if (cls.netcon)
to = cls.netcon->peeraddress;
else
if (i < (int)sizeof(password) - 1)
password[i++] = *s;
password[i] = 0;
- if (!strcmp(rcon_password.string, password))
+ if (password[0] > ' ' && !strcmp(rcon_password.string, password))
{
// looks like a legitimate rcon command with the correct password
Con_Printf("server received rcon command from %s:\n%s\n", host_client ? host_client->name : addressstring2, s);