From c8612ee587015f9d8700cd66f976c478b90c96eb Mon Sep 17 00:00:00 2001 From: cperciva Date: Thu, 27 May 2010 03:15:04 +0000 Subject: 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 --- usr.sbin/jail/jail.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'usr.sbin/jail/jail.c') diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index ca87796..0722bfd 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)) { -- cgit v1.1