Changeset 86792 in webkit
- Timestamp:
- May 18, 2011 2:46:33 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r86783 r86792 1 2011-05-18 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/9457633> and https://bugs.webkit.org/show_bug.cgi?id=61009 6 Processes spawned by SnowLeopard's WebProcess attempt to install WebKit2 shims. 7 8 If the WebProcess or PluginProcess forks, it shouldn't pass WebKit2 shims along to the new process 9 in the DYLD_INSERT_LIBRARIES environment variable. 10 11 Add Environment Utilities helper to strip unwanted values from an environment variable: 12 * Platform/unix/EnvironmentUtilities.cpp: Added. 13 (WebKit::EnvironmentUtilities::stripValuesEndingWithString): 14 * Platform/unix/EnvironmentUtilities.h: Added. 15 * WebKit2.xcodeproj/project.pbxproj: 16 17 Strip PluginProcessShim.dylib from DYLD_INSERT_LIBRARIES: 18 * PluginProcess/mac/PluginProcessMainMac.mm: 19 (WebKit::PluginProcessMain): 20 21 Strip WebProcessShim.dylib from DYLD_INSERT_LIBRARIES: 22 * WebProcess/mac/WebProcessMainMac.mm: 23 (WebKit::WebProcessMain): 24 25 Unprotect SnowLeopard now that it will behave and not spawn processes trying to use WebKit2 shims: 26 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: 27 (WebKit::ProcessLauncher::launchProcess): 28 1 29 2011-05-18 Jon Lee <jonlee@apple.com> 2 30 -
trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm
r86097 r86792 30 30 31 31 #import "CommandLine.h" 32 #import "EnvironmentUtilities.h" 32 33 #import "NetscapePluginModule.h" 33 34 #import "PluginProcess.h" … … 52 53 int PluginProcessMain(const CommandLine& commandLine) 53 54 { 54 // Unset DYLD_INSERT_LIBRARIES. We don't want our plug-in process shim to be loaded55 // by any child processes that the plug-in may launch.56 unsetenv("DYLD_INSERT_LIBRARIES");55 // Remove the PluginProcess shim from the DYLD_INSERT_LIBRARIES environment variable so any processes 56 // spawned by the PluginProcess don't try to insert the shim and crash. 57 EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/PluginProcessShim.dylib"); 57 58 58 59 // Check if we're being spawned to write a MIME type preferences file. -
trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
r86724 r86792 146 146 if (m_launchOptions.processType == ProcessLauncher::PluginProcess) 147 147 processShimPathNSString = [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"PluginProcessShim.dylib"]; 148 #ifndef BUILDING_ON_SNOW_LEOPARD149 148 else if (m_launchOptions.processType == ProcessLauncher::WebProcess) 150 149 processShimPathNSString = [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"WebProcessShim.dylib"]; 151 #endif152 150 153 151 // Make sure that the shim library file exists and insert it. -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r86692 r86792 363 363 51ACBBA0127A8F2C00D203B9 /* WebContextMenuProxyMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */; }; 364 364 51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */; }; 365 51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */; }; 366 51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */; }; 365 367 51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */; }; 366 368 51B3005112529D0E000B5CA0 /* WebPageProxyCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */; }; … … 1291 1293 51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuProxyMac.h; sourceTree = "<group>"; }; 1292 1294 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuProxyMac.mm; sourceTree = "<group>"; }; 1295 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EnvironmentUtilities.cpp; path = unix/EnvironmentUtilities.cpp; sourceTree = "<group>"; }; 1296 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnvironmentUtilities.h; path = unix/EnvironmentUtilities.h; sourceTree = "<group>"; }; 1293 1297 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebBackForwardListCF.cpp; path = cf/WebBackForwardListCF.cpp; sourceTree = "<group>"; }; 1294 1298 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPageProxyCF.cpp; path = cf/WebPageProxyCF.cpp; sourceTree = "<group>"; }; … … 2427 2431 sourceTree = "<group>"; 2428 2432 }; 2433 51B15A7D138439B200321AD8 /* unix */ = { 2434 isa = PBXGroup; 2435 children = ( 2436 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */, 2437 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */, 2438 ); 2439 name = unix; 2440 sourceTree = "<group>"; 2441 }; 2429 2442 51B3004D12529CF5000B5CA0 /* cf */ = { 2430 2443 isa = PBXGroup; … … 3018 3031 1AB5A1BA10E021D30040F6CF /* CoreIPC */, 3019 3032 1A7E814E1152D2240003695B /* mac */, 3033 51B15A7D138439B200321AD8 /* unix */, 3020 3034 51A7F2F4125BF8D4008AEB1D /* Logging.cpp */, 3021 3035 51A7F2F2125BF820008AEB1D /* Logging.h */, … … 3796 3810 51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */, 3797 3811 51D130561382EAC000351EDD /* SecItemResponseData.h in Headers */, 3812 51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */, 3798 3813 ); 3799 3814 runOnlyForDeploymentPostprocessing = 0; … … 4462 4477 51D130551382EAC000351EDD /* SecItemResponseData.cpp in Sources */, 4463 4478 51D130581382F10500351EDD /* WebProcessProxyMac.mm in Sources */, 4479 51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */, 4464 4480 ); 4465 4481 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm
r86734 r86792 28 28 29 29 #import "CommandLine.h" 30 #import "EnvironmentUtilities.h" 30 31 #import "RunLoop.h" 31 32 #import "WebProcess.h" … … 43 44 #import <wtf/Threading.h> 44 45 #import <wtf/text/CString.h> 46 #import <wtf/text/StringBuilder.h> 45 47 46 48 // FIXME: We should be doing this another way. … … 59 61 int WebProcessMain(const CommandLine& commandLine) 60 62 { 63 #ifdef BUILDING_ON_SNOWLEOPARD 64 // Remove the WebProcess shim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by 65 // the WebProcess don't try to insert the shim and crash. 66 EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/WebProcessShim.dylib"); 67 #endif 68 61 69 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 62 70 … … 91 99 RunLoop::initializeMainRunLoop(); 92 100 93 #ifndef BUILDING_ON_SNOW_LEOPARD94 101 // Initialize the shim. 95 102 WebProcess::shared().initializeShim(); 96 #endif97 103 98 104 // Create the connection.
Note: See TracChangeset
for help on using the changeset viewer.