Open non-temporary db's before chroot (rhbz#103952, 173285)

This commit is contained in:
Panu Matilainen 2007-06-19 13:33:50 +03:00
parent f95946925c
commit 30234b3737
1 changed files with 4 additions and 1 deletions

View File

@ -1689,8 +1689,11 @@ rpmMessage(RPMMESS_DEBUG, _("computing %d file fingerprints\n"), totalFileCount)
const char * rootDir = rpmtsRootDir(ts);
xx = chdir("/");
/*@-superuser -noeffect @*/
if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/')
if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') {
/* opening db before chroot not optimal, see rhbz#103852 c#3 */
xx = rpmdbOpenAll(ts->rdb);
xx = chroot(rootDir);
}
/*@=superuser =noeffect @*/
(void) rpmtsSetChrootDone(ts, 1);
}