Minor fix on USER checking 84/184584/2
authorHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 19 Jul 2018 04:31:41 +0000 (13:31 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 19 Jul 2018 04:32:15 +0000 (13:32 +0900)
Change-Id: I861137d16ac40792a542247dc412aad74ad26045
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/storage.c

index 6fdc8f9..93bb85c 100644 (file)
@@ -72,7 +72,7 @@ API int storage_foreach_device_supported(storage_device_supported_cb callback, v
                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) {
@@ -116,7 +116,7 @@ API int storage_get_root_directory(int storage_id, char **path)
                return STORAGE_ERROR_INVALID_PARAMETER;
        }
 
-       if (getuid() < USER_UID_START)
+       if (getuid() <= USER_UID_START)
                user = false;
 
        /* internal storage */
@@ -124,8 +124,8 @@ API int storage_get_root_directory(int storage_id, char **path)
                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;
                }
 
@@ -189,13 +189,13 @@ API int storage_get_directory(int storage_id, storage_directory_e type, char **p
                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;
                }