[Webkit-unassigned] [Bug 202277] [GTK][WPE] Stray files left under /tmp if UIProcess exits while a content extension is being compiled

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 26 10:40:27 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=202277

Adrian Perez <aperez at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #1 from Adrian Perez <aperez at igalia.com> ---
In Linux we can use “open("/path/to/dir", mode | O_TMPFILE)” to get
a file descriptor which is not linked to a directory entry in the
file system. If the process exits or drops the file handle cleanup
is automatic. Such a file descriptor can be directly linked into
its final location using “linkat()” passing “/proc/self/fd/<num>”
as the first path.

While the above is very neat, we still need some other mechanism
for other systems (the BSDs come to mind). In that case, I think
a reasonable fallback is to unlink the temporary file immediately
after its creation, then once compilation ended create a *new* file
into the final location, truncate it to the right size, and copy
the data. Note that in the current implementation a data copy is
already being performed if “/tmp” and the storage location for
a WebKitUserContentFilterStore aren't inside the same mount point
(not uncommon with “/tmp” very often being an on-RAM file system
and “/home” often being a separate volume).

If somebody is aware of something similar to Linux's “O_TMPFILE”
which would work on other common systems we support, I would love
to hear about it =)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190926/a8a5d6ac/attachment.html>


More information about the webkit-unassigned mailing list