Windows fixes
This commit is contained in:
parent
41b9fea146
commit
1b69e6294d
7 changed files with 30 additions and 20 deletions
|
|
@ -34,7 +34,7 @@ const (
|
|||
)
|
||||
|
||||
var safeArgs = map[string]ArgAcceptedValue{
|
||||
"accel": ArgAcceptedValueString,
|
||||
"accel": ArgAcceptedValueKeyValue,
|
||||
"boot": ArgAcceptedValueString,
|
||||
"m": ArgAcceptedValueUint,
|
||||
"smp": ArgAcceptedValueUint,
|
||||
|
|
|
|||
|
|
@ -69,11 +69,6 @@ func NewKeyValueArg(key string, items []KeyValueArgItem) (*KeyValueArg, error) {
|
|||
return nil, fmt.Errorf("empty key not allowed")
|
||||
}
|
||||
|
||||
if len(item.Value) == 0 {
|
||||
// Values *can* be empty, though. We do not allow them for consistency.
|
||||
return nil, fmt.Errorf("empty value for key '%v' is not allowed", item.Key)
|
||||
}
|
||||
|
||||
err := validateArgStrValue(item.Key)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "validate key '%v'", item.Key)
|
||||
|
|
|
|||
|
|
@ -45,5 +45,9 @@ func validateArgStrValue(s string) error {
|
|||
return fmt.Errorf("backslashes are not allowed")
|
||||
}
|
||||
|
||||
if strings.Contains(s, "=") {
|
||||
return fmt.Errorf("equals sign is not allowed")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue