aboutsummaryrefslogtreecommitdiffstats
path: root/usr.sbin/jail/jail.c
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2010-05-27 03:15:04 +0000
committerColin Percival <cperciva@FreeBSD.org>2010-05-27 03:15:04 +0000
commita6b5951a1159278502d0b699efcdf9276a4334db (patch)
treee4938b70333428a22b43a642ce2d063f2e1bb813 /usr.sbin/jail/jail.c
parent2e7e77ff792417b708755984259bd4833608e85b (diff)
downloadsrc-a6b5951a1159278502d0b699efcdf9276a4334db.tar.gz
src-a6b5951a1159278502d0b699efcdf9276a4334db.zip
Change the current working directory to be inside the jail created by
the jail(8) command. [10:04] Fix a one-NUL-byte buffer overflow in libopie. [10:05] Correctly sanity-check a buffer length in nfs mount. [10:06] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-10:04.jail Security: FreeBSD-SA-10:05.opie Security: FreeBSD-SA-10:06.nfsclient
Notes
Notes: svn path=/releng/8.0/; revision=208586
Diffstat (limited to 'usr.sbin/jail/jail.c')
-rw-r--r--usr.sbin/jail/jail.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c
index ca87796d3364..0722bfd22397 100644
--- a/usr.sbin/jail/jail.c
+++ b/usr.sbin/jail/jail.c
@@ -511,6 +511,10 @@ set_param(const char *name, char *value)
*value++ = '\0';
}
+ /* jail_set won't chdir along with its chroot, so do it here. */
+ if (!strcmp(name, "path") && chdir(value) < 0)
+ err(1, "chdir: %s", value);
+
/* Check for repeat parameters */
for (i = 0; i < nparams; i++)
if (!strcmp(name, params[i].jp_name)) {