summaryrefslogtreecommitdiff
path: root/src/editor/simple/upload.cgi
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2011-07-07 16:57:59 +0000
committerhallgren <hallgren@chalmers.se>2011-07-07 16:57:59 +0000
commitc4f1fbbc9ad7efb7ec1e0286f8659f299c2330b8 (patch)
treef4465f48e0b4f633312e0839149c75f1a6bca417 /src/editor/simple/upload.cgi
parentc7fffd861b4fa74afc450be2970cd8cf63f64a88 (diff)
gfse: grammars in the cloud, still primitve, but good enough to be installed on the server, I think
Diffstat (limited to 'src/editor/simple/upload.cgi')
-rw-r--r--src/editor/simple/upload.cgi18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/editor/simple/upload.cgi b/src/editor/simple/upload.cgi
index ec262a062..18d584b54 100644
--- a/src/editor/simple/upload.cgi
+++ b/src/editor/simple/upload.cgi
@@ -145,6 +145,7 @@ case "$REQUEST_METHOD" in
ContentType="text/plain; charset=$charset"
cgiheaders
cd "$path"
+ shopt -s nullglob
echo_n *-*.json
else
error404
@@ -162,6 +163,7 @@ case "$REQUEST_METHOD" in
ContentType="text/plain; charset=$charset"
cgiheaders
cd "$path"
+ shopt -s nullglob
rm *.gf *.gfo *-*.json *.pgf grammars.cgi
cd ..
rmdir "$path"
@@ -195,6 +197,22 @@ case "$REQUEST_METHOD" in
*) error400
esac
;;
+ rm=*)
+ file=$(qparse "$QUERY_STRING" rm)
+ case "$file" in
+ /tmp/gfse.*/*.json) # shouldn't allow .. in path !!!
+ path="$documentRoot$file"
+ if [ -r "$path" ] ; then
+ ContentType="text/javascript; charset=$charset"
+ cgiheaders
+ rm "$path"
+ else
+ error404
+ fi
+ ;;
+ *) error400
+ esac
+ ;;
*) error400
esac
esac