! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar-volman tries to setup encrypted device twice
Status:
RESOLVED: FIXED
Product:
Thunar-volman
Component:
General

Comments

Description Yves-Alexis Perez editbugs 2009-05-30 19:18:22 CEST
Not much to add. I have an encrypted partition on an usb key. When I plug it, thunar asks for the passphrase once. I enter it, the partition is setup, and then it re-asks for the passphrase. If I try to enter it again, it tells me it's already setup, so in fact I have to clic “ignore”, but I wonder why it asks me twice.

lshal-m gives:

Start monitoring devicelist:
-------------------------------------------------
21:14:30.216: usb_device_13fe_1d00_5B7B0DB10058 added
21:14:30.243: usb_device_13fe_1d00_5B7B0DB10058_usbraw added
21:14:30.293: usb_device_13fe_1d00_5B7B0DB10058_if0 added
21:14:30.305: usb_device_13fe_1d00_5B7B0DB10058_if0_scsi_host added
21:14:35.223: usb_device_13fe_1d00_5B7B0DB10058_if0_scsi_host_0 added
21:14:35.223: usb_device_13fe_1d00_5B7B0DB10058_if0_scsi_host_0_scsi_device_lun0 added
21:14:35.806: storage_serial_Kingston_DataTraveler_2_0_5B7B0DB10058_0_0 added
21:14:35.822: storage_serial_Kingston_DataTraveler_2_0_5B7B0DB10058_0_0 property info.interfaces = {'org.freedesktop.Hal.Device.Storage.Removable'} (new)
21:14:36.079: volume_uuid_e6397684_910c_4066_b520_59fd929dc9a8 added
21:14:36.145: volume_uuid_357b0fec_9ffd_48ee_bbe4_8dc98f50f052 added
21:14:36.155: volume_uuid_47D6_B8AB added



(t-v asks for passphrase, I give it, the device is setup)



21:14:47.498: volume_uuid_357b0fec_9ffd_48ee_bbe4_8dc98f50f052 property info.callouts.remove = {'hal-luks-remove', 'hal-acl-tool --remove-device'}
21:14:47.659: volume_uuid_f0e50a1e_fb06_402a_856a_52966a48a1f1 added

(t-v re-asks for passphrase)

