# manila-rootwrap command filters for share nodes
# This file should be owned by (and only-writeable by) the root user

[Filters]
# manila/utils.py : 'chown', '%s', '%s'
chown: CommandFilter, chown, root
# manila/utils.py : 'cat', '%s'
cat: CommandFilter, cat, root

# manila/share/drivers/lvm.py: 'mkfs.ext4', '/dev/mapper/%s'
mkfs.ext4: CommandFilter, mkfs.ext4, root

# manila/share/drivers/lvm.py: 'mkfs.ext3', '/dev/mapper/%s'
mkfs.ext3: CommandFilter, mkfs.ext3, root

# manila/share/drivers/lvm.py: 'smbd', '-s', '%s', '-D'
smbd: CommandFilter, smbd, root
smb: CommandFilter, smb, root

# manila/share/drivers/lvm.py: 'rmdir', '%s'
rmdir: CommandFilter, rmdir, root

# manila/share/drivers/lvm.py: 'dd' 'count=0', 'if=%s' % srcstr, 'of=%s'
dd: CommandFilter, dd, root

# manila/share/drivers/lvm.py: 'fsck', '-pf', %s
fsck: CommandFilter, fsck, root

# manila/share/drivers/lvm.py: 'resize2fs', %s
resize2fs: CommandFilter, resize2fs, root

# manila/share/drivers/helpers.py: 'smbcontrol', 'all', 'close-share', '%s'
smbcontrol: CommandFilter, smbcontrol, root

# manila/share/drivers/helpers.py: 'net', 'conf', 'addshare', '%s', '%s', 'writeable=y', 'guest_ok=y
# manila/share/drivers/helpers.py: 'net', 'conf', 'delshare', '%s'
# manila/share/drivers/helpers.py: 'net', 'conf', 'setparm', '%s', '%s', '%s'
# manila/share/drivers/helpers.py: 'net', 'conf', 'getparm', '%s', 'hosts allow'
net: CommandFilter, net, root

# manila/share/drivers/helpers.py: 'cp', '%s', '%s'
cp: CommandFilter, cp, root

# manila/share/drivers/helpers.py: 'service', '%s', '%s'
service: CommandFilter, service, root

# manila/share/drivers/lvm.py: 'lvremove', '-f', "%s/%s
lvremove: CommandFilter, lvremove, root

# manila/share/drivers/lvm.py: 'lvextend', '-L', '%sG''-n', %s
lvextend: CommandFilter, lvextend, root

# manila/share/drivers/lvm.py: 'lvcreate', '-L', %s, '-n', %s
lvcreate: CommandFilter, lvcreate, root

# manila/share/drivers/lvm.py: 'vgs', '--noheadings', '-o', 'name'
# manila/share/drivers/lvm.py: 'vgs', %s, '--rows', '--units', 'g'
vgs: CommandFilter, vgs, root

# manila/share/drivers/lvm.py: 'tune2fs', '-U', 'random', '%volume-snapshot%'
tune2fs: CommandFilter, tune2fs, root

# manila/share/drivers/generic.py: 'sed', '-i', '\'/%s/d\'', '%s'
sed: CommandFilter, sed, root

# manila/share/drivers/glusterfs.py: 'mkdir', '%s'
# manila/share/drivers/ganesha/manager.py: 'mkdir', '-p', '%s'
mkdir: CommandFilter, mkdir, root

# manila/share/drivers/glusterfs.py: 'rm', '-rf', '%s'
rm: CommandFilter, rm, root

# manila/share/drivers/glusterfs.py: 'mount', '-t', 'glusterfs', '%s', '%s'
# manila/share/drivers/glusterfs/glusterfs_native.py: 'mount', '-t', 'glusterfs', '%s', '%s'
mount: CommandFilter, mount, root

# manila/share/drivers/glusterfs.py: 'gluster', '--xml', 'volume', 'info', '%s'
# manila/share/drivers/glusterfs.py: 'gluster', 'volume', 'set', '%s', 'nfs.export-dir', '%s'
gluster: CommandFilter, gluster, root

# manila/network/linux/ip_lib.py: 'ip', 'netns', 'exec', '%s', '%s'
ip: CommandFilter, ip, root

# manila/network/linux/interface.py: 'ovs-vsctl', 'add-port', '%s', '%s'
ovs-vsctl: CommandFilter, ovs-vsctl, root

# manila/share/drivers/glusterfs/glusterfs_native.py: 'find', '%s', '-mindepth', '1', '!', '-path', '%s', '!', '-path', '%s', '-delete'
# manila/share/drivers/glusterfs/glusterfs_native.py: 'find', '%s', '-mindepth', '1', '-delete'
find: CommandFilter, find, root

# manila/share/drivers/glusterfs/glusterfs_native.py: 'umount', '%s'
umount: CommandFilter, umount, root

