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?

Inso.

link|improve this question
feedback

1 Answer

Perhaps the pmount program can help you. Another option is setting sudo rules. The sudo program does allow you to define some pretty specific rules once you grok its config syntax.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.