Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116731 - Unable to eject Ipod nano device
Summary: Unable to eject Ipod nano device
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 135229 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-25 13:14 UTC by Pekka Enberg
Modified: 2006-06-11 07:42 UTC (History)
3 users (show)

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


Attachments
Patch scsi block for 2.6.16 (linux-2.6.16-scsi-eject.patch,882 bytes, patch)
2006-04-23 06:40 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pekka Enberg 2005-12-25 13:14:07 UTC
When I try tro unmount Ipod nano volume in Nautilus, I get the following error:
/usr/bin/eject: unable to eject, last error: Invalid argument. I am using dbus, hal, and ivman and have added myself to the disk group. I can fix the problem by making /usr/bin/eject a suid binary.

Portage 2.1_pre1 (default-linux/x86/2005.0, gcc-3.3.4, glibc-2.3.5-r3, 2.6.14.4 i686)
=================================================================
System uname: 2.6.14.4 i686 Intel(R) Celeron(R) CPU 2.80GHz
Gentoo Base System version 1.12.0_pre12
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -g"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -g"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks nostrip sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac acl acpi adns alsa apm audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cscope cups curl dbus eds emboss encode esd exif expat fam ffmpeg flac foomaticdb gd gdbm gif glut gnome gphoto2 gpm gstreamer gtk gtk2 guile hal idn imagemagick imlib ipod ipv6 jack java jpeg junit lcms libg++ libwww mad mikmod mmx mng mono motif mozilla mp3 mpeg ncurses nls nptl ogg oggvorbis opengl oss pam pcre pdflib perl png python qt quicktime readline ruby sdl slang spell sqlite sse sse2 ssl tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts udev usb vorbis win32codecs xine xml xml2 xmms xv xvid zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, LDFLAGS, LINGUAS, MAKEOPTS
Comment 1 Steev Klimaszewski (RETIRED) gentoo-dev 2005-12-25 13:25:27 UTC
are you in the plugdev group?
Comment 2 Pekka Enberg 2005-12-26 03:16:03 UTC
> are you in the plugdev group?

Yes, I am.
Comment 3 Pekka Enberg 2005-12-26 05:06:06 UTC
> > are you in the plugdev group?
> 
> Yes, I am.

While doing testing for another bug [1], I noticed that I cannot unmount Ipod nano device when logged in as myself if I plug in the device when X is in the GDM login screen. So the SUID bit doesn't completely fix the problem.

  https://bugs.gentoo.org/show_bug.cgi?id=116729
Comment 4 Pekka Enberg 2005-12-26 05:07:00 UTC
(Please note the I upgraded my kernel and portage so I have included emerge info here again.)

Portage 2.1_pre2 (default-linux/x86/2005.0, gcc-3.3.4, glibc-2.3.5-r3, 2.6.15-rc7 i686)
=================================================================
System uname: 2.6.15-rc7 i686 Intel(R) Celeron(R) CPU 2.80GHz
Gentoo Base System version 1.12.0_pre12
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -g"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -g"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks nostrip sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac acl acpi adns alsa apm audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cscope cups curl dbus eds emboss encode esd exif expat fam ffmpeg flac foomaticdb gd gdbm gif glut gnome gphoto2 gpm gstreamer gtk gtk2 guile hal idn imagemagick imlib ipod ipv6 jack java jpeg junit lcms libg++ libwww mad mikmod mmx mng mono motif mozilla mp3 mpeg ncurses nls nptl ogg oggvorbis opengl oss pam pcre pdflib perl png python qt quicktime readline ruby sdl slang spell sqlite sse sse2 ssl tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts udev usb vorbis win32codecs xine xml xml2 xmms xv xvid zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, LDFLAGS, LINGUAS, MAKEOPTS
Comment 5 Pekka Enberg 2005-12-27 05:18:02 UTC
I haven't tested this patch [1] yet but it should fix the error. Relevant discussion is here [2]. I'll report once I have the chance to test it.

