From: Kurt Zeilenga Date: Wed, 11 Oct 2000 04:50:14 +0000 (+0000) Subject: chdir before chroot X-Git-Tag: OPENLDAP_REL_ENG_2_0_7~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b84b83801588142c15ccbb4afdc961bdd25ecfa6;p=thirdparty%2Fopenldap.git chdir before chroot --- diff --git a/CHANGES b/CHANGES index e2359e8862..aee75807db 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ OpenLDAP 2.0.X Engineering Updated -lldap SASL error reporting Updated -lldap TLS error reporting Updated slapadd error reporting + Updated slapd chroot handling (ITS#810) Added slapd numericString indexing Build Environment Fixed make comment bug (ITS#811) diff --git a/servers/slapd/main.c b/servers/slapd/main.c index d0bbbe7e1d..4b38c3f9b9 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -301,10 +301,17 @@ int main( int argc, char **argv ) } #if defined(HAVE_CHROOT) - if ( sandbox && chroot( sandbox ) ) { - perror("chroot"); - rc = 1; - goto stop; + if ( sandbox ) { + if ( chdir( sandbox ) ) { + perror("chdir"); + rc = 1; + goto stop; + } + if ( chroot( sandbox ) ) { + perror("chroot"); + rc = 1; + goto stop; + } } #endif