diff options
Diffstat (limited to 'cmds/installd')
-rw-r--r-- | cmds/installd/commands.c | 12 | ||||
-rw-r--r-- | cmds/installd/installd.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index dcae0c7..79bda74 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -218,14 +218,20 @@ int free_cache(int free_size) static int is_valid_apk_path(const char *path) { int len = strlen(APK_DIR_PREFIX); +int nosubdircheck = 0; if (strncmp(path, APK_DIR_PREFIX, len)) { len = strlen(PROTECTED_DIR_PREFIX); if (strncmp(path, PROTECTED_DIR_PREFIX, len)) { - LOGE("invalid apk path '%s' (bad prefix)\n", path); - return 0; + len = strlen(SDCARD_DIR_PREFIX); + if (strncmp(path, SDCARD_DIR_PREFIX, len)) { + LOGE("invalid apk path '%s' (bad prefix)\n", path); + return 0; + } else { + nosubdircheck = 1; + } } } - if (strchr(path + len, '/')) { + if ((nosubdircheck != 1) && strchr(path + len, '/')) { LOGE("invalid apk path '%s' (subdir?)\n", path); return 0; } diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index 1679d14..35a173e 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -68,6 +68,7 @@ /* other handy constants */ #define PROTECTED_DIR_PREFIX "/data/app-private/" +#define SDCARD_DIR_PREFIX "/asec/" #define DALVIK_CACHE_PREFIX "/data/dalvik-cache/" #define DALVIK_CACHE_POSTFIX "/classes.dex" |