Modify lpadmin to read a PPD directly from stdin.

This patch allows lpadmin to read PPD content directly from standard
input instead of given file. To use this functionality, the value of
'-P' command line parameter must be set to '-'.
Inside lpadmin, the content of PPD file is read twice by different
structures. Because the standard input cannot be read twice, the PPD
content is first saved to two separate Linux temporary files. Then
descriptors of these files are used by CUPS structures as an input.

BUG=chromium:848029
TEST=Tested on nautilus for ~3.2K different PPD files

Change-Id: I5ad2972f756b5cdef27c7077237337f6307b2ab7
Reviewed-on: https://chromium-review.googlesource.com/1182672
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Piotr Pawliczek <pawliczek@chromium.org>
Reviewed-by: Sean Kau <skau@chromium.org>
1 file changed