diff options
Diffstat (limited to 'src/editor/simple/upload.cgi')
| -rw-r--r-- | src/editor/simple/upload.cgi | 18 |
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 |
