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 SASL error reporting
Updated -lldap TLS error reporting Updated -lldap TLS error reporting
Updated slapadd error reporting Updated slapadd error reporting
Updated slapd chroot handling (ITS#810)
Added slapd numericString indexing Added slapd numericString indexing
Build Environment Build Environment
Fixed make comment bug (ITS#811) Fixed make comment bug (ITS#811)

View File

@ -301,10 +301,17 @@ int main( int argc, char **argv )
} }
#if defined(HAVE_CHROOT) #if defined(HAVE_CHROOT)
if ( sandbox && chroot( sandbox ) ) { if ( sandbox ) {
perror("chroot"); if ( chdir( sandbox ) ) {
rc = 1; perror("chdir");
goto stop; rc = 1;
goto stop;
}
if ( chroot( sandbox ) ) {
perror("chroot");
rc = 1;
goto stop;
}
} }
#endif #endif