aboutsummaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorTomSweeneyRedHat <tsweeney@redhat.com>2020-09-24 19:33:34 -0400
committerTomSweeneyRedHat <tsweeney@redhat.com>2020-10-13 19:30:08 -0400
commit33366a2cda518fafed0e72cf6e53b55abfa3c5e5 (patch)
treec35ad7ea24989b8259857dc0103dc28ab259b64e /pkg/util
parentd1ba9ce555099ad4cf2fd49c4598edaae0bfe0e4 (diff)
downloadpodman-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/util')
-rw-r--r--pkg/util/utils.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index c3a70e2fb..91aba9fa7 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -474,8 +474,8 @@ func getTomlStorage(storeOptions *storage.StoreOptions) *tomlConfig {
config.Storage.RunRoot = storeOptions.RunRoot
config.Storage.GraphRoot = storeOptions.GraphRoot
for _, i := range storeOptions.GraphDriverOptions {
- s := strings.Split(i, "=")
- if s[0] == "overlay.mount_program" {
+ s := strings.SplitN(i, "=", 2)
+ if s[0] == "overlay.mount_program" && len(s) == 2 {
config.Storage.Options.MountProgram = s[1]
}
}