From f7dc2c1057dc0483a2cc63bafd421ef4dd0af386 Mon Sep 17 00:00:00 2001 From: Sanghyup Lee Date: Wed, 25 Sep 2013 16:39:22 +0900 Subject: [PATCH] Revert "Validate smack label of forked/executed WebProcess and PluginProcess" This reverts commit abf2d2377d11e20f77d2a88d9102f763bbd440c5. Change-Id: I97184ff7c8b3914263bbb015c4f315d9e1ee7f90 --- Source/WTF/wtf/Platform.h | 3 +- Source/WebKit2/PlatformTizen.cmake | 3 - .../PluginProcess/efl/PluginProcessMainEfl.cpp | 17 ---- Source/WebKit2/Shared/Plugins/PluginModuleInfo.h | 3 - Source/WebKit2/Shared/tizen/ProcessSmackLabel.cpp | 103 --------------------- Source/WebKit2/Shared/tizen/ProcessSmackLabel.h | 39 -------- Source/WebKit2/UIProcess/API/efl/ewk_context.cpp | 16 +--- .../WebKit2/UIProcess/Launcher/ProcessLauncher.h | 4 +- .../UIProcess/Launcher/efl/ProcessLauncherEfl.cpp | 26 +----- Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h | 9 +- .../UIProcess/Plugins/PluginProcessManager.cpp | 3 - .../UIProcess/Plugins/PluginProcessProxy.cpp | 4 - Source/WebKit2/UIProcess/WebContext.cpp | 4 +- Source/WebKit2/UIProcess/WebContext.h | 8 +- Source/WebKit2/UIProcess/WebProcessProxy.cpp | 5 +- Source/WebKit2/UIProcess/efl/WebContextEfl.cpp | 8 +- .../WebKit2/WebProcess/efl/WebProcessMainEfl.cpp | 17 ---- Source/cmake/FindLIBSMACK.cmake | 21 ----- Source/cmake/OptionsTizen.cmake | 1 - packaging/webkit2-efl.spec | 8 +- 20 files changed, 30 insertions(+), 272 deletions(-) delete mode 100644 Source/WebKit2/Shared/tizen/ProcessSmackLabel.cpp delete mode 100644 Source/WebKit2/Shared/tizen/ProcessSmackLabel.h delete mode 100644 Source/cmake/FindLIBSMACK.cmake diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index fd38b45..d2759e0 100644 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -789,7 +789,8 @@ com) : Patch to do not adjust cover rect as fixed pixel size*/ #define ENABLE_TIZEN_UPDATE_TIMEZONE_INFO 1 /* Hojong Han(hojong.han@samsung.com) : Sync timezone before getting local time */ #define ENABLE_TIZEN_WRT_LAUNCHING_PERFORMANCE 1 /* Byungwoo Lee(bw80.lee@samsung.com) : Local patches to enhance web app launching performance */ -#define ENABLE_TIZEN_PROCESS_PERMISSION_CONTROL 1 /* Yunchan Cho(yunchan.cho@samsung.com), Ryuan Choi(ryuan.choi@samsung.com) : Change smack label of launched webkit processes */ +#define ENABLE_TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH 1 /* Yunchan Cho(yunchan.cho@samsung.com) : Support to set path of web process executable file */ + #define ENABLE_TIZEN_REDUCE_KEY_LAGGING 1 /* Soon-Young Lee(sy5002.lee@samsung.com) : Temporary solution for a keylagging problem. FIXME */ #define ENABLE_TIZEN_TEXT_CODEC_MEMORY_REDUCTION 1 /*KyungTae Kim(ktf.kim@samsung.com) : Share Encode & Decode buffer for TextCodecUTF8 for memory reduction */ #define ENABLE_TIZEN_ADJUST_CONTENTS_SIZE_FOR_MINUS_X_WORKAROUND 1 /*KyungTae Kim(ktf.kim@samsung.com) : Workaround patch that adjusts contents size of minus x position contents */ diff --git a/Source/WebKit2/PlatformTizen.cmake b/Source/WebKit2/PlatformTizen.cmake index 562f2ec..5663545 100755 --- a/Source/WebKit2/PlatformTizen.cmake +++ b/Source/WebKit2/PlatformTizen.cmake @@ -33,7 +33,6 @@ LIST(APPEND WebKit2StaticForDebug_INCLUDE_DIRECTORIES ${Tizen-Location-Manager_INCLUDE_DIRS} ${UIGadget_INCLUDE_DIRS} ${EFL_ASSIST_INCLUDE_DIRS} - ${LIBSMACK_INCLUDE_DIRS} ) LIST(APPEND WebKit2_LIBRARIES @@ -43,7 +42,6 @@ LIST(APPEND WebKit2_LIBRARIES ${TTS_LIBRARIES} ${Tizen-Location-Manager_LIBRARIES} ${UIGadget_LIBRARY} - ${LIBSMACK_LIBRARIES} ) ADD_DEFINITIONS(-DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=0) @@ -67,7 +65,6 @@ LIST(APPEND WebKit2StaticForDebug_SOURCES Shared/tizen/NativeWebKeyboardEventTizen.cpp Shared/tizen/WebURLRequestTizen.cpp Shared/tizen/WebURLResponseTizen.cpp - Shared/tizen/ProcessSmackLabel.cpp UIProcess/API/C/efl/tizen/WKLocalFileSystemManager.cpp UIProcess/API/C/efl/tizen/WKContextTizen.cpp diff --git a/Source/WebKit2/PluginProcess/efl/PluginProcessMainEfl.cpp b/Source/WebKit2/PluginProcess/efl/PluginProcessMainEfl.cpp index 225b6f0..888fbc9 100755 --- a/Source/WebKit2/PluginProcess/efl/PluginProcessMainEfl.cpp +++ b/Source/WebKit2/PluginProcess/efl/PluginProcessMainEfl.cpp @@ -43,10 +43,6 @@ #include "NetscapePlugin.h" #endif // ENABLE(TIZEN_SCAN_PLUGIN) -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) -#include "ProcessSmackLabel.h" -#endif - using namespace WebCore; namespace WebKit { @@ -77,19 +73,6 @@ WK_EXPORT int PluginProcessMainEfl(int argc, char* argv[]) ASSERT(argc == 2); #endif // ENABLE(TIZEN_SCAN_PLUGIN) -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - // check process smack label - if (!changeProcessSmackLabel("/usr/bin/PluginProcess", argv[0])) { - TIZEN_LOGI("failed to change smack label"); - return 1; - } - - // drop CAP_MAC_ADMIN capability - if (!dropProcessCapability()) { - TIZEN_LOGI("failed to drop CAP_MAC_ADMIN"); - return 1; - } -#endif if (!eina_init()) return 1; diff --git a/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h b/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h index 8f54346..a232db3 100644 --- a/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h +++ b/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h @@ -45,9 +45,6 @@ struct PluginModuleInfo { #elif PLATFORM(WIN) uint64_t fileVersion; #endif -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - String executablePath; -#endif PluginModuleInfo isolatedCopy() const { diff --git a/Source/WebKit2/Shared/tizen/ProcessSmackLabel.cpp b/Source/WebKit2/Shared/tizen/ProcessSmackLabel.cpp deleted file mode 100644 index 2395a2a..0000000 --- a/Source/WebKit2/Shared/tizen/ProcessSmackLabel.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2013 Samsung Electronics. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace WebKit { - -bool changeProcessSmackLabel(const char* defaultExecutablePath, const char* currentExecutablePath) -{ - ASSERT(defaultExecutablePath && currentExecutablePath); - - // this case needs not to change smack label - if (!strcmp(defaultExecutablePath, currentExecutablePath)) - return true; - - // check if this process is launched as abnormal way - char* newLabel; - if (smack_lgetlabel(currentExecutablePath, &newLabel, SMACK_LABEL_EXEC) < 0) - return false; - - if (smack_set_label_for_self(newLabel) < 0) { - free(newLabel); - return false; - } - - free(newLabel); - return true; -} - -bool dropProcessCapability() -{ - // in case of root user, any capabilities aren't dropped - if (getuid() == 0) - return true; - - cap_user_header_t header; - cap_user_data_t data; - - header = static_cast(malloc(sizeof(*header))); - data = static_cast(calloc(sizeof(*data), _LINUX_CAPABILITY_U32S_3)); - - // check if header and data is allocated normally - ASSERT(header && data); - - header->pid = getpid(); - header->version = _LINUX_CAPABILITY_VERSION_3; - - // read already granted capabilities of this process - if (capget(header, data) < 0) { - free(header); - free(data); - return false; - } - - // remove process capability for CAP_MAC_ADMIN - data[CAP_TO_INDEX(CAP_MAC_ADMIN)].inheritable &= ~CAP_TO_MASK(CAP_MAC_ADMIN); - data[CAP_TO_INDEX(CAP_MAC_ADMIN)].permitted &= ~CAP_TO_MASK(CAP_MAC_ADMIN); - data[CAP_TO_INDEX(CAP_MAC_ADMIN)].effective &= ~CAP_TO_MASK(CAP_MAC_ADMIN); - - bool ret = true; - if (capset(header, data) < 0) - ret = false; - - free(header); - free(data); - - return ret; -} - -} // namespace WebKit -#endif - diff --git a/Source/WebKit2/Shared/tizen/ProcessSmackLabel.h b/Source/WebKit2/Shared/tizen/ProcessSmackLabel.h deleted file mode 100644 index e98868d..0000000 --- a/Source/WebKit2/Shared/tizen/ProcessSmackLabel.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013 Samsung Electronics. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef ProcessSmackLabel_h -#define ProcessSmackLabel_h - -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) -namespace WebKit { - -bool changeProcessSmackLabel(const char* defaultExecutablePath, const char* currentExecutablePath); -bool dropProcessCapability(); - -} // namespace WebKit -#endif - -#endif - diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp index 77f40d5..b2deb61 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp @@ -568,18 +568,12 @@ Ewk_Context* ewk_context_new() #if OS(TIZEN) Ewk_Context* ewkContext = Ewk_Context::create().leakRef(); ewkContextInjectedBundleClientAttachClient(ewkContext); -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) const char* webProcessExecutablePath = getenv("WEB_PROCESS_EXECUTABLE_PATH"); if (webProcessExecutablePath) { WKContextRef contextRef = ewkContext->wkContext(); toImpl(contextRef)->setWebProcessExecutablePath(String::fromUTF8(webProcessExecutablePath)); } - - const char* pluginProcessExecutablePath = getenv("PLUGIN_PROCESS_EXECUTABLE_PATH"); - if (pluginProcessExecutablePath) { - WKContextRef contextRef = ewkContext->wkContext(); - toImpl(contextRef)->pluginInfoStore().setExecutablePath(String::fromUTF8(pluginProcessExecutablePath)); - } #endif return ewkContext; #else @@ -633,18 +627,12 @@ Ewk_Context* ewk_context_new_with_injected_bundle_path(const char* path) #if OS(TIZEN) Ewk_Context* ewkContext = Ewk_Context::create(String::fromUTF8(path)).leakRef(); ewkContextInjectedBundleClientAttachClient(ewkContext); -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) const char* webProcessExecutablePath = getenv("WEB_PROCESS_EXECUTABLE_PATH"); if (webProcessExecutablePath) { WKContextRef contextRef = ewkContext->wkContext(); toImpl(contextRef)->setWebProcessExecutablePath(String::fromUTF8(webProcessExecutablePath)); } - - const char* pluginProcessExecutablePath = getenv("PLUGIN_PROCESS_EXECUTABLE_PATH"); - if (pluginProcessExecutablePath) { - WKContextRef contextRef = ewkContext->wkContext(); - toImpl(contextRef)->pluginInfoStore().setExecutablePath(String::fromUTF8(pluginProcessExecutablePath)); - } #endif return ewkContext; #else diff --git a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h index 6bc5166..7f09523 100644 --- a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h +++ b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h @@ -58,8 +58,8 @@ public: cpu_type_t architecture; bool executableHeap; #endif -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - String customExecutablePath; +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) + String webProcessExecutablePath; #endif #ifndef NDEBUG String processCmdPrefix; diff --git a/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp b/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp index 390ee65..e4e4cb3 100644 --- a/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp +++ b/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp @@ -195,32 +195,16 @@ void ProcessLauncher::launchProcess() String executablePath; switch (m_launchOptions.processType) { case WebProcess: -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - if (!m_launchOptions.customExecutablePath.isEmpty()) { - executablePath = m_launchOptions.customExecutablePath; - TIZEN_LOGI("web process executable path: %s", executablePath.utf8().data()); +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) + if (!m_launchOptions.webProcessExecutablePath.isEmpty()) { + executablePath = m_launchOptions.webProcessExecutablePath; + TIZEN_LOGI("executable path: %s", executablePath.utf8().data()); } else #endif executablePath = executablePathOfWebProcess(); break; case PluginProcess: -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - { - // this env is used for tizen wrt process pool, and has highest priority for use. - const char* pathForProcessPool = getenv("PLUGIN_PROCESS_EXECUTABLE_PATH_FOR_PROCESS_POOL"); - if (pathForProcessPool) { - executablePath = String::fromUTF8(pathForProcessPool); - TIZEN_LOGI("plugin process executable path: %s", executablePath.utf8().data()); - break; - } - } - - if (!m_launchOptions.customExecutablePath.isEmpty()) { - executablePath = m_launchOptions.customExecutablePath; - TIZEN_LOGI("plugin process executable path: %s", executablePath.utf8().data()); - } else -#endif - executablePath = executablePathOfPluginProcess(); + executablePath = executablePathOfPluginProcess(); break; default: ASSERT_NOT_REACHED(); diff --git a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h index 4848a24..42df69b 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h +++ b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h @@ -58,11 +58,6 @@ public: // Note that the plug-in will still be seen by e.g. navigator.plugins bool shouldBlockPlugin(const PluginModuleInfo&) const; -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - void setExecutablePath(const String& path) { m_executablePath = path; }; - const String& executablePath() const { return m_executablePath; }; -#endif - private: PluginModuleInfo findPluginForMIMEType(const String& mimeType) const; PluginModuleInfo findPluginForExtension(const String& extension, String& mimeType) const; @@ -93,9 +88,7 @@ private: Vector m_additionalPluginsDirectories; Vector m_plugins; bool m_pluginListIsUpToDate; -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - String m_executablePath; -#endif + mutable Mutex m_pluginsLock; }; diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp b/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp index f87d360..cebf4f7 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp @@ -50,9 +50,6 @@ void PluginProcessManager::getPluginProcessConnection(const PluginInfoStore& plu ASSERT(!pluginPath.isNull()); PluginModuleInfo plugin = pluginInfoStore.infoForPluginWithPath(pluginPath); -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - plugin.executablePath = pluginInfoStore.executablePath(); -#endif PluginProcessProxy* pluginProcess = getOrCreatePluginProcess(plugin); pluginProcess->getPluginProcessConnection(reply); } diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp index f41fe75..df8f96d 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp @@ -69,10 +69,6 @@ PluginProcessProxy::PluginProcessProxy(PluginProcessManager* PluginProcessManage launchOptions.executableHeap = PluginProcessProxy::pluginNeedsExecutableHeap(pluginInfo); #endif -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - launchOptions.customExecutablePath = pluginInfo.executablePath; -#endif - m_processLauncher = ProcessLauncher::create(this, launchOptions); } diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp index 40135e0..140eb55 100644 --- a/Source/WebKit2/UIProcess/WebContext.cpp +++ b/Source/WebKit2/UIProcess/WebContext.cpp @@ -178,8 +178,8 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa #endif , m_processTerminationEnabled(true) , m_pluginWorkQueue("com.apple.CoreIPC.PluginQueue") -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - , m_webProcessExecutablePath() +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) + , m_webProcessExecutablePath(String()) #endif { #if !LOG_DISABLED diff --git a/Source/WebKit2/UIProcess/WebContext.h b/Source/WebKit2/UIProcess/WebContext.h index 07035bf..f98dd8d 100755 --- a/Source/WebKit2/UIProcess/WebContext.h +++ b/Source/WebKit2/UIProcess/WebContext.h @@ -182,12 +182,10 @@ public: #if PLATFORM(EFL) void notifyLowMemory(); #endif - -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - void setWebProcessExecutablePath(const String& path) { m_webProcessExecutablePath = path; }; +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) + void setWebProcessExecutablePath(const String); const String& webProcessExecutablePath() const { return m_webProcessExecutablePath; }; #endif - #if ENABLE(TIZEN_WEBKIT2_MEMORY_SAVING_MODE) void setMemorySavingMode(bool memorySavingMode); #endif @@ -458,7 +456,7 @@ private: String m_soupDataDirectory; #endif -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) String m_webProcessExecutablePath; #endif diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.cpp b/Source/WebKit2/UIProcess/WebProcessProxy.cpp index 2fd7453..147d2d4 100644 --- a/Source/WebKit2/UIProcess/WebProcessProxy.cpp +++ b/Source/WebKit2/UIProcess/WebProcessProxy.cpp @@ -120,9 +120,8 @@ void WebProcessProxy::connect() launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture; launchOptions.executableHeap = false; #endif - -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - launchOptions.customExecutablePath = m_context->webProcessExecutablePath(); +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) + launchOptions.webProcessExecutablePath = m_context->webProcessExecutablePath(); #endif #ifndef NDEBUG diff --git a/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp b/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp index 4ec0929..6e26e74 100755 --- a/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp +++ b/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp @@ -125,6 +125,13 @@ void WebContext::setProxy(const String& proxyAddress) } #endif +#if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH) +void WebContext::setWebProcessExecutablePath(const String webProcessExecutablePath) +{ + m_webProcessExecutablePath = webProcessExecutablePath; +} +#endif + #if ENABLE(TIZEN_SESSION_REQUEST_CANCEL) void WebContext::abortSession() { @@ -151,7 +158,6 @@ void WebContext::notifyLowMemory() #endif #endif } - #if ENABLE(TIZEN_SOUP_COOKIE_CACHE_FOR_WEBKIT2) String WebContext::soupDataDirectory() { diff --git a/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp b/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp index 8d60826..ae00f5d 100644 --- a/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp +++ b/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp @@ -53,10 +53,6 @@ #include "wtf/WTFThreadData.h" #endif -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) -#include "ProcessSmackLabel.h" -#endif - using namespace WebCore; namespace WebKit { @@ -75,19 +71,6 @@ WK_EXPORT int WebProcessMainEfl(int argc, char* argv[]) if (argc != 2) return 1; -#if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL) - // change process smack label - if (!changeProcessSmackLabel("/usr/bin/WebProcess", argv[0])) { - TIZEN_LOGI("failed to change smack label"); - return 1; - } - // drop CAP_MAC_ADMIN capability - if (!dropProcessCapability()) { - TIZEN_LOGI("failed to drop CAP_MAC_ADMIN"); - return 1; - } -#endif - if (!eina_init()) return 1; diff --git a/Source/cmake/FindLIBSMACK.cmake b/Source/cmake/FindLIBSMACK.cmake deleted file mode 100644 index 27c1a7f..0000000 --- a/Source/cmake/FindLIBSMACK.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# - Try to find smack -# Once done, this will define -# -# LIBSMACK_FOUND - system has libsmack -# LIBSMACK_INCLUDE_DIRS - the libsmack include directories -# LIBSMACK_LIBRARIES - link these to use libsmack - -INCLUDE(FindPkgConfig) - -PKG_CHECK_MODULES(PC_LIBSMACK libsmack) - -FIND_PATH(LIBSMACK_INCLUDE_DIRS NAMES sys/smack.h - HINTS ${PC_LIBSMACK_INCLUDE_DIRS} ${PC_LIBSMACK_INCLUDEDIR} -) - -FIND_LIBRARY(LIBSMACK_LIBRARIES NAMES smack - HINTS ${PC_LIBSMACK_LIBRARY_DIRS} ${PC_LIBSMACK_LIBDIR} -) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSMACK DEFAULT_MSG LIBSMACK_INCLUDE_DIRS LIBSMACK_LIBRARIES) diff --git a/Source/cmake/OptionsTizen.cmake b/Source/cmake/OptionsTizen.cmake index 13ee401..c666c98 100644 --- a/Source/cmake/OptionsTizen.cmake +++ b/Source/cmake/OptionsTizen.cmake @@ -232,7 +232,6 @@ FIND_PACKAGE(UIGadget REQUIRED) FIND_PACKAGE(VConf REQUIRED) FIND_PACKAGE(feedback REQUIRED) FIND_PACKAGE(EFL_ASSIST REQUIRED) -FIND_PACKAGE(LIBSMACK REQUIRED) ADD_DEFINITIONS(-DENABLE_GESTURE_EVENTS=1) diff --git a/packaging/webkit2-efl.spec b/packaging/webkit2-efl.spec index f8ce220..d11a133 100644 --- a/packaging/webkit2-efl.spec +++ b/packaging/webkit2-efl.spec @@ -58,8 +58,6 @@ BuildRequires: pkgconfig(gles20) BuildRequires: pkgconfig(tts) BuildRequires: pkgconfig(capi-system-power) BuildRequires: pkgconfig(capi-system-info) -BuildRequires: pkgconfig(libsmack) -BuildRequires: libcap, libcap-devel %description @@ -149,8 +147,10 @@ chmod 644 %{_libdir}/libewebkit2.so # 2. Resources chmod 644 /usr/share/edje/webkit.edj # 3. executables -setfattr -n security.capability -v 0sAQAAAgAAAAAAAAAAAAAAAAIAAAA= %{_bindir}/WebProcess -setfattr -n security.capability -v 0sAQAAAgAAAAAAAAAAAAAAAAIAAAA= %{_bindir}/PluginProcess +if [ `grep -c smack /proc/filesystems` -eq 1 ] +then + setcap cap_mac_admin=ie %{_bindir}/WebProcess +fi %postun -- 2.7.4