Ant: Re: [sane-devel] New Model: Brother MFC-210C

Henning Meier-Geinitz henning at meier-geinitz.de
Tue Oct 18 16:46:10 UTC 2005


Hi,

Please reply to the sane-devel mailing list.

On Tue, Oct 18, 2005 at 03:34:40PM +0200, Benjamin Mirza wrote:
> Yes, it works,

Thanks. I'll update our lists.

> but only as root.

The standard solution is described in README.linux and
tools/hotplug/README. It depends on the situation if giving anybody on
the console the right to scan and to not base the permission on the
user.

I have re-arranged the quoting a bit so that sane-devl can see your
proposed solution also.

> The workaround works (i?m able to scan as non-root),
> but kooka and openoffice crash, when i?m trying to
> make a prescan and resize the scanningarea. After
> that, i have to reboot, to get it working again.
> 
> I?d be nice, if you had any solution for this (root
> only+crashing).

Root only, see above. Usually you must only add your user to group
"scanner" (or similar). It depends on the distribution.

Concerning the crash, I'm afraid the chance that we can help is quite
low as the brother backends are not part of the sane-backends
distribution and they contain also binary-only software. If you don't
get an answer here, try to contact the Brother developers.

Bye,
  Henning


> Still, there?s a
> workaround from fedoraforum.org:
> 
> "I was finally able to get my USB Snapscan scanner to
> work as a user without having to disconnect and
> reconnect the device. I've attached the contents of
> /etc/security/console.perms 
>  which i finally got configured correctly to handle
> setting permissions to /proc/bus/usb/00*/00* 
>  # /etc/security/console.perms 
>  # 
>  # This file determines the permissions that will be
> given to priviledged 
>  # users of the console at login time, and the
> permissions to which to 
>  # revert when the users log out. 
>  
>  # format is: 
>  # <class>=list of regexps specifying consoles or
> globs specifying files 
>  # file-glob|<class> perm dev-regex|<dev-class> \ 
>  # revert-mode revert-owner[.revert-group] 
>  # the revert-mode, revert-owner, and revert-group are
> optional, and default 
>  # to 0600, root, and root, respectively. 
>  # 
>  # For more information: 
>  # man 5 console.perms 
>  
>  # file classes -- these are regular expressions 
>  <console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9]
> :[0-9] 
>  <xconsole>=:[0-9]\.[0-9] :[0-9] 
>  
>  # device classes -- these are shell-style globs 
>  <floppy>=/dev/fd[0-1]* \ 
>  /dev/floppy/* /mnt/floppy* 
>  <sound>=/dev/dsp* /dev/audio* /dev/midi* \ 
>  /dev/mixer* /dev/sequencer \ 
>  /dev/sound/* /dev/beep \ 
>  /dev/snd/* 
>  <cdrom>=/dev/cdrom* /dev/cdroms/* /dev/cdwriter*
> /mnt/cdrom* 
>  <pilot>=/dev/pilot 
>  <jaz>=/mnt/jaz* 
>  <zip>=/mnt/pocketzip* /mnt/zip* 
>  <ls120>=/dev/ls120 /mnt/ls120* 
>    <scanner>=/dev/scanner /dev/usb/scanner*
> /proc/bus/usb/00*/00*   
>  <rio500>=/dev/usb/rio500 
>  <camera>=/mnt/camera* /dev/usb/dc2xx*
> /dev/usb/mdc800* 
>  <memstick>=/mnt/memstick* 
>  <flash>=/mnt/flash* 
>  <diskonkey>=/mnt/diskonkey* 
>  <rem_ide>=/mnt/microdrive* 
>  <fb>=/dev/fb /dev/fb[0-9]* \ 
>  /dev/fb/* 
>  <kbd>=/dev/kbd 
>  <joystick>=/dev/js[0-9]* 
>  <v4l>=/dev/video* /dev/radio* /dev/winradio*
> /dev/vtx* /dev/vbi* \ 
>  /dev/video/* 
>  <gpm>=/dev/gpmctl 
>  <dri>=/dev/nvidia* /dev/3dfx* 
>  <mainboard>=/dev/apm_bios 
>  
>  # permission definitions 
>  <console> 0660 <floppy> 0660 root.floppy 
>  <console> 0600 <sound> 0600 root 
>  <console> 0600 <cdrom> 0660 root.disk 
>  <console> 0600 <pilot> 0660 root.uucp 
>  <console> 0600 <jaz> 0660 root.disk 
>  <console> 0600 <zip> 0660 root.disk 
>  <console> 0600 <ls120> 0660 root.disk 
>   <console> 0666 <scanner> 0600 root  
>  <console> 0600 <camera> 0600 root 
>  <console> 0600 <memstick> 0600 root 
>  <console> 0600 <flash> 0600 root 
>  <console> 0600 <diskonkey> 0660 root.disk 
>  <console> 0600 <rem_ide> 0660 root.disk 
>  <console> 0600 <fb> 0600 root 
>  <console> 0600 <kbd> 0600 root 
>  <console> 0600 <joystick> 0600 root 
>  <console> 0600 <v4l> 0600 root 
>  <console> 0700 <gpm> 0700 root 
>  <console> 0600 <mainboard> 0600 root 
>  <console> 0600 <rio500> 0600 root 
>  
>  <xconsole> 0600 /dev/console 0600 root.root 
>  <xconsole> 0600 <dri> 0600 root 
>  
>  i added /proc/bus/usb/00*/00* to the end of the
> <scanner> line 
>  
>  I also changed the permissions for scanner from 0600
> to 0666 (but 0660 will probably also work) 
>  
>  Restarted my system, logged in as user and voila
> xsane came up perfectly. 
>  
>  Hope this is of some help to those other newbies
> struggling to get their devices configured correctly. 
>  
>  If you unplug or disconnect your device during the
> session you may have to add a chmod command to
> /etc/hotplug/libusbscanner in case permissions get
> reset... heres my copy of  libusbscanner  
>  
>  #!/bin/bash 
>  # $Id:  libusbscanner  ,v 1.1 2004/05/04 13:05:27
> twaugh Exp $ 
>  # 
>  # /etc/hotplug/usb/libusbscanner 
>  # 
>  # Sets up newly plugged in USB scanner so that the
> user who owns 
>  # the console according to pam_console can access it
> from user space 
>  # 
>  # Note that for this script to work, you'll need all
> of the following: 
>  # a) a line in the file /etc/hotplug/usermap that
> corresponds to the 
>  # camera you are using. 
>  # b) a setup using pam_console creates the respective
> lock files 
>  # containing the name of the respective user. You can
> check for that 
>  # by executing "echo `cat
> /var/{run,lock}/console.lock`" and 
>  # verifying the appropriate user is mentioned
> somewhere there. 
>  # c) a Linux kernel supporting hotplug and usbdevfs 
>  # d) the hotplug package ( 
> http://linux-hotplug.sourceforge.net/  ) 
>  # 
>  # In the usermap file, the first field "usb module"
> should be named 
>  # "libusbscanner" like this script. 
>  # 
>  
>  if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ] 
>  then 
>  # New code, using lock files instead of copying
> /dev/console permissions 
>  # This also works with non-gdm logins (e.g. on a
> virtual terminal) 
>  # Idea and code from Nalin Dahyabhai
> <nalin at redhat.com> 
>  if [ -f /var/run/console.lock ] 
>  then 
>  CONSOLEOWNER=`cat /var/run/console.lock` 
>  elif [ -f /var/lock/console.lock ] 
>  then 
>  CONSOLEOWNER=`cat /var/lock/console.lock` 
>  else 
>  CONSOLEOWNER= 
>  fi 
>  if [ -n "$CONSOLEOWNER" ] 
>  then 
>  chmod 0000 "${DEVICE}" 
>  chown "$CONSOLEOWNER" "${DEVICE}" 
>  chmod 0600 "${DEVICE}" 
>    chmod a+rw /proc/bus/usb/00*   
>  fi 
>  fi "
> 
> 
> Bye
> Benjamin



More information about the sane-devel mailing list