Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: build/install-chroot.sh

Issue 3755010: Add the chroot creator to the default set of allowed groups (with override flag). (Closed)
Patch Set: review cleanup Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/install-chroot.sh
diff --git a/build/install-chroot.sh b/build/install-chroot.sh
index 194c0d6a15d1f68d28f65f592dd0f76c22436bca..b5b3ccd0838540080528bdb1600e9b845e94811c 100755
--- a/build/install-chroot.sh
+++ b/build/install-chroot.sh
@@ -11,15 +11,21 @@
# Debian-derived system.
usage() {
- echo "usage: ${0##*/} [-m mirror]"
- echo "-m mirror an alternate repository mirror for package downloads"
- echo "-h this help message"
+ echo "usage: ${0##*/} [-m mirror] [-g group,...]"
+ echo "-g group,... groups that can use the chroot unauthenticated"
+ echo " Default: 'admin' and current user's group ('$(id -gn)')"
+ echo "-m mirror an alternate repository mirror for package downloads"
+ echo "-h this help message"
}
process_opts() {
local OPTNAME OPTIND OPTERR OPTARG
- while getopts ":m:h" OPTNAME; do
+ while getopts ":g:m:h" OPTNAME; do
case "$OPTNAME" in
+ g)
+ [ -n "${OPTARG}" ] &&
+ chroot_groups="${chroot_groups}${chroot_groups:+,}${OPTARG}"
+ ;;
m)
if [ -n "${mirror}" ]; then
echo "You can only specify exactly one mirror location"
@@ -167,6 +173,9 @@ fi
# Add new entry to /etc/schroot/schroot.conf
grep ubuntu.com /usr/share/debootstrap/scripts/"${distname}" >&/dev/null &&
brand="Ubuntu" || brand="Debian"
+if [ -z "${chroot_groups}" ]; then
+ chroot_groups="admin,$(id -gn)"
+fi
sudo sh -c 'cat >>/etc/schroot/schroot.conf' <<EOF
[${target%bit}]
description=${brand} ${distname} ${arch}
@@ -174,8 +183,8 @@ type=directory
directory=/var/lib/chroot/${target}
priority=3
users=root
-groups=admin
-root-groups=admin
+groups=${chroot_groups}
+root-groups=${chroot_groups}
personality=linux$([ "${arch}" != 64bit ] && echo 32)
script-config=script-${target}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698