Bug 332057 - Mounting LUKS encrypted device does not work after restore of home directory
Summary: Mounting LUKS encrypted device does not work after restore of home directory
Status: RESOLVED DUPLICATE of bug 331002
Alias: None
Product: openSUSE 10.3
Classification: openSUSE
Component: Hotplug (show other bugs)
Version: Final
Hardware: x86-64 openSUSE 10.3
: P5 - None : Critical (vote)
Target Milestone: ---
Assignee: Holger Macht
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-09 06:03 UTC by Frank Fiene
Modified: 2007-11-01 22:48 UTC (History)
0 users

See Also:
Found By: Consulting
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Screenshot of KryptoMedia dialog with error (25.69 KB, image/png)
2007-10-09 06:03 UTC, Frank Fiene
Details
Screenshot of Konqueror trying to open /dev/media/sr0 with error message (72.39 KB, image/png)
2007-10-09 12:58 UTC, Frank Fiene
Details
Debug output of haldaemon (32.05 KB, text/plain)
2007-10-13 11:07 UTC, Frank Fiene
Details
Debug output of haldaemon after starting consolekit (33.70 KB, text/plain)
2007-10-15 11:23 UTC, Frank Fiene
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Fiene 2007-10-09 06:03:16 UTC
Created attachment 176929 [details]
Screenshot of KryptoMedia dialog with error

My problem is to decrypt an external LUKS encrypted Hard Disk with one XFS partition.

After plugging in the HD, the dialog "Decrypt Strorage Device - KryptoMedia" appears but after entering the correct passphrase (tested with another user and in a shell) this error occurs: hal-storage-crypto-setup-removable no.

This happens after restore of my home partition so maybe this is an error with MediaManager settings but i dunno where to setup.

As i've said, the KryptoMedia dialog works with another user and root and i can decrypt the device with cryptsetup in a shell!

Anyway i was searching for a corresponding hal script, but nothing like this!

Regards
Frank
Comment 1 Frank Fiene 2007-10-09 12:56:52 UTC
Same error with mounting removable media like CDs or DVDs.

After popup, which action i want to and klicking on open, the error "hal-storage-mount-removable no" occurs.

A screenshot is attached!
Comment 2 Frank Fiene 2007-10-09 12:58:24 UTC
Created attachment 177062 [details]
Screenshot of Konqueror trying to open /dev/media/sr0 with error message
Comment 3 Frank Fiene 2007-10-10 06:37:08 UTC
Hmm, the problem is gone, i dunno why.

I've opened with emacs /etc/dbus-1/system/hal.conf but changed nothing and did not save the file.

I leave this bug as a reminder.
Comment 4 Frank Fiene 2007-10-12 16:41:12 UTC
The problem is up again.

"hal-storage-mount-removable no" occurs after entering the passphrase into KryptoManager dialog.

Shall i enable hal debugging? This was really hard to read!
Comment 5 Frank Fiene 2007-10-13 11:07:05 UTC
Created attachment 178260 [details]
Debug output of haldaemon

Last line Denied by Policy is important i think but, there were no changes, only official updates.
Comment 6 Frank Fiene 2007-10-13 15:37:12 UTC
I changed some things so that this is working for me now but i think this is only a workaround.

Changed file /etc/PolicyKit/PolicyKit.conf to (be aware of my username "ffiene", cjange this to your user!):

#########snip############

<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->

<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">

<!-- See the manual page PolicyKit.conf(5) for file format -->

<config version="0.1">
  <match action="hal-storage-crypto-setup-removable">
    <match user="ffiene">
      <return result="yes"/>
    </match>
  </match>
  <match action="hal-storage-mount-removable">
    <match user="ffiene">
      <return result="yes"/>
    </match>
  </match>
</config>

#########snip############

Then call "polkit-reload-config" and everything is fine!
So how has been changed the default settings and where to find them?
Comment 7 Danny Al-Gaaf 2007-10-15 10:47:02 UTC
The problem is not HAL, it's ConsoleKit I think. Looks as consolekit wasn't running.

The log show this error message: 

Error doing GetSessionForUnixProcess on ConsoleKit: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files

Is there XDG_SESSION_COOKIE in the environment (env | grep XDG_SESSION) of your user?

Btw. Don't add such file to PolicyKit, it only prevent to find the problem and cause security problems.

I reassign this to the maintainer of consolekit
Comment 8 Holger Macht 2007-10-15 10:52:11 UTC
Please check if Dannys suspicion about ConsoleKit is right (rcconsolekit status). Thanks.
Comment 9 Frank Fiene 2007-10-15 11:22:12 UTC
rcconsolekit status
Checking for service ConsoleKit daemon                               unused

But:

chkconfig consolekit
consolekit  on

I've started consolekit, edited PolicyKit.conf to an empty config.
No success, same error message: "hal-storage-crypto-setup-removable no"

I attach the debug output.

Oh, and no, no XDG_SESSION in environment! Maybe because of a 10.2 homedir restore?
Comment 10 Frank Fiene 2007-10-15 11:23:46 UTC
Created attachment 178407 [details]
Debug output of haldaemon after starting consolekit
Comment 11 Danny Al-Gaaf 2007-10-16 09:52:13 UTC
@Holger: looks to me as if for some reasons the complete update case from 10.2 to 10.3 doesn't work with ConsoleKit (and related KDE/GNOME/Basesystem parts). The same in bug #333706.
Comment 12 Frank Fiene 2007-10-16 10:39:11 UTC
Sorry when i am interfering.

Yes, maybe this is update case, but to narrow this down:
I did only a backup and restore of my home directory and SCPM, i would say something is wrong with .profiles or any other local setup files in my home directory!
Comment 13 Danny Al-Gaaf 2007-10-16 12:49:45 UTC
If you restart consolekit and restart X including login to your account: do you get now XDG_SESSION_COOKIE in your environment?

One other thing: Did you a clean new 10.3 install and restored then your 10.2 home or did you update from 10.2 to 10.3.

Could you try if insserv rcconsolekit (or insserv -f) help to get consolekit running with the next boot? 
Comment 14 Holger Macht 2007-10-16 15:02:59 UTC
One additional question: How is the behaviour with a plain new user/home directory?
Comment 15 Frank Fiene 2007-10-16 17:49:35 UTC
Sorry for delay, i am in Mumbai right now and my sh... expensive hotel is not able to provide internet access! :-(

Anyway.

So to Comment #13:
------------------
consolekit was running now, dunno why and yes,

env | grep XDG_SESSION
XDG_SESSION_COOKIE=705be2a3327b1d9d9b6a260047061000-1192549822.453485-1876329815

I have to test the decryption now!

Yes, it was a clean 10.3 installation, i do this since SuSE 4.2. After setup, i've restored my home partition (after mounting my encrypted home partition, read later!). This was an updated (KDE-3.5.7) 10.2 home partition.


Now to comment #14:
-------------------
OK, some words about my config. My home partition is encrypted, i've created my user without the encrypted partition for backup purposes if no passphrase is entered at boot time. So this unencrypted home directory is from 10.3 base installation.

So without mounting the encrypted home partition, i can encrypt the USB HD and mount the XFS partition.

But to be sure iÄve created a new user and everything is fine also with this user!
Comment 16 Frank Fiene 2007-10-16 17:55:15 UTC
Hmmm, now with ConsoleKit running since boot time, and this cookie and without the PolicyKit.conf workaround i can decrypt my home partition.

Now i have to look if SCPM is the problem, maybe with another profile i will get the error again! :-(

Confusing!
Comment 17 Frank Fiene 2007-10-18 05:39:17 UTC
So, today consolekit was not running again, no idea why.
Nor XDG_SESSION_COOKIE, too!

Result: The error comes up again decrypting the device!

After starting manually consolekit, logout and login to X session i have the cookie and decrypting the USB device is working again.

So the problem relies on consolekit, sometimes it starts, sometimes not.

But then the issue doesn't depend on restoring my home partition, right?

But it was a clean 10.3-64bit installation! I've restored also the SCPM database, but the error with consolekit is coming up also without changing SCPM profile.

Hmm, is there any log file where consolekit stores error messages during boot? syslog?
Comment 18 Holger Macht 2007-10-18 10:20:23 UTC
Ok, we actually have three bugs of which I think they are duplicates: 331002, 333735 and this (332057) one.

It looks like a problem in the D-Bus init script. An update of D-Bus is tricky, however, so we need definitely make sure that it's really the culprit.

Frank, please apply the changes mentioned in bug 333735 comment 12 and report back. Thanks!
Comment 19 Frank Fiene 2007-10-18 10:45:07 UTC
Ha, here we are, i've read the other bug report, two totally different results for maybe the same error.

But as i read this, i was wondering about also loosing sometimes my s2r and s2d in the KDE logoff screen. Maybe this is at the same the KryproMedia error comes up!

I will test Comment #12 in bug 333735 but the same comment as the other poster, the error happens randomly! So the reason if it does not appear for a short time there is no guarantee the error is gone!

Comment 20 Holger Macht 2007-11-01 20:47:21 UTC
Update package candidates are here:

  ftp://ftp.suse.com/pub/people/hmacht/10.3/dbus-1/

Please test! Also make sure that when updating, the dbus daemon does not get
restarted. As a result, you should _not_ get something like this in
/var/log/messages:

  powersaved[30146]: ERROR (filter_function:99) DBus daemon disconnected.
Trying to reconnect...
Comment 21 Frank Fiene 2007-11-01 22:02:09 UTC
OK, update seems to work for x86_64:

erwin:/home/ffiene/download/kernel # rpm -Uvh dbus-1-*
Preparing...                ########################################### [100%]
   1:dbus-1                 ########################################### [ 50%]
   2:dbus-1-x11             ########################################### [100%]
Update in progress, not restarting the D-Bus daemon


What are the changes? Only not using startproc for background starting?
Comment 22 Holger Macht 2007-11-01 22:48:44 UTC
> What are the changes? Only not using startproc for background starting?

Right. And as you might see, that the daemon is not restarted in the update case. 

So I think this is a dup of 331002, so closing as such. Thanks for your testing efforts!

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