chdir before chroot

This commit is contained in:
Kurt Zeilenga 2000-10-11 04:50:14 +00:00
parent 84d92d6bb3
commit b84b838015
2 changed files with 12 additions and 4 deletions

View File

@ -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)

View File

@ -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