Cheers,
Comment 1 Colin Leroy 2009-06-02 12:33:07 CEST
I don't think this could come from Thunar-volman...
Comment 2 Yves-Alexis Perez editbugs 2009-06-02 12:37:55 CEST
(In reply to comment #1)
> I don't think this could come from Thunar-volman...

Any idea of how I could debug this? The dialog is run by thunar-volman, so if it shows it that's because something told it too, maybe because he saw a luks-device beeing inserted? But hal monitoring says there's no event, so I'm a bit lost.
Comment 3 Benedikt Meurer editbugs 2009-11-07 10:31:22 CET
Mass reassign. Nick, please check these pending reports. Thx.
Comment 4 charlie-tca 2010-03-04 14:35:37 CET
This bug has been reported on Ubuntu Launchpad as: 
https://bugs.launchpad.net/bugs/527738

I have several external drives encrypted with cryptsetup/luks. Whenever one is plugged in, thunar-volman displays a popup asking for the passphrase. After the passphrase is entered, it immediately asks again. Pressing "Ignore" makes it continue as expected. If I enter the passphrase again, I get the error "/dev/sdc1 is already setup?". Also the device is not mounted iff you enter the passphrase twice.

Both devices contain only one partition formatted with luks and ext4. I already checked, that I only have on instance of thunar-volman running, so I suppose this is a new bug.

Regards, Lars

ProblemType: Bug
Architecture: amd64
Date: Thu Feb 25 13:24:13 2010
DistroRelease: Ubuntu 9.10
InstallationMedia: Xubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
Package: thunar-volman 0.3.80-2ubuntu1
ProcEnviron:
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
SourcePackage: thunar-volman
Uname: Linux 2.6.31-19-generic x86_64

http://launchpadlibrarian.net/39762735/XsessionErrors.txt
Comment 5 Colin Leroy 2010-03-04 14:39:30 CET
Can't reproduce (on a brand new ubuntu Karmic install). Had to manually install cryptsetup, though.
Comment 6 Lars 2010-03-09 20:33:01 CET
(In reply to comment #5)
> Can't reproduce (on a brand new ubuntu Karmic install). Had to manually install
> cryptsetup, though.

Hi. I'm the one who recently reported this issue on launchpad. I am able to reproduce it here, on my freshly installed karmic box. I also had to install cryptsetup and also installed some other packages including stuff from gnome. 

To make sure, it is not my users settings somewhere in /home/me, I created a new user, but the problem persisted.

How can I debug this? Would some strace of thunar-volman help? Is there any other place I can look? Could HAL cause this by calling the setup handlers twice?

Regards, Lars
Comment 7 Yves-Alexis Perez editbugs 2010-03-10 07:31:29 CET
I wasn't to investigate either, but I wonder if it's not something like:

encrypted device is plugged in
hal detects it, calls thunar-volman
thunar-volman ask passphrase, pass it to cryptsetup
decrypted device is setup
new device appear
hal detects the device, and somehow thinks it's encrypted
thunar-volman asks for a passphrase for a non-encrypted device

Not exactly sure it's what happen but it seems plausible.
Comment 8 Lars 2010-03-10 09:38:12 CET
(In reply to comment #7)
Here is the full log from syslog showing the "plug in, enter passphrase, hit ignore on second popup" process for an encrypted device. I've truncated the USB stuff which looks normal to me. Indeed something is started twice. Does that hint to the problem?


Mar 10 10:35:25 feorag kernel: [ 3148.264519] sd 6:0:0:0: [sdc] Attached SCSI removable disk
Mar 10 10:35:29 feorag upstart-udev-bridge[6079]: Disconnected from Upstart
Mar 10 10:35:29 feorag init: upstart-udev-bridge main process (6079) terminated with status 1
Mar 10 10:35:29 feorag init: upstart-udev-bridge main process ended, respawning
Mar 10 10:35:31 feorag upstart-udev-bridge[6484]: Disconnected from Upstart
Mar 10 10:35:31 feorag init: upstart-udev-bridge main process (6484) terminated with status 1
Mar 10 10:35:31 feorag init: upstart-udev-bridge main process ended, respawning
Mar 10 10:35:34 feorag kernel: [ 3156.764589] kjournald starting.  Commit interval 5 seconds
Mar 10 10:35:34 feorag hald: mounted /dev/mapper/luks_crypto_4bd45d8a-4b57-433a-a704-6120ee8277e4 on behalf of uid 1000
Mar 10 10:35:34 feorag kernel: [ 3156.805527] EXT3 FS on dm-5, internal journal
Mar 10 10:35:34 feorag kernel: [ 3156.805535] EXT3-fs: mounted filesystem with writeback data mode.
Comment 9 Colin Leroy 2010-03-10 10:37:44 CET
Created attachment 2883 
Probable fix

I've been able to reproduce it. It seems like a stupid race condition where asking libHAL for the plain UDI right after the device has been setup returns NULL.

This patch tries again twice after one second delay when we get no plain UDI and also no error.

If anyone could test...
Comment 10 Yves-Alexis Perez editbugs 2011-04-29 14:55:14 CEST
thunar-volman now uses gio/udisks/... so this is “fixed” (though that means it doesn't work anymore at all on BSD).

Bug #5416

Reported by:
Yves-Alexis Perez
Reported on: 2009-05-30
Last modified on: 2011-04-29

People

Assignee:
Jannis Pohlmann
CC List:
4 users

Version

Version:
unspecified

Attachments

Probable fix (1.24 KB, patch)
2010-03-10 10:37 CET , Colin Leroy
no flags

Additional information