Allow to save contents to /tmp/ directory 00/177900/1
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 4 May 2018 08:10:41 +0000 (17:10 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 4 May 2018 08:10:46 +0000 (17:10 +0900)
Change-Id: I86ac02812a4b46149fd77f9449141fd319de2281

packaging/download-provider.spec
provider/download-provider-security.c

index ae8f50f..62f081c 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.1.95
+Version:    2.1.96
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0
index bf1590f..8d0af25 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)
 {
@@ -157,6 +158,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.