Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 2015 23:40:30 +0000 (UTC)
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r285345 - stable/9/usr.sbin/jail
Message-ID:  <201507092340.t69NeUnl062655@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jamie
Date: Thu Jul  9 23:40:29 2015
New Revision: 285345
URL: https://svnweb.freebsd.org/changeset/base/285345

Log:
  MFC r241196:
  
    Move properly to the next parameter when jailparam_init fails
     (i.e. on an unknown parameter), to avoid freeing bogus pointers.
  
  MFC r256256 (partial):
  
    - Fix a minor bug in jail(8) which prevented it from returning false
      when jail -r failed.

Modified:
  stable/9/usr.sbin/jail/config.c
  stable/9/usr.sbin/jail/jail.c
Directory Properties:
  stable/9/usr.sbin/jail/   (props changed)

Modified: stable/9/usr.sbin/jail/config.c
==============================================================================
--- stable/9/usr.sbin/jail/config.c	Thu Jul  9 23:09:59 2015	(r285344)
+++ stable/9/usr.sbin/jail/config.c	Thu Jul  9 23:40:29 2015	(r285345)
@@ -688,6 +688,7 @@ import_params(struct cfjail *j)
 		if (jailparam_init(jp, p->name) < 0) {
 			error = -1;
 			jail_warnx(j, "%s", jail_errmsg);
+			jp++;
 			continue;
 		}
 		if (TAILQ_EMPTY(&p->val))

Modified: stable/9/usr.sbin/jail/jail.c
==============================================================================
--- stable/9/usr.sbin/jail/jail.c	Thu Jul  9 23:09:59 2015	(r285344)
+++ stable/9/usr.sbin/jail/jail.c	Thu Jul  9 23:40:29 2015	(r285345)
@@ -470,10 +470,12 @@ main(int argc, char **argv)
 				if (dep_check(j))
 					continue;
 				if (j->jid < 0) {
-					if (!(j->flags & (JF_DEPEND | JF_WILD))
-					    && verbose >= 0)
-						jail_quoted_warnx(j,
-						    "not found", NULL);
+					if (!(j->flags & (JF_DEPEND|JF_WILD))) {
+						if (verbose >= 0)
+							jail_quoted_warnx(j,
+							    "not found", NULL);
+						failed(j);
+					}
 					goto jail_remove_done;
 				}
 				j->comparam = stopcommands;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507092340.t69NeUnl062655>