]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
upgrade: Drop more privileges during 1.4.0 migration
authorAlessandro Astone <ales.astone@gmail.com>
Sun, 22 Jan 2023 14:30:49 +0000 (15:30 +0100)
committerAlessandro Astone <ales.astone@gmail.com>
Sun, 22 Jan 2023 14:38:18 +0000 (15:38 +0100)
Now that the container is properly stopped we can touch rootfs and
data too

tools/actions/upgrader.py

index 9fa299edd1183155c3037618ef220d1d0fa99197..1262637b3f8717b3d29df3ec755198017a223bbb 100644 (file)
@@ -20,7 +20,7 @@ def migration(args):
     try:
         old_ver = tools.helpers.props.file_get(args, args.work + "/waydroid_base.prop", "waydroid.tools_version")
         if versiontuple(old_ver) <= versiontuple("1.3.4"):
     try:
         old_ver = tools.helpers.props.file_get(args, args.work + "/waydroid_base.prop", "waydroid.tools_version")
         if versiontuple(old_ver) <= versiontuple("1.3.4"):
-            chmod_paths = ["cache_http", "host-permissions", "lxc", "images", "waydroid_base.prop", "waydroid.prop", "waydroid.cfg"]
+            chmod_paths = ["cache_http", "host-permissions", "lxc", "images", "rootfs", "data", "waydroid_base.prop", "waydroid.prop", "waydroid.cfg"]
             tools.helpers.run.user(args, ["chmod", "-R", "g-w,o-w"] + [os.path.join(args.work, f) for f in chmod_paths], check=False)
             tools.helpers.run.user(args, ["chmod", "g-w,o-w", args.work], check=False)
     except:
             tools.helpers.run.user(args, ["chmod", "-R", "g-w,o-w"] + [os.path.join(args.work, f) for f in chmod_paths], check=False)
             tools.helpers.run.user(args, ["chmod", "g-w,o-w", args.work], check=False)
     except:
@@ -28,7 +28,6 @@ def migration(args):
 
 def upgrade(args):
     get_config(args)
 
 def upgrade(args):
     get_config(args)
-    migration(args)
     status = "STOPPED"
     if os.path.exists(tools.config.defaults["lxc"] + "/waydroid"):
         status = helpers.lxc.status(args)
     status = "STOPPED"
     if os.path.exists(tools.config.defaults["lxc"] + "/waydroid"):
         status = helpers.lxc.status(args)
@@ -40,6 +39,7 @@ def upgrade(args):
             container.Stop(False)
         except Exception as e:
             logging.debug(e)
             container.Stop(False)
         except Exception as e:
             logging.debug(e)
+    migration(args)
     helpers.drivers.loadBinderNodes(args)
     if not args.offline:
         if args.images_path not in tools.config.defaults["preinstalled_images_paths"]:
     helpers.drivers.loadBinderNodes(args)
     if not args.offline:
         if args.images_path not in tools.config.defaults["preinstalled_images_paths"]: