(#3767) Some protection from malicious qvms - patches and ideas by Amanieu d'Antras and Ben Millwood

This commit is contained in:
Thilo Schulz 2011-03-08 01:39:34 +00:00
parent 657c791257
commit 8c3f320504
12 changed files with 155 additions and 26 deletions

View file

@ -430,6 +430,9 @@ void Cmd_RemoveCommand( const char *cmd_name );
typedef void (*completionFunc_t)( char *args, int argNum );
// don't allow VMs to remove system commands
void Cmd_RemoveCommandSafe( const char *cmd_name );
void Cmd_CommandCompletion( void(*callback)(const char *s) );
// callback with each valid string
void Cmd_SetCommandCompletionFunc( const char *command,
@ -501,11 +504,15 @@ void Cvar_Update( vmCvar_t *vmCvar );
void Cvar_Set( const char *var_name, const char *value );
// will create the variable with no flags if it doesn't exist
void Cvar_SetSafe( const char *var_name, const char *value );
// sometimes we set variables from an untrusted source: fail if flags & CVAR_PROTECTED
void Cvar_SetLatched( const char *var_name, const char *value);
// don't set the cvar immediately
void Cvar_SetValue( const char *var_name, float value );
// expands value to a string and calls Cvar_Set
void Cvar_SetValueSafe( const char *var_name, float value );
// expands value to a string and calls Cvar_Set/Cvar_SetSafe
float Cvar_VariableValue( const char *var_name );
int Cvar_VariableIntegerValue( const char *var_name );