I am writing this software that creates virtual block device nodes almost like loop does. I need to allow non-superusers to mount and umount filesystems from these devices. I don't know the names of the block device nodes beforehand so i can't use fstab entries to add "user" or "owner" flags there.
Currently i solve this by providing a small suid helper tool that verifies that this is indeed "my" block device the user is trying to mount and then just call /sbin/mount or /sbin/umount to do the job. This is definitely better than setting a suid bit for the whole program but not really perfect. Is there a better way?