diff options
author | Doug Zongker <dougz@android.com> | 2010-07-08 17:27:55 -0700 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2010-07-08 17:27:55 -0700 |
commit | 23ceeea85e6a3555dd3d7140128e310954cadf7f (patch) | |
tree | 3d189beaa3ce60b54b20d66876cd52b69a7a3202 /roots.c | |
parent | c78a9698dd55a165c2206c380f87f173bacba2aa (diff) | |
download | bootable_recovery-23ceeea85e6a3555dd3d7140128e310954cadf7f.zip bootable_recovery-23ceeea85e6a3555dd3d7140128e310954cadf7f.tar.gz bootable_recovery-23ceeea85e6a3555dd3d7140128e310954cadf7f.tar.bz2 |
make a copy of sideloaded packages in /tmp before verifying
Copy a sideloaded package into /tmp, then verify and install the copy,
to prevent malicious users from overwriting the package between
verification and install.
Bug: 2826890 package can be replaced during verification
Bug: 2058160 Recovery should copy sideloaded (sd card) update ...
Change-Id: I3de148b0f1a671f1974782b6855527caeaefda23
Diffstat (limited to 'roots.c')
-rw-r--r-- | roots.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -42,6 +42,7 @@ xxx may just want to use enums static const char g_mtd_device[] = "@\0g_mtd_device"; static const char g_raw[] = "@\0g_raw"; static const char g_package_file[] = "@\0g_package_file"; +static const char g_ramdisk[] = "@\0g_ramdisk"; static RootInfo g_roots[] = { { "BOOT:", g_mtd_device, NULL, "boot", NULL, g_raw }, @@ -53,7 +54,7 @@ static RootInfo g_roots[] = { { "SDCARD:", "/dev/block/mmcblk0p1", "/dev/block/mmcblk0", NULL, "/sdcard", "vfat" }, { "SYSTEM:", g_mtd_device, NULL, "system", "/system", "yaffs2" }, { "MBM:", g_mtd_device, NULL, "mbm", NULL, g_raw }, - { "TMP:", NULL, NULL, NULL, "/tmp", NULL }, + { "TMP:", NULL, NULL, NULL, "/tmp", g_ramdisk }, }; #define NUM_ROOTS (sizeof(g_roots) / sizeof(g_roots[0])) @@ -180,7 +181,9 @@ internal_root_mounted(const RootInfo *info) if (info->mount_point == NULL) { return -1; } -//xxx if TMP: (or similar) just say "yes" + if (info->filesystem == g_ramdisk) { + return 0; + } /* See if this root is already mounted. */ |