Bug 107362

Summary: [WK2] Remove obsolete plug-in sandboxing code
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebKit2Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch
none
regenerated the patch with a saved ChangeLog none

Description Alexey Proskuryakov 2013-01-18 23:45:10 PST
Remove obsolete plug-in sandboxing code.
Comment 1 Alexey Proskuryakov 2013-01-18 23:50:54 PST
Created attachment 183606 [details]
proposed patch
Comment 2 WebKit Review Bot 2013-01-18 23:53:51 PST
Attachment 183606 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Alexey Proskuryakov 2013-01-18 23:55:48 PST
Created attachment 183607 [details]
regenerated the patch with a saved ChangeLog
Comment 4 Darin Adler 2013-01-19 08:07:49 PST
Comment on attachment 183607 [details]
regenerated the patch with a saved ChangeLog

View in context: https://bugs.webkit.org/attachment.cgi?id=183607&action=review

> Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm:328
> -    RetainPtr<NSString> profileString = [[NSString alloc] initWithContentsOfURL:(NSURL *)sandboxURL.get() encoding:NSUTF8StringEncoding error:NULL];
> +    RetainPtr<NSString> profileString = adoptNS([[NSString alloc] initWithContentsOfURL:(NSURL *)sandboxURL.get() encoding:NSUTF8StringEncoding error:NULL]);
>      if (!profileString)
>          return;
>  
> -    enterSandbox([profileString.get() UTF8String], 0, 0);
> +    enterSandbox([profileString.get() UTF8String]);

Seems crazy to decode UTF-8 then re-encode as UTF8. If we want to use initWIthContentsOfURL: then I think we should use the one on NSData, not NSString, here.
Comment 5 Darin Adler 2013-01-19 08:08:24 PST
Comment on attachment 183607 [details]
regenerated the patch with a saved ChangeLog

View in context: https://bugs.webkit.org/attachment.cgi?id=183607&action=review

>> Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm:328
>> +    enterSandbox([profileString.get() UTF8String]);
> 
> Seems crazy to decode UTF-8 then re-encode as UTF8. If we want to use initWIthContentsOfURL: then I think we should use the one on NSData, not NSString, here.

Another way to put it is, this is a really roundabout way to add a 0 byte to the end of some data.
Comment 6 Alexey Proskuryakov 2013-01-20 10:53:32 PST
Comment on attachment 183607 [details]
regenerated the patch with a saved ChangeLog

Thank you for the review!

Switching to NSData is a good idea, I'll probably do it when touching this code the next time.
Comment 7 WebKit Review Bot 2013-01-20 10:58:57 PST
Comment on attachment 183607 [details]
regenerated the patch with a saved ChangeLog

Clearing flags on attachment: 183607

Committed r140274: <http://trac.webkit.org/changeset/140274>
Comment 8 WebKit Review Bot 2013-01-20 10:59:01 PST
All reviewed patches have been landed.  Closing bug.