Date: Fri, 10 Sep 2010 21:45:42 +0000 (UTC) From: Jamie Gritton <jamie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212436 - head/sys/kern Message-ID: <201009102145.o8ALjgvq091375@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jamie Date: Fri Sep 10 21:45:42 2010 New Revision: 212436 URL: http://svn.freebsd.org/changeset/base/212436 Log: Don't exit kern_jail_set without freeing options when enforce_statfs has an illegal value. MFC after: 3 days Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Sep 10 20:42:41 2010 (r212435) +++ head/sys/kern/kern_jail.c Fri Sep 10 21:45:42 2010 (r212436) @@ -584,12 +584,15 @@ kern_jail_set(struct thread *td, struct gotchildmax = 1; error = vfs_copyopt(opts, "enforce_statfs", &enforce, sizeof(enforce)); - gotenforce = (error == 0); - if (gotenforce) { - if (enforce < 0 || enforce > 2) - return (EINVAL); - } else if (error != ENOENT) + if (error == ENOENT) + gotenforce = 0; + else if (error != 0) goto done_free; + else if (enforce < 0 || enforce > 2) { + error = EINVAL; + goto done_free; + } else + gotenforce = 1; pr_flags = ch_flags = 0; for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009102145.o8ALjgvq091375>