commit
c814466e15
|
|
@ -40,6 +40,9 @@ var whitelist = []string{
|
||||||
// which leads to a special mount on the /var/run/docker.sock file itself, but the directory to exist
|
// which leads to a special mount on the /var/run/docker.sock file itself, but the directory to exist
|
||||||
// in the image with no way to tell if it came from the base image or not.
|
// in the image with no way to tell if it came from the base image or not.
|
||||||
"/var/run",
|
"/var/run",
|
||||||
|
// similarly, we whitelist /etc/mtab, since there is no way to know if the file was mounted or came
|
||||||
|
// from the base image
|
||||||
|
"/etc/mtab",
|
||||||
}
|
}
|
||||||
var volumeWhitelist = []string{}
|
var volumeWhitelist = []string{}
|
||||||
|
|
||||||
|
|
@ -194,7 +197,6 @@ func extractFile(dest string, hdr *tar.Header, tr io.Reader) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
currFile.Close()
|
currFile.Close()
|
||||||
|
|
||||||
case tar.TypeDir:
|
case tar.TypeDir:
|
||||||
logrus.Debugf("creating dir %s", path)
|
logrus.Debugf("creating dir %s", path)
|
||||||
if err := os.MkdirAll(path, mode); err != nil {
|
if err := os.MkdirAll(path, mode); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ func Test_fileSystemWhitelist(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
actualWhitelist, err := fileSystemWhitelist(path)
|
actualWhitelist, err := fileSystemWhitelist(path)
|
||||||
expectedWhitelist := []string{"/kaniko", "/proc", "/dev", "/dev/pts", "/sys", "/var/run"}
|
expectedWhitelist := []string{"/kaniko", "/proc", "/dev", "/dev/pts", "/sys", "/var/run", "/etc/mtab"}
|
||||||
sort.Strings(actualWhitelist)
|
sort.Strings(actualWhitelist)
|
||||||
sort.Strings(expectedWhitelist)
|
sort.Strings(expectedWhitelist)
|
||||||
testutil.CheckErrorAndDeepEqual(t, false, err, expectedWhitelist, actualWhitelist)
|
testutil.CheckErrorAndDeepEqual(t, false, err, expectedWhitelist, actualWhitelist)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue