Author: jamie Date: Mon Aug 20 05:32:40 2018 New Revision: 338090 URL: https://svnweb.freebsd.org/changeset/base/338090
Log: MFC r337867: Don't let clobber jailparam values when checking for modification of init-only parameters. PR: 230487 Submitted by: Jason Mader Modified: stable/11/usr.sbin/jail/jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/jail/jail.c ============================================================================== --- stable/11/usr.sbin/jail/jail.c Mon Aug 20 04:56:37 2018 (r338089) +++ stable/11/usr.sbin/jail/jail.c Mon Aug 20 05:32:40 2018 (r338090) @@ -802,8 +802,10 @@ rdtun_params(struct cfjail *j, int dofail) exit(1); } for (jp = j->jp; jp < j->jp + j->njp; jp++) - if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) + if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { *++rtjp = *jp; + rtjp->jp_value = NULL; + } rval = 0; if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { @@ -814,8 +816,11 @@ rdtun_params(struct cfjail *j, int dofail) jp->jp_valuelen == 0 && *(int *)jp->jp_value) && !(rtjp->jp_valuelen == jp->jp_valuelen && - !memcmp(rtjp->jp_value, jp->jp_value, - jp->jp_valuelen))) { + !((jp->jp_ctltype & CTLTYPE) == + CTLTYPE_STRING ? strncmp(rtjp->jp_value, + jp->jp_value, jp->jp_valuelen) : + memcmp(rtjp->jp_value, jp->jp_value, + jp->jp_valuelen)))) { if (dofail) { jail_warnx(j, "%s cannot be " "changed after creation", _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"