From nobody Sun Jan 21 05:22:15 2024 X-Original-To: dev-commits-src-main@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 4THhYg3Rntz56ZfK; Sun, 21 Jan 2024 05:22:15 +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 4THhYg2SC5z4h10; Sun, 21 Jan 2024 05:22:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705814535; 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=ZzmNdHR5plXo4YyyG1xN476SAadbYQVOuRL9gNnAjXI=; b=cphxzUDoZrx+yoe9l4jF6YfUYs2q5pWg1gClOwjfxUJpjkby9C+sfV4h5tt0qVJ8/dIfFg j3Nm40Sp70VMspX5zRdsKT99g630yNFQ6h70rAPpR3h27AQoHTAr9NdGvtdpypGL8pap5O 4kMjIB5kHgcfwVrQ/w1DeUayQaToppZ4aBfNS9Ju/DTw/ZktIlKU6c/kfHgtQWQFKvrCm4 EyktkPttSRkOagAIW1LNu5scUOsc7ZH7WNORSbGw5S3Sk//yeYPUQ2TkE/Pg+Y/qON5YKb 8e+6Qb5/W7Antyb7WdcncSyuhe0qqokbTf9Wg9QCePK8eRNiCjITbPgcmzkY6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705814535; 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=ZzmNdHR5plXo4YyyG1xN476SAadbYQVOuRL9gNnAjXI=; b=aJrDb5/26pZuWJ28JWyjeafz48ZxOw5JO8m9RJkicVpjR+9CwsYmPHPAv8dxhr8ZyBkoOM jL/1ViDYWuh6nIILOFeWjk9xwmU7QVS5J8u59ajI0iwE5c10vGHj6zwutaYW5tWZihIxqv k+o9bbxsCV2w8jI1lQSPUntscd0RHtzRiR73hpA2yvfOPQepHIRUICRxBpnJF05jM6Y1Uy EunZdZdJc4w5KvaelAZsv3FsmkBSYvKA47RO/NkJHRjGTA6BY1i+Ul3ZDQbZNFqhEq97ld AEeqiFbAkXv5pCwqsQ+b0yhb8a0OmybEzjI2/hJV7Cw4I58ClKokiNkNDJAFzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705814535; a=rsa-sha256; cv=none; b=ncBepqmUT9RLi68OJhJ7Zec4NbyghUPD0/zaT0H2XFX7xr76Dl1ji6Lv9DIFe31V1OfXi5 NdGECzlF/J1+4wqJLHj1jmPYG5f0rkpDGzq8ilzkEaStr+SabpKDRr9sVbGGUrsvxjQ5mC 9vVjT1gfefI3UWvKQMqOuN2nPvIhF8fSOGEymeenFYqCMYQHqmE61N4eWeulJQcjeV7MkQ P07xzatGAMLxnmMNpM4xHA/CGVZ49vg1QNjzeLbzM8J7C5LjMefWAAA0wupFgliBszliO9 pKir5wcaKArzw+fRyeZSjKdcmGztLulzCoVWSdoIqqREAsLkWCErMPDRvYzn+w== 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 4THhYg1XCLz15NJ; Sun, 21 Jan 2024 05:22:15 +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 40L5MFTA047210; Sun, 21 Jan 2024 05:22:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40L5MFvp047207; Sun, 21 Jan 2024 05:22:15 GMT (envelope-from git) Date: Sun, 21 Jan 2024 05:22:15 GMT Message-Id: <202401210522.40L5MFvp047207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 768149ff156e - main - jail: make sure jail.conf parse errors exit, and not crash. Reported by: Mason Loring Bliss List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 768149ff156e7d34a035853030bf946ca94cb461 Auto-Submitted: auto-generated The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=768149ff156e7d34a035853030bf946ca94cb461 commit 768149ff156e7d34a035853030bf946ca94cb461 Author: Jamie Gritton AuthorDate: 2024-01-21 05:20:59 +0000 Commit: Jamie Gritton CommitDate: 2024-01-21 05:20:59 +0000 jail: make sure jail.conf parse errors exit, and not crash. Reported by: Mason Loring Bliss --- 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).