From: Abhishek Vijay Date: Tue, 11 Aug 2020 10:15:57 +0000 (+0530) Subject: [Non-ACR] removing API causing dbus execution vulnerability X-Git-Tag: submit/tizen/20201201.045940^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F241005%2F1;p=platform%2Fcore%2Fapi%2Fcontext.git [Non-ACR] removing API causing dbus execution vulnerability Change-Id: If0759cfb4109c3f5957461404ea779700c5b9dab Signed-off-by: Abhishek Vijay (cherry picked from commit 64c199a0688e55bb76026e016a07ac55ba316228) --- diff --git a/include/context_trigger_internal.h b/include/context_trigger_internal.h deleted file mode 100644 index 23b5146..0000000 --- a/include/context_trigger_internal.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TIZEN_CONTEXT_CONTEXT_TRIGGER_INTERNAL_H__ -#define __TIZEN_CONTEXT_CONTEXT_TRIGGER_INTERNAL_H__ - -#include -#include - -/** - * @brief Sets a D-Bus method call as the action of a rule. - * @since_tizen 2.4 - * - * @param[in] rule The rule to set the action on - * @param[in] bus_name Destination remote bus name - * @param[in] object_path Path of the remote object - * @param[in] interface_name D-Bus interface to invoke method on - * @param[in] method_name The name of the method to invoke - * @param[in] param Tuple with parameters for the method, - * or @c NULL if not passing parameters. - * - * @return 0 on success, otherwise a negative error value - * @retval #CONTEXT_TRIGGER_ERROR_NONE Successful - * @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #CONTEXT_TRIGGER_ERROR_PERMISSION_DENIED Permission denied - * @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory - * @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed - */ -int context_trigger_rule_set_action_dbus_call(context_trigger_rule_h rule, - const char *bus_name, const char *object_path, const char *interface_name, - const char *method_name, GVariant *param); - -#endif diff --git a/src/trigger/context_trigger.cpp b/src/trigger/context_trigger.cpp index b78fc7b..001581c 100644 --- a/src/trigger/context_trigger.cpp +++ b/src/trigger/context_trigger.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include "PrivilegeChecker.h" #include "ContextItem.h" @@ -590,23 +589,6 @@ EXPORT_API int context_trigger_rule_set_action_notification(context_trigger_rule return ret; } -//LCOV_EXCL_START -EXPORT_API int context_trigger_rule_set_action_dbus_call(context_trigger_rule_h rule, - const char *bus_name, const char *object_path, const char *interface_name, const char *method_name, GVariant *param) -{ - CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE); - ASSERT_NOT_NULL(rule && bus_name && object_path && interface_name && method_name); - IF_FAIL_RETURN_TAG(!rule->hasAction, E_INV_RULE, _E, "The rule has an action"); - - int ret = ctx_sched_job_set_dbus(rule->job, bus_name, object_path, interface_name, method_name, param); - - if (ret == E_NONE) - rule->hasAction = true; - - return ret; -} -//LCOV_EXCL_STOP - EXPORT_API int context_trigger_rule_set_description(context_trigger_rule_h rule, const char* description) { CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);