[sane-devel] sanei_usb_open() and permission denied
chris at cnpbagwell.com
Sun Aug 25 17:09:40 UTC 2013
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the sane-devel