- media_content_sec_debug("Old condition[%s]", condition);
- if (((strstr(condition, "PATH") != NULL) || (strstr(condition, "path") != NULL)) && (strstr(condition, old_path) != NULL)) {
- char *cond = strdup(condition);
- char *repl_cond_ptr = replace_condition;
- char *cond_ptr = cond;
-
- if (cond_ptr == NULL) {
- SAFE_FREE(old_path);
- media_content_error("memory allocation failed");
- return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
- }
- while (*cond_ptr != '\0') {
- if (strlen(cond_ptr) < strlen(old_path)) {
- memcpy(repl_cond_ptr, cond_ptr, strlen(cond_ptr));
- break;
- }
- /* replace path only and keep other condition */
- if (memcmp(cond_ptr, old_path, strlen(old_path)) == 0) {
- memcpy(repl_cond_ptr, tzplatform_getenv(TZ_USER_CONTENT), strlen(tzplatform_getenv(TZ_USER_CONTENT)));
- cond_ptr += strlen(old_path);
- repl_cond_ptr += strlen(tzplatform_getenv(TZ_USER_CONTENT));
- } else {
- *repl_cond_ptr = *cond_ptr;
- cond_ptr++;
- repl_cond_ptr++;
- }
- }
- SAFE_FREE(cond);
- } else {
- snprintf(replace_condition, MAX_QUERY_SIZE, "%s", condition);
+ /*1. Check Hidden Directory*/
+ if (strstr(dir_path, "/.") != NULL) {
+ content_error("hidden path");
+ return true;