Package: pamusb-common
Version: 0.5.0-4
Severity: normal
Tags: patch

--- Please enter the report below this line. ---

Currently pamusb-conf wont accept sd/mmc cards, I made this little patch to 
avoid the problem.

--- System information. ---
Architecture: amd64
Kernel:       Linux 3.3.0-2.dmz.1-liquorix-amd64

Debian Release: wheezy/sid
  500 unstable        www.debian-multimedia.org 
  500 unstable        snapshots.ekiga.net 
  500 unstable        moblock-deb.sourceforge.net 
  500 unstable        liquorix.net 
  500 unstable        ftp.de.debian.org 
  500 unstable        debian.tu-bs.de 
  500 unstable        debian.speedblue.org 
  500 unstable        debian.pengutronix.de 
  500 unstable        debian.orson.at 
  500 unstable        debian.corsac.net 
  500 unstable        deb.torproject.org 
  500 unstable        deb.opera.com 
  500 unstable        deb.matteobonora.it 
  500 testing         www.debian-multimedia.org 
  500 testing         ftp.de.debian.org 
  500 testing         dl.google.com 
  500 testing         deb.opera.com 
  500 testing         apt.byteme.org.uk 
  500 stable          www.emdebian.org 
  500 stable          www.debian-multimedia.org 
  500 stable          webmin.mirror.somersettechsolutions.co.uk 
  500 stable          security.debian.org 
  500 stable          repository.spotify.com 
  500 stable          packages.dotdeb.org 
  500 stable          ftp.de.debian.org 
  500 stable          download.webmin.com 
  500 stable          dl.google.com 
  500 stable          deb.opera.com 
  500 stable          apt.mucommander.com 
  500 squeeze-wx      apt.wxwidgets.org 
  500 squeeze         deb.playonlinux.com 
  500 squeeze         apsy.gse.uni-magdeburg.de 
  500 sid             www.lamaresh.net 
  500 sid             packages.enlightenment.org 
  500 sid             linux.dropbox.com 
  500 proposed-updates ftp.de.debian.org 
  500 oneiric         ppa.launchpad.net 
  500 natty-getdeb    archive.getdeb.net 
  500 natty           ppa.launchpad.net 
  500 maverick        ppa.launchpad.net 
  500 lucid           ppa.launchpad.net 
  500 karmic          ppa.launchpad.net 
  500 jaunty          ppa.launchpad.net 
  500 any             apt.jenslody.de 
  500 all             liveusb.info 
  100 squeeze-backports backports.debian.org 
  100 experimental-snapshots qt-kde.debian.net 
    1 experimental    ftp.de.debian.org 

--- Package information. ---
Depends             (Version) | Installed
=============================-+-===========
dbus                          | 1.5.12-1
python               (>= 2.5) | 2.7.2-10
python-dbus                   | 0.84.0-3
python-gobject                | 3.2.0-3
libc6                (>= 2.4) | 2.13-30
libdbus-1-3        (>= 1.0.2) | 1.5.12-1
libxml2            (>= 2.7.4) | 2.7.8.dfsg-8


Recommends      (Version) | Installed
=========================-+-===========
libpam-usb     (>> 0.5.0) | 0.5.0-4


Package's Suggests field is empty.




--- pamusb-conf	2012-02-08 16:32:28.000000000 +0100
+++ /usr/bin/pamusb-conf	2012-04-19 15:45:20.229644441 +0200
@@ -28,10 +28,16 @@
 				udi)
 		deviceProperties = dbus.Interface(deviceObj, dbus.PROPERTIES_IFACE)
 		if deviceProperties.Get('org.freedesktop.UDisks.Device', 'DeviceIsRemovable') != 1:
-			raise Exception, 'Not a removable device'
+			# Workaround for removable devices with fixed media (such as SD cards)
+			if not "mmcblk" in udi:
+				raise Exception, 'Not a removable device'
 		self.vendor = deviceProperties.Get('org.freedesktop.UDisks.Device', 'DriveVendor')
 		self.product = deviceProperties.Get('org.freedesktop.UDisks.Device', 'DriveModel')
-		self.serialNumber = deviceProperties.Get('org.freedesktop.UDisks.Device', 'DriveSerial')
+                if deviceProperties.Get('org.freedesktop.UDisks.Device', 'DriveSerial'):
+			self.serialNumber = deviceProperties.Get('org.freedesktop.UDisks.Device', 'DriveSerial')
+		else:
+			# Workaround for devices without serial number (such as SD cards)
+			self.serialNumber = "0"
 		if len(self.volumes()) < 1:
 			raise Exception, 'Device does not contain any volume'
 

Reply via email to