From 861f633196923c7aa167e1f603d001cd8a7c2e5a Mon Sep 17 00:00:00 2001 From: Ghe Rivero Date: Mon, 28 Jan 2013 17:20:22 +0100 Subject: [PATCH] Add sudoers rule to format and mount anykind of partitions in disks. The element vm is the only one creating a partition in the disk. If not included, it will ask for sudo password to format or mount the whole nbd disk or disks with multiple partitions. Change-Id: Iac0987d2088433873b7cbb68deecc9254b2d0103 --- sudoers.d/img-build-sudoers | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sudoers.d/img-build-sudoers b/sudoers.d/img-build-sudoers index 25393eb5..ea3da56a 100644 --- a/sudoers.d/img-build-sudoers +++ b/sudoers.d/img-build-sudoers @@ -1,12 +1,12 @@ # Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -23,7 +23,7 @@ ALL ALL=(root) NOPASSWD: /bin/mount --bind /tmp/*/hooks /tmp/*/mnt/tmp/in_target ALL ALL=(root) NOPASSWD: /bin/mount -o remount\,ro\,bind /tmp/*/hooks /tmp/*/mnt/tmp/in_target.d ALL ALL=(root) NOPASSWD: /bin/mount -t proc none /tmp/*/mnt/proc ALL ALL=(root) NOPASSWD: /bin/mount -t sysfs none /tmp/*/mnt/sys -ALL ALL=(root) NOPASSWD: /bin/mount /dev/nbd0p1 /tmp/*/mnt +ALL ALL=(root) NOPASSWD: /bin/mount /dev/nbd0* /tmp/*/mnt ALL ALL=(root) NOPASSWD: /bin/mv /tmp/*/mnt/* /tmp/*/mnt/* ALL ALL=(root) NOPASSWD: /bin/rm -* /tmp/*/mnt/* ALL ALL=(root) NOPASSWD: /bin/rmdir /tmp/*/mnt/* @@ -33,7 +33,7 @@ ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt/dev ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt/proc ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt/sys ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt/tmp/in_target.d -ALL ALL=(root) NOPASSWD: /sbin/mkfs -F -t ext4 -L cloudimg-rootfs /dev/nbd0p1 +ALL ALL=(root) NOPASSWD: /sbin/mkfs -F -t ext4 -L cloudimg-rootfs /dev/nbd0* ALL ALL=(root) NOPASSWD: /sbin/modprobe nbd max_part=16 ALL ALL=(root) NOPASSWD: /sbin/sfdisk /dev/nbd0 ALL ALL=(root) NOPASSWD: /usr/bin/qemu-nbd -c /dev/nbd0 --cache=writeback /tmp/*/image