# GPFS commands
# manila/share/drivers/ibm/gpfs.py: 'mmgetstate', '-Y'
mmgetstate: CommandFilter, mmgetstate, root
# manila/share/drivers/ibm/gpfs.py: 'mmlsattr', '%s'
mmlsattr: CommandFilter, mmlsattr, root
# manila/share/drivers/ibm/gpfs.py: 'mmcrfileset', '%s', '%s', '--inode-space', 'new'
mmcrfileset: CommandFilter, mmcrfileset, root
# manila/share/drivers/ibm/gpfs.py: 'mmlinkfileset', '%s', '%s', '-J', '%s'
mmlinkfileset: CommandFilter, mmlinkfileset, root
# manila/share/drivers/ibm/gpfs.py: 'mmsetquota', '-j', '%s', '-h', '%s', '%s'
mmsetquota: CommandFilter, mmsetquota, root
# manila/share/drivers/ibm/gpfs.py: 'mmunlinkfileset', '%s', '%s', '-f'
mmunlinkfileset: CommandFilter, mmunlinkfileset, root
# manila/share/drivers/ibm/gpfs.py: 'mmdelfileset', '%s', '%s', '-f'
mmdelfileset: CommandFilter, mmdelfileset, root
# manila/share/drivers/ibm/gpfs.py: 'mmcrsnapshot', '%s', '%s', '-j', '%s'
mmcrsnapshot: CommandFilter, mmcrsnapshot, root
# manila/share/drivers/ibm/gpfs.py: 'mmdelsnapshot', '%s', '%s', '-j', '%s'
mmdelsnapshot: CommandFilter, mmdelsnapshot, root
# manila/share/drivers/ibm/gpfs.py: 'rsync', '-rp', '%s', '%s'
rsync: CommandFilter, rsync, root
# manila/share/drivers/ibm/gpfs.py: 'exportfs'
exportfs: CommandFilter, exportfs, root
# manila/share/drivers/ibm/gpfs.py: 'stat', '--format=%F', '%s'
stat: CommandFilter, stat, root
# manila/share/drivers/ibm/gpfs.py: 'df', '-P', '-B', '1', '%s'
df: CommandFilter, df, root
# manila/share/drivers/ibm/gpfs.py: 'chmod', '777', '%s'
chmod: CommandFilter, chmod, root
# manila/share/drivers/ibm/gpfs.py: 'mmnfs', 'export', '%s', '%s'
mmnfs: CommandFilter, mmnfs, root
# manila/share/drivers/ibm/gpfs.py: 'mmlsfileset', '%s', '-J', '%s', '-L'
mmlsfileset: CommandFilter, mmlsfileset, root
# manila/share/drivers/ibm/gpfs.py: 'mmchfileset', '%s', '-J', '%s', '-j', '%s'
mmchfileset: CommandFilter, mmchfileset, root
# manila/share/drivers/ibm/gpfs.py: 'mmlsquota', '-j', '-J', '%s', '%s'
mmlsquota: CommandFilter, mmlsquota, root

# manila/share/drivers/ganesha/manager.py: 'mv', '%s', '%s'
mv: CommandFilter, mv, root

# manila/share/drivers/ganesha/manager.py: 'mktemp', '-p', '%s', '-t', '%s'
mktemp: CommandFilter, mktemp, root

# manila/share/drivers/ganesha/manager.py:
shcat: RegExpFilter, sh, root, sh, -c, echo '((.|\n)*)' > /.*

# manila/share/drivers/ganesha/manager.py:
dbus-addexport: RegExpFilter, dbus-send, root, dbus-send, --print-reply, --system, --dest=org\.ganesha\.nfsd, /org/ganesha/nfsd/ExportMgr, org\.ganesha\.nfsd\.exportmgr\.(Add|Remove)Export, .*, .*

# manila/share/drivers/ganesha/manager.py:
dbus-removeexport: RegExpFilter, dbus-send, root, dbus-send, --print-reply, --system, --dest=org\.ganesha\.nfsd, /org/ganesha/nfsd/ExportMgr, org\.ganesha\.nfsd\.exportmgr\.(Add|Remove)Export, .*

# manila/share/drivers/ganesha/manager.py:
dbus-updateexport: RegExpFilter, dbus-send, root, dbus-send, --print-reply, --system, --dest=org\.ganesha\.nfsd, /org/ganesha/nfsd/ExportMgr, org\.ganesha\.nfsd\.exportmgr\.UpdateExport, .*, .*

# manila/share/drivers/ganesha/manager.py:
rmconf: RegExpFilter, sh, root, sh, -c, rm -f /.*/\*\.conf$

# ZFS commands
# manila/share/drivers/zfsonlinux/driver.py
# manila/share/drivers/zfsonlinux/utils.py
zpool: CommandFilter, zpool, root

# manila/share/drivers/zfsonlinux/driver.py
# manila/share/drivers/zfsonlinux/utils.py
zfs: CommandFilter, zfs, root

# manila/share/drivers/zfsonlinux/driver.py
kill: CommandFilter, kill, root

# manila/data/utils.py: 'ls', '-pA1', '--group-directories-first', '%s'
ls: CommandFilter, ls, root

# manila/data/utils.py: 'touch', '--reference=%s', '%s'
touch: CommandFilter, touch, root

# manila/share/drivers/container/container.py: docker <whatever>
docker: CommandFilter, docker, root

# manila/share/drivers/container/container.py: brctl <whatever>
brctl: CommandFilter, brctl, root

# manila/share/drivers/container/storage_helper.py: e2fsck <whatever>
# manila/share/drivers/generic.py: e2fsck <whatever>
# manila/share/drivers/lvm.py: e2fsck <whatever>
e2fsck: CommandFilter, e2fsck, root

# manila/share/drivers/lvm.py: lvconvert --merge %s
lvconvert: CommandFilter, lvconvert, root

# manila/data/utils.py: 'sha256sum', '%s'
sha256sum: CommandFilter, sha256sum, root

# manila/utils.py: 'tee', '%s'
tee: CommandFilter, tee, root

# manila/share/drivers/container/storage_helper.py: lvs -o lv_size --noheadings --nosuffix --units g <device>
lvs: CommandFilter, lvs, root

# manila/share/drivers/container/storage_helper.py: lvrename --autobackup n <old_name> <new_name>
lvrename: CommandFilter, lvrename, root
