<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>185960</bug_id>
          
          <creation_ts>2018-05-24 14:34:42 -0700</creation_ts>
          <short_desc>Update plugin search path to look for user installed plugins</short_desc>
          <delta_ts>2018-05-24 22:24:29 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="youenn fablet">youennf</reporter>
          <assigned_to name="youenn fablet">youennf</assigned_to>
          <cc>andersca</cc>
    
    <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>mitz</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1427065</commentid>
    <comment_count>0</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-24 14:34:42 -0700</bug_when>
    <thetext>Update plugin search path to look for user installed plugins</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427068</commentid>
    <comment_count>1</comment_count>
      <attachid>341224</attachid>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-24 14:37:07 -0700</bug_when>
    <thetext>Created attachment 341224
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427085</commentid>
    <comment_count>2</comment_count>
      <attachid>341224</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2018-05-24 15:55:33 -0700</bug_when>
    <thetext>Comment on attachment 341224
Patch

Looks good! r=me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427086</commentid>
    <comment_count>3</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2018-05-24 15:56:02 -0700</bug_when>
    <thetext>Won&apos;t this break any users that have plug-ins installed in the container directory? 

I think you should either:

- Pick the home folder based on whether sandboxing is enabled or not.
- Add both sets of directories.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427089</commentid>
    <comment_count>4</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-24 16:14:04 -0700</bug_when>
    <thetext>(In reply to Anders Carlsson from comment #3)
&gt; Won&apos;t this break any users that have plug-ins installed in the container
&gt; directory? 

The plug-ins usually install themselves globally or on user home folder, not in the container of a specific application embedding WebKit.

&gt; I think you should either:
&gt; 
&gt; - Pick the home folder based on whether sandboxing is enabled or not.
&gt; - Add both sets of directories.

I am fine adding both if sandboxing is enabled but I am not sure this is worth it.
AFAIK, WebKit UIProcess is currently not sandboxed in platforms supporting plug-ins so I do not think that any user is currently using a plug-in that is installed in the container directory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427090</commentid>
    <comment_count>5</comment_count>
      <attachid>341224</attachid>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-24 16:15:17 -0700</bug_when>
    <thetext>Comment on attachment 341224
Patch

Cq+ing now.
Anders, feel free to stop the cq if you think we should add both folders in case sandbox is enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427094</commentid>
    <comment_count>6</comment_count>
      <attachid>341224</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-05-24 16:42:20 -0700</bug_when>
    <thetext>Comment on attachment 341224
Patch

Clearing flags on attachment: 341224

Committed r232169: &lt;https://trac.webkit.org/changeset/232169&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427095</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-05-24 16:42:22 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427099</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-05-24 16:43:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/40539448&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427105</commentid>
    <comment_count>9</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2018-05-24 16:54:45 -0700</bug_when>
    <thetext>(In reply to youenn fablet from comment #4)
&gt; (In reply to Anders Carlsson from comment #3)
&gt; &gt; Won&apos;t this break any users that have plug-ins installed in the container
&gt; &gt; directory? 
&gt; 
&gt; The plug-ins usually install themselves globally or on user home folder, not
&gt; in the container of a specific application embedding WebKit.

An app can put a plug-in inside the user home folder - I don&apos;t think there&apos;s any other way for an application to expose a plug-in to WebKit.

&gt; 
&gt; &gt; I think you should either:
&gt; &gt; 
&gt; &gt; - Pick the home folder based on whether sandboxing is enabled or not.
&gt; &gt; - Add both sets of directories.
&gt; 
&gt; I am fine adding both if sandboxing is enabled but I am not sure this is
&gt; worth it.
&gt; AFAIK, WebKit UIProcess is currently not sandboxed in platforms supporting
&gt; plug-ins so I do not think that any user is currently using a plug-in that
&gt; is installed in the container directory.

There are many macOS apps that are sandboxed. This patch could potentially break them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427110</commentid>
    <comment_count>10</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2018-05-24 17:03:41 -0700</bug_when>
    <thetext>(In reply to Anders Carlsson from comment #9)
&gt; &gt; The plug-ins usually install themselves globally or on user home folder, not
&gt; &gt; in the container of a specific application embedding WebKit.
&gt; 
&gt; An app can put a plug-in inside the user home folder - I don&apos;t think there&apos;s
&gt; any other way for an application to expose a plug-in to WebKit.

I&apos;m confused -- do you mean there are apps that have plugins hosted inside their container, and need WebKit to access that location? I wasn&apos;t aware of that.

In that case, it seems like adding the container directory as well would be a reasonable thing to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427191</commentid>
    <comment_count>11</comment_count>
      <attachid>341224</attachid>
    <who name="">mitz</who>
    <bug_when>2018-05-24 22:20:24 -0700</bug_when>
    <thetext>Comment on attachment 341224
Patch

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

&gt; Source/WebKit/UIProcess/Plugins/mac/PluginInfoStoreMac.mm:52
&gt; +    if (auto* pw = getpwuid(getuid()))
&gt; +        pluginsDirectories.uncheckedAppend(makeString(pw-&gt;pw_dir, pluginPath));

The change log doesn’t explain what’s motivating this change or how it can be tested, but this change doesn’t really help sandboxed WebKit clients use plug-ins from the user’s home directory, because by default, sandboxed apps don’t have access to Library/Internet Plug-Ins under the user’s home directory. Perhaps you tested with MiniBrowser and concluded that this fix is good, but MiniBrowser has an entitlement that gives it read-only access to the entire file system. Most other sandboxed apps that use WebKit don’t have this sort of access. The way sandboxed apps enjoy access to some locations under the user’s Library directory is that (a) the application sandbox (/System/Library/Sandbox/Profiles/application.sb) allows this access and (b) the sandbox machinery creates a symlink from the Library directory inside the app’s container to the appropriate location in the user’s home directory. The code in the app (or any framework used by the app) only ever needs to use NSHomeDirectory(), and the symlink and the sandbox take care of the rest. You can see all those symlinks if you look in ~/Library/Containers/org.webkit.MiniBrowser/Data/Library.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427193</commentid>
    <comment_count>12</comment_count>
    <who name="">mitz</who>
    <bug_when>2018-05-24 22:24:29 -0700</bug_when>
    <thetext>(In reply to Anders Carlsson from comment #9)
&gt; (In reply to youenn fablet from comment #4)
&gt; &gt; (In reply to Anders Carlsson from comment #3)
&gt; &gt; &gt; Won&apos;t this break any users that have plug-ins installed in the container
&gt; &gt; &gt; directory? 
&gt; &gt; 
&gt; &gt; The plug-ins usually install themselves globally or on user home folder, not
&gt; &gt; in the container of a specific application embedding WebKit.
&gt; 
&gt; An app can put a plug-in inside the user home folder - I don&apos;t think there&apos;s
&gt; any other way for an application to expose a plug-in to WebKit.

In Legacy WebKit, WebPluginDatabase searches in

        [NSHomeDirectory() stringByAppendingPathComponent:@&quot;Library/Internet Plug-Ins&quot;],
        @&quot;/Library/Internet Plug-Ins&quot;,
        [[NSBundle mainBundle] builtInPlugInsPath],

applications that bundle plug-ins are expected to use the last location. Perhaps modern WebKit is missing that last search path?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>341224</attachid>
            <date>2018-05-24 14:37:07 -0700</date>
            <delta_ts>2018-05-24 16:42:20 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-185960-20180524143707.patch</filename>
            <type>text/plain</type>
            <size>2104</size>
            <attacher name="youenn fablet">youennf</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjMyMTIzCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0L0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCmluZGV4IDI3NzkyZTM5MTQ5NWI0OGUx
NDBkMzA4YWU1NDdhM2JhMWZhOGI0MmUuLjRhY2E0OTU5NDM4ZWU0YzAzNjc4OTQzMTU4YmJlNTkx
ZjE4Y2Y5NDggMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCisrKyBiL1NvdXJj
ZS9XZWJLaXQvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTgtMDUtMjQgIFlvdWVubiBG
YWJsZXQgIDx5b3Vlbm5AYXBwbGUuY29tPgorCisgICAgICAgIFVwZGF0ZSBwbHVnaW4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