1. http://bugzilla.ubuntu.com/attachment.cgi?id=5415
2. http://marc.theaimsgroup.com/?l=linux-kernel&m=113508268711624&w=2
Comment 6 Pekka Enberg 2005-12-27 07:59:30 UTC
(In reply to comment #5)
> I haven't tested this patch [1] yet but it should fix the error. Relevant
> discussion is here [2]. I'll report once I have the chance to test it.
> 
> 1. http://bugzilla.ubuntu.com/attachment.cgi?id=5415
> 2. http://marc.theaimsgroup.com/?l=linux-kernel&m=113508268711624&w=2

This patch fixes the permission problem so I don't have the SUID /usr/bin/eject. Please consider applying.
Comment 7 Saleem Abdulrasool (RETIRED) gentoo-dev 2006-02-17 15:12:04 UTC
Is this bug still reproducible?
Comment 8 Pekka Enberg 2006-02-19 02:56:44 UTC
> Is this bug still reproducible?

Yes it is. I have a slightly different configuration now. No ivman, just gnome-volume-manager. I have downgraded everything to Gentoo stable now (I used to be ~x86). I still need to chmod u+s /usr/bin/eject for ipod unmount to work properly.

raquel penberg # emerge info
Portage 2.0.54 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.15 i686)
=================================================================
System uname: 2.6.15 i686 Intel(R) Celeron(R) CPU 2.80GHz
Gentoo Base System version 1.6.14
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -g"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -g"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks nostrip sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac acl acpi adns alsa apm audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cscope cups curl dbus eds emboss encode esd exif expat fam ffmpeg flac foomaticdb gd gdbm gif glut gmp gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hal idn imagemagick imlib ipod ipv6 jack java jpeg junit lcms libg++ libwww mad mikmod mmx mng mono motif mozilla mp3 mpeg ncurses nls nptl ogg oggvorbis opengl oss pam pcre pdflib perl png python qt quicktime readline ruby sdl slang spell sqlite sse sse2 ssl tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts udev usb vlc vorbis win32codecs xine xml xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS, LINGUAS, MAKEOPTS
Comment 9 Roy Marples (RETIRED) gentoo-dev 2006-04-23 06:37:51 UTC
After getting my iPod and doing some research, this issue is now in two distinct parts.

1) eject-2.1.4 is required
2) a patch to block/scsi_ioctl.c in linux kernel is required

With patch applied, eject works with my iPod Nano without having to be suid root.

As such, it's not GNOME bug at all. Re-assigning to kernel team as eject has already been fixed in portage.
Comment 10 Roy Marples (RETIRED) gentoo-dev 2006-04-23 06:40:35 UTC
Created attachment 85271 [details, diff]
Patch scsi block for 2.6.16

Patch ripped from a Ubuntu kernel.

Fixes above issue, request inclusion in gentoo-sources.
Comment 11 Daniel Drake (RETIRED) gentoo-dev 2006-04-23 08:32:15 UTC
Please get that included upstream, and/or fix eject. Ejecting works as a user over SCSI transport, as long as the device is opened for read+write.
Comment 12 Roy Marples (RETIRED) gentoo-dev 2006-04-23 09:10:06 UTC
(In reply to comment #11)
> Please get that included upstream, and/or fix eject. Ejecting works as a user
> over SCSI transport, as long as the device is opened for read+write.

eject-2.1.4 is already fixed. 

http://www.ussg.iu.edu/hypermail/linux/kernel/0512.2/0808.html
Note the comment at the bottom - I'll quote here.

>bcollins@colorless:~$ id -a
> uid=1000(bcollins) gid=1000(bcollins)
> groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),104(lpadmin),105(scanner),106(admin),1000(bcollins)
> bcollins@colorless:~$ ls -l /dev/hdc
> brw-rw---- 1 root plugdev 22, 0 Dec 19 2005 /dev/hdc
> bcollins@colorless:~$ eject -s /dev/hdc
> eject: unable to eject, last error: Operation not permitted
> bcollins@colorless:~$ eject -r /dev/hdc
> bcollins@colorless:~$
> 
> Write permissions is not enough.

What is the proper action for getting this included upstream if you won't put it in gentoo-sources?
Comment 13 Daniel Drake (RETIRED) gentoo-dev 2006-04-23 09:38:44 UTC
That's an eject bug because it opens for read-only.

From "strace eject -s /dev/sdb1":
open("/dev/sdb1", O_RDONLY|O_NONBLOCK)  = 3

I am using eject v2.1.4
Comment 14 Roy Marples (RETIRED) gentoo-dev 2006-04-23 15:42:43 UTC
You're right, sorry.
Comment 15 Roy Marples (RETIRED) gentoo-dev 2006-04-23 15:43:33 UTC
I'll take this then and patch eject as it looks like the kernel is now fine.
Comment 16 Roy Marples (RETIRED) gentoo-dev 2006-04-23 15:46:42 UTC
Fixed in eject-2.1.4-r1
Comment 17 SpanKY gentoo-dev 2006-06-11 07:42:26 UTC
*** Bug 135229 has been marked as a duplicate of this bug. ***