| Use an absolute base path for execl. - geomyidae - A small C-based gopherd. | |
| git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri… | |
| Log | |
| Files | |
| Refs | |
| Tags | |
| README | |
| LICENSE | |
| --- | |
| commit 446537b44a1d6920611306a53d5e2b55cd012216 | |
| parent b4c65d77c916d3b13ab4a1239cfb8b60d042ce6d | |
| Author: Quentin Rameau <[email protected]> | |
| Date: Sun, 9 Jul 2017 19:59:10 +0200 | |
| Use an absolute base path for execl. | |
| Signed-off-by: Christoph Lohmann <[email protected]> | |
| Diffstat: | |
| M geomyidae.8 | 1 - | |
| M main.c | 3 +++ | |
| 2 files changed, 3 insertions(+), 1 deletion(-) | |
| --- | |
| diff --git a/geomyidae.8 b/geomyidae.8 | |
| @@ -118,7 +118,6 @@ Loglevels: | |
| . | |
| .It Fl b Ar base | |
| Root directory to serve (default: /var/gopher). | |
| -This directory should be specified as an absolute path. | |
| . | |
| .It Fl p Ar port | |
| Port geomyidae should listen on (default: 70) | |
| diff --git a/main.c b/main.c | |
| @@ -458,6 +458,9 @@ main(int argc, char *argv[]) | |
| perror("chroot"); | |
| return 1; | |
| } | |
| + } else if(*base != '/' && !(base = realpath(base, NULL))) { | |
| + perror("realpath"); | |
| + return 1; | |
| } | |
| if(dropprivileges(gr, us) < 0) { |