Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable upload limit for drivers #433

Closed
SiebelsTim opened this issue Jul 21, 2022 · 8 comments
Closed

Configurable upload limit for drivers #433

SiebelsTim opened this issue Jul 21, 2022 · 8 comments
Labels
enhancement New feature or request priority-medium

Comments

@SiebelsTim
Copy link

As far as I can tell, MAX_FILE_SIZE is hardcoded in templates and therefore cannot be changed. We have drivers that are over 400KB in size and cannot be uploaded.

Can we increase the limit or make it configurable?

@zdohnal zdohnal added investigating Investigating the issue waiting for reporter There are data requested from the reporter labels Jul 21, 2022
@zdohnal
Copy link
Member

zdohnal commented Jul 21, 2022

Hi @SiebelsTim ,

drivers are for about 10 years deprecated in CUPS, what model do you want to support by the driver? Doesn't the device support some of the driverless standards (AirPrint, IPP Everywhere, Wifi direct, Mopria, PCLm, IPP-over-USB)?

@michaelrsweet
Copy link
Member

@SiebelsTim Do you mean uploading PPDs over 400k in size when adding a printer through the CUPS web interface?

The current limit (256k) has been in place since December 7, 2005, meaning it was added for CUPS 1.2, and this is the first time the limit has been an issue in the last 17 years...

Understand that PPDs and drivers are going away in CUPS 3.0. Changing the limit is a trivial thing, and making it 1MB probably won't increase the potential security risks, but we also are trying very hard not to spend time on improving PPD infrastructure/support because they are going away.

Is there a particular reason why you are manually uploading huge PPD files vs. installing them in one of the standard locations so that you can just pick the driver from the list?

@FelixJacobi
Copy link

Is there a particular reason why you are manually uploading huge PPD files vs. installing them in one of the standard locations so that you can just pick the driver from the list?

We're operating CUPS as a part of our server software solution which is usually delivered on bare metal servers to our customers. All the day to day administration is performed using a web interface which embeds the CUPS web interface. As our key customer group are schools in Germany, where frequently normal school teachers are responsible for the IT administration and mostly only have basic knowledge on IT things, we don't recommend using the root console - which would be required for installing in the standard location -, which could cause various damages to the server by accident, when you not so much experienced.

In our case, the large drivers come from the fact that we have several thousand schools as customers, which of course use a wide variety of printers from many manufacturers. Depending on the manufacturer, the operation with CUPS is only fully supported via PPD files, there are large differences from manufacturer to manufacturer. I know that virtually every network-capable printer supports IPP Everywhere in principle, but in practice sometimes advanced functions do not work without a PPD.

@jsmeix
Copy link

jsmeix commented Jul 21, 2022

@FelixJacobi
if you were more specific about your PPDs
it could help to understand why you have a problem
that nobody else seems to have had since a long time.

E.g. the maximum PPD sizes on my openSUSE Leap 15.3 system
for some currently installed printer driver packages:

# for d in OpenPrintingPPDs/ghostscript OpenPrintingPPDs/postscript gutenprint manufacturer-PPDs/hplip manufacturer-PPDs/hplip-hpps manufacturer-PPDs/hplip-plugin ; \
do echo -e "\n$d" ; \
find /usr/share/cups/model/$d -name '*.ppd*' -ls | tr -s ' ' | cut -d ' ' -f8,12 | sort -n | tail -n2 ; \
done

OpenPrintingPPDs/ghostscript
14740 /usr/share/cups/model/OpenPrintingPPDs/ghostscript/Savin-MP_C6502.pxlcolor-Savin.ppd.gz
14740 /usr/share/cups/model/OpenPrintingPPDs/ghostscript/Savin-MP_C8002.pxlcolor-Savin.ppd.gz

OpenPrintingPPDs/postscript
36714 /usr/share/cups/model/OpenPrintingPPDs/postscript/Lexmark-X952.Postscript-Lexmark.ppd.gz
36714 /usr/share/cups/model/OpenPrintingPPDs/postscript/Lexmark-X954.Postscript-Lexmark.ppd.gz

