Lei Chen wrote: > Bill Sommerfeld wrote: >> The whole "scanner as removable media" thing was a total distraction/red >> herring. >> >> Project team (or Darren?): is there a portable way with libsane to reset >> a scanner to its power-on-default or factory-default configuration? Or >> does this require scanner-model-specific knowledge? >> > The reset-to-default behavior depends on the hardware's capability. Some > scanners support reset operation. Upon device close/open, a reset > command will be sent to the device. For those that don't support > hardware reset, the backend will call its own init_options() or similar > function to set default parameters for a device upon sane_init(), > sane_open() or sane_start()[1], then write such parameters to device to > acquire data. Some backend may even use all the methods to set initial > state of a scanner. Application can change the parameter values by > calling sane_control_option(). So, whenever a user starts to acquire > image data from a scanner, the scanner's state is reset.
My understanding of the above summary is that "device clean" is effectively built into the API and to the scanimage(1) command. However given that the devices are managed by logindevperm when not running with Trusted Extensions this is more than should be necessary. When Trusted Extensions is enabled (svcadm enable labeled) the logindevperm entries that give access to the USB scanner devices (via libusb/ugen(7D)) are disabled from logindevperm. This means the system is "safe" though scanner devices can't be allocated. Fixing the allocation of non mass-storage/audio devices when running with Trusted Extensions is very much out of scope for this case. I think such a case is needed; but I don't currently see any value in derailing this case to write an opinion to say so. Instead I've logged bugster CR# 6676059. -- Darren J Moffat
