Manual CUPS driver installation should specify and enforce expected file type |
||||
Issue descriptionGoogle Chrome 62.0.3202.63 (Official Build) beta (64-bit) Revision 0 Platform 9901.49.0 (Official Build) beta-channel samus What steps will reproduce the problem? (1) Try to add a printer (2) Set up destination properly (3) Choose a random file for the driver What is the expected result? Be told "this isn't a PPD" or similar and taken back to the select UI. What happens instead? Get an "error adding printer" popup and dialog closes, losing all state. You have to start over. Larger issue: Printer OEMs ship drivers in a wide range of formats. It's really easy to end up with a DMG or ZIP or TAR or EXE or whatever. There's no indication in our UI of what we expect or how to troubleshoot when things go wrong.
,
Jan 24 2018
PPDs are plain text files that we accept as either unzipped or GZipped. So, we can check the first few bytes to verify it's GZip or UTF-8. That should be sufficient to verify most cases. Then we can let cupstestppd handle the rest. (cupstestppd is already invoked by debugd).
,
Jan 24 2018
,
Jan 24 2018
I'm not sure if CUPS supports UTF-16, but we should allow that if it does.
,
Feb 1 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/17584880be50839966928a40cbc406905c2f029f commit 17584880be50839966928a40cbc406905c2f029f Author: David Valleau <valleau@chromium.org> Date: Thu Feb 01 20:07:13 2018 Adding basic verification to PPDs selected by the user When the user selects a file to be used as a PPD for a printer to be added, a simple check is made to verify if the selected file looks to be a PPD. This does not perform a full validation of the PPD file and is just to help notify the user if they've selected a file which is obviously wrong. R=skau@chromium.org, xdai@chromium.org Bug: 778462 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I794a48c84d176b979e9bfdcf90ee5049f08f4541 Reviewed-on: https://chromium-review.googlesource.com/887858 Commit-Queue: David Valleau <valleau@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Reviewed-by: Xiaoqian Dai <xdai@chromium.org> Reviewed-by: Sean Kau <skau@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/master@{#533792} [modify] https://crrev.com/17584880be50839966928a40cbc406905c2f029f/chrome/browser/resources/settings/printing_page/cups_set_manufacturer_model_behavior.js [modify] https://crrev.com/17584880be50839966928a40cbc406905c2f029f/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc [modify] https://crrev.com/17584880be50839966928a40cbc406905c2f029f/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h [modify] https://crrev.com/17584880be50839966928a40cbc406905c2f029f/chromeos/printing/ppd_line_reader.cc [modify] https://crrev.com/17584880be50839966928a40cbc406905c2f029f/chromeos/printing/ppd_line_reader.h [modify] https://crrev.com/17584880be50839966928a40cbc406905c2f029f/chromeos/printing/ppd_line_reader_unittest.cc
,
Feb 15 2018
,
Feb 16 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7f1d7dbb9fd410420786fe38110913448f6110dc commit 7f1d7dbb9fd410420786fe38110913448f6110dc Author: David Valleau <valleau@chromium.org> Date: Fri Feb 16 02:54:53 2018 Adding error message for when a user selects an invalid PPD file This change is built off of https://crrev.com/c/887858 which added basic verification to user-selected PPD files in order to provide them with more immediate feedback when they select an invalid file. This change is simply adding an error message that is displayed to the user. Here are some screenshots of what this change looks like in the UI: - invalid PPD (https://screenshot.googleplex.com/YKH4CPFTJpV.png) - valid PPD (https://screenshot.googleplex.com/ube7K8v9QtT.png) R=dpapad@chromium.org, xdai@chromium.org Bug: 778462 , 806915 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I6992a594cbf0c086e136c32814b8070724b1ed71 Reviewed-on: https://chromium-review.googlesource.com/898432 Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Reviewed-by: Xiaoqian Dai <xdai@chromium.org> Commit-Queue: David Valleau <valleau@chromium.org> Cr-Commit-Position: refs/heads/master@{#537151} [modify] https://crrev.com/7f1d7dbb9fd410420786fe38110913448f6110dc/chrome/app/settings_strings.grdp [modify] https://crrev.com/7f1d7dbb9fd410420786fe38110913448f6110dc/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html [modify] https://crrev.com/7f1d7dbb9fd410420786fe38110913448f6110dc/chrome/browser/resources/settings/printing_page/cups_set_manufacturer_model_behavior.js [modify] https://crrev.com/7f1d7dbb9fd410420786fe38110913448f6110dc/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc |
||||
►
Sign in to add a comment |
||||
Comment 1 by skau@chromium.org
, Jan 24 2018