]> www.dolda2000.com Git - ashd.git/commitdiff
htparser: chdir as part of chrooting.
authorFredrik Tolf <fredrik@dolda2000.com>
Fri, 29 Apr 2011 01:20:45 +0000 (03:20 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Fri, 29 Apr 2011 01:20:45 +0000 (03:20 +0200)
src/htparser.c

index ceae319aeafbd12ef68cd0342c9e4be6e2747c38..5179a25935a0e9f328e771edf8b159f32c988a42 100644 (file)
@@ -499,7 +499,7 @@ int main(int argc, char **argv)
     if(usesyslog)
        opensyslog();
     if(root) {
-       if(chroot(root)) {
+       if(chdir(root) || chroot(root)) {
            flog(LOG_ERR, "could not chroot to %s: %s", root, strerror(errno));
            exit(1);
        }