#define INVALID_DEFAULT_VALUE -1
-#define MEDIA_PATH_EXTERNAL tzplatform_getenv(TZ_SYS_STORAGE) /* external storage */
+#define MEDIA_PATH_EXTERNAL tzplatform_getenv(TZ_SYS_STORAGE) /* external storage, or TZ_SYS_MEDIA */
+#define MEDIA_PATH_USER tzplatform_getenv(TZ_USER_CONTENT) /* user media storage */
+
#define MEDIA_STORAGE_PRIVILEGE_NAME "http://tizen.org/privilege/mediastorage"
#define EXTERNAL_STORAGE_PRIVILEGE_NAME "http://tizen.org/privilege/externalstorage"
#define INTERNET_PRIVILEGE_NAME "http://tizen.org/privilege/internet"
file_path = path+7; /* remove file prefix */
}
- if (strncmp(file_path, MEDIA_PATH_EXTERNAL, strlen(MEDIA_PATH_EXTERNAL)) == 0)
- privilege = EXTERNAL_STORAGE_PRIVILEGE_NAME;
- else
- privilege = MEDIA_STORAGE_PRIVILEGE_NAME;
+ if (!privilege) {
+ if (strncmp(file_path, MEDIA_PATH_EXTERNAL, strlen(MEDIA_PATH_EXTERNAL)) == 0)
+ privilege = EXTERNAL_STORAGE_PRIVILEGE_NAME;
+ else if (strncmp(file_path, MEDIA_PATH_USER, strlen(MEDIA_PATH_USER)) == 0)
+ privilege = MEDIA_STORAGE_PRIVILEGE_NAME;
+ else
+ return PLAYER_ERROR_NONE;
+ }
}
+ LOGD("privilege check : %s", privilege);
if (!muse_core_security_check_cynara(client_fd, privilege)) {
ret = PLAYER_ERROR_PERMISSION_DENIED;
LOGE("security check failed %s", privilege);