diff --git a/ego/premain/core/core.go b/ego/premain/core/core.go index 99e9a91..32a8c0a 100644 --- a/ego/premain/core/core.go +++ b/ego/premain/core/core.go @@ -51,7 +51,7 @@ func PreMain(payload string, mounter Mounter, fs afero.Fs, hostEnviron []string) // Convert host environment string array to key-value map hostEnvironMap := make(map[string]string, len(hostEnviron)) for _, envVar := range hostEnviron { - splitString := strings.Split(envVar, "=") + splitString := strings.SplitN(envVar, "=", 2) hostEnvironMap[splitString[0]] = splitString[1] } diff --git a/ego/premain/core/core_test.go b/ego/premain/core/core_test.go index 0c56018..658d7d8 100644 --- a/ego/premain/core/core_test.go +++ b/ego/premain/core/core_test.go @@ -33,7 +33,7 @@ func TestPremain(t *testing.T) { assert := assert.New(t) require := require.New(t) - hostEnviron := []string{"EDG_CWD=/host"} + hostEnviron := []string{"EDG_CWD=/host", "EDG_CONTAINS_EQUAL_SIGN=foo=bar"} fs := afero.NewMemMapFs() // sane default values @@ -51,6 +51,7 @@ func TestPremain(t *testing.T) { // Supply valid payload, no Marble mounter := assertionMounter{assert: assert, expectedMounts: conf.Mounts, usedTargets: make(map[string]bool), remountAsHostFS: false} assert.NoError(PreMain("", &mounter, fs, hostEnviron)) + assert.Equal("foo=bar", os.Getenv("EDG_CONTAINS_EQUAL_SIGN")) // Supply valid payload, no Marble payload, err := json.Marshal(conf)