View Single Post
  #1   (View Single Post)  
Old 8th January 2013
GullibleJones GullibleJones is offline
Port Guard
 
Join Date: Sep 2008
Posts: 13
Cool Getting hotplugd to work

I'm trying to make OpenBSD automount USB and optical media, so that I don't have to bother with kern.usermount and associated insecurity. Because I'm trying to keep things simple and avoid using regexps, I just want to mount stuff by device name.

My /etc/hotplug/attach file looks like this:

Code:
#!/bin/sh

DEVCLASS=$1
DEVNAME=$2

case $DEVCLASS in
2) # disk devices
        case $DEVNAME in
        sd1) # USB drives
                mount -o nodev,nosuid /dev/sd1i /mnt/flash
                ;;
        cd0) # CD drives
                mount -o nodev,nosuid /dev/cd0a /mnt/optical
                ;;
        esac
esac
This mounts the USB drive, but keeps it read-only for limited users. It never mounts optical media.

How can I get it to mount a CD or DVD? And what's the best way to apply sane permissions to the USB drive, without changing the permissions on the device node?

Edit: okay, major "Duh" moment on the USB permissions problem. The solution is to make the mount directory writeable by whoever needs to write to it.

Still haven't figured out the CD drive though.

Last edited by GullibleJones; 8th January 2013 at 10:01 PM. Reason: One problem solved.
Reply With Quote