char uid[32];
snprintf(uid, 32, "%d", getuid());
ret = true;
- ret = __check_privilege(uid, VC_PRIVILEGE);
- __check_privilege_deinitialize();
+ ret = __check_privilege(uid, VC_PRIVILEGE_RECORDER);
if (false == ret) {
//LCOV_EXCL_START
- SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Permission is denied");
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_RECORDER, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_PERMISSION_DENIED;
//LCOV_EXCL_STOP
}
+
+ ret = __check_privilege(uid, VC_PRIVILEGE_DATASHARING);
+ if (false == ret) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_DATASHARING, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
+ return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
+ }
+
+ ret = __check_privilege(uid, VC_PRIVILEGE_APPMGR);
+ if (false == ret) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_APPMGR, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
+ return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
+ }
+
+ __check_privilege_deinitialize();
}
g_privilege_allowed = true;
char uid[32];
snprintf(uid, 32, "%d", getuid());
ret = true;
- ret = __check_privilege(uid, VC_PRIVILEGE);
+ ret = __check_privilege(uid, VC_PRIVILEGE_RECORDER);
if (false == ret) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE, uid);
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_RECORDER, uid);
__check_privilege_deinitialize();
g_privilege_allowed = false;
pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_PERMISSION_DENIED;
}
- ret = true;
ret = __check_privilege(uid, VC_MGR_PRIVILEGE);
if (false == ret) {
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Permission is denied(%s)(%s)", VC_MGR_PRIVILEGE, uid);
return VC_ERROR_PERMISSION_DENIED;
}
+ ret = __check_privilege(uid, VC_PRIVILEGE_DATASHARING);
+ if (false == ret) {
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_DATASHARING, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
+ return VC_ERROR_PERMISSION_DENIED;
+ }
+
+ ret = __check_privilege(uid, VC_PRIVILEGE_APPMGR);
+ if (false == ret) {
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_APPMGR, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
+ return VC_ERROR_PERMISSION_DENIED;
+ }
+
__check_privilege_deinitialize();
}
char uid[32];
snprintf(uid, 32, "%d", getuid());
ret = true;
- ret = __check_privilege(uid, VC_PRIVILEGE);
- __check_privilege_deinitialize();
+ ret = __check_privilege(uid, VC_PRIVILEGE_RECORDER);
+ if (false == ret) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_RECORDER, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
+ return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
+ }
+
+ ret = __check_privilege(uid, VC_PRIVILEGE_DATASHARING);
if (false == ret) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied");
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_DATASHARING, uid);
+ __check_privilege_deinitialize();
g_privilege_allowed = false;
pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
}
+
+ ret = __check_privilege(uid, VC_PRIVILEGE_APPMGR);
+ if (false == ret) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_APPMGR, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
+ return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
+ }
+
+ __check_privilege_deinitialize();
}
g_privilege_allowed = true;
#define VC_MGR_FEATURE_PATH "tizen.org/feature/speech.control_manager"
#define VC_MIC_FEATURE_PATH "tizen.org/feature/microphone"
-#define VC_PRIVILEGE "http://tizen.org/privilege/recorder"
-#define VC_MGR_PRIVILEGE "http://tizen.org/privilege/voicecontrol.manager"
+#define VC_PRIVILEGE_RECORDER "http://tizen.org/privilege/recorder"
+#define VC_MGR_PRIVILEGE "http://tizen.org/privilege/voicecontrol.manager"
+#define VC_PRIVILEGE_DATASHARING "http://tizen.org/privilege/datasharing"
+#define VC_PRIVILEGE_APPMGR "http://tizen.org/privilege/appmanager.launch"
/******************************************************************************************
* Definitions for common enum
char uid[32];
snprintf(uid, 32, "%d", getuid());
ret = true;
- ret = __check_privilege(uid, VC_PRIVILEGE);
- __check_privilege_deinitialize();
+ ret = __check_privilege(uid, VC_PRIVILEGE_RECORDER);
+ if (false == ret) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_RECORDER, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
+ return VCE_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
+ }
+
+ ret = __check_privilege(uid, VC_PRIVILEGE_DATASHARING);
+ if (false == ret) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_DATASHARING, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
+ return VCE_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
+ }
+
+ ret = __check_privilege(uid, VC_PRIVILEGE_APPMGR);
if (false == ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Permission is denied");
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_APPMGR, uid);
+ __check_privilege_deinitialize();
+ g_privilege_allowed = false;
pthread_mutex_unlock(&g_cynara_mutex);
return VCE_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
}
+
+ __check_privilege_deinitialize();
+
}
g_privilege_allowed = true;