[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#761815: wow, huh

Control: severity -1 serious
Control: tags -1 +patch

[CCing Ansgar as the original bug submitter]

Just to give some context: This bug is about adding entries for USB mass
storage devices to /etc/fstab on installation.

Olliver Schinagl <oliver@schinagl.nl> writes:

> I just got bitten by this bug myself.
> As a long time gentoo + ubuntu user, I was baffled after getting the 
> solution to this problem. I have worked through several different kind 
> of fstab files, but this was a serious wtf. Why wasn't removable storage 
> working for me? I just couldn't figure it out, everything 'looked' normal.
> I'd increase the severity of this report, as it is far far from
> obvious.

I just had a look at the relevant code in partman-target
finish.d/fstab_removable_media_entries. As far as I understand it (no
testing done) these entries are added if a USB device is currently
plugged in. The code is from 2004 (commit
af81206d02f8d668dab382e5ec8483ccbc90a506) when this probably made sense.

Does it make any sense anymore to keep this code? IMO the fstab entries
should at least not be added when udisks is installed. I attached a
patch (not yet tested) which does this.

My patch currently only prohibits adding of USB device entries. Should
this be extended to floppies and CD-ROMs? What about kfreebsd and hurd?

IMO this should be fixed before the release as it causes unexpected and
inconsistent behavior. For example udisks will just mount the usb device
as normal if it does not have the same device node as the one used
during installation, but devices that happen to get the same device node
won't be accessible and mounted on a different path. This will lead to
things like one device being accessible and the other not if you plug in
two usb mass storage devices.

I raised the severity of the bug to serious as I think this should be
RC, but if members more involved with d-i than I am currently disagree,
feel free to downgrade again.


From ec9b2cc840412863499c10854926f7328d6c9cc0 Mon Sep 17 00:00:00 2001
From: Gaudenz Steinlin <gaudenz@debian.org>
Date: Thu, 4 Dec 2014 10:22:32 +0100
Subject: [PATCH] Only add USB entries to fstab if udisks is not installed

In combination with udisks these entries cause USB mass storage devices
to be mounted with options that prohibit the current user from accessing
the data. The also change the mount point to always be /media/usb0.

The fstab entries also only work if the USB device has the same device
node as the device that was used on installation. Which is not
guaranteed at all.
 finish.d/fstab_removable_media_entries | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/finish.d/fstab_removable_media_entries b/finish.d/fstab_removable_media_entries
index 813873d..5e209b5 100755
--- a/finish.d/fstab_removable_media_entries
+++ b/finish.d/fstab_removable_media_entries
@@ -159,7 +159,10 @@ done
 case `udpkg --print-os` in
-		populate_media usb auto rw,user,noauto $USBDEVICES
+		# Only add USB entries if udisks or udisks2 are not installed
+		if ! in-target sh -c "dpkg-query -s udisks udisks2 2>/dev/null | grep -q '^Status: install ok installed'" ; then
+			populate_media usb auto rw,user,noauto $USBDEVICES
+		fi
 		populate_media usb auto rw,noauto $USBDEVICES

Attachment: signature.asc
Description: PGP signature

Reply to: