From owner-svn-ports-head@freebsd.org Thu Oct 22 11:11:04 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4242B445685; Thu, 22 Oct 2020 11:11:04 +0000 (UTC) (envelope-from rene@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH4RX11xYz3V2j; Thu, 22 Oct 2020 11:11:04 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07C0115CE6; Thu, 22 Oct 2020 11:11:04 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MBB3Uw005536; Thu, 22 Oct 2020 11:11:03 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MBB3PW005535; Thu, 22 Oct 2020 11:11:03 GMT (envelope-from rene@FreeBSD.org) Message-Id: <202010221111.09MBB3PW005535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Thu, 22 Oct 2020 11:11:03 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r552961 - head/sysutils/p5-BSD-Jail-Object/files X-SVN-Group: ports-head X-SVN-Commit-Author: rene X-SVN-Commit-Paths: head/sysutils/p5-BSD-Jail-Object/files X-SVN-Commit-Revision: 552961 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 11:11:04 -0000 Author: rene Date: Thu Oct 22 11:11:03 2020 New Revision: 552961 URL: https://svnweb.freebsd.org/changeset/ports/552961 Log: sysutils/p5-BSD-Jail-Object: remove legacy code in patch for FreeBSD 7/8 Phabricator: D26646 Modified: head/sysutils/p5-BSD-Jail-Object/files/patch-Object.pm Modified: head/sysutils/p5-BSD-Jail-Object/files/patch-Object.pm ============================================================================== --- head/sysutils/p5-BSD-Jail-Object/files/patch-Object.pm Thu Oct 22 11:10:17 2020 (r552960) +++ head/sysutils/p5-BSD-Jail-Object/files/patch-Object.pm Thu Oct 22 11:11:03 2020 (r552961) @@ -8,9 +8,9 @@ ! version information along with the cached data. ! Look at usr.sbin/{jail,jls,jexec} sources for the right ideas. ! ---- ./Object.pm.orig 2006-08-08 04:54:29.000000000 +0000 -+++ ./Object.pm 2008-12-28 14:06:27.000000000 +0000 -@@ -317,21 +317,69 @@ +--- Object.pm.orig 2006-08-08 04:54:29 UTC ++++ Object.pm +@@ -317,21 +317,56 @@ struct xprison return NULL; } @@ -22,19 +22,13 @@ +_is_jail_ip4(char *string, struct xprison *xp) +{ + struct in_addr in; -+#if ((__FreeBSD_version >= 800056) || (__FreeBSD_version < 800000) && (__FreeBSD_version >= 701103)) + struct in_addr *iap; + char *q; + int i; -+#endif + + if (inet_pton(AF_INET, string, &in) != 1) + return (0); + -+#if ((__FreeBSD_version >= 800000 && __FreeBSD_version < 800056) || __FreeBSD_version < 701103) -+ if (in.s_addr == xp->pr_ip) -+ return (1); -+#else + if (xp->pr_ip4s == 0) + return (0); + q = (char *)(xp + 1); @@ -42,21 +36,15 @@ + for (i=0; i < xp->pr_ip4s; i++) + if (in.s_addr == iap[i].s_addr) + return (1); -+#endif + return (0); +} + +static void +_get_jail_ip4(struct xprison *xp, struct in_addr *ia) +{ -+#if ((__FreeBSD_version >= 800056) || (__FreeBSD_version < 800000) && (__FreeBSD_version >= 701103)) + struct in_addr *iap; + char *q; -+#endif + -+#if ((__FreeBSD_version >= 800000 && __FreeBSD_version < 800056) || __FreeBSD_version < 701103) -+ ia->s_addr = xp->pr_ip; -+#else + if (xp->pr_ip4s == 0) + ia->s_addr = 0; + else { @@ -64,7 +52,6 @@ + iap = (struct in_addr *)(void *)q; + ia->s_addr = iap[0].s_addr; + } -+#endif +} + // fetch a specific jail's information @@ -83,7 +70,7 @@ len = sysctl_len(); /* -@@ -341,15 +389,15 @@ +@@ -341,15 +376,15 @@ _find_jail( int compare, char *string ) */ for (i = 0; i < len / sizeof(*xp); i++) { @@ -101,7 +88,7 @@ Inline_Stack_Push( sv_2mortal( newSVpvf( inet_ntoa(in) ) )); Inline_Stack_Push( sv_2mortal( newSVpvf( xp->pr_host ) )); Inline_Stack_Push( sv_2mortal( newSVpvf( xp->pr_path ) )); -@@ -360,6 +408,7 @@ +@@ -360,6 +395,7 @@ _find_jail( int compare, char *string ) } } @@ -109,7 +96,7 @@ Inline_Stack_Done; } -@@ -367,12 +416,12 @@ +@@ -367,12 +403,12 @@ _find_jail( int compare, char *string ) void _find_jids() { @@ -124,7 +111,7 @@ len = sysctl_len(); for (i = 0; i < len / sizeof(*xp); i++) { -@@ -380,6 +429,7 @@ +@@ -380,6 +416,7 @@ _find_jids() xp++; } @@ -132,18 +119,15 @@ Inline_Stack_Done; } -@@ -402,8 +452,14 @@ +@@ -402,8 +439,9 @@ _create( char *path, char *hostname, char *ipaddr ) j.path = path; j.hostname = hostname; -+#if ((__FreeBSD_version >= 800000 && __FreeBSD_version < 800056) || __FreeBSD_version < 701103) - j.ip_number = ntohl( ip.s_addr ); - j.version = 0; -+#else +- j.ip_number = ntohl( ip.s_addr ); +- j.version = 0; + j.version = JAIL_API_VERSION; + j.ip4s = 1; + j.ip4 = &ip; -+#endif if ( (jid = jail( &j )) == -1 ) return 0;