diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-22 18:35:01 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-22 18:35:01 +0100 |
commit | cbd4cb507bcbeaa721e23baef7e5da6aa34e8214 (patch) | |
tree | ee946491a62464125c56423b536467a9424b4070 | |
parent | 5bd2e73ac8911372ff7abffb491566f6fd5c9b1c (diff) | |
download | gitano-cbd4cb507bcbeaa721e23baef7e5da6aa34e8214.tar.gz |
USERCOMMAND: Ensure sshkey is validating tag names
-rw-r--r-- | lib/gitano/usercommand.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitano/usercommand.lua b/lib/gitano/usercommand.lua index bf8791a..4a28fde 100644 --- a/lib/gitano/usercommand.lua +++ b/lib/gitano/usercommand.lua @@ -119,6 +119,12 @@ local function builtin_sshkey_validate(config, _, cmdline) log.error("sshkey", cmdline[2] .. ": Expected tag and no more") return false end + if not cmdline[3]:match("^[a-z][a-z0-9_-]+$") then + log.error("sshkey:", cmdline[3], "is not a valid tag name.") + log.state("Tag names start with a letter and may contain only letters") + log.state("and numbers, underscores and dashes. Tag names must be at") + log.state("least two characters long.") + end else log.error("sshkey: Unknown subcommand", cmdline[2]) return false |