From 49a78929c61cbab0d25b49fdee43beac62fc9f66 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Thu, 21 Mar 2013 20:06:20 -0700 Subject: [PATCH] Repositories and tags can't have ':' in their name (to allow parsing the REPO:TAG notation) --- tags.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tags.go b/tags.go index 55a5135860..a26a2f196d 100644 --- a/tags.go +++ b/tags.go @@ -2,9 +2,11 @@ package docker import ( "encoding/json" + "fmt" "io/ioutil" "os" "path/filepath" + "strings" ) type TagStore struct { @@ -60,6 +62,12 @@ func (store *TagStore) Reload() error { } func (store *TagStore) Set(repoName, tag, revision string) error { + if strings.Contains(repoName, ":") { + return fmt.Errorf("Illegal repository name: %s", repoName) + } + if strings.Contains(repoName, ":") { + return fmt.Errorf("Illegal tag name: %s", tag) + } if err := store.Reload(); err != nil { return err }