Give the USB devices sensible default permissions.

Suggested by:  Kaltashkin Eugene <zhecka@klondike.ru>
This commit is contained in:
Nick Hibma 2001-01-07 18:43:31 +00:00
parent 6a75465ff3
commit 958210ab0d

View File

@ -975,19 +975,24 @@ usb)
;;
usb*)
umask 7
unit=`expr $i : 'usb\(.*\)'`
mknod usb$unit c 108 `unit2minor $unit` root:operator
chmod 0660 usb$unit
umask 77
;;
uhid*)
umask 7
unit=`expr $i : 'uhid\(.*\)'`
mknod uhid$unit c 122 `unit2minor $unit`
mknod uhid$unit c 122 `unit2minor $unit` root:operator
umask 77
;;
ums*)
umask 7
unit=`expr $i : 'ums\(.*\)'`
mknod ums$unit c 111 `unit2minor $unit`
mknod ums$unit c 111 `unit2minor $unit` root:operator
umask 77
;;
ulpt*)
@ -999,45 +1004,56 @@ ulpt*)
;;
ugen*)
umask 7
unit=`expr $i : 'ugen\([0-9][0-9]*\)'`
endpoint=`expr $i : 'ugen.*\.\([0-9][0-9]*\)'`
if [ -z "${unit}" ]; then
echo $i - Invalid unit number
fi
if [ -z "${endpoint}" ]; then # ugen0 & ugen0.1 - ugen0.15
mknod ugen$unit c 114 `unit2minor $(($unit * 16))`
mknod ugen$unit c 114 \
`unit2minor $(($unit * 16))` root:operator
i=1
while [ $i -lt 16 ]; do
mknod ugen$unit.$i c 114 \
`unit2minor $(($unit * 16 + $i))`
`unit2minor $(($unit * 16 + $i))` root:operator
i=$(($i + 1))
done
else
minor=`unit2minor $(($unit * 16 + $endpoint))`
mknod ugen$unit.$endpoint c 114 $minor
mknod ugen$unit.$endpoint c 114 $minor root:operator
fi
umask 77
;;
urio*)
umask 7
unit=`expr $i : 'urio\(.*\)'`
mknod urio$unit c 143 `unit2minor $unit`
mknod urio$unit c 143 `unit2minor $unit` root:operator
umask 77
;;
usio*)
umask 7
unit=`expr $i : 'usio\(.*\)'`
minor=`unit2minor $(($unit + 128))`
mknod usio$unit c 138 $minor
mknod usio$unit c 138 $minor uucp:dialer
umask 77
;;
uscanner*)
umask 7
unit=`expr $i : 'uscanner\(.*\)'`
mknod uscanner$unit c 156 `unit2minor $unit`
mknod uscanner$unit c 156 `unit2minor $unit` root:operator
umask 77
;;
umodem*)
unit=`expr $i : 'umodem\(.*\)'`
mknod umodem$unit c 124 `unit2minor $unit`
;;
umask 7
unit=`expr $i : 'umodem\(.*\)'`
mknod umodem$unit c 124 `unit2minor $unit` uucp:dialer
umask 77
;;
lpt*)
unit=`expr $i : 'lpt\(.*\)'`