From 065a50d90ea8c4294101e6ebcd6760f1de5a9135 Mon Sep 17 00:00:00 2001
From: Evan Su <48808396+HACKERALERT@users.noreply.github.com>
Date: Sun, 13 Apr 2025 18:54:00 -0400
Subject: [PATCH] fix: 0700 instead of 0600 for mkdirall
---
Changelog.md | 2 +-
src/Picocrypt.go | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Changelog.md b/Changelog.md
index 60a5a05..87ac649 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -11,7 +11,7 @@
✓ Encrypt previously unencrypted temporary zip files
✓ Add `.incomplete` to filenames while work is in progress
✓ Use `encrypted-*.zip.pcv` output name instead of `Encrypted.zip.pcv`
- ✓ Use 0600 permissions when auto unzipping for optimal security
+ ✓ Use 0700 permissions when auto unzipping and creating folders
# v1.47 (Released 02/19/2025)
diff --git a/src/Picocrypt.go b/src/Picocrypt.go
index 339be2b..dcd25fe 100644
--- a/src/Picocrypt.go
+++ b/src/Picocrypt.go
@@ -2486,7 +2486,7 @@ func unpackArchive(zipPath string) error {
// Make directory if current entry is a folder
if f.FileInfo().IsDir() {
- if err := os.MkdirAll(outPath, f.Mode()); err != nil {
+ if err := os.MkdirAll(outPath, 0700); err != nil {
return err
}
}
@@ -2505,7 +2505,7 @@ func unpackArchive(zipPath string) error {
outPath := filepath.Join(extractDir, f.Name)
// Otherwise create necessary parent directories
- if err := os.MkdirAll(filepath.Dir(outPath), 0600); err != nil {
+ if err := os.MkdirAll(filepath.Dir(outPath), 0700); err != nil {
return err
}