From 28d7a0fa2f0ed8629e994dc9f89cfaf5fb8e30f4 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Wed, 10 Jan 2018 21:36:50 +0000
Subject: [PATCH] Write permissions to data directory

---
 src/freedombone-app-privatebin | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/freedombone-app-privatebin b/src/freedombone-app-privatebin
index c4cc6cc79..9535deb89 100755
--- a/src/freedombone-app-privatebin
+++ b/src/freedombone-app-privatebin
@@ -54,10 +54,9 @@ function secure_privatebin {
 
     find "${pbpath}/" -type f -print0 | xargs -0 chmod 0640
     find "${pbpath}/" -type d -print0 | xargs -0 chmod 0550
-    find "${pbdata}/" -type f -print0 | xargs -0 chmod 0640
-    find "${pbdata}/" -type d -print0 | xargs -0 chmod 0750
 
     chown -R ${rootuser}:${htgroup} "${pbpath}/"
+    chown -R www-data:www-data ${pbdata}
 }
 
 function logging_on_privatebin {
@@ -442,6 +441,8 @@ function install_privatebin {
     sed -i 's|sizelimit =.*|sizelimit = 32768|g' /var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php
     sed -i 's|defaultformatter =.*|defaultformatter = "markdown"|g' /var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php
 
+    mkdir -p /var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/data
+
     secure_privatebin
 
     systemctl restart php7.0-fpm
-- 
GitLab