From 4a4cf4a69118b8ce27e9de05083609b895a8005a Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Fri, 4 May 2018 17:10:41 +0900 Subject: [PATCH] Allow to save contents to /tmp/ directory Change-Id: I86ac02812a4b46149fd77f9449141fd319de2281 --- packaging/download-provider.spec | 2 +- provider/download-provider-security.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/download-provider.spec b/packaging/download-provider.spec index ae8f50f..62f081c 100755 --- a/packaging/download-provider.spec +++ b/packaging/download-provider.spec @@ -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 diff --git a/provider/download-provider-security.c b/provider/download-provider-security.c index bf1590f..8d0af25 100644 --- a/provider/download-provider-security.c +++ b/provider/download-provider-security.c @@ -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. -- 2.7.4