Bug 75513 - nautilus stilling not ejecting external usb zip
nautilus stilling not ejecting external usb zip
Status: CLOSED DUPLICATE of bug 101533
Product: Red Hat Linux
Classification: Retired
Component: eject (Show other bugs)
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Ngo Than
Jay Turner
Depends On:
  Show dependency treegraph
Reported: 2002-10-09 08:55 EDT by Brett Boren
Modified: 2015-01-07 19:00 EST (History)
2 users (show)

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

Attachments (Terms of Use)

  None (edit)
Description Brett Boren 2002-10-09 08:55:17 EDT
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 11:00:52 EDT
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 04:51:48 EDT
Nautilus just execs 'eject'.
Comment 3 Brett Boren 2002-10-14 14:27:59 EDT
But the eject command will eject this disk.
Comment 4 Alexander Larsson 2002-10-15 04:14:17 EDT
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 09:26:07 EDT
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 16:42:47 EDT
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-15 21:39:22 EDT
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 08:15:04 EDT
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 08:42:41 EDT
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 08:51:17 EDT
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 10:36:39 EDT
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 11:09:24 EDT
No idea. than, do you know?
Comment 13 Ngo Than 2002-10-21 15:35:34 EDT
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 09:57:17 EDT
Samne result except that -p gives a "umount: only root can do that"
Comment 15 Ngo Than 2004-09-08 06:53:23 EDT

*** This bug has been marked as a duplicate of 101533 ***
Comment 16 Red Hat Bugzilla 2006-02-21 13:49:47 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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