diff --git a/pam_usb/tools/pamusb-conf b/pam_usb/tools/pamusb-conf index 60422d1..1145ee6 100755 --- a/pam_usb/tools/pamusb-conf +++ b/pam_usb/tools/pamusb-conf @@ -24,7 +24,6 @@ from xml.dom import minidom class Device: def __init__(self, udi): self.__udi = udi - self.__findStorageDevice() deviceObj = bus.get_object('org.freedesktop.Hal', udi) deviceProperties = deviceObj.GetAllProperties( @@ -47,13 +46,6 @@ class Device: return True return self.__isChildOfDevice(properties['info.parent']) - def __findStorageDevice(self): - for child in halManager.FindDeviceByCapability('storage'): - if self.__isChildOfDevice(child): - self.__storageUdi = child - return - raise Exception, '%s is not a storage device.' % self.__udi - def __repr__(self): return "%s %s (%s)" % (self.vendor, self.product, self.serialNumber) @@ -64,7 +56,9 @@ class Device: volume) deviceProperties = deviceObj.GetAllProperties( dbus_interface = 'org.freedesktop.Hal.Device') - if deviceProperties['block.storage_device'] != self.__storageUdi: + if deviceProperties['block.major'] != 8: + continue + if not self.__isChildOfDevice(volume): continue vols.append({'uuid' : deviceProperties['volume.uuid'], 'device' : deviceProperties['block.device']})