#define MAX_ARRAY_LEN 1024
#define SECURITY_ATTRIBUTES_PATH "/proc/%d/attr/current"
#define TEMP_DIR "/tmp/"
+#define LEGACY_USER_APP "/opt/usr/apps/"
static int dp_is_exist_dir(const char *dirpath)
{
}
// Check permission: private storage
- temp = tzplatform_getenv(TZ_USER_APP);
- if (temp) {
+ if (strncmp(resolved_path, LEGACY_USER_APP, strlen(LEGACY_USER_APP)) == 0) {
+ // Some applications use a legacy app path.
+ snprintf(apps_storage, PATH_MAX - 1, "%s", LEGACY_USER_APP);
+ } else {
+ temp = tzplatform_getenv(TZ_USER_APP);
snprintf(apps_storage, PATH_MAX - 1, "%s/", temp);
+ temp = NULL;
+ }
+
+ if (strlen(apps_storage) > 0) {
if (strncmp(resolved_path, apps_storage,
strlen(apps_storage)) == 0) {
pkg_id = _dp_get_pkg_id(cred);
free(pkg_id);
return DP_ERROR_NONE;
}
- temp = NULL;
}
// Check whether directory is shared directory or not.