• Alan Screen's avatar
    Parse PPD in a sandbox compliant manner · 6b19560d
    Alan Screen authored
    The Linux sandbox causes created files to be automatically deleted once
    they are closed.  This means that creating a file without leaving an
    open file handle is useless afterwards for any subsequent calls
    expecting it to exist with results of previous work.
    
    Change ParsePpdCapabilities() to open a stream for a temporary file and
    keep that open for the duration of the file operations, instead of
    doing multiple open/close operations against a common filename.  This
    is necessary for supporting sandboxing of the print backend in a
    utility process.
    
    Bug: 809738
    Change-Id: Id16dc686873decad7be980ce4621747b4233184a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597143Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
    Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
    Commit-Queue: Alan Screen <awscreen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#839166}
    6b19560d
cups_helper.cc 24.8 KB