<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>blog.crox.net (Entries tagged as scanner)</title>
    <link>https://blog.crox.net/</link>
    <description></description>
    <dc:language>en</dc:language>
    <generator>Serendipity 2.5.0 - http://www.s9y.org/</generator>
    <pubDate>Mon, 28 Dec 2009 01:36:45 GMT</pubDate>

    <image>
    <url>https://blog.crox.net/templates/2k11/img/s9y_banner_small.png</url>
    <title>RSS: blog.crox.net - </title>
    <link>https://blog.crox.net/</link>
    <width>100</width>
    <height>21</height>
</image>

<item>
    <title>Scanner permissions in Ubuntu Karmic (udev libusb saned problem with udev-acl)</title>
    <link>https://blog.crox.net/archives/64-Scanner-permissions-in-Ubuntu-Karmic-udev-libusb-saned-problem-with-udev-acl.html</link>
    
    <comments>https://blog.crox.net/archives/64-Scanner-permissions-in-Ubuntu-Karmic-udev-libusb-saned-problem-with-udev-acl.html#comments</comments>
    <wfw:comment>https://blog.crox.net/wfwcomment.php?cid=64</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>https://blog.crox.net/rss.php?version=2.0&amp;type=comments&amp;cid=64</wfw:commentRss>
    

    <author>nospam@example.com (crox)</author>
    <content:encoded>
    In Ubuntu Karmic (and possibly Jaunty ?), when you install libsane, it adds a file /lib/udev/rules.d/40-libsane.rules which contains rules that match on supported scanners and set the environment variable &quot;libsane_matched&quot; to &quot;yes&quot;.&lt;br /&gt;
&lt;br /&gt;
This in turn triggers the following in /lib/udev/rules.d/70-acl.rules:&lt;br /&gt;
&lt;pre&gt;# USB scanners&lt;br /&gt;ENV{libsane_matched}==&quot;yes&quot;, ENV{ACL_MANAGE}=&quot;1&quot;&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
# apply ACL for all locally logged in users&lt;br /&gt;LABEL=&quot;acl_apply&quot;, ENV{ACL_MANAGE}==&quot;?*&quot;, TEST==&quot;/var/run/ConsoleKit/database&quot;, \&lt;br /&gt;  RUN+=&quot;udev-acl --action=$env{ACTION} --device=$env{DEVNAME}&quot;&lt;/pre&gt;&lt;br /&gt;
In the end, the result is that an ACL is created for the device, which allows locally logged in users to use it (read/write permission). eg for my scanner:&lt;br /&gt;
&lt;pre&gt;~# lsusb&lt;br /&gt;Bus 001 Device 005: ID 04b8:011c Seiko Epson Corp. Perfection 3200&lt;br /&gt;~# ls -l /dev/bus/usb/001/005&lt;br /&gt;crw-rw-r--+ 1 root root 189, 4 2009-12-28 00:11 /dev/bus/usb/001/005&lt;br /&gt;~# getfacl /dev/bus/usb/001/005&lt;br /&gt;getfacl: Removing leading &#039;/&#039; from absolute path names&lt;br /&gt;# file: dev/bus/usb/001/005&lt;br /&gt;# owner: root&lt;br /&gt;# group: root&lt;br /&gt;user::rw-&lt;br /&gt;user:crox:rw-&lt;br /&gt;group::rw-&lt;br /&gt;mask::rw-&lt;br /&gt;other::r--&lt;br /&gt;~#&lt;/pre&gt;&lt;br /&gt;
However, I also wanted to allow access to the scanner from other workstations through saned. In older Ubuntu versions, you could just add saned (or whatever user the service runs as) to the scanner group. This no longer works since the device belongs to root:root, and ACLs are added for specific users. The solution that works for me is to create a file /etc/udev/rules.d/99-sane-group.rules with the following contents:&lt;br /&gt;
&lt;pre&gt;# change group to scanner for sane devices&lt;br /&gt;ENV{libsane_matched}==&quot;yes&quot;, GROUP=&quot;scanner&quot;&lt;/pre&gt;&lt;br /&gt;
Then you just need to run &lt;pre&gt;sudo udevadm trigger&lt;/pre&gt; and the group of the device magically changes to scanner.&lt;br /&gt;
&lt;br /&gt;
Of course you could also add a similar rule specifically for a certain device instead, in my case this would work too:&lt;br /&gt;
&lt;pre&gt;ATTRS{idVendor}==&quot;1d6b&quot;, ATTRS{idProduct}==&quot;0002&quot;, GROUP=&quot;scanner&quot;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
To check that it worked, run the following: &lt;pre&gt;sudo su -s /bin/bash -c &#039;scanimage -L&#039; saned&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sun, 27 Dec 2009 23:13:00 +0000</pubDate>
    <guid isPermaLink="false">https://blog.crox.net/archives/64-guid.html</guid>
    <category>linux</category>
<category>scanner</category>
<category>ubuntu</category>

</item>
<item>
    <title>Firewire scanner on linux</title>
    <link>https://blog.crox.net/archives/7-Firewire-scanner-on-linux.html</link>
    
    <comments>https://blog.crox.net/archives/7-Firewire-scanner-on-linux.html#comments</comments>
    <wfw:comment>https://blog.crox.net/wfwcomment.php?cid=7</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.crox.net/rss.php?version=2.0&amp;type=comments&amp;cid=7</wfw:commentRss>
    

    <author>nospam@example.com (crox)</author>
    <content:encoded>
    (as root)&lt;br /&gt;
&lt;pre&gt;modprobe ieee1394&lt;br/&gt;modprobe ohci1394&lt;br/&gt;modprobe sbp2&lt;br/&gt;sane-find-scanner&lt;br/&gt;chmod a+rw /dev/sg0&lt;/pre&gt;&lt;br /&gt;
(as regular user)&lt;br /&gt;
&lt;pre&gt;scanimage -L&lt;/pre&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Fri, 06 Oct 2006 22:16:57 +0000</pubDate>
    <guid isPermaLink="false">https://blog.crox.net/archives/7-guid.html</guid>
    <category>linux</category>
<category>scanner</category>

</item>

</channel>
</rss>
