svn commit: r244371 - projects/portbuild/tools
Mark Linimon
linimon at FreeBSD.org
Tue Dec 18 01:13:26 UTC 2012
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}
More information about the svn-src-projects
mailing list