diff options
author | Semun Lee <sm79.lee@samsung.com> | 2015-05-26 03:46:49 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2015-05-26 03:46:50 -0700 |
commit | b02b6d3994bf6f22dada6f369cc5ab8ee3167de2 (patch) | |
tree | c6950a7c0f5807881f7a22f610945cf80fe3edce | |
parent | fb9724d8d79a56f0c53518489df7f94c53ffa1ce (diff) | |
parent | 8937ac0832e556b034025737cfdb2f7fdb5191ff (diff) | |
download | aul-1-submit/tizen/20150526.104937.tar.gz aul-1-submit/tizen/20150526.104937.tar.bz2 aul-1-submit/tizen/20150526.104937.zip |
Merge "change parameter in __get_path function and return error in invalid parameter." into tizensubmit/tizen/20150526.104937
-rwxr-xr-x | src/aul_path.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/aul_path.c b/src/aul_path.c index 16fbc3a0..f9f326fc 100755 --- a/src/aul_path.c +++ b/src/aul_path.c @@ -31,7 +31,6 @@ #include "simple_util.h" #include "aul.h" -#define _GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER) #define _EXTERNAL_APP_SPECIFIC_PATH \ tzplatform_mkpath(TZ_SYS_STORAGE, "sdcard/apps/") #define _APP_SPECIFIC_PATH tzplatform_getenv(TZ_USER_APP) @@ -260,47 +259,71 @@ SLPAPI const char *aul_get_app_external_specific_path(void) SLPAPI int aul_get_app_shared_data_path_by_appid(const char *appid, char **path) { - return __get_path(path, appid, _SHARED_DATA_DIR, _GLOBAL_USER); + if (appid == NULL || path == NULL) + return AUL_R_EINVAL; + + return __get_path(path, appid, _SHARED_DATA_DIR, getuid()); } SLPAPI int aul_get_app_shared_resource_path_by_appid(const char *appid, char **path) { - return __get_path(path, appid, _SHARED_RESOURCE_DIR, _GLOBAL_USER); + if (appid == NULL || path == NULL) + return AUL_R_EINVAL; + + return __get_path(path, appid, _SHARED_RESOURCE_DIR, getuid()); } SLPAPI int aul_get_app_shared_trusted_path_by_appid(const char *appid, char **path) { - return __get_path(path, appid, _SHARED_TRUSTED_DIR, _GLOBAL_USER); + if (appid == NULL || path == NULL) + return AUL_R_EINVAL; + + return __get_path(path, appid, _SHARED_TRUSTED_DIR, getuid()); } SLPAPI int aul_get_app_external_shared_data_path_by_appid(const char *appid, char **path) { - return __get_external_path(path, appid, _SHARED_DATA_DIR, _GLOBAL_USER); + if (appid == NULL || path == NULL) + return AUL_R_EINVAL; + + return __get_external_path(path, appid, _SHARED_DATA_DIR, getuid()); } SLPAPI int aul_get_usr_app_shared_data_path_by_appid(const char *appid, char **path, uid_t uid) { + if (appid == NULL || path == NULL) + return AUL_R_EINVAL; + return __get_path(path, appid, _SHARED_DATA_DIR, uid); } SLPAPI int aul_get_usr_app_shared_resource_path_by_appid(const char *appid, char **path, uid_t uid) { + if (appid == NULL || path == NULL) + return AUL_R_EINVAL; + return __get_path(path, appid, _SHARED_RESOURCE_DIR, uid); } SLPAPI int aul_get_usr_app_shared_trusted_path_by_appid(const char *appid, char **path, uid_t uid) { + if (appid == NULL || path == NULL) + return AUL_R_EINVAL; + return __get_path(path, appid, _SHARED_TRUSTED_DIR, uid); } SLPAPI int aul_get_usr_app_external_shared_data_path_by_appid(const char *appid, char **path, uid_t uid) { + if (appid == NULL || path == NULL) + return AUL_R_EINVAL; + return __get_external_path(path, appid, _SHARED_DATA_DIR, uid); } |