Package: backintime / 1.1.12-2

01-858193-back-up-slash-root-perms.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: back up permissions of '/' as well
Origin: https://github.com/bit-team/backintime/commit/38b24399c765b0a42eec6139d293e2f86cba5b2a
Bug: https://github.com/bit-team/backintime/issues/708
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858193
Applied-Upstream: 1.1.14
Last-Update: 2017-04-22

--- backintime-1.1.12.orig/common/snapshots.py
+++ backintime-1.1.12/common/snapshots.py
@@ -439,6 +439,12 @@
         if 0 == version:
             return file_info_dict
 
+        # default value for /
+        # only used if fileinfo.bz2 does not have a value for /
+        # when it was created with version <= 1.1.12
+        # bugfix for https://github.com/bit-team/backintime/issues/708
+        file_info_dict[b'/'] = (16877, b'root', b'root')
+
         fileinfo_path = self.get_snapshot_fileinfo_path( snapshot_id )
         if not os.path.exists( fileinfo_path ):
             return file_info_dict
@@ -1411,6 +1417,10 @@
                     find = subprocess.Popen(cmd, stdout = subprocess.PIPE,
                                             stderr = subprocess.PIPE)
 
+                    # backup permission for /
+                    # bugfix for https://github.com/bit-team/backintime/issues/708
+                    self._save_path_info(fileinfo, b'/')
+
                     for line in find.stdout:
                         if line:
                             self._save_path_info(fileinfo, decode.remote(line.rstrip(b'\n'))[head:])
@@ -1425,6 +1435,10 @@
                         permission_done = True
 
                 if not permission_done:
+                    # backup permission for /
+                    # bugfix for https://github.com/bit-team/backintime/issues/708
+                    self._save_path_info(fileinfo, b'/')
+
                     path_to_explore = self.get_snapshot_path_to(self.NEW_SNAPSHOT_ID).rstrip('/').encode()
                     for path, dirs, files in os.walk( path_to_explore ):
                         dirs.extend( files )