diff options
author | bapt <bapt@FreeBSD.org> | 2012-09-19 16:20:49 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2012-09-19 16:20:49 +0000 |
commit | 13681004dd325c4c4029473cb3c92da7080dede8 (patch) | |
tree | 6f049359680efbc78ee7cb411d741b8f2d1e489d /cddl/contrib | |
parent | 8d736b48eed2f3df86c39c170c77994d27e92ac2 (diff) | |
download | FreeBSD-src-13681004dd325c4c4029473cb3c92da7080dede8.zip FreeBSD-src-13681004dd325c4c4029473cb3c92da7080dede8.tar.gz |
Allow zfs jail and zfs unjail to use both jailnames and jailid
Reviewed by: pjd
MFC after: 1 month
Diffstat (limited to 'cddl/contrib')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zfs/zfs.8 | 4 | ||||
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zfs/zfs_main.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 b/cddl/contrib/opensolaris/cmd/zfs/zfs.8 index f83d6b4..64a67e9 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs.8 @@ -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 diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c index ff698a7..fd0f693 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c @@ -6300,9 +6300,9 @@ do_jail(int argc, char **argv, int attach) 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); } |