gutenprint
39805 /usr/share/cups/model/gutenprint/5.2/C/stp-escp2-p7000c.5.2.ppd.gz
40451 /usr/share/cups/model/gutenprint/5.2/C/stp-escp2-p9000c.5.2.ppd.gz

manufacturer-PPDs/hplip
54703 /usr/share/cups/model/manufacturer-PPDs/hplip/hp-designjet_z9_pro_64in_ps-ps.ppd.gz
55043 /usr/share/cups/model/manufacturer-PPDs/hplip/hp-designjet_Z9dr_44in-ps.ppd.gz

manufacturer-PPDs/hplip-hpps
55372 /usr/share/cups/model/manufacturer-PPDs/hplip-hpps/hp-designjet_Z6dr_44in-ps.ppd.gz
55736 /usr/share/cups/model/manufacturer-PPDs/hplip-hpps/hp-color_laserjet_cp6015-ps.ppd.gz

manufacturer-PPDs/hplip-plugin
3440 /usr/share/cups/model/manufacturer-PPDs/hplip-plugin/hp-color_laserjet_3600.ppd.gz
4175 /usr/share/cups/model/manufacturer-PPDs/hplip-plugin/hp-color_laserjet_pro_mfp_m176n.ppd.gz

The biggest one
/usr/share/cups/model/manufacturer-PPDs/hplip-hpps/hp-color_laserjet_cp6015-ps.ppd.gz
is 55K gzip compressed data (with gzip max compression).

Uncompressed it becomes 378K which exceeds the current limit (256k).

I don't know if uploading PPDs through the CUPS web interface
also works with gzip compressed PPDs.

@FelixJacobi
Copy link

@jsmeix We're talking about thirdparty PPDs by Printer vendors not shipped by any Linux distribution AFAIK (probably due to proprietary license), but used by our customers, our sample is the Kyocera_TASKalfa_6054ci.ppd by Kyocera (I cannot post it here directly for legal reasons due to the given copyright and terms) which has a size of 421 KB.

@zdohnal zdohnal removed the waiting for reporter There are data requested from the reporter label Jul 22, 2022
@zdohnal
Copy link
Member

zdohnal commented Jul 22, 2022

@FelixJacobi ok, I've found the model on Kyocera webpages (you could at least share the link :) ) - Kyocera produces the packages, but it doesn't put it into dirs where CUPS expects them, so they're not shown in the drivers list.

@jsmeix The limit is set only for PPDs uploaded via web interface and its Browse button - if the driver resides in CUPS directories, cups-driverd is able to pick them up, return them via cupsd to admin.cgi, which shows them in driver's list. Currently I cannot find whether (or there isn't...) there is a limit for PPD loaded via cups-driverd.
Ad uploading gzipped PPDs - I've tested it and you can upload gzipped PPDs via Browse button as well.

Off topic - ad PPD itself - the half of the PPD are translations, which can be covered by CUPS itself if the driver is generated via internal CUPS/cups-filters PPD generators from IPP response.

So to sum it up - it would be great if the printer driver provider updated their packages, so the drivers will get installed into CUPS directories, which IMO helps users much more than uploading them to CUPS Web interface, because printing stack in Linux can pick them up.
@FelixJacobi Felix, would you mind reporting the issue to Kyocera? The solution would be to put the kyocera9.1 dir from the printer driver package into /usr/share/cups/model (the older Kyocera drivers put it there and then they are shown in driver's list).

Ad the size limit - @michaelrsweet I see pappl has 2MB limit for attachments in web if - can I set it to the same value in CUPS templates?

@jsmeix
Copy link

jsmeix commented Jul 22, 2022

@zdohnal
thank you for your efforts to find out
what this issue here actually is about.

I guess that those Kyocera_TASKalfa_6054ci.ppd size of 421 KB
is uncompressed (but I won't spend more time with guessing here).

@zdohnal zdohnal added enhancement New feature or request priority-medium and removed investigating Investigating the issue labels Jul 25, 2022
zdohnal added a commit that referenced this issue Jul 25, 2022
CUPS Web UI: Raise the file limit (fixes #433)
@michaelrsweet
Copy link
Member

@zdohnal Sorry for the late reply, but yes you can increase the limit to 2MB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-medium
Projects
None yet
Development

No branches or pull requests

5 participants