Bug 139262 - Web Inspector: [Mac] Saving webarchives via Web Inspector in Safari creates files that are not double clickable
Summary: Web Inspector: [Mac] Saving webarchives via Web Inspector in Safari creates f...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: DoNotImportToRadar
Depends on:
Blocks:
 
Reported: 2014-12-04 11:09 PST by Joseph Pecoraro
Modified: 2014-12-07 09:50 PST (History)
7 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (6.18 KB, patch)
2014-12-04 11:18 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (7.68 KB, patch)
2014-12-04 12:50 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2014-12-04 11:09:23 PST
* SUMMARY
Saving webarchives with Web Inspector in Safari creates file that gets stopped by Gatekeeper when double clicked. This doesn't happen when saving a web archive from Safari itself, so this is unexpected.
Comment 1 Joseph Pecoraro 2014-12-04 11:10:17 PST
<rdar://problem/18323498>
Comment 2 Joseph Pecoraro 2014-12-04 11:18:05 PST
Created attachment 242576 [details]
[PATCH] Proposed Fix
Comment 3 Alexey Proskuryakov 2014-12-04 11:26:02 PST
Comment on attachment 242576 [details]
[PATCH] Proposed Fix

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

> Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm:63
> +static void removeQuarantinePropertiesFromFile(NSURL *path)

It seems unfortunate to have multiple copies of this non-trivial function.

> Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm:383
> +        removeQuarantinePropertiesFromFile(actualURL);

This looks strange to me. If an application gets its files automatically quarantined, then can it actually remove the quarantine?
Comment 4 Joseph Pecoraro 2014-12-04 11:47:09 PST
(In reply to comment #3)
> Comment on attachment 242576 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=242576&action=review
> 
> > Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm:63
> > +static void removeQuarantinePropertiesFromFile(NSURL *path)
> 
> It seems unfortunate to have multiple copies of this non-trivial function.

Yep. I considered putting this in WebCore/platform/FileSystemMac.mm. Would you prefer that?


> > Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm:383
> > +        removeQuarantinePropertiesFromFile(actualURL);
> 
> This looks strange to me. If an application gets its files automatically
> quarantined, then can it actually remove the quarantine?

I had only tested with Safari, and that was the case.

It seems anyone can remove the xattr from a file. For example:

    shell> xattr -d com.apple.quarantine /path/to/file
Comment 5 Alexey Proskuryakov 2014-12-04 12:00:55 PST
> Yep. I considered putting this in WebCore/platform/FileSystemMac.mm. Would
> you prefer that?

Yes.

> It seems anyone can remove the xattr from a file.

It's not anyone, this depends on their sandbox. A correct sandbox would normally disallow that, and I thought that AppSandbox did.
Comment 6 Joseph Pecoraro 2014-12-04 12:50:03 PST
Created attachment 242582 [details]
[PATCH] Proposed Fix

Shared the code in FileSystemMac. If there is an error removing the quarantine property it is fine to ignore it.
Comment 7 Alexey Proskuryakov 2014-12-05 15:56:26 PST
Comment on attachment 242582 [details]
[PATCH] Proposed Fix

We decided that we don't need this.