aboutsummaryrefslogtreecommitdiffhomepage
path: root/pkg/pkg.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-09-18 19:37:20 +0900
committerOphestra <cat@gensokyo.uk>2026-09-18 19:37:20 +0900
commitd189b1c0fba1fe8bd1ec3968806c3b019690a4c2 (patch)
tree6975946948f16b8806dccf26c37d339e9136c9ec /pkg/pkg.go
parent4728f58ba88fad76ddb5ceee64ec26ac58d6cd99 (diff)
pkg: make status world-readablestaging
These files may be inspected externally, mainly for the CI use case. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'pkg/pkg.go')
-rw-r--r--pkg/pkg.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkg/pkg.go b/pkg/pkg.go
index 75e0d1b1..e3d32028 100644
--- a/pkg/pkg.go
+++ b/pkg/pkg.go
@@ -206,7 +206,7 @@ func (t *TContext) prepareStatus(writeHeader bool) error {
if t.status, t.statusErr = os.OpenFile(
t.statusPath.String(),
syscall.O_CREAT|syscall.O_EXCL|syscall.O_WRONLY,
- 0400,
+ 0444,
); t.statusErr != nil {
return t.statusErr
}
@@ -2798,7 +2798,6 @@ func Open(
dirSubstitute,
dirIdentifier,
dirChecksum,
- dirStatus,
dirFault,
dirWork,
} {
@@ -2810,6 +2809,17 @@ func Open(
}
}
+ for _, name := range []string{
+ dirStatus,
+ } {
+ if err := os.MkdirAll(
+ base.Append(name).String(),
+ 0711,
+ ); err != nil && !errors.Is(err, os.ErrExist) {
+ return nil, err
+ }
+ }
+
c := Cache{
parent: ctx,