diff options
author | TomSweeneyRedHat <tsweeney@redhat.com> | 2020-09-24 19:33:34 -0400 |
---|---|---|
committer | TomSweeneyRedHat <tsweeney@redhat.com> | 2020-10-13 19:30:08 -0400 |
commit | 33366a2cda518fafed0e72cf6e53b55abfa3c5e5 (patch) | |
tree | c35ad7ea24989b8259857dc0103dc28ab259b64e /pkg/spec/security.go | |
parent | d1ba9ce555099ad4cf2fd49c4598edaae0bfe0e4 (diff) | |
download | podman-33366a2cda518fafed0e72cf6e53b55abfa3c5e5.tar.gz podman-33366a2cda518fafed0e72cf6e53b55abfa3c5e5.tar.bz2 podman-33366a2cda518fafed0e72cf6e53b55abfa3c5e5.zip |
Convert Split() calls with an equal sign to SplitN()
After seeing #7759, I decided to look at the calls in
Podman and Buildah to see if we had issues with strings.Split()
calls where an "=" (equals) sign was in play and we expected
to split on only the first one.
There were only one or two that I found in here that I think
might have been troubling, the remainder are just adding
some extra safety.
I also had another half dozen or so that were checking length
expectations appropriately, those I left alone.
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Diffstat (limited to 'pkg/spec/security.go')
-rw-r--r-- | pkg/spec/security.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/spec/security.go b/pkg/spec/security.go index e152e3495..5f7db7edb 100644 --- a/pkg/spec/security.go +++ b/pkg/spec/security.go @@ -178,7 +178,7 @@ func (c *SecurityConfig) ConfigureGenerator(g *generate.Generator, user *UserCon for _, opt := range c.SecurityOpts { // Split on both : and = - splitOpt := strings.Split(opt, "=") + splitOpt := strings.SplitN(opt, "=", 2) if len(splitOpt) == 1 { splitOpt = strings.Split(opt, ":") } |