Browse Source

Handle devices without UUID. Disable one time pads if so

master
Andrea Luzzardi 17 years ago
parent
commit
91ec8c4584
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      pam_usb/tools/pusb_conf

+ 12
- 1
pam_usb/tools/pusb_conf View File

@ -106,7 +106,11 @@ def addDevice(options):
print 'Vendor\t\t: %s' % device.vendor
print 'Model\t\t: %s' % device.product
print 'Serial\t\t: %s' % device.serialNumber
print 'Volume UUID\t: %s (%s)' % (volume['uuid'], volume['device'])
if volume['uuid'] != '':
print 'Volume UUID\t: %s (%s)' % (volume['uuid'], volume['device'])
else:
print
print 'WARNING: No UUID detected for device %s. One time pads will be disabled.' % volume['device']
print
print 'Save device to %s ?' % options['configFile']
@ -134,6 +138,13 @@ def addDevice(options):
e.appendChild(t)
dev.appendChild(e)
# Disable one time pads if there's no device UUID
if volume['uuid'] == '':
e = doc.createElement('option')
e.setAttribute('name', 'one_time_pad')
e.appendChild(doc.createTextNode('false'))
dev.appendChild(e)
try:
f = open(options['configFile'], 'w')
f.write(doc.toxml())


Loading…
Cancel
Save