Bug 188383 - gthumb can not import images from digital camera
gthumb can not import images from digital camera
Status: CLOSED DUPLICATE of bug 186131
Product: Fedora
Classification: Fedora
Component: gthumb (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Carl Worth
Depends On:
  Show dependency treegraph
Reported: 2006-04-08 16:19 EDT by Gerard Fernandes
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-02 23:47:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Dumps of 'gphoto2 --list-files' debug & strace for root vs. user on FC5 (116.65 KB, application/x-gzip)
2006-04-28 14:36 EDT, Andy Walls
no flags Details
Dumps of 'gphoto2 --list-files' debug & strace for root vs. user on FC5 (116.65 KB, application/x-compressed-tar)
2006-04-28 14:37 EDT, Andy Walls
no flags Details

  None (edit)
Description Gerard Fernandes 2006-04-08 16:19:47 EDT
Description of problem: gthumb can not import images from my digital camera.
This worked in FC4.

Version-Release number of selected component (if applicable):gthumb

How reproducible: always

Steps to Reproduce:
1. Log in as a non-root user
2. Connect digital camera with USB cable
Actual results: Nothing happens

Expected results: Should pop up a dialog asking if I want to import the images

Additional info: On attempting to manually import (File/Import...), it says it
failed to claim the USB device because either some other process has it, or it
has no permissions.

It was possible to import the images from the digital camera when running gthumb
as root. This squarely indicates incorrect permissions on the USB device.

I'm logging this as a gthumb bug rather than a hot-plug bug because this
behavior is not reproducible with other USB devices (e.g. a USB hard-drive or a
USB MP3 player).
Comment 1 Andy Walls 2006-04-28 14:36:32 EDT
Created attachment 128368 [details]
Dumps of 'gphoto2 --list-files'  debug & strace for root vs. user on FC5
Comment 2 Andy Walls 2006-04-28 14:37:56 EDT
Created attachment 128369 [details]
Dumps of 'gphoto2 --list-files'  debug & strace for root vs. user on FC5
Comment 3 Andy Walls 2006-04-28 14:59:47 EDT
Sorry about the dupe attachment.

The auto-magic import can be re-enabled under System->Preferences->Removeable
Drives and Media from the GNOME desktop menus.

I get the same error about "claiming a usb device" on my FC5 x86_64 system with
a Kodak Z760 (USB PTP) camera.  Using 'gphoto2 --list-files' I found that camera
access fails for normal users, but works for root.  It appears to be a
permissions issue with /proc/bus/usb/nnn/mmm.  See the dumps in the attached tgz

I'm not sure how to get the right permissions to come up on these nodes: udev
rules? /etc/security/console.perms?  What's the right way for an admin user to
fix this in the short term?
Comment 4 Andy Walls 2006-04-28 18:57:05 EDT
More info:

Despite hald-runner running as root and despite the
/usr/libexec/gphoto-set-procperm script spawned by hald-runner is running with
EUID=root and UID=root, the `cat /var/run/console/console.lock` within the
script returns permission denied (as did a debug ls command in the script).
% ls -al /var/run/console/console.lock
-rw------- 1 root andy 4 Apr 28 13:24 /var/run/console/console.lock

So I figure SELinux configuration is the culprit.  Both
/etc/selinux/targeted/contexts/files/file_contexts and
/etc/selinux/targeted/modules/active/file_contexts contain a line like:

/var/run/console(/.*)?  system_u:object_r:pam_var_console_t:s0

And /var/log/audit/audit.log contains:

type=AVC msg=audit(1146264308.039:762): avc:  denied  { search } for  pid=7301
comm="cat" name="console" dev=dm-0 ino=14713195
tcontext=system_u:object_r:pam_var_console_t:s0 tclass=dir
type=SYSCALL msg=audit(1146264308.039:762): arch=c000003e syscall=2 success=no
exit=-13 a0=7fffffb2e897 a1=0 a2=2 a3=2 items=1 pid=7301 auid=4294967295 uid=0
gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 comm="cat" exe="/bin/cat"
type=CWD msg=audit(1146264308.039:762):  cwd="/usr/libexec"
type=PATH msg=audit(1146264308.039:762): item=0
name="/var/run/console/console.lock" flags=101

So what's the right way to add
/var/run/console/console.lock to the system_u:system_r:hald_t:s0 context?
Comment 5 Matthias Clasen 2006-08-02 23:47:43 EDT

*** This bug has been marked as a duplicate of 186131 ***

Note You need to log in before you can comment on or make changes to this bug.