(Before) /opt/usr/media/XXX
(After) /opt/usr/home/USER/media/XXX
/opt/usr/media bind-mounted by /opt/usr/home/USER/media
is workaround for supporting legacy Tizen applications based on /opt/usr/media hard coding.
Strictly, public apis do not need to use legacy path (/opt/usr/media).
Change-Id: Ida39777ac40587719beb8d28b8f04172c98900e5
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
+#include <unistd.h>
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static const char *internal_get_root(void)
{
const char *ret;
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 STORAGE_ERROR_INVALID_PARAMETER;
}
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) {
user = false;
DD_LIST_FOREACH(st_int_head, elem, st) {
return STORAGE_ERROR_INVALID_PARAMETER;
}
return STORAGE_ERROR_INVALID_PARAMETER;
}
- if (getuid() < USER_UID_START)
+ if (getuid() <= USER_UID_START)
user = false;
/* internal storage */
user = false;
/* internal storage */
if (st->storage_id != storage_id)
continue;
if (!user) {
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;
}
return STORAGE_ERROR_INVALID_PARAMETER;
}
- if (getuid() < USER_UID_START)
+ if (getuid() <= USER_UID_START)
user = false;
if (found && st) {
if (!user) {
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;
}
return STORAGE_ERROR_INVALID_PARAMETER;
}