浏览代码

Ensure correct permissions on data directory during upgrades

Bob Mottram 7 年前
父节点
当前提交
a14781337f
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5
    4
      src/freedombone-app-privatebin

+ 5
- 4
src/freedombone-app-privatebin 查看文件

@@ -154,15 +154,16 @@ function reconfigure_privatebin {
154 154
 }
155 155
 
156 156
 function upgrade_privatebin {
157
+    if grep -q "privatebin domain" "$COMPLETION_FILE"; then
158
+        PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
159
+    fi
160
+    chmod 755 "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/data"
161
+
157 162
     CURR_PRIVATEBIN_COMMIT=$(get_completion_param "privatebin commit")
158 163
     if [[ "$CURR_PRIVATEBIN_COMMIT" == "$PRIVATEBIN_COMMIT" ]]; then
159 164
         return
160 165
     fi
161 166
 
162
-    if grep -q "privatebin domain" "$COMPLETION_FILE"; then
163
-        PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
164
-    fi
165
-
166 167
     # update to the next commit
167 168
     function_check set_repo_commit
168 169
     set_repo_commit "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs" "privatebin commit" "$PRIVATEBIN_COMMIT" "$PRIVATEBIN_REPO"