Bug 248687

Summary: umounting hal mounted media with umount does not work, works with umount.hal
Product: [Fedora] Fedora Reporter: Thorsten Leemhuis <fedora>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: davidz, kzak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-18 17:36:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
strace from umount.hal when chain called from /bin/umount none

Description Thorsten Leemhuis 2007-07-18 09:10:08 UTC
Description of problem:
Umount afaics call umount.hal to umount hal-mounted media. That seems to fail
for some strange reason and umounting fails

Version-Release number of selected component (if applicable):
util-linux-2.13-0.52.fc7

How reproducible:
Always

Steps to Reproduce:
[thl@thl ~]$ # /me puts a CD into the drive an waits for hal to mount it.
[thl@thl ~]$ mount | grep Neu
/dev/scd0 on /media/Neu type iso9660 (ro,nosuid,nodev,uhelper=hal,uid=2261)
[thl@thl ~]$ gerp Neu /etc/mtab 
bash: gerp: command not found
[thl@thl ~]$ grep Neu /etc/mtab 
/dev/scd0 /media/Neu iso9660 ro,nosuid,nodev,uhelper=hal,uid=2261 0 0
[thl@thl ~]$ umount /media/Neu
/sbin/umount.hal: Unmounting /media/Neu failed:
org.freedesktop.Hal.PermissionDenied: Permission denied: Not in active session
[thl@thl ~]$ /sbin/umount.hal /media/Neu
[thl@thl ~]$

Comment 1 David Zeuthen 2007-07-18 15:24:58 UTC
Did you mess around with the environment or log out of your session? Did you log
in via gdm? What is the content of XDG_SESSION_COOKIE from the shell you're
attempting to do this from?

Comment 2 Thorsten Leemhuis 2007-07-19 04:57:28 UTC
(In reply to comment #1)
> Did you mess around with the environment or log out of your session?

Nope.

> Did you log in via gdm?

Yes.

> What is the content of XDG_SESSION_COOKIE from the shell you're
> attempting to do this from?

$ echo $XDG_SESSION_COOKIE
83de36c13101876e24d369004577e900-1184129730.490865-1030612696

----
Your questions head into a direction as if there would be problems with the
ConsoleKit setup. But wouldn't /sbin/umount.hal fail in that case? But it and
umounting via nautilus work fine; it seems to be more /bin/umount that fails
when it calls /sbin/umount.hal afaics (BTW, that's the reason why I filed the
bug against util-linux and not gnome-mount)

Note that I've seen this error on my main machine, which isn't a isn't a fresh
install; it was updated several times already. But I can reproduce the behavior
on a fresh Fedora 7 install (both machines are x86_64, in case that matters; no
i386 F7 at hand to test atm; sorry)

Comment 3 David Zeuthen 2007-07-19 15:53:32 UTC
(In reply to comment #2)
> Your questions head into a direction as if there would be problems with the
> ConsoleKit setup. But wouldn't /sbin/umount.hal fail in that case? But it and
> umounting via nautilus work fine; it seems to be more /bin/umount that fails
> when it calls /sbin/umount.hal afaics (BTW, that's the reason why I filed the
> bug against util-linux and not gnome-mount)
> 
> Note that I've seen this error on my main machine, which isn't a isn't a fresh
> install; it was updated several times already. But I can reproduce the behavior
> on a fresh Fedora 7 install (both machines are x86_64, in case that matters; no
> i386 F7 at hand to test atm; sorry)

Is it possible you can replace /sbin/umount.hal with a shell script that just
dumps the environment somewhere? And then paste the output as an attachment?
Maybe /bin/umount is deleting something in the environment... Just a guess. Thanks.

Comment 4 Thorsten Leemhuis 2007-07-20 13:43:34 UTC
Created attachment 159654 [details]
strace from umount.hal when chain called from /bin/umount

selinux seems to be the culprit; disabling it temporary solved the problem.
Sorry, should have tried this earlier. No, I can't see any error messages in
audit.log

Find attached a straced run of the original umount.hal when failing (I put a
script in between to catch it)

Comment 5 David Zeuthen 2007-07-20 14:45:45 UTC
Reassigning to selinux-policy-targeted then.

Comment 6 Daniel Walsh 2007-09-10 14:36:30 UTC
Are  you seeing avc messages?

Comment 7 Thorsten Leemhuis 2007-09-13 17:12:21 UTC
(In reply to comment #6)
> Are  you seeing avc messages?

Daniel, no, sorry, there were none on F7 (see comment 4) and are none on rawhide
-- i just re-checked again there.

Comment 8 Daniel Walsh 2007-09-13 20:35:59 UTC
Can you try 

# semodule -DB
to disable dontaudits and then try again.

#semodule -B 

will restore dontaudit rules.


Comment 9 Thorsten Leemhuis 2007-09-14 14:17:32 UTC
what the ... -- it suddenly works now on devel. I got a new
selinux-policy-targeted in the past 24 hours -- Dan, did you change anything?

I can retry on F7 on Monday -- I saw the problem there as well. 

Comment 10 Daniel Walsh 2007-09-14 15:20:34 UTC
Not that I remember.