#951454 xsane: Scanning for devices hangs the program

Package:
xsane
Source:
xsane
Description:
featureful graphical frontend for SANE (Scanner Access Now Easy)
Submitter:
JCGoran
Date:
2021-03-23 14:06:02 UTC
Severity:
normal
#951454#5
Date:
2020-02-16 18:56:41 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?
    `xsane` takes an exuberant amount of time scanning for devices on large networks,
    basically hanging the entire program and making it unusable.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
    Completely turning off all networking works, as well as running the program in a sandbox
    as `unshare -n xsane`, however both of those methods are a bit cumbersome to use,
    and I have not found any switches in the preferences for disabling the scanning for network (non USB) devices.

   * What outcome did you expect instead?
    That `xsane` starts normally and then lists available devices, and/or
    an option to entirely disable scanning over the network in the preferences.

    Below is a sample output of `strace xsane`:

recvfrom(18, "\0\0\204\0\0\0\0\1\0\0\0\1%HP LaserJet 400 col"..., 2048, 0, {sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("XXX.XXX.XXX.XXX")}, [16]) = 623
select(19, [18], NULL, NULL, {tv_sec=0, tv_usec=300000}) = 1 (in [18], left {tv_sec=0, tv_usec=281291})
recvfrom(18, "\0\0\204\0\0\0\0\1\0\0\0\1&HP Color LaserJet M"..., 2048, 0, {sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("YYY.YYY.YYY.YYY")}, [16]) = 834
select(19, [18], NULL, NULL, {tv_sec=0, tv_usec=300000}) = 1 (in [18], left {tv_sec=0, tv_usec=290064})

#951454#10
Date:
2021-03-23 14:02:54 UTC
From:
To:
My current, non-sudo-requiring workaround is to just use firejail by setting
the following alias in ~/.bash_aliases:

alias xsane='firejail --noprofile --net=none xsane'

and the same thing for the /usr/share/applications/xsane.desktop file.
The file
gets reset after every upgrade to the xsane package, but since the stable
version isn't upgraded that often, it's not a big deal.

Cheers,
Goran