#include "content/mime_type.h"
#define DP_SDCARD_MNT_POINT tzplatform_mkpath(TZ_SYS_STORAGE, "sdcard")
+#define DP_EXTERNAL_STORAGE "/opt/media/"
#define DP_MAX_FILE_PATH_LEN 256
#define DP_MAX_MIME_TABLE_NUM 15
return DP_ERROR_INVALID_PARAMETER;
}
+ if (strncmp(saved_path, DP_EXTERNAL_STORAGE, strlen(DP_EXTERNAL_STORAGE)) == 0
+ || strncmp(DP_SDCARD_MNT_POINT,
+ saved_path, strlen(DP_SDCARD_MNT_POINT)) == 0) {
+ TRACE_INFO("Do not change permission for %s", saved_path);
+ return DP_ERROR_NONE;
+ }
+
struct stat lstat_info;
int fd;
dp_credential cred = slot->credential;
// Change the owner to client's uid.
if (fchown(fd, cred.uid, lstat_info.st_gid) != 0) {
TRACE_ERROR("[ERROR][%d] permission user:%d group:%d",
- request->id, cred.uid, cred.gid);
+ request->id, cred.uid, lstat_info.st_gid);
close(fd);
return DP_ERROR_PERMISSION_DENIED;
}
- TRACE_INFO("file owner has been changed to %d.", cred.uid);
+ TRACE_INFO("file owner has been changed to %d:%d", cred.uid, lstat_info.st_gid);
close(fd);
return DP_ERROR_NONE;
TRACE_SECURE_DEBUG("[FINISH][%d][%s]", request->id, info->saved_path);
if (info->err == DA_RESULT_OK) {
if (info->saved_path != NULL) {
- errorcode = __set_file_permission_to_client(slot, request, info->saved_path);
+ errorcode = __set_file_permission_to_client(slot,
+ request, info->saved_path);
} else {
TRACE_ERROR("[ERROR][%d] No SavedPath", request->id);
errorcode = DP_ERROR_INVALID_DESTINATION;