aboutsummaryrefslogtreecommitdiffstats
path: root/backend/magiback
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2020-01-20 09:42:52 +0100
committerPapoteur <papoteur@mageia.org>2020-01-20 09:42:52 +0100
commit6bf666a534f5376ba813b0aaf8993691d2925496 (patch)
treedf20b98b0257618d994f2736107b08383cc82693 /backend/magiback
parent9f89ca4f026e708f7a5ddc59a0f0ee5f581ef37c (diff)
downloadisodumper-6bf666a534f5376ba813b0aaf8993691d2925496.tar
isodumper-6bf666a534f5376ba813b0aaf8993691d2925496.tar.gz
isodumper-6bf666a534f5376ba813b0aaf8993691d2925496.tar.bz2
isodumper-6bf666a534f5376ba813b0aaf8993691d2925496.tar.xz
isodumper-6bf666a534f5376ba813b0aaf8993691d2925496.zip
Add encryption for persistent partition
Diffstat (limited to 'backend/magiback')
-rwxr-xr-xbackend/magiback21
1 files changed, 11 insertions, 10 deletions
diff --git a/backend/magiback b/backend/magiback
index 6bf0202..e7541c3 100755
--- a/backend/magiback
+++ b/backend/magiback
@@ -40,6 +40,7 @@ class Isodumper(raw_write.Dumper):
<method name='do_persistence'>
<arg type='s' name='target' direction='in'/>
<arg type='s' name='label' direction='in'/>
+ <arg type='s' name='key' direction='in'/>
</method>
<method name='get_sum'>
<arg type='s' name='source' direction='in'/>
@@ -75,7 +76,7 @@ class Isodumper(raw_write.Dumper):
self.signature_checked = False
self.writing_perm = False
self.writing_target = ""
-
+
def do_write(self,source, target, size, dbus_context):
self.finished.clear()
@@ -90,19 +91,19 @@ class Isodumper(raw_write.Dumper):
logging.debug(self.return_message)
self.finished.set()
- def do_persistence(self, target, label):
+ def do_persistence(self, target, label, key):
self.finished.clear()
if self.writing_perm and self.writing_target == target :
- self._do_persistence(target, label)
+ self._do_persistence(target, label, key)
else:
self.return_message = "Persistence: Access denied"
self.writing_perm = False
self.writing_target = ""
-
+
@property
def done(self):
return self.finished.wait(1)
-
+
@property
def message(self):
return self.return_message
@@ -128,13 +129,13 @@ class Isodumper(raw_write.Dumper):
def get_sum(self, source):
self.key_thread = threading.Thread(target=self._get_sum, args=(source,))
self.key_thread.start()
-
+
def check_write(self,target, source):
if hasattr(self, 'key_thread'):
self.key_thread.join()
self.thread = threading.Thread(target=self._check_write, args=(target, source,))
self.thread.start()
-
+
def run(self):
self.loop.run()
@@ -142,7 +143,7 @@ def check_permission(action, dbus_context):
""" Check permission
"""
return dbus_context.is_authorized(action, {'polkit.icon_name': 'isodumper.png',}, interactive=True)
-
+
class ConfFile(object):
"""
<node>
@@ -161,7 +162,7 @@ class ConfFile(object):
"""
def __init__(self):
super().__init__()
-
+
def setName(self,file_name):
self.file_name = file_name
@@ -175,7 +176,7 @@ class ConfFile(object):
break
content += line
return content
-
+
def saveFile(self, tc, dbus_context):
if check_permission('org.mageia.Magiback.write',dbus_context):
try: