LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-10-2004, 08:51 AM   #1
1kyle
Member
 
Registered: Feb 2004
Location: 'Ol Blighty
Distribution: SLED 10, SUSE 10.3
Posts: 722

Rep: Reputation: 32
Scanner to work as USER and not forced as ROOT Root (Suse 9.1)


SUSE and a number of distributions have a problem assigning proper user rights to USB HOTPLUG devices such as scanners and I'm sure running as root when you don't have to is not a good idea --especially if other users can use the machine(s).

This problem is not restricted to SUSE but comes from the way the HOTPLUG USB stuff has been implemented in the 2.6 Kernel.

Finally found the answer so I can use XSANE / KOOKA as a user RATHER than ROOT.

The problem is in the permissions gained via HOTPLUG.


So look at your /etc/hotplug/usb directory and pick up file sane-hardcoded.usermap

You'll see some cryptic entries like this
desktopdev 0x0003 0x03f0 0x0101 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x0
desktopdev 0x0003 0x03f0 0x0102 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x0
desktopdev 0x0003 0x03f0 0x0105 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x0

etc.

The first entry in each line is the name of the script to execute.
The next part identifies your scanner device.

Your scanner will have a number and depending on this number it will exeute the named script.

In this case they are all called desktopdev. As I only have 1 scanner I'm not going to find out which it is since all of the entries call the same script.

The old script is as follows (default with the system)

#!/bin/bash
# This adds a USB device to the "desktop usb" group.
# You just need to create an entry "desktopdev ..." in a usermap file
# and it will be picked up automatically.

if [ -x /sbin/resmgr -a ! -z "$DEVICE" ]; then
if [ "${ACTION}" = "add" ]; then
/sbin/resmgr ${ACTION} ${DEVICE} desktop usb && exit 0
else
/sbin/resmgr ${ACTION} ${DEVICE} desktop && exit 0
fi
fi


I've changed this to

#!/bin/bash
# This adds a USB device to the "desktop usb" group.
# You just need to create an entry "desktopdev ..." in a usermap file
# and it will be picked up automatically.
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
chown root "${DEVICE}"
chgrp scanner "${DEVICE}" <======= your new group scanner
chmod 660 "${DEVICE}"
fi

Now I create a group called scanner and add the user to it. The name must be the same as in the chgrp line

file is in /etc/group

add the scanner group
........various entries etc etc
at:!:25:
public:x:32:
video:x:33:kyle
games:x:40:
xok:x:41:
trusted:x:42:
modem:x:43:
ftp:x:49:
postfix:!:51:
maildrop:!:59:
man:x:62:
sshd:!:65:
ntadmin:!:71:
scanner:x:93:kyle <================add this line (with your userid of course)
mobody:x:65533:nobody
nogroup:x:65534:nobody
users:x:100:

Add your userid to the scanner group.

Re-boot the machine -- not sure if it's necessary to re-boot but coming from Windows you always have to re-boot when changing system configurations --or so it seemed to me anyway.

He presto it works.

Last edited by 1kyle; 07-10-2004 at 09:33 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forced Root File System Check? snobird Linux - Newbie 5 11-20-2006 10:17 PM
Forced Root Filesystem Check Mr_Penguin_02 Linux - Newbie 2 08-15-2004 07:37 PM
KDE (DCOP) problem starting root after forced reboot powadha Linux - Software 2 05-30-2004 05:14 PM
IntelliMouse thumb buttons work as root, broken as non-root user, wheel works always digital vortex Linux - Hardware 7 03-02-2004 04:14 PM
got ALSA to work in root, need help getting it to work in my user profile ic3 Slackware 2 11-28-2003 10:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration