<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - Make fontconfig cache relocatable"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101889#c32">Comment # 32</a>
              on <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - Make fontconfig cache relocatable"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101889">bug 101889</a>
              from <span class="vcard"><a class="email" href="mailto:alexl@redhat.com" title="Alexander Larsson <alexl@redhat.com>"> <span class="fn">Alexander Larsson</span></a>
</span></b>
        <pre>I don't think the alias table works as implemented.

For example, say on the host we have /usr/share/fonts. We'll generate a .uuid
file for it and a cache file based on the hash of that. Then the app reads
this, but in a different location, say /run/host/fonts.

First we load /run/host/fonts/.uuid and use that to find the host-side cache
file. But its cache->dirname is /usr/share/fonts, so we add to the alias table:
  /usr/share/fonts -> /run/host/fonts 

This means that if a fc pattern has a path of /usr/share/fonts/foo we will
instead load it at /run/host/fonts/foo, which is correct if we got the pattern
from the cache above.

However, what if you're loading a font from the runtime, which is properly in
/usr/share/fonts in the sandbox? This will *also* be mapped via the alias
table.

You can't use a global mapping like that, it has to depend on what cache the
pattern came from.

Also, why are all the hashes you added using FcStrHashIgnoreCase for the
filename? You're using regular strcmp later, so its not like the hash lookup
will be case insensitive anyway.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>