From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 16:20:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9461D106564A; Wed, 19 Sep 2012 16:20:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661778FC0C; Wed, 19 Sep 2012 16:20:50 +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 q8JGKoko024464; Wed, 19 Sep 2012 16:20:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JGKorx024460; Wed, 19 Sep 2012 16:20:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209191620.q8JGKorx024460@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 19 Sep 2012 16:20:50 +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: r240696 - in head/cddl: contrib/opensolaris/cmd/zfs sbin/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 16:20:50 -0000 Author: bapt Date: Wed Sep 19 16:20:49 2012 New Revision: 240696 URL: http://svn.freebsd.org/changeset/base/240696 Log: Allow zfs jail and zfs unjail to use both jailnames and jailid Reviewed by: pjd MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/sbin/zfs/Makefile Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Sep 19 16:20:49 2012 (r240696) @@ -256,10 +256,10 @@ .Op Ar snapshot Ns | Ns Ar filesystem .Nm .Cm jail -.Ar jailid filesystem +.Ar jailid Ns | Ns Ar jailname filesystem .Nm .Cm unjail -.Ar jailid filesystem +.Ar jailid Ns | Ns Ar jailname filesystem .Sh DESCRIPTION The .Nm Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:20:49 2012 (r240696) @@ -6300,9 +6300,9 @@ do_jail(int argc, char **argv, int attac usage(B_FALSE); } - jailid = atoi(argv[1]); - if (jailid == 0) { - (void) fprintf(stderr, gettext("invalid jailid\n")); + jailid = jail_getid(argv[1]); + if (jailid < 0) { + (void) fprintf(stderr, gettext("invalid jail id or name\n")); usage(B_FALSE); } Modified: head/cddl/sbin/zfs/Makefile ============================================================================== --- head/cddl/sbin/zfs/Makefile Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/sbin/zfs/Makefile Wed Sep 19 16:20:49 2012 (r240696) @@ -21,8 +21,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -DPADD= ${LIBGEOM} ${LIBNVPAIR} ${LIBUMEM} \ +DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} -LDADD= -lgeom -lnvpair -lumem -lutil -luutil -lzfs +LDADD= -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs .include