*/
+#include <unistd.h>
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static const char *internal_get_root(void)
{
const char *ret;
-
- if (is_compat_bind_mount())
- ret = COMPAT_DIR;
- else
- ret = tzplatform_getenv(TZ_USER_CONTENT);
+ ret = tzplatform_uid_getenv(getuid(), TZ_USER_CONTENT);
return ret;
}
return STORAGE_ERROR_INVALID_PARAMETER;
}
- if (getuid() < USER_UID_START)
+ if (getuid() <= USER_UID_START)
user = false;
DD_LIST_FOREACH(st_int_head, elem, st) {
return STORAGE_ERROR_INVALID_PARAMETER;
}
- if (getuid() < USER_UID_START)
+ if (getuid() <= USER_UID_START)
user = false;
/* internal storage */
if (st->storage_id != storage_id)
continue;
if (!user) {
- _E("Only Tizen applications and user session daemons can use \
- storage_get_root_directory(id , ...)");
+ _E("Only Tizen applications and user session daemons can use\
+ storage_get_root_directory(INTERNAL_STORAGE_ID, ...)");
return STORAGE_ERROR_INVALID_PARAMETER;
}
break;
}
- if (getuid() < USER_UID_START)
+ 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, ...)");
+ _E("Only Tizen applications and user session daemons can use\
+ storage_get_directory(INTERNAL_STORAGE_ID, ...)");
return STORAGE_ERROR_INVALID_PARAMETER;
}