From owner-svn-src-all@FreeBSD.ORG Tue Feb 14 07:14:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7737106566C; Tue, 14 Feb 2012 07:14:42 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1D758FC08; Tue, 14 Feb 2012 07:14:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E7Eg71083744; Tue, 14 Feb 2012 07:14:42 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E7Egm9083740; Tue, 14 Feb 2012 07:14:42 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201202140714.q1E7Egm9083740@svn.freebsd.org> From: Robert Millan Date: Tue, 14 Feb 2012 07:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231642 - in head: rescue/rescue sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 07:14:43 -0000 Author: rmh Date: Tue Feb 14 07:14:42 2012 New Revision: 231642 URL: http://svn.freebsd.org/changeset/base/231642 Log: Disable jail support in ifconfig when either building a rescue image or MK_JAIL knob has been set to "no". Reviewed by: bz Approved by: adrian (mentor) Modified: head/rescue/rescue/Makefile head/sbin/ifconfig/Makefile head/sbin/ifconfig/ifconfig.c Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Tue Feb 14 07:13:09 2012 (r231641) +++ head/rescue/rescue/Makefile Tue Feb 14 07:14:42 2012 (r231642) @@ -125,7 +125,7 @@ CRUNCH_LIBS+= -lipx .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lavl -lnvpair -lzfs -lpthread -luutil -lumem .endif -CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs -lz +CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz .if ${MACHINE_CPUARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Tue Feb 14 07:13:09 2012 (r231641) +++ head/sbin/ifconfig/Makefile Tue Feb 14 07:14:42 2012 (r231642) @@ -35,8 +35,8 @@ SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround SRCS+= ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support -DPADD+= ${LIBBSDXML} ${LIBJAIL} ${LIBSBUF} -LDADD+= -lbsdxml -ljail -lsbuf +DPADD+= ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lbsdxml -lsbuf SRCS+= carp.c # SIOC[GS]VH support SRCS+= ifgroup.c # ... @@ -56,6 +56,11 @@ SRCS+= af_ipx.c # IPX support DPADD+= ${LIBIPX} LDADD+= -lipx .endif +.if ${MK_JAIL} != "no" && !defined(RELEASE_CRUNCH) && !defined(RESCUE) +CFLAGS+= -DJAIL +DPADD+= ${LIBJAIL} +LDADD+= -ljail +.endif MAN= ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Feb 14 07:13:09 2012 (r231641) +++ head/sbin/ifconfig/ifconfig.c Tue Feb 14 07:14:42 2012 (r231642) @@ -66,7 +66,9 @@ static const char rcsid[] = #include #include #include +#ifdef JAIL #include +#endif #include #include #include @@ -255,6 +257,7 @@ main(int argc, char *argv[]) ifconfig(argc, argv, 1, NULL); exit(0); } +#ifdef JAIL /* * NOTE: We have to special-case the `-vnet' command * right here as we would otherwise fail when trying @@ -268,6 +271,7 @@ main(int argc, char *argv[]) ifconfig(argc, argv, 0, NULL); exit(0); } +#endif errx(1, "interface %s does not exist", ifname); } } @@ -688,6 +692,7 @@ deletetunnel(const char *vname, int para err(1, "SIOCDIFPHYADDR"); } +#ifdef JAIL static void setifvnet(const char *jname, int dummy __unused, int s, const struct afswtch *afp) @@ -715,6 +720,7 @@ setifrvnet(const char *jname, int dummy if (ioctl(s, SIOCSIFRVNET, &my_ifr) < 0) err(1, "SIOCSIFRVNET(%d, %s)", my_ifr.ifr_jid, my_ifr.ifr_name); } +#endif static void setifnetmask(const char *addr, int dummy __unused, int s, @@ -1173,8 +1179,10 @@ static struct cmd basic_cmds[] = { DEF_CMD_ARG2("tunnel", settunnel), DEF_CMD("-tunnel", 0, deletetunnel), DEF_CMD("deletetunnel", 0, deletetunnel), +#ifdef JAIL DEF_CMD_ARG("vnet", setifvnet), DEF_CMD_ARG("-vnet", setifrvnet), +#endif DEF_CMD("link0", IFF_LINK0, setifflags), DEF_CMD("-link0", -IFF_LINK0, setifflags), DEF_CMD("link1", IFF_LINK1, setifflags),