File tree Expand file tree Collapse file tree
internal/plugins/command-runner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -299,11 +299,11 @@ func (e *Executor) GetAllowedVMCommands(vm VM) []string {
299299func (e * Executor ) AddToWhitelist (targetType TargetType , command string ) {
300300 switch targetType {
301301 case TargetHost :
302- e .config .AllowedCommands .Host = append (e .config .AllowedCommands .Host , command )
302+ e .config .AllowedCommands .Host = append ([] string { command }, e .config .AllowedCommands .Host ... )
303303 case TargetContainer :
304- e .config .AllowedCommands .Container = append (e .config .AllowedCommands .Container , command )
304+ e .config .AllowedCommands .Container = append ([] string { command }, e .config .AllowedCommands .Container ... )
305305 case TargetVM :
306- e .config .AllowedCommands .VM = append (e .config .AllowedCommands .VM , command )
306+ e .config .AllowedCommands .VM = append ([] string { command }, e .config .AllowedCommands .VM ... )
307307 }
308308 // Refresh the validator so it picks up the new entry.
309309 e .validator = NewValidator (e .config )
You can’t perform that action at this time.
0 commit comments