Skip to content

Commit

Permalink
Ensure rq_config.py permissions are restored on next upgrade
Browse files Browse the repository at this point in the history
In a future 2.10.1 upgrade, the global chown over /var/www/securedrop
would've blown away rq_config.py's root:www-data ownership, breaking
read access for www-data. Add an exclusion, just like the existing one
for config.py.
  • Loading branch information
legoktm committed Sep 18, 2024
1 parent 71502d5 commit b46ee14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion securedrop/debian/securedrop-app-code.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,16 @@ case "$1" in
chown -R root:root /var/www/securedrop
chmod 755 /var/www/securedrop

# Make sure config.py is owned by root and readable by www-data,
# Make sure config.py and rq_config.py are owned by root and readable by www-data,
# but not world-readable
if [ -f "/var/www/securedrop/config.py" ]; then
chown root:www-data /var/www/securedrop/config.py
chmod 640 /var/www/securedrop/config.py
fi
if [ -f "/var/www/securedrop/rq_config.py" ]; then
chown root:www-data /var/www/securedrop/rq_config.py
chmod 640 /var/www/securedrop/rq_config.py
fi
# And logo needs to be writable by webserver user
# If there's no custom logo yet, copy the default in its place
if [ ! -f "/var/www/securedrop/static/i/custom_logo.png" ]; then
Expand Down

0 comments on commit b46ee14

Please sign in to comment.