-
Notifications
You must be signed in to change notification settings - Fork 0
Fix umask configuration to enable group-writable files #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: kurowski <7466+kurowski@users.noreply.github.com>
Co-authored-by: kurowski <7466+kurowski@users.noreply.github.com>
Dockerfile
Outdated
|
|
||
| # Change default umask and add user to web group so we can share write permission on web files | ||
| RUN sed -i 's/^UMASK\s*022/UMASK 002/' /etc/login.defs | ||
| RUN sed -i 's/^UMASK[[:space:]]*022/UMASK\t\t002/' /etc/login.defs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't see UMASK in /etc/login.defs anymore. perhaps it was moved in between debian 12 (our original base image) and debian 13 (which we recently upgraded to)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I've updated the approach to configure pam_umask directly instead of relying on /etc/login.defs. The new implementation sets umask=002 as a parameter to pam_umask.so in the PAM configuration files (/etc/pam.d/common-session and /etc/pam.d/common-session-noninteractive), which works regardless of whether UMASK exists in /etc/login.defs. This makes it compatible with both Debian 12 and 13. (67e626a)
Co-authored-by: kurowski <7466+kurowski@users.noreply.github.com>
Co-authored-by: kurowski <7466+kurowski@users.noreply.github.com>
The umask was reverting to
022instead of002, preventing Apache and vscode users from both writing to log files and shared directories.Root Cause
UMASK was removed from
/etc/login.defsin Debian 13 (the base image was recently upgraded from Debian 12). The original fix attempted to modify this file, but the setting no longer exists there.Changes
Dockerfile
pam_umaskdirectly withumask=002parameter in PAM configuration files (/etc/pam.d/common-sessionand/etc/pam.d/common-session-noninteractive)/etc/login.defs, making it compatible with both Debian 12 and 13umask 002to/etc/apache2/envvarsfor Apache processesrefresh_content.sh
chmod -R g+w web/sites/default/filesas temporary workaround until new containers are rebuiltTechnical Details
PAM's
pam_umaskmodule accepts a directumask=parameter, which is more robust than relying on/etc/login.defs. The sed pattern simply addsumask=002afterpam_umask.soin the PAM configuration files.Original prompt
<issue_description>We seem to be back to
022for the umask. This breaks local logging.Step 1: add
chmod -R g+w web/sites/default/filestouceap refresh-contentas temporary workaroundStep 2: fix the umask (again).</issue_description>
Comments on the Issue (you are @copilot in this section)
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.