Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 87652 - hotplug does not set correct permissions
Summary: hotplug does not set correct permissions
Status: VERIFIED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Greg Kroah-Hartman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-02 04:29 UTC by Marcin Kryczek (RETIRED)
Modified: 2005-08-16 14:12 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Kryczek (RETIRED) gentoo-dev 2005-04-02 04:29:01 UTC
i've got problems with permissions to my usb camera.
only root can connect to it. i see, that /etc/hotplug/usb/usbcam cointains the following code:

    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}"
    fi

however i havn't got /var/run/console.lock nor /var/lock/console.lock - besides - shouldn't permissions be 660 instead of 600? 

i'm using udev-056 and i'm starting X with kdm (if that matters). i'm also using gphoto2 to connect to camera (it's not mass-storage compatible)
Comment 1 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-04-08 09:54:03 UTC
What package provides this file?
Comment 2 Daniel Seyffer 2005-05-07 07:10:03 UTC
Similar problems here (w Canon Digital Ixus) the device can only be used by the root user.

This script is provided by libgphoto2:
# epm -qf /etc/hotplug/usb/usbcam
libgphoto2-2.1.5

Permissions of the usb device (here /proc/bus/usb/001/011) are set to user only:
-rw-r--r--  1 root root 52  7. Mai 09:37 011

Also the lock files do not exist on my system. A bit of debugging clearly shows that therefore CONSOLEOWNER variable is always empty so the if statement is never entered and the device permissions will never be updated...  

(As workaround I added these two lines just after the if statement in /etc/hotplug/usb/camera a bit ugly but at least works...)
...
    fi

    chown ds:users "${DEVICE}"
    chmod 0640 "${DEVICE}"
fi

Comment 3 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-08-16 12:05:06 UTC
Not a hotplug package issue, closing.