mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
release/dist/qnap: update perms for tmpDir files
Allows all users to read all files, and .sh/.cgi files to be executable. Updates tailscale/tailscale-qpkg#135 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
parent
14ac41febc
commit
5d4b4ffc3c
9
release/dist/qnap/pkgs.go
vendored
9
release/dist/qnap/pkgs.go
vendored
@ -14,6 +14,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"slices"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"tailscale.com/release/dist"
|
"tailscale.com/release/dist"
|
||||||
@ -160,15 +161,15 @@ func newQNAPBuilds(b *dist.Build, signer *signer) (*qnapBuilds, error) {
|
|||||||
}
|
}
|
||||||
outPath := filepath.Join(m.tmpDir, path)
|
outPath := filepath.Join(m.tmpDir, path)
|
||||||
if d.IsDir() {
|
if d.IsDir() {
|
||||||
return os.MkdirAll(outPath, 0700)
|
return os.MkdirAll(outPath, 0755)
|
||||||
}
|
}
|
||||||
file, err := fs.ReadFile(buildFiles, path)
|
file, err := fs.ReadFile(buildFiles, path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
perm := fs.FileMode(0600)
|
perm := fs.FileMode(0644)
|
||||||
if filepath.Ext(path) == ".sh" {
|
if slices.Contains([]string{".sh", ".cgi"}, filepath.Ext(path)) {
|
||||||
perm = 0700
|
perm = 0755
|
||||||
}
|
}
|
||||||
return os.WriteFile(outPath, file, perm)
|
return os.WriteFile(outPath, file, perm)
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user