Recently Written · git

clic

MIRROR ONLY Gopher client with pretty colours in Common Lisp

git clone https://github.com/equwal/clic

Log | Files | Refs


commit be4bf91b222d03b0de1c9c83ab2afccbfa41dc28
Solene Rapenne <solene@perso.pw>
2018-06-21 10:53:10 +0200

restrain pledge in kiosk mode

 clic.lisp | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/clic.lisp b/clic.lisp
index f27a870..f2e7eeb 100644
--- a/clic.lisp
+++ b/clic.lisp
@@ -16,6 +16,10 @@
     void gotoPledge() {
        pledge(\"dns inet stdio rpath tty wpath cpath proc exec\",NULL);
     }
+
+    void kioskPledge() {
+       pledge(\"dns inet stdio tty rpath\",NULL);
+    }
     #endif
 
     int ttyPredicate() {
@@ -23,6 +27,9 @@
     unsigned int getTerminalHeight()  {
       struct winsize w;
       return ioctl(1,TIOCGWINSZ,&w)<0?UINT_MAX:w.ws_row;}")
+  (ffi:def-function
+      ("kioskPledge" c-kiosk-pledge)
+      () :returning :void)
   (ffi:def-function
       ("gotoPledge" c-pledge)
       () :returning :void)
@@ -410,6 +417,7 @@
          (quit))
 
         ((string= "-k" url)
+         (c-kiosk-pledge)
          (setf *kiosk-mode* t))
 
         ((= 0 (or (search "file://" url) 1))