diff options
author | Papoteur <papoteur@mageia.org> | 2023-06-30 11:28:07 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2023-06-30 11:28:07 +0200 |
commit | 23cd3e7048252777e6bb38288b66c14c2ec718db (patch) | |
tree | 8be4424b6c21b3603ee5c8846a1098cea378a3c1 /backend/magiback | |
parent | d9ed76e1088e8af27bdea226a9f562e91209283a (diff) | |
download | isodumper-23cd3e7048252777e6bb38288b66c14c2ec718db.tar isodumper-23cd3e7048252777e6bb38288b66c14c2ec718db.tar.gz isodumper-23cd3e7048252777e6bb38288b66c14c2ec718db.tar.bz2 isodumper-23cd3e7048252777e6bb38288b66c14c2ec718db.tar.xz isodumper-23cd3e7048252777e6bb38288b66c14c2ec718db.zip |
Give user ownership to the backup image.
Diffstat (limited to 'backend/magiback')
-rwxr-xr-x | backend/magiback | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/backend/magiback b/backend/magiback index c65b3a3..526e98a 100755 --- a/backend/magiback +++ b/backend/magiback @@ -38,6 +38,12 @@ class Isodumper(raw_write.Dumper): <arg type='s' name='label' direction='in'/> <arg type='s' name='key' direction='in'/> </method> + <method name='set_backup_mode'> + <arg type='x' name='uid' direction='in'/> + <arg type='x' name='gid' direction='in'/> + </method> + <method name='unset_backup_mode'> + </method> <method name='end'> <arg type='b' name='success' direction='out'/> <arg type='s' name='message' direction='out'/> @@ -69,11 +75,14 @@ class Isodumper(raw_write.Dumper): self.signature_checked = False self.writing_perm = False self.writing_target = "" + self.backup_mode = False + self.uid = 0 + self.gid = 0 def do_write(self, source, target, size, dbus_context): self.finished.clear() if check_permission('org.mageia.Magiback.Isodumper.write', dbus_context): - self.thread = threading.Thread(target=self._do_write, args=(source, target, size, )) + self.thread = threading.Thread(target=self._do_write, args=(source, target, size, self.backup_mode, self.uid, self.uid)) self.thread.start() logging.debug("Writing thread started") self.writing_perm = True @@ -124,6 +133,16 @@ class Isodumper(raw_write.Dumper): self.thread = threading.Thread(target=self._check_write, args=(target, source,)) self.thread.start() + def set_backup_mode(self, uid, gid): + self.backup_mode = True + self.uid = uid + self.gid = gid + + def unset_backup_mode(self): + self.backup_mode = False + self.uid = 0 + self.gid = 0 + def run(self): self.loop.run() |