Set umask to 0000 while overlays are being built. Fixes #584

This commit is contained in:
David McFarlane
2023-01-18 14:30:15 +11:00
parent 1df6f6229e
commit 950099f9dc
2 changed files with 5 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import (
"path/filepath"
"regexp"
"strings"
"syscall"
"text/template"
"github.com/hpcng/warewulf/internal/pkg/node"
@@ -197,6 +198,9 @@ func BuildOverlayIndir(nodeInfo node.NodeInfo, overlayNames []string, outputDir
return errors.Errorf("overlay names contains illegal characters: %v", overlayNames)
}
// Temporarily set umask to 0000, so directories in the overlay retain permissions
defer syscall.Umask(syscall.Umask(0))
wwlog.Verbose("Processing node/overlay: %s/%s", nodeInfo.Id.Get(), strings.Join(overlayNames, "-"))
for _, overlayName := range overlayNames {
wwlog.Verbose("Building overlay %s for node %s in %s", overlayName, nodeInfo.Id.Get(), outputDir)