Added privilege check logic for foreach found bssid function 77/182277/1 accepted/tizen/unified/20180622.122707 submit/tizen/20180622.032935
authortaesub kim <taesub.kim@samsung.com>
Fri, 22 Jun 2018 03:17:47 +0000 (12:17 +0900)
committertaesub kim <taesub.kim@samsung.com>
Fri, 22 Jun 2018 03:18:00 +0000 (12:18 +0900)
Change-Id: I0dc46318cf14e799f36910e59b6ea79f9621197c
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
src/wifi_manager.c

index bd87247..bcb3a1c 100755 (executable)
@@ -616,6 +616,8 @@ EXPORT_API int wifi_manager_foreach_found_bssid_ap(wifi_manager_h wifi,
 {
        __NETWORK_CAPI_FUNC_ENTER__;
 
+       int rv;
+
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (callback == NULL || !(__wifi_check_handle_validity(wifi))) {
@@ -624,6 +626,13 @@ EXPORT_API int wifi_manager_foreach_found_bssid_ap(wifi_manager_h wifi,
                return WIFI_MANAGER_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
+       rv = _wifi_check_get_privilege();
+       if (rv != WIFI_MANAGER_ERROR_NONE) {
+               WIFI_LOG(WIFI_ERROR, "Fail to check the privilege"); //LCOV_EXCL_LINE
+               __NETWORK_CAPI_FUNC_EXIT__; //LCOV_EXCL_LINE
+               return rv; //LCOV_EXCL_LINE
+       }
+
        __NETWORK_CAPI_FUNC_EXIT__;
        return _wifi_foreach_found_bssid_ap(callback, user_data);
 }