Merge "Fix null-terminated string issue after fread @download-provider-security.c... accepted/tizen/unified/20180508.071607 submit/tizen/20180508.012433
authorTaesoo Jun <steve.jun@samsung.com>
Tue, 8 May 2018 01:21:56 +0000 (01:21 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 8 May 2018 01:21:56 +0000 (01:21 +0000)
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 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.