Merge "Fix null-terminated string issue after fread @download-provider-security.c...
[platform/framework/web/download-provider.git] / provider / download-provider-security.c
index fa6c877..15ff4a9 100644 (file)
@@ -39,6 +39,7 @@
 
 #define MAX_ARRAY_LEN 1024
 #define SECURITY_ATTRIBUTES_PATH "/proc/%d/attr/current"
+#define TEMP_DIR "/tmp/"
 
 static int dp_is_exist_dir(const char *dirpath)
 {
@@ -158,6 +159,10 @@ int dp_is_valid_dir(dp_credential cred, const char *dirpath)
                return DP_ERROR_INVALID_DESTINATION;
        }
 
+       // Check whether directory is temporary directory or not.
+       if (strncmp(resolved_path, TEMP_DIR, strlen(TEMP_DIR)) == 0)
+               return DP_ERROR_NONE;
+
        tzplatform_set_user(cred.uid);
 
        // Check whether directory is default directory or not.