Date: Mon, 17 Dec 2012 19:00:52 +0000 (UTC) From: Mark Linimon <linimon@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r244361 - projects/portbuild/tools Message-ID: <201212171900.qBHJ0r4a045835@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: linimon (doc,ports committer) Date: Mon Dec 17 19:00:52 2012 New Revision: 244361 URL: http://svnweb.freebsd.org/changeset/base/244361 Log: First pass at a script that allows the delegation of most useful ZFS permissions to the 'portbuild' user. Added: projects/portbuild/tools/zfsadmin (contents, props changed) Added: projects/portbuild/tools/zfsadmin ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/portbuild/tools/zfsadmin Mon Dec 17 19:00:52 2012 (r244361) @@ -0,0 +1,41 @@ +#!/bin/sh + +# server-side script to setup delegated zfs administration. Should be run as root. + +# configurable variables +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 +fi +if [ ! -e ${pbc}/conf/server.conf ] ; then + echo "You must first create ${pbc}/conf/server.conf." + exit 1 +fi +. ${pbc}/conf/server.conf + +if [ -z "${ZFS_VOLUME}" ]; then + echo "You must define ZFS_VOLUME in ${pbc}/conf/server.conf." + exit 1 +fi +if [ -z "${ZFS_PERMISSIONSET}" ]; then + echo "You must define ZFS_PERMISSIONSET in ${pbc}/conf/server.conf." + exit 1 +fi +if [ -z "${PORTBUILD_USER}" ]; then + echo "You must define PORTBUILD_USER in ${pbc}/conf/server.conf." + exit 1 +fi + +# create the "zfsadmin" permission set. +zfs allow -s @zfsadmin ${ZFS_PERMISSIONSET} ${ZFS_VOLUME} + +# delegate the "zfsadmin" permission set to the PORTBUILD_USER. +zfs allow -u ${PORTBUILD_USER} @zfsadmin ${ZFS_VOLUME} + +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?201212171900.qBHJ0r4a045835>