Bug 75513

Summary: nautilus stilling not ejecting external usb zip
Product: [Retired] Red Hat Linux Reporter: Brett Boren <bab>
Component: ejectAssignee: Ngo Than <than>
Status: CLOSED DUPLICATE QA Contact: Jay Turner <jturner>
Severity: low Docs Contact:
Priority: medium    
Version: 8.0CC: alexl, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 18:49:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Brett Boren 2002-10-09 12:55:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 

Description of problem:
As reported for NULL in a sidenote, nautilus still will not actually eject a 
usb zip disk. IDE zips eject just fine.

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

How reproducible:

Steps to Reproduce:
1. mount a usb zip with nautilus
2. right click on zip icon and move to eject
3. disk is unmounted but not ejected

Additional info:

Comment 1 Havoc Pennington 2002-10-09 15:00:52 UTC
Presumably the kernel has a different interface for the eject here or something.
If the command line "eject" command works we can probably copy what it does.

Comment 2 Alexander Larsson 2002-10-10 08:51:48 UTC
Nautilus just execs 'eject'.

Comment 3 Brett Boren 2002-10-14 18:27:59 UTC
But the eject command will eject this disk.

Comment 4 Alexander Larsson 2002-10-15 08:14:17 UTC
strange. Maybe it's ejecting the wrong device node or something.
can you "strace -o exec.log -f -e execve nautilus" (after first killing
nautilus). Just try to eject and then kill nautilus again. Then the exec.log
file should contain what eject command was tried.

Comment 5 Brett Boren 2002-10-15 13:26:07 UTC
Ok, but when I do that all of a sudden I can't mount or umount/eject through
nautilus (because you can't ptrace suid programs...?). So I log in as root -
works fine even strace'ing it. But as a regular user it doesn't work and I can't
strace it to see the return from the system calls.

Comment 6 Alexander Larsson 2002-10-15 20:42:47 UTC
So, when you strace it as root. Does it launch eject, and it fails to eject the
floppy? If so, what is the argument list for the eject command?

Comment 7 Brett Boren 2002-10-16 01:39:22 UTC
No, as root it works fine straced or not. It's when it's run by a regular user 
that it fails.

Comment 8 Alexander Larsson 2002-10-16 12:15:04 UTC
very strange.
BTW, my eject command is not setuid. Is yours really?
what happens when you try to strace nautilus as a user?

Comment 9 Brett Boren 2002-10-16 12:42:41 UTC
no, but nautilus first execs `umount` then eject. mount & umount are setuid. I 
can only imagine that eject must call umount before trying to eject a disk.

Comment 10 Alexander Larsson 2002-10-16 12:51:17 UTC
the eject will certainly fail if the unmount failes (device busy or suchlike).
I don't understand why it fails when you're not stracing it though, since it
seems to launch the right things.

It does manage to unmount it, you say so above, but the eject fails. Maybe the
eject doesn't work if you do it immediately after the unmount. Maybe you have to
wait a while.

Can you test this is a shell
first mount the floppy, then
umount /dev/floppy; eject /dev/floppy
and see if it works.

Comment 11 Brett Boren 2002-10-16 14:36:39 UTC
Bingo - eject will not eject the disk using the /dev/sda4 argument as a normal
user. I get:

$ eject /dev/sda4
eject: unable to eject. last error: Invalid argument

In fact I can't exec eject at all right now (something here is screwy - I guess
before I just remember being able to eject it when I was root) regardless of
what argument I give it. Each time I do It umounts the disk but returns the
error listed above.
but eject works fine as root. 

Should eject be an suid program?

BTW: stracing eject I see this line after its opendd a file descriptor on /dev/sda4

ioctl(3, FDEJECT, 0xbffff9e8) = -1 EINVAL


Comment 12 Alexander Larsson 2002-10-16 15:09:24 UTC
No idea. than, do you know?

Comment 13 Ngo Than 2002-10-21 19:35:34 UTC
very strange, i can eject my MO medium as normal user without this problem.

Could you please try with eject -s -p if it works?

Comment 14 Brett Boren 2002-10-22 13:57:17 UTC
Samne result except that -p gives a "umount: only root can do that"

Comment 15 Ngo Than 2004-09-08 10:53:23 UTC

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

Comment 16 Red Hat Bugzilla 2006-02-21 18:49:47 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.