do not try to chroot into "/", part 2
This commit is contained in:
parent
394a569a16
commit
80c96f59f4
@ -1938,7 +1938,7 @@ assert(psm->mi == NULL);
|
||||
|
||||
case PSM_CHROOT_IN:
|
||||
/* Change root directory if requested and not already done. */
|
||||
if (ts->rootDir && !(ts->rootDir[0] == '/' && ts->rootDir[1] == '\0') && !ts->chrootDone && !psm->chrootDone) {
|
||||
if (ts->rootDir && !ts->chrootDone && !psm->chrootDone) {
|
||||
static int _loaded = 0;
|
||||
|
||||
/*
|
||||
@ -1952,6 +1952,7 @@ assert(psm->mi == NULL);
|
||||
}
|
||||
|
||||
xx = chdir("/");
|
||||
if (!(ts->rootDir[0] == '/' && ts->rootDir[1] == '\0')) {
|
||||
/*@-unrecog -superuser @*/
|
||||
rc = chroot(ts->rootDir);
|
||||
/*@=unrecog =superuser @*/
|
||||
@ -1962,6 +1963,7 @@ assert(psm->mi == NULL);
|
||||
chroot_prefix = ts->rootDir;
|
||||
/*@=onlytrans@*/
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PSM_CHROOT_OUT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user