config: reject remote names starting with a dash. (#4261)

This commit is contained in:
jtagcat
2020-06-16 13:34:03 +03:00
committed by Nick Craig-Wood
parent 62650a3eb3
commit 2d88d24881
2 changed files with 8 additions and 0 deletions

View File

@@ -23,6 +23,9 @@ func TestCheckConfigName(t *testing.T) {
{"rem\\ote", errInvalidCharacters},
{"[remote", errInvalidCharacters},
{"*", errInvalidCharacters},
{"-remote", errCantStartWithDash},
{"r-emote-", nil},
{"_rem_ote_", nil},
} {
got := CheckConfigName(test.in)
assert.Equal(t, test.want, got, test.in)