1
0
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:
Giuseppe Scrivano
2025-03-20 11:44:16 +01:00
parent 4dcc397ac5
commit 2031709a69

View File

@@ -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)
}