Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Make native filesystem directory permissions configurable to support shared POSIX ACL access

Đang mở Phù hợp với người mới
#15,566 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
laravel, php
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu tại src/Filesystem/AbstractAdapter.php::makeDirectory(), nơi chế độ 0755 được hardcode, và tại src/Providers/ViewServiceProvider.php::boot(), nơi kích hoạt việc tạo thư mục storage/statamic/tmp/nocache trong lúc khởi động. Thêm cài đặt directory_permissions với giá trị mặc định 0755 trong config/statamic/system.php và đọc nó tại chỗ mà makeDirectory truyền chế độ, không đụng tới cấu hình của static page writer cũng không chmod các thư mục đã tồn tại. Coi như hoàn thành khi một cấu hình 0775/0770 được dùng cho các thư mục được tạo mới (được bao phủ bởi một test trên adapter gốc) trong khi hành vi mặc định vẫn không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug description

Statamic’s native filesystem adapter creates directories with a hardcoded 0755 mode. On Linux deployments where CLI and web processes use different Unix accounts and share write access through POSIX ACLs, this restricts the inherited access ACL mask to r-x.

The named user entries are inherited, but their effective write permission is removed. This can prevent Blade nocache fragments from being written:

file_put_contents(.../storage/statamic/tmp/nocache/_nocache….blade.php):
Failed to open stream: Permission denied

The permission mechanism was reproduced locally using Statamic’s native filesystem adapter.

Relevant code

This path uses the native filesystem adapter, so Laravel disk permissions configured in config/filesystems.php do not affect it. The static page writer’s configurable permissions also do not cover these temporary Blade views.

Reproduction
Proposed change

Expose the native filesystem directory creation mode through configuration, preserving 0755 as the default for backwards compatibility.

For example, introduce a setting in config/statamic/system.php:

'directory_permissions' => 0755,

The native adapter would use that configured mode instead of the hardcoded value. Deployments using shared group or ACL access could choose 0775 or 0770.

This should affect newly created directories only, without recursively changing existing permissions or altering the separate static page writer configuration.

Expected behavior

With a configured mode of 0775 or 0770, inherited ACL write permissions remain effective for the other account, allowing CLI and web processes to share Statamic’s temporary directories.

Changing the process umask alone cannot solve this: it cannot add the group-class write bit missing from the explicitly requested 0755 mode.

How to reproduce

In a disposable application checkout:

  1. Use different Unix accounts for CLI commands and web requests.
  2. Grant both accounts write access to storage/statamic through access and default ACLs, with a default mask of rwx.
  3. Start with storage/statamic/tmp/nocache absent.
  4. Boot the application through a CLI command.
  5. Render a Blade template containing a nocache region through the web account.

Directories created by the CLI account inherit ACLs like:

user::rwx
user:web_account:rwx       #effective:r-x
group::rwx                #effective:r-x
mask::r-x
default:user:web_account:rwx
default:mask::rwx

The web account cannot create the fragment. The directory owner retains write access; the failure affects the other account accessing it through the masked ACL entries.

Restoring the access mask allows writing again:

setfacl -R -m m::rwX storage/statamic/tmp
Logs

Environment
- Statamic: 6.34.1
- Laravel: 12.69.3
Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Ngôn ngữ chính
PHP
Star
4.9k
Fork
647
Merge trung bình
1 ngày 20 giờ
Pull request đã merge (30 ngày)
113

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của statamic/cms

Tất cả issue của statamic/cms

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.