ref: 9bba5b5471fbcdabf28f85317be73d3e3dd6278f
parent: eab2528f138c9976ebd39935f7ee9a03dc583718
author: cinap_lenrek <cinap_lenrek@rei2>
date: Mon Jan 9 16:44:27 EST 2012
nusbrc: fix permissions, restore before complication of complication
--- a/rc/bin/nusbrc
+++ b/rc/bin/nusbrc
@@ -5,6 +5,8 @@
if(! bind -a '#u' /dev)
exit
+mkdir -p -m 700 '#σc/usbnet'
+
@{rfork ne
fn attach {@@ -14,6 +16,7 @@
case *02
# serial and ethernet
nusb/serial $1
+ nusb/ether $1
case *03
# handled /sys/src/9/boot/nusbrc
# nusb/kb $1
@@ -25,9 +28,13 @@
}
}
fn detach {- # handled /sys/src/9/boot/nusbrc
+ switch($4){+ case *02
+ rm -f '#σ/usbnet/'^$1.*
+ }
}
rc < '#σ/usb/usbevent' &
}
bind -a '#σ/usb' /dev
+bind -a '#σ/usbnet' /net
--
⑨