From nobody Fri Feb 02 16:45:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRM8m7412z594gn; Fri, 2 Feb 2024 16:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRM8m6RJxz4T7j; Fri, 2 Feb 2024 16:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706892344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tygH2W/GPh0ZYQZB4wbZYWIcf0MmRV+DFqMbUT4bjgk=; b=JS3wdMTm4MCgm3gEIuipzKhM+XSoHYE/kNak73GcAibRqp4guzCno4sM/xY7Xa1mw8hSDF FrW50rA79HNdF1BB9+m2PG7PRlbWEA2j2uWEm0nhbglHpAnu25DBr53j5U1quMwYYjw1aY pL4eMKEt7w0K9Tf9O5aNVw6L9Q32VSzrKGs/P/Rzn5R2CwFlaQBEDoZdwX/1atis+tGh3O YDJ4PM0brdg3mWLBpue2Ictx/95+FMa555KrcZu5/+c0FP1ZNonGFAXNJLib3Uer0RU1Sa C67uBMlgYFU3TGkb/Icd0XXJQSZpQsXEmpiB1hwuCb0GIDmT3NbIq3UU9O5MeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706892344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tygH2W/GPh0ZYQZB4wbZYWIcf0MmRV+DFqMbUT4bjgk=; b=eImLmOEZ5koHxN8ihYgk0+eIvMk6/wyOsmZQlDAWm3S2GP3/MSmqJL7dueoh+8vptJv4Lx znMlKjgAuaZAU9fJrPoPJITj86Ah0TBsNvB/tMIEybnfFY9sv2SJMoZ/oEo6CfrffDjSkA 7dR88nicOyvlKjfQ5JIbUg13XdR/zYtvbDXNLMDy76WU+cjgBHAEc7zNtqstOlB7263LJT tZ1k3k1Dyt4pX7eB2IU+ybkKDZesN3e0zvH+KOpldVlYcr/+61I5phHg4JcMzTo3ktt9cO myH5nnal+xt9/FiSb3+e4gTuDDzdcFdl/u1/OuZjlZlYP3jd23WSzWs57oLIqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706892344; a=rsa-sha256; cv=none; b=PshRapwsDW/TsvNeUzN1rVhp5ciNOdlBcpDVyGboJLaxuU9DDGWDDbjtM94hmAga195PP5 Tv7A1SZ+IXN3iFafYkfn4khFK9VGlCtcjXMDWLamZvqwLl5+1BaZ/fkC4C06MditYnv1Vt evKe6FQAr8ledtq+USyR3D83N5i7O89U8Hz6yzG3QpEpicQ/pf4KcBDtbLB4VF5Gesoyf+ eO9NeeODGxoGLpAr4bRxdlqetQSKgxM6udKBEJYbt84sK9X9V/uLKxHWZ77hq8s5ao8qLJ IF0cN5ybzXsb90zZ/F9Sdv/Tj5+567IjXmRdff0BJjf2wPLMSLRnTOA4N+eNPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRM8m5Ns1zdKZ; Fri, 2 Feb 2024 16:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 412Gji7d017983; Fri, 2 Feb 2024 16:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 412GjiCv017980; Fri, 2 Feb 2024 16:45:44 GMT (envelope-from git) Date: Fri, 2 Feb 2024 16:45:44 GMT Message-Id: <202402021645.412GjiCv017980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: dcae96578145 - stable/14 - MFC jail: make sure jail.conf parse errors exit, and not crash. Reported by: Mason Loring Bliss List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dcae9657814544c4ac2c28bec0022346eb7c587f Auto-Submitted: auto-generated The branch stable/14 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=dcae9657814544c4ac2c28bec0022346eb7c587f commit dcae9657814544c4ac2c28bec0022346eb7c587f Author: Jamie Gritton AuthorDate: 2024-01-21 05:20:59 +0000 Commit: Jamie Gritton CommitDate: 2024-02-02 16:44:20 +0000 MFC jail: make sure jail.conf parse errors exit, and not crash. Reported by: Mason Loring Bliss (cherry picked from commit 768149ff156e7d34a035853030bf946ca94cb461) --- usr.sbin/jail/jailparse.y | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/jail/jailparse.y b/usr.sbin/jail/jailparse.y index 047ca882e59f..048cfcf11c2b 100644 --- a/usr.sbin/jail/jailparse.y +++ b/usr.sbin/jail/jailparse.y @@ -234,16 +234,19 @@ extern int YYLEX_DECL(); static void YYERROR_DECL() { + struct cflex *cflex = yyget_extra(scanner); + if (!yyget_text(scanner)) warnx("%s line %d: %s", - yyget_extra(scanner)->cfname, yyget_lineno(scanner), s); + cflex->cfname, yyget_lineno(scanner), s); else if (!yyget_text(scanner)[0]) warnx("%s: unexpected EOF", - yyget_extra(scanner)->cfname); + cflex->cfname); else warnx("%s line %d: %s: %s", - yyget_extra(scanner)->cfname, yyget_lineno(scanner), + cflex->cfname, yyget_lineno(scanner), yyget_text(scanner), s); + cflex->error = 1; } /* Handle special parameters (i.e. the include directive).