~usb-creator-hackers/usb-creator/trunk

« back to all changes in this revision

Viewing changes to bin/usb-creator-helper

  • Committer: Marc Deslauriers
  • Date: 2015-04-23 15:19:07 UTC
  • Revision ID: marc.deslauriers@canonical.com-20150423151907-aixgqful9q126pfs
* SECURITY UPDATE: privilege escalation via missing polkit check
  (LP: #1447396)
  - bin/usb-creator-helper, dbus/com.ubuntu.usbcreator.policy.in: add
    proper polkit integration for KVM use.
  - CVE number pending

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
                return True
118
118
        return False
119
119
 
120
 
    @dbus.service.method(USBCREATOR_IFACE, in_signature='sa{ss}', out_signature='')
121
 
    def KVMTest(self, device, env):
 
120
    @dbus.service.method(USBCREATOR_IFACE, in_signature='sa{ss}', out_signature='',
 
121
                         sender_keyword='sender', connection_keyword='conn')
 
122
    def KVMTest(self, device, env, sender=None, conn=None):
122
123
        '''Run KVM with the freshly created device as the first disk.'''
 
124
        self.check_polkit(sender, conn, 'com.ubuntu.usbcreator.kvm')
123
125
        for key in ('DISPLAY', 'XAUTHORITY'):
124
126
            if key not in env:
125
127
                logging.debug('Missing %s' % key)