aboutsummaryrefslogtreecommitdiff
path: root/tools/boca-submit-run-root
diff options
context:
space:
mode:
Diffstat (limited to 'tools/boca-submit-run-root')
-rwxr-xr-xtools/boca-submit-run-root12
1 files changed, 4 insertions, 8 deletions
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' '`