From b0df67acd310939f155271a42ae63cd18d75524d Mon Sep 17 00:00:00 2001 From: Diogo Monica Date: Wed, 17 Jun 2015 22:06:37 -0700 Subject: [PATCH] Added small validation to GUNs, changed logrus loglevel --- cmd/notary/keys.go | 5 ++++- cmd/notary/main.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/notary/keys.go b/cmd/notary/keys.go index a562f984e3..95047a6fa4 100644 --- a/cmd/notary/keys.go +++ b/cmd/notary/keys.go @@ -162,8 +162,11 @@ func keysGenerate(cmd *cobra.Command, args []string) { fatalf("must specify a GUN") } - // (diogo): Validate GUNs + //TODO (diogo): Validate GUNs. Don't allow '/' or '\' for now. gun := args[0] + if gun[0:1] == "/" || gun[0:1] == "\\" { + fatalf("invalid Global Unique Name: %s", gun) + } _, cert, err := generateKeyAndCert(gun) if err != nil { diff --git a/cmd/notary/main.go b/cmd/notary/main.go index 69afe31d05..8b8f9ebed7 100644 --- a/cmd/notary/main.go +++ b/cmd/notary/main.go @@ -26,7 +26,7 @@ const tufDir string = configPath + "tuf/" var caStore trustmanager.X509Store func init() { - logrus.SetLevel(logrus.DebugLevel) + logrus.SetLevel(logrus.ErrorLevel) // Retrieve current user to get home directory usr, err := user.Current() if err != nil {