View | Details | Raw Unified | Return to bug 262471
Collapse All | Expand All

(-)b/usr.sbin/jail/jail.c (-10 / +22 lines)
Lines 790-796 static int Link Here
790
rdtun_params(struct cfjail *j, int dofail)
790
rdtun_params(struct cfjail *j, int dofail)
791
{
791
{
792
	struct jailparam *jp, *rtparams, *rtjp;
792
	struct jailparam *jp, *rtparams, *rtjp;
793
	int nrt, rval;
793
	const void *jp_value;
794
	size_t jp_valuelen;
795
	int nrt, rval, bool_true;
794
796
795
	if (j->flags & JF_RDTUN)
797
	if (j->flags & JF_RDTUN)
796
		return 0;
798
		return 0;
Lines 818-832 rdtun_params(struct cfjail *j, int dofail) Link Here
818
		rtjp = rtparams + 1;
820
		rtjp = rtparams + 1;
819
		for (jp = j->jp; rtjp < rtparams + nrt; jp++) {
821
		for (jp = j->jp; rtjp < rtparams + nrt; jp++) {
820
			if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) {
822
			if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) {
821
				if (!((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) &&
823
				jp_value = jp->jp_value;
822
				    jp->jp_valuelen == 0 &&
824
				jp_valuelen = jp->jp_valuelen;
823
				    *(int *)jp->jp_value) &&
825
				if (jp_value == NULL && jp_valuelen > 0) {
824
				    !(rtjp->jp_valuelen == jp->jp_valuelen &&
826
					if (jp->jp_flags & (JP_BOOL |
825
				    !((jp->jp_ctltype & CTLTYPE) ==
827
					    JP_NOBOOL | JP_JAILSYS)) {
826
				    CTLTYPE_STRING ? strncmp(rtjp->jp_value,
828
						bool_true = 1;
827
				    jp->jp_value, jp->jp_valuelen) :
829
						jp_value = &bool_true;
828
				    memcmp(rtjp->jp_value, jp->jp_value,
830
						jp_valuelen = sizeof(bool_true);
829
				    jp->jp_valuelen)))) {
831
					} else if ((jp->jp_ctltype & CTLTYPE) ==
832
					    CTLTYPE_STRING)
833
						jp_value = "";
834
					else
835
						jp_valuelen = 0;
836
				}
837
				if (rtjp->jp_valuelen != jp_valuelen ||
838
				    (CTLTYPE_STRING ? strncmp(rtjp->jp_value,
839
				    jp_value, jp_valuelen)
840
				    : memcmp(rtjp->jp_value, jp_value,
841
				    jp_valuelen))) {
830
					if (dofail) {
842
					if (dofail) {
831
						jail_warnx(j, "%s cannot be "
843
						jail_warnx(j, "%s cannot be "
832
						    "changed after creation",
844
						    "changed after creation",

Return to bug 262471