Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Dec 2012 01:13:24 +0000 (UTC)
From:      Mark Linimon <linimon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244371 - projects/portbuild/tools
Message-ID:  <201212180113.qBI1DOIT018881@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: linimon (doc,ports committer)
Date: Tue Dec 18 01:13:24 2012
New Revision: 244371
URL: http://svnweb.freebsd.org/changeset/base/244371

Log:
  Make more robust.  Remove cruft.

Modified:
  projects/portbuild/tools/zfsadmin

Modified: projects/portbuild/tools/zfsadmin
==============================================================================
--- projects/portbuild/tools/zfsadmin	Tue Dec 18 00:25:48 2012	(r244370)
+++ projects/portbuild/tools/zfsadmin	Tue Dec 18 01:13:24 2012	(r244371)
@@ -6,8 +6,6 @@
 pbc=${PORTBUILD_CHECKOUT:-/var/portbuild}
 pbd=${PORTBUILD_DATA:-/var/portbuild}
 
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:${pbc}/scripts
-
 if [ `id -u` != 0 ]; then
     echo "$0 must be run as root."
     exit 1
@@ -31,11 +29,15 @@ if [ -z "${PORTBUILD_USER}" ]; then
     exit 1
 fi
 
+# reset the "zfsadmin" permission set if it already exists. 
+zfs unallow -s @zfsadmin ${ZFS_VOLUME} 2> /dev/null   
+zfs unallow -u ${PORTBUILD_USER} ${ZFS_VOLUME} 2> /dev/null
+
 # create the "zfsadmin" permission set.
-zfs allow -s @zfsadmin ${ZFS_PERMISSIONSET} ${ZFS_VOLUME}
+zfs allow -s @zfsadmin ${ZFS_PERMISSIONSET} ${ZFS_VOLUME} || exit 1
 
-# delegate the "zfsadmin" permission set to the PORTBUILD_USER.
-zfs allow -u ${PORTBUILD_USER} @zfsadmin ${ZFS_VOLUME}
+# delegate the "zfsadmin" permission set to the PORTBUILD_USER. 
+zfs allow -u ${PORTBUILD_USER} @zfsadmin ${ZFS_VOLUME} || exit 1
 
 echo "result of operation:"
 zfs allow ${ZFS_VOLUME}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212180113.qBI1DOIT018881>