sane-plustek creates lock file in non-existent directory /var/lock/sane/
Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973490
On many modern Linux distributions, /var/lock points to /run/lock, which usually resides on a tmpfs and is not intended to contain any persistent data. The original announcement for /run explicitly states this: https://lwn.net/Articles/436012/
Yet, sane-plustek creates a lock file in /var/run/lock/sane/ without ensuring that the directory exists (at least if locks are enabled). This leads to errors when the file can't be opened, such as this one:
$ SANE_DEBUG_PLUSTEK=255 scanimage -L
[18:09:01.316974] [plustek] usbDev_open(auto,) - 0x5631a0273570
[18:09:01.316987] [plustek] sanei_access_lock failed: 11
[18:09:01.316994] [plustek] open failed: -1
[18:09:01.317001] [plustek] sane_get_devices (0x7ffd2dd4f860, 0)
scanimage: no SANE devices found
Tracing scanimage in the debugger revealed that it wanted to create /var/lock/sane/LCK..auto
This is particularly evident when saned isn't used and a user tries to use sane directly.
While creating the directory with a logged in user's ownership may certainly lead to other issues, not creating it all and displaying no useful error message leads to a very bad user experience.