From 7950472e0e4cd3d55d18604a382a192e44a6749c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 14 Jun 2016 20:09:28 +0200 Subject: [PATCH] Droopy: Make chmod optional. Droopy always does the chmod operation, if the option is set. On partitions with FAT it is not possible to execute this operation. Droopy may ran into issue in that situation. With that fix, the option won't be set on droopy start to prevent any chmod operation on FAT partitions. Fixes #154 --- CHANGELOG | 1 + Makefile | 1 + piratebox/piratebox/conf/piratebox.conf | 2 ++ piratebox/piratebox/init.d/piratebox | 4 +++- piratebox/piratebox/init.d/piratebox_alt | 4 +++- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5e14840..9bbe079 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,7 @@ CHANGELOG * [Changed] Send HTTP-Code 204 via PHP, much cleaner * [Changed] Update jQuery to 2.2.3, removes IE <=8 support * [Changed] Redirect happens now always to wished domain name +* [Changed] Droopy, make chmod operation optional (prevent errors on OpenWRT) * [Fix] License Adjustments * [Fix] Prevent JS Injection in Shoutbox * [Fix] Shoutbox: Missing blank between author and content diff --git a/Makefile b/Makefile index b1e94f0..012f8a3 100644 --- a/Makefile +++ b/Makefile @@ -64,6 +64,7 @@ $(OPENWRT_CONFIG_FOLDER): sed 's:DNSMASQ_INTERFACE="wlan0":DNSMASQ_INTERFACE="br-lan":' -i $@/piratebox.conf sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf + sed 's:DROOPY_CHMOD:#DROOPY_CHMOD:' -i $@/piratebox.conf sed 's:LEASE_FILE_LOCATION=$$PIRATEBOX_FOLDER/tmp/lease.file:LEASE_FILE_LOCATION=/tmp/lease.file:' -i $@/piratebox.conf sed 's:TIMESAVE_FORMAT="":TIMESAVE_FORMAT="+%C%g%m%d%H%M":' -i $@/piratebox.conf sed 's:FIREWALL_FETCH_DNS="yes":FIREWALL_FETCH_DNS="no":' -i $@/firewall.conf diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index e4acc74..87ac41c 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -129,7 +129,9 @@ IMAGE="$PIRATEBOX_FOLDER/src/$IMAGENAME" DROOPY_TXT="" DROOPY_PORT="8080" # Set correct permissions for an uploaded file +# The following line needs to be commented for FAT32 / vfat partitions DROOPY_CHMOD="755" + DROOPY_USERDIR="" # Uncomment line below for adding directory feature #DROOPY_USERDIR=" -u True " diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 0378a90..40a3e8b 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -173,7 +173,9 @@ case "$1" in if [ "$DROOPY_USE_USER" = "yes" ] ; then DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " fi - start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" --chmod $DROOPY_CHMOD $DROOPY_USERDIR $DROOPY_PORT + DROOPY_DO_CHMOD="" + test -n "$DROOPY_CHMOD" && DROOPY_DO_CHMOD="--chmod $DROOPY_CHMOD" + start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" $DROOPY_DO_CHMOD $DROOPY_USERDIR $DROOPY_PORT log_end_msg $? fi diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 7d382fc..06d76eb 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -167,7 +167,9 @@ case "$1" in if [ "$DROOPY_USE_USER" = "yes" ] ; then DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " fi - start-stop-daemon $DROOPY_USER -m -S -b -p $PIDFILE_DROOPY -x $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" --chmod $DROOPY_CHMOD $DROOPY_USERDIR $DROOPY_PORT + DROOPY_DO_CHMOD="" + test -n "$DROOPY_CHMOD" && DROOPY_DO_CHMOD="--chmod $DROOPY_CHMOD" + start-stop-daemon $DROOPY_USER -m -S -b -p $PIDFILE_DROOPY -x $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" $DROOPY_DO_CHMOD $DROOPY_USERDIR $DROOPY_PORT echo $? fi