mirror of
https://github.com/containers/buildah.git
synced 2026-02-05 09:45:38 +01:00
linux: accept unmask paths as glob values
That is the same configuration used already by Podman. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
12
run_linux.go
12
run_linux.go
@@ -1233,9 +1233,17 @@ func setupMaskedPaths(g *generate.Generator, opts *define.CommonBuildOptions) {
|
||||
if slices.Contains(opts.Unmasks, "all") {
|
||||
return
|
||||
}
|
||||
nextMaskedPath:
|
||||
for _, mp := range append(config.DefaultMaskedPaths(), opts.Masks...) {
|
||||
if slices.Contains(opts.Unmasks, mp) {
|
||||
continue
|
||||
for _, unmask := range opts.Unmasks {
|
||||
match, err := filepath.Match(unmask, mp)
|
||||
if err != nil {
|
||||
logrus.Warnf("Invalid unmask pattern %q: %v", unmask, err)
|
||||
continue
|
||||
}
|
||||
if match {
|
||||
continue nextMaskedPath
|
||||
}
|
||||
}
|
||||
g.AddLinuxMaskedPaths(mp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user