diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 18:44:51 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 18:44:51 +0200 |
commit | ad38bc6ecb80ddeb562841b33258dd53659b1da6 (patch) | |
tree | e02e9c3ff760554fd87f70df0e18b88594091a48 /tools/openbsd | |
parent | 9c23ed018d72eed2554f4f9cff1ae6e6bb0cd479 (diff) |
New upstream version 1.0.31upstream/1.0.31
Diffstat (limited to 'tools/openbsd')
-rwxr-xr-x | tools/openbsd/attach | 15 | ||||
-rwxr-xr-x | tools/openbsd/detach | 17 |
2 files changed, 15 insertions, 17 deletions
diff --git a/tools/openbsd/attach b/tools/openbsd/attach index b6c98c8..16ce31f 100755 --- a/tools/openbsd/attach +++ b/tools/openbsd/attach @@ -5,16 +5,15 @@ DEVNAME=$2 case $DEVCLASS in 0) - # generic devices case "$DEVNAME" in ugen*) - BUSNAME=`usbdevs -v -d | egrep "Controller|$DEVNAME\$" | grep -B 1 ugen0$ | head -n 1 | sed -e 's,Controller ,,' -e 's,:$,,' ` - echo $BUSNAME > /var/run/${DEVNAME}.bus - # probably our scanner - chgrp usb /dev/"$DEVNAME".* - chgrp usb /dev/"$BUSNAME" + BUSNAME=$(usbdevs -vv | egrep "Controller|$DEVNAME\$" | grep -B 1 "$DEVNAME\$" | awk -F'[ :]' '/^Controller/ { print $2 }') + echo $BUSNAME > /var/run/${DEVNAME}.bus + chown _cups:_saned /dev/${DEVNAME}.* && + chmod 660 /dev/${DEVNAME}.* + chown _cups:_saned $BUSNAME && + chmod 660 $BUSNAME ;; esac - - ;; + ;; esac diff --git a/tools/openbsd/detach b/tools/openbsd/detach index a5c209c..8566e51 100755 --- a/tools/openbsd/detach +++ b/tools/openbsd/detach @@ -5,18 +5,17 @@ DEVNAME=$2 case $DEVCLASS in 0) - # generic devices case "$DEVNAME" in ugen*) - BUSNAME=`cat /var/run/${DEVNAME}.bus` + BUSNAME=$(cat /var/run/${DEVNAME}.bus) rm -f /var/run/${DEVNAME}.bus - # probably our scanner - chgrp wheel /dev/"$DEVNAME".* - if [ x$BUSNAME != x ] ; then - chgrp wheel /dev/"$BUSNAME" - fi + chown root:wheel /dev/${DEVNAME}.* && + chmod 600 /dev/${DEVNAME}.* + test -n "$BUSNAME" && { + chown root:wheel $BUSNAME && + chmod 600 $BUSNAME + } ;; esac - - ;; + ;; esac |