commit: f6c270fbd28d0821db85ee6f8db1b7edb9d2c524
parent 3bcff8290596925bbae2095ac7907eb4b30d2d6f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 2 Oct 2021 21:44:51 +0200
Add CVE client
Diffstat:
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/cgi-bin/cve b/cgi-bin/cve
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if test -n "$1"
+then
+ print '20 text/gemini; charset=utf-8\r\n'
+ /git/cve-client.work/cve-client.pl -g "$1"
+else
+ print '10 Please enter a CVE-ID\r\n'
+fi
diff --git a/index.gmi b/index.gmi
@@ -20,6 +20,9 @@ Hello, Haelwenn (lanodan) Monnier here :)
=> /cgi-bin/mdate 24.5h-cycle clock (m stands for Mars/My)
=> /cgi-src/mdate.c Source code of that 24.5h-cycle clock
+=> /cgi-bin/cve CVE.org client, gemini argument is the CVE-ID
+=> https://hacktivis.me/git/cve-client/ Source code of that CVE client
+
## Contact
=> mailto:contact+gemini@hacktivis.me
=> xmpp:contact@hacktivis.me
diff --git a/server.sh b/server.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2020 Haelwenn (lanodan) Monnier <contact+gemini@hacktivis.me>
+# Copyright 2020-2021 Haelwenn (lanodan) Monnier <contact+gemini@hacktivis.me>
# Distributed under the terms of the GNU Affero General Public License version 3
# AGPL-3 because it's a service on the internet, screw permissive licences for these
@@ -19,7 +19,7 @@ IFS=#'
query="${line#gemini://}"
query="${query%%../*}"
query="${query//%20/ }"
-path="$GEMDIR/${query}"
+path="$GEMDIR/${query//\?*}"
status="--"
if echo $path | egrep -q '.gmi$'
@@ -36,7 +36,12 @@ then
if [ -x "$path" -a -f "$path" ]
then
cd "${GEMDIR}/"
- env -i PATH=/var/empty/ "$query"
+ if echo $query | egrep -q '\?'
+ then
+ sandbox --ns-on --ns-ipc-on --ns-mnt-on --ns-pid-on --ns-user-on "./${query//\?*}" "${query//*\?}"
+ else
+ sandbox --ns-on --ns-ipc-on --ns-mnt-on --ns-pid-on --ns-user-on "./${query}" ""
+ fi
status="x$?"
else
status="50"