diff --git a/start-web-server b/start-web-server index d418d90..75d3dca 100755 --- a/start-web-server +++ b/start-web-server @@ -96,14 +96,15 @@ exec scsh +lpsd -ll packages.scm -dm -o http-test -e main -s "$0" "$@" (else (unknown-option-error (car options))))))))) + (define (become-nobody-if-root) + (cond ((zero? (user-uid)) + (set-gid (->gid "nobody")) + (set-uid (->uid "nobody"))))) (define (main args) (init) (format #t "reading options: ~s~%" (cdr args)) (get-options (cdr args)) - (cond ((zero? (user-uid)) - (set-gid (->gid "nobody")) - (set-uid (->uid "nobody")))) (format #t "Going to run Webserver with: htdocs-dir: ~a @@ -122,6 +123,7 @@ exec scsh +lpsd -ll packages.scm -dm -o http-test -e main -s "$0" "$@" with-root-directory (cwd) with-syslog? #t with-log-file log-file-name + with-post-bind-thunk become-nobody-if-root with-request-handler (alist-path-dispatcher (list (cons "cgi-bin" (cgi-handler cgi-bin-dir)))