[sane-devel] sanei_usb_open() and permission denied

Chris Bagwell chris at cnpbagwell.com
Sun Aug 25 17:09:40 UTC 2013


Hi all,

This is probably directly more towards Stéphane based on recent USB work
but of interest to all.

The sanie_usb_test.c test is failing on one of my Linux boxes in the
test_open_all() test... I'd like to get some input on best way to fix this
failure or if we should fix it at all.

The reason it is failing for me is because this box has a USB wifi module
that has a report with Vendor Specific Class/Subclass/Protocol and so sane
adds it to the list as possible scanner.  The open itself fails when ran by
normal user because its accessable only by root (EACCES).  The open fails
when ran as root because its already opened by networking stuff (EBUSY).

Because these two cases are kinda soft failures, I was thinking about
changing the test to simply skip over these opens instead of failing the
whole test case.  What do you think about this change?

If you agree with that change, the second issue I'll have is that
sanei_usb_open() seems to treat EPERM as permission denied
(SANE_STATUS_ACCESS_DENIED) but not EACCES.  Do you see any issues with me
changing it so both EPERM and EACCES map to SANE_STATUS_ACCESS_DENIED?

If I don't make that change then the EACCES error code is mapped to generic
SANE_STATUS_INVAL and I can't tell difference between real failures and
permission failures.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130825/0d958d4d/attachment.html>


More information about the sane-devel mailing list