From owner-freebsd-python@freebsd.org Thu Aug 16 20:39:06 2018 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 058671076395 for ; Thu, 16 Aug 2018 20:39:06 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 9A73F78712 for ; Thu, 16 Aug 2018 20:39:05 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 5F7F01076393; Thu, 16 Aug 2018 20:39:05 +0000 (UTC) Delivered-To: python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D8D41076392 for ; Thu, 16 Aug 2018 20:39:05 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gritton.org", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D7E4F78711 for ; Thu, 16 Aug 2018 20:39:04 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) by gritton.org (8.15.2/8.15.2) with ESMTP id w7GKd3St062105 for ; Thu, 16 Aug 2018 14:39:03 -0600 (MDT) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_86ad2306758396fa4d87703cbb45da68" Date: Thu, 16 Aug 2018 14:39:03 -0600 From: James Gritton To: python@FreeBSD.org Subject: devel/py-freebsd and deprecation of jail(2) Message-ID: <40cbb5b104f2c563f92a5ff158ed920c@freebsd.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.3.6 X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Aug 2018 20:39:06 -0000 --=_86ad2306758396fa4d87703cbb45da68 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hello, I'd like to have jsil(2) moved to COMPAT_FREEBSD11 for the release of 12.0, which means that userspace utilities will need to be moved off of jail(2) and onto jail_set(2). In the case of py-freebsd, the PyFB_jail function uses the old jail(2) interface. It's simple enough to change that to use jail_setv(3) instead, and add libjail. Perhaps it would be better to add a new function for a more complete interface to jail_set(2), but that's beyond the scope of just making sure the program doesn't stop working. Considering it uses Python 2.7, I don't know if there's much interest in updating its functionality. I'm including an updated version of patch-src-jail.c, as well as a new patch-src-.libraries.def - but I don't know how to make the later patch actually get used; so all I can say right now is this ought to work if I knew how to get the patches right. Thanks, Jamie --=_86ad2306758396fa4d87703cbb45da68 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=patch-src-.libraries.def Content-Disposition: attachment; filename=patch-src-.libraries.def; size=197 LS0tIHNyYy8ubGlicmFyaWVzLmRlZi5vcmlnCTIwMTgtMDgtMTYgMTQ6MTc6MjkuMzUxNTE3MDAw IC0wNjAwCisrKyBzcmMvLmxpYnJhcmllcy5kZWYKQEAgLTEsMyArMSw2IEBACiAjaWYgX19GcmVl QlNEX3ZlcnNpb24gPj0gNTAwMTAxCiBnZW9tCiAjZW5kaWYKKyNpZiBfX0ZyZWVCU0RfdmVyc2lv biA+PSA4MDAxMDEKK2phaWwKKyNlbmRpZgo= --=_86ad2306758396fa4d87703cbb45da68 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=patch-src-jail.c Content-Disposition: attachment; filename=patch-src-jail.c; size=1044 LS0tIHNyYy9qYWlsLmMub3JpZwkyMDA1LTA1LTA4IDAwOjU1Oj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