Your message dated Thu, 11 May 2006 17:56:05 +0200
with message-id <[EMAIL PROTECTED]>
and subject line Bug#366845: libsane: Only root can use canon_pp backend
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libsane
Version: 1.0.17-3
Severity: normal


I've been trying to use my Canon N640P.  It works very well when I run
as root, but when I run as my normal user, sane can't find the scanner.

When I run scanimage -L as root, I see:
device `canon_pp:parport0' is a CANON N640P flatbed scanner

As normal user, I get:
No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

I think that it has something to do with the permissions on /dev/port
that libieee1284-3 uses.  

$ ls -l /dev/port
crw-rw---- 1 root scanner 1, 4 2006-05-11 08:16 /dev/port

I've changed these permissions to the above in
/etc/udev/permissions.rules, and I am a member of the scanner group.

Here's an extract of an strace -L as normal uses:
open("/dev/parport0", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/0", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport1", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/1", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport2", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/2", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport3", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/3", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport4", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/4", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport5", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/5", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport6", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/6", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport7", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/7", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
ioperm(0x378, 0x3, 0x1)                 = -1 EPERM (Operation not
permitted)
open("/dev/port", O_RDWR|O_NOCTTY)      = -1 EPERM (Operation not
permitted)
open("/dev/lp0", O_RDONLY|O_NOCTTY)     = -1 ENOENT (No such file or
directory)
open("/dev/lp1", O_RDONLY|O_NOCTTY)     = -1 ENOENT (No such file or
directory)
open("/dev/lp2", O_RDONLY|O_NOCTTY)     = -1 ENOENT (No such file or
directory)


And here's a similar extract as root.

open("/dev/parports/1", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport2", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/2", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport3", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/3", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport4", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/4", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport5", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/5", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport6", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/6", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parport7", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
open("/dev/parports/7", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or
directory)
ioperm(0x378, 0x3, 0x1)                 = 0
ioperm(0x378, 0x3, 0)                   = 0
open("/dev/port", O_RDWR|O_NOCTTY)      = 3
close(3)                                = 0
open("/dev/lp0", O_RDONLY|O_NOCTTY)     = -1 ENOENT (No such file or
directory)
open("/dev/lp1", O_RDONLY|O_NOCTTY)     = -1 ENOENT (No such file or
directory)
open("/dev/lp2", O_RDONLY|O_NOCTTY)     = -1 ENOENT (No such file or
directory)


As you can see, root happily opens /dev/port, but normal user doesn't.
Doh.

That's about all of the useful info that I can think of.



-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (650, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.9
Locale: LANG=en_CA, LC_CTYPE=en_CA (charmap=ISO-8859-1)

Versions of packages libsane depends on:
ii  adduser                       3.87       Add and remove users and groups
ii  libc6                         2.3.6-7    GNU C Library: Shared libraries
ii  libgphoto2-2                  2.1.6-8    gphoto2 digital camera library
ii  libgphoto2-port0              2.1.6-8    gphoto2 digital camera port librar
ii  libieee1284-3                 0.2.10-1   cross-platform library for paralle
ii  libjpeg62                     6b-12      The Independent JPEG Group's JPEG 
ii  libusb-0.1-4                  2:0.1.12-2 userspace USB programming library
ii  makedev                       2.3.1-81   creates device files in /dev

Versions of packages libsane recommends:
ii  module-init-tools             3.2.2-2    tools for managing Linux kernel mo
ii  sane-utils                    1.0.17-3   API library for scanners -- utilit
ii  udev [hotplug]                0.091-2    /dev/ and hotplug management daemo

-- no debconf information


--- End Message ---
--- Begin Message ---
Mark Small <[EMAIL PROTECTED]> wrote:

Hi,

> As you can see, root happily opens /dev/port, but normal user doesn't.
> Doh.

And this is the intended behaviour. Only root can perform low-level I/O.

Load the parport_pc module, create /dev/parport0 (though udev should
do it for you) and try again, applying proper permissions on
/dev/parport0.

Above all, RESTORE THE PREVIOUS PERMISSIONS ON /DEV/PORT. You just
opened a security hole.

JB.

-- 
 Julien BLACHE - Debian & GNU/Linux Developer - <[EMAIL PROTECTED]> 
 
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

--- End Message ---

Reply via email to