Skip to content

Commit d9a9a83

Browse files
authored
Merge pull request #3166 from Shikachuu/fix-login-username
Add repository login component username validation
2 parents d9d133c + f630815 commit d9a9a83

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/nerdctl/login.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ func processLoginOptions(cmd *cobra.Command) (types.LoginCommandOptions, error)
6262
return types.LoginCommandOptions{}, err
6363
}
6464

65+
if strings.Contains(username, ":") {
66+
return types.LoginCommandOptions{}, errors.New("username cannot contain colons")
67+
}
68+
6569
if password != "" {
6670
log.L.Warn("WARNING! Using --password via the CLI is insecure. Use --password-stdin.")
6771
if passwordStdin {

0 commit comments

Comments
 (0)