From 4a7c0dab31dc43dc6fd9b800a93b952cb2063213 Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Thu, 13 Jun 2013 18:54:21 +0900 Subject: [PATCH] fix secure log Change-Id: Iae6f0238249ce79014ada8aec419f509e5ea07de Signed-off-by: Young Ik Cho --- CMakeLists.txt | 10 ++++++++++ osp-service-app-loader/CMakeLists.txt | 8 ++------ osp-service-app-loader/serviceapp_loader.c | 4 +++- osp-system-service-loader/CMakeLists.txt | 8 ++------ osp-system-service-loader/systemservice_loader.c | 10 ++++++---- osp-ui-app-loader/CMakeLists.txt | 9 ++------- osp-ui-app-loader/uiapp_loader.c | 22 ++++++++-------------- packaging/osp-loader.spec | 4 ++-- 8 files changed, 35 insertions(+), 40 deletions(-) mode change 100755 => 100644 CMakeLists.txt mode change 100755 => 100644 osp-ui-app-loader/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index dd62ca7..f87f11c --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,16 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) SET(CMAKE_EXECUTABLE_SUFFIX "") SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/output") +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + dlog + aul +) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + ADD_SUBDIRECTORY(osp-ui-app-loader) ADD_SUBDIRECTORY(osp-service-app-loader) ADD_SUBDIRECTORY(osp-system-service-loader) diff --git a/osp-service-app-loader/CMakeLists.txt b/osp-service-app-loader/CMakeLists.txt index 77a58ae..e03c3b5 100644 --- a/osp-service-app-loader/CMakeLists.txt +++ b/osp-service-app-loader/CMakeLists.txt @@ -1,10 +1,5 @@ SET (this_target osp-service-app-loader) -INCLUDE_DIRECTORIES( - /usr/include/aul - /usr/include/dlog -) - SET (${this_target}_SOURCE_FILES serviceapp_loader.c ) @@ -15,7 +10,8 @@ SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS} -fPIE") -TARGET_LINK_LIBRARIES(${this_target} "-ldl -ldlog -laul") TARGET_LINK_LIBRARIES(${this_target} "-Wl,--no-undefined -Wl,--as-needed -pie") +TARGET_LINK_LIBRARIES(${this_target} "-ldl") +TARGET_LINK_LIBRARIES(${this_target} ${pkgs_LDFLAGS}) INSTALL(TARGETS ${this_target} DESTINATION ${LIB_INSTALL_DIR}/osp) diff --git a/osp-service-app-loader/serviceapp_loader.c b/osp-service-app-loader/serviceapp_loader.c index 6a1fcda..b120c8c 100644 --- a/osp-service-app-loader/serviceapp_loader.c +++ b/osp-service-app-loader/serviceapp_loader.c @@ -201,7 +201,9 @@ get_appid_executable_name_from_path(const char path[], char appid[], char execut strncpy(executable_name, p + 1, exec_len); - LOGI("exeName is %s", executable_name); +#ifdef _SECURE_LOG + LOGI("Exec is %s", executable_name); +#endif if (path_len < /* '/' */ 1 + 10 + strlen("/bin/") + exec_len) { diff --git a/osp-system-service-loader/CMakeLists.txt b/osp-system-service-loader/CMakeLists.txt index 1f8e518..f6d3499 100644 --- a/osp-system-service-loader/CMakeLists.txt +++ b/osp-system-service-loader/CMakeLists.txt @@ -1,10 +1,5 @@ SET (this_target osp-system-service-loader) -INCLUDE_DIRECTORIES( - /usr/include/aul - /usr/include/dlog -) - SET (${this_target}_SOURCE_FILES systemservice_loader.c ) @@ -15,8 +10,9 @@ SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS} -fPIE") -TARGET_LINK_LIBRARIES(${this_target} "-ldl -ldlog -laul") TARGET_LINK_LIBRARIES(${this_target} "-Wl,--no-undefined -Wl,--as-needed -pie") +TARGET_LINK_LIBRARIES(${this_target} "-ldl") +TARGET_LINK_LIBRARIES(${this_target} ${pkgs_LDFLAGS}) INSTALL(TARGETS ${this_target} DESTINATION ${LIB_INSTALL_DIR}/osp) diff --git a/osp-system-service-loader/systemservice_loader.c b/osp-system-service-loader/systemservice_loader.c index 7dfb9d5..e4f75f9 100644 --- a/osp-system-service-loader/systemservice_loader.c +++ b/osp-system-service-loader/systemservice_loader.c @@ -16,9 +16,9 @@ // /** -* @file systemservice_loader.c -* @brief This is the implementation for the osp-system-service-loader. -*/ + * @file systemservice_loader.c + * @brief This is the implementation for the osp-system-service-loader. + */ #include #include @@ -112,7 +112,9 @@ get_appid_executable_name_from_path(const char path[], char appid[], char execut strncpy(executable_name, p + 1, exec_len); - LOGI("ExeName is %s", executable_name); +#ifdef _SECURE_LOG + LOGI("Exec is %s", executable_name); +#endif if (path_len < /* '/' */ 1 + 10 + strlen("/bin/") + exec_len) { diff --git a/osp-ui-app-loader/CMakeLists.txt b/osp-ui-app-loader/CMakeLists.txt old mode 100755 new mode 100644 index 75298cf..11d492d --- a/osp-ui-app-loader/CMakeLists.txt +++ b/osp-ui-app-loader/CMakeLists.txt @@ -1,10 +1,5 @@ SET (this_target osp-ui-app-loader) -INCLUDE_DIRECTORIES( - /usr/include/aul - /usr/include/dlog -) - SET (${this_target}_SOURCE_FILES uiapp_loader.c ) @@ -15,9 +10,9 @@ SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS} -fPIE") -#TARGET_LINK_LIBRARIES(${this_target} "-ldl -ldlog -laul -lcapi-appfw-application") -TARGET_LINK_LIBRARIES(${this_target} "-ldl -ldlog -laul") TARGET_LINK_LIBRARIES(${this_target} "-Wl,--no-undefined -Wl,--as-needed -pie") +TARGET_LINK_LIBRARIES(${this_target} "-ldl") +TARGET_LINK_LIBRARIES(${this_target} ${pkgs_LDFLAGS}) INSTALL(TARGETS ${this_target} DESTINATION ${LIB_INSTALL_DIR}/osp) diff --git a/osp-ui-app-loader/uiapp_loader.c b/osp-ui-app-loader/uiapp_loader.c index f49f0d6..cc4bf3f 100644 --- a/osp-ui-app-loader/uiapp_loader.c +++ b/osp-ui-app-loader/uiapp_loader.c @@ -29,7 +29,6 @@ #include #include -//#include #include #include @@ -212,7 +211,9 @@ get_appid_executable_name_from_path(const char path[], char appid[], char execut strncpy(executable_name, p + 1, exec_len); - LOGI("ExeName is %s", executable_name); +#ifdef _SECURE_LOG + LOGI("Exec is %s", executable_name); +#endif if (path_len < /* '/' */ 1 + 10 + strlen("/bin/") + exec_len) { @@ -234,7 +235,9 @@ get_package_name_from_appid_executable_name(const char appid[], const char execu // package name is "[appid]" snprintf(package_name, MAX_PACKAGE_NAME, "%s", appid); - LOGI("Package_name is %s", package_name); +#ifdef _SECURE_LOG + LOGI("Package is %s", package_name); +#endif return 0; } @@ -297,19 +300,10 @@ main(int argc, char* argv[]) // convert package path to package name get_appid_executable_name_from_path(argv[0], appid, executable_name); get_package_name_from_appid_executable_name(appid, executable_name, package_name); - LOGI("Osp package_name %s.", package_name); - -#if 0 - // pequest splash window - LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Request splash window", __func__, __LINE__); - service_h service; - service_create(&service); - service_set_package(service, "com.samsung.splash"); - service_add_extra_data(service, "package_name", package_name); - service_send_launch_request(service, NULL, NULL); +#ifdef _SECURE_LOG + LOGI("Osp package %s.", package_name); #endif - if (getuid() == 0) { // self caging diff --git a/packaging/osp-loader.spec b/packaging/osp-loader.spec index cff4875..2665d57 100755 --- a/packaging/osp-loader.spec +++ b/packaging/osp-loader.spec @@ -1,7 +1,7 @@ Name: osp-loader Summary: osp application loader -Version: 1.2.1.0 -Release: 2 +Version: 1.2.2.0 +Release: 1 Group: TO_BE/FILLED_IN License: Apache-2.0 Source0: %{name}-%{version}.tar.gz -- 2.7.4