aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2015-08-30 15:31:13 +0000
committercassio <cassiopc@gmail.com>2015-08-30 15:31:13 +0000
commite71b036c9ecab82d8d8e4bbcfe3657fd671fca75 (patch)
treec9b773b828d092b6e1c67f09307cf88453c5ba0b
parent198dcd42b9a44a838020c05999dfb263ae1628e8 (diff)
downloadboca-e71b036c9ecab82d8d8e4bbcfe3657fd671fca75.tar.gz
boca-e71b036c9ecab82d8d8e4bbcfe3657fd671fca75.zip
small fixes
-rwxr-xr-xtools/boca-submit-run2
-rwxr-xr-xtools/boca-submit-run-cron5
-rwxr-xr-xtools/boca-submit-run-root12
3 files changed, 9 insertions, 10 deletions
diff --git a/tools/boca-submit-run b/tools/boca-submit-run
index f78fbd6..78e79bd 100755
--- a/tools/boca-submit-run
+++ b/tools/boca-submit-run
@@ -63,7 +63,7 @@ if [ -r "$5" ]; then
$runaux $temp
if [ "$?" == "2" ]; then
echo "$BOCASERVER: time-out - this will automatically retry soon, you should not worry"
- $runroot "$BOCASERVER" "$user" "$pass" "$nom" "$5"
+ $runroot $temp
fi
rm $temp
done
diff --git a/tools/boca-submit-run-cron b/tools/boca-submit-run-cron
index ace21d0..83f5b41 100755
--- a/tools/boca-submit-run-cron
+++ b/tools/boca-submit-run-cron
@@ -6,12 +6,15 @@ if [ "`id -u`" != "0" ]; then
fi
if [ -d /root/submissions ]; then
+ touch /root/submissions/placeholder.bocarun
runaux=`which boca-submit-run-aux`
if [ "$runaux" == "" ]; then
runaux=/var/www/boca/tools/boca-submit-run-aux
fi
for i in `ls /root/submissions/*.bocarun`; do
- $runaux "$i"
+ if [ "$i" != "/root/submissions/placeholder.bocarun" ]; then
+ $runaux "$i"
+ fi
done
fi
diff --git a/tools/boca-submit-run-root b/tools/boca-submit-run-root
index 60365cf..8a9fed7 100755
--- a/tools/boca-submit-run-root
+++ b/tools/boca-submit-run-root
@@ -5,19 +5,15 @@ if [ "`id -u`" != "0" ]; then
exit 1
fi
-if [ "$5" != "" ]; then
+fnam=`echo "$1" | tr -cd '[[:alnum:]]._-/'`
+if [ "$fnam" != "" -a -r "$fnam" ]; then
mkdir -p /root/submissions
chown root /root/submissions
chmod 700 /root/submissions
nom=/root/submissions/`date +%s%N`.bocarun.tmp
- echo "BOCASERVER=`echo "$1" | tr -cd '[[:alnum:]]._-'`" > "$nom"
- echo "user=`echo "$2" | tr -cd '[[:alnum:]]._-'`" >> "$nom"
- echo "pass=`echo "$3" | tr -cd '[[:alnum:]]._-'`" >> "$nom"
- echo "name=`echo "$4" | tr -cd '[[:alnum:]]._-'`" >> "$nom"
- echo -n "data=" >> "$nom"
- uuencode -m zzzzzzzzzz < `echo "$5" | tr -cd '[[:alnum:]]._-'` | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> "$nom"
- echo "" >> "$nom"
+ cat $fnam | tr -cd '[[:alnum:]]._+-/= ' > "$nom"
+
echo "dateerr=`date +%s`" >> "$nom"
uniq=`date +%sN`-`sha256sum "$1"`
uniq=`echo $uniq | sha256sum - | cut -f1 -d' '`