[v0.2.36] add path condition to check user media storage privilege 00/97800/1 accepted/tizen/3.0/common/20161116.143926 accepted/tizen/3.0/ivi/20161116.023356 accepted/tizen/3.0/mobile/20161116.022842 accepted/tizen/3.0/tv/20161116.023021 accepted/tizen/3.0/wearable/20161116.023243 submit/tizen_3.0/20161115.060306
authorEunhae Choi <eunhae1.choi@samsung.com>
Tue, 15 Nov 2016 05:30:11 +0000 (14:30 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 15 Nov 2016 05:30:11 +0000 (14:30 +0900)
Change-Id: I6e1d29624a5eedca4e8b9217e9041be0f94daa93

muse/src/muse_player.c
packaging/mmsvc-player.spec

index 3fd69fe..6e5cd87 100644 (file)
@@ -35,7 +35,9 @@
 
 #define INVALID_DEFAULT_VALUE -1
 
-#define MEDIA_PATH_EXTERNAL             tzplatform_getenv(TZ_SYS_STORAGE) /* external storage */
+#define MEDIA_PATH_EXTERNAL  tzplatform_getenv(TZ_SYS_STORAGE)  /* external storage, or TZ_SYS_MEDIA */
+#define MEDIA_PATH_USER      tzplatform_getenv(TZ_USER_CONTENT) /* user media storage */
+
 #define MEDIA_STORAGE_PRIVILEGE_NAME    "http://tizen.org/privilege/mediastorage"
 #define EXTERNAL_STORAGE_PRIVILEGE_NAME "http://tizen.org/privilege/externalstorage"
 #define INTERNET_PRIVILEGE_NAME         "http://tizen.org/privilege/internet"
@@ -340,12 +342,17 @@ static int _check_supportable(muse_module_h module, char *path)
                                file_path = path+7; /* remove file prefix */
                }
 
-               if (strncmp(file_path, MEDIA_PATH_EXTERNAL, strlen(MEDIA_PATH_EXTERNAL)) == 0)
-                       privilege = EXTERNAL_STORAGE_PRIVILEGE_NAME;
-               else
-                       privilege = MEDIA_STORAGE_PRIVILEGE_NAME;
+               if (!privilege) {
+                       if (strncmp(file_path, MEDIA_PATH_EXTERNAL, strlen(MEDIA_PATH_EXTERNAL)) == 0)
+                               privilege = EXTERNAL_STORAGE_PRIVILEGE_NAME;
+                       else if (strncmp(file_path, MEDIA_PATH_USER, strlen(MEDIA_PATH_USER)) == 0)
+                               privilege = MEDIA_STORAGE_PRIVILEGE_NAME;
+                       else
+                               return PLAYER_ERROR_NONE;
+               }
        }
 
+       LOGD("privilege check : %s", privilege);
        if (!muse_core_security_check_cynara(client_fd, privilege)) {
                ret = PLAYER_ERROR_PERMISSION_DENIED;
                LOGE("security check failed %s", privilege);
index 423dd9b..92757f9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.35
+Version:    0.2.36
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0