diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 0fc8b3072c..ccf2f93c04 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -301,7 +301,7 @@ int main( int argc, char **argv ) } #if defined(HAVE_CHROOT) - if ( sandbox && chroot( sandbox ) ) { + if ( sandbox && chdir( sandbox ) && chroot( sandbox ) ) { perror("chroot"); rc = 1; goto stop;