const struct storage_ops *st;
dd_list *elem;
int ret;
+ bool user = true;
if (!callback) {
_E("Invalid parameter");
return STORAGE_ERROR_INVALID_PARAMETER;
}
+ if (getuid() < USER_UID_START)
+ user = false;
+
DD_LIST_FOREACH(st_int_head, elem, st) {
- ret = callback(st->storage_id, st->type, st->get_state(),
- st->root(), user_data);
- /* if the return value is false, will be stop to iterate */
- if (!ret)
- break;
+ if (user) {
+ ret = callback(st->storage_id, st->type, st->get_state(),
+ st->root(), user_data);
+ /* if the return value is false, will be stop to iterate */
+ if (!ret)
+ break;
+ }
}
if (!storage_ext_is_supported()) {
char root[PATH_MAX];
int ret;
bool extendedint;
+ bool user = true;
if (storage_id < 0)
return STORAGE_ERROR_NOT_SUPPORTED;
return STORAGE_ERROR_INVALID_PARAMETER;
}
- if (storage_id == STORAGE_TYPE_INTERNAL && getuid() < USER_UID_START) {
- _E("Only Tizen applications and user session daemons can use \
- storage_get_root_directory(STORAGE_TYPE_INTERNAL, ...)");
- return STORAGE_ERROR_INVALID_PARAMETER;
- }
+ if (getuid() < USER_UID_START)
+ user = false;
/* internal storage */
DD_LIST_FOREACH(st_int_head, elem, st) {
if (st->storage_id != storage_id)
continue;
+ if (!user) {
+ _E("Only Tizen applications and user session daemons can use \
+ storage_get_root_directory(id , ...)");
+ return STORAGE_ERROR_INVALID_PARAMETER;
+ }
+
*path = strdup(st->root());
if (!*path) {
//LCOV_EXCL_START System Error
dd_list *elem;
bool found;
bool extendedint;
+ bool user = true;
if (storage_id < 0)
return STORAGE_ERROR_NOT_SUPPORTED;
break;
}
+ if (getuid() < USER_UID_START)
+ user = false;
+
if (found && st) {
+ if (!user) {
+ _E("Only Tizen applications and user session daemons can use \
+ storage_get_directory(id, ...)");
+ return STORAGE_ERROR_INVALID_PARAMETER;
+ }
+
snprintf(root, sizeof(root), "%s", st->root());
if (type == STORAGE_DIRECTORY_SYSTEM_RINGTONES) {
temp2 = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR);