#!/bin/sh . /etc/control.d/functions CONFIG=/etc/udev/rules.d/60-fuse.rules BINARY=/usr/bin/fusermount DEVICE=/dev/fuse new_subst public \ '^KERNEL=="fuse", MODE="0666", GROUP="root"' \ 's|^\(KERNEL=="fuse", MODE=\)"[0-7]\+",\( GROUP=\)"[a-zA-Z0-9_-]\+"|\1="0666",\2="root"|' new_fmode public 4511 root root new_subst fuse \ '^KERNEL=="fuse", MODE="0660", GROUP="fuse"' \ 's|^\(KERNEL=="fuse", MODE=\)"[0-7]\+",\( GROUP=\)"[a-zA-Z0-9_-]\+"|\1="0660",\2="fuse"|' new_fmode fuse 4711 root root new_subst wheelonly \ '^KERNEL=="fuse", MODE="0660", GROUP="wheel"' \ 's|^\(KERNEL=="fuse", MODE=\)"[0-7]\+",\( GROUP=\)"[a-zA-Z0-9_-]\+"|\1="0660",\2="wheel"|' new_fmode wheelonly 4710 root wheel new_subst restricted \ '^KERNEL=="fuse", MODE="0600", GROUP="root"' \ 's|^\(KERNEL=="fuse", MODE=\)"[0-7]\+",\( GROUP=\)"[a-zA-Z0-9_-]\+"|\1="0600",\2="root"|' new_fmode restricted 700 root root new_help public "Any user can execute $BINARY and access $DEVICE" new_help fuse "Any user can execute $BINARY, only \"fuse\" group members can access $DEVICE" new_help wheelonly "Only \"wheel\" group members can execute $BINARY and access $DEVICE" new_help restricted "Only root can execute $BINARY" case "$*" in status|'') STATUS="`control_fmode "$BINARY" status`" || exit 1 if [ "$STATUS" = "public" ]; then control_subst "$CONFIG" status || exit 1 else test -z "$STATUS" || echo "$STATUS" fi ;; public|fuse) control_fmode "$BINARY" public || exit 1 # TODO: fix device perms control_subst "$CONFIG" "$*" || exit 1 ;; wheelonly|restricted) control_fmode "$BINARY" "$*" || exit 1 control_subst "$CONFIG" public || exit 1 ;; *) control_fmode "$BINARY" "$*" || exit 1 ;; esac