aboutsummaryrefslogtreecommitdiffstats
path: root/backend/magiback
diff options
context:
space:
mode:
Diffstat (limited to 'backend/magiback')
-rwxr-xr-xbackend/magiback17
1 files changed, 17 insertions, 0 deletions
diff --git a/backend/magiback b/backend/magiback
index 904afcf..01a730c 100755
--- a/backend/magiback
+++ b/backend/magiback
@@ -36,6 +36,9 @@ class Isodumper(raw_write.Dumper):
<arg type='s' name='target' direction='in'/>
<arg type='s' name='source' direction='in'/>
</method>
+ <method name='do_persistence'>
+ <arg type='s' name='target' direction='in'/>
+ </method>
<method name='get_sum'>
<arg type='s' name='source' direction='in'/>
</method>
@@ -67,6 +70,9 @@ class Isodumper(raw_write.Dumper):
self.sum_check = ""
self.sum_check_searched = False
self.signature_checked = False
+ self.writing_perm = False
+ self.writing_target = ""
+
def do_write(self,source, target, size, dbus_context):
self.finished.clear()
@@ -74,10 +80,21 @@ class Isodumper(raw_write.Dumper):
self.thread = threading.Thread(target=self._do_write, args=(source, target, size, ))
self.thread.start()
logging.debug("Writing thread started")
+ self.writing_perm = True
+ self.writing_target = target
else:
self.return_message = "Access denied"
self.finished.set()
+ def do_persistence(self, target):
+ self.finished.clear()
+ if self.writing_perm and self.writing_target == target :
+ self._do_persistence(target)
+ else:
+ self.return_message = "Access denied"
+ self.writing_perm = False
+ self.writing_target = ""
+
@property
def done(self):
return self.finished.wait(1)