Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

CUPS-Get-PPDs fails when ppd-make-and-model contains "+" #3254

Closed

Description

@michaelrsweet

Version: 1.4rc1
CUPS.org User: twaugh.redhat

When a CUPS-Get-PPDs IPP operation has a ppd-make-and-model attribute containing the "+" character, the operation fails because cups-driverd is given too many arguments.

The solution is to URL-encode that character in url_encode_string(). Patch attached. Original bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=509586

Simple test case using pycups:

!/usr/bin/python

import cups
c=cups.Connection()
c.getPPDs(ppd_make_and_model="Lexmark Optra R+ Foomatic/Postscript")

Activity

  1. michaelrsweet commented on Jul 6, 2009

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: till.kamppeter

    Please do not close this bug report telling that it is a bug in Foomatic. Manufacturer-supplied PostScript PPDs can as well contain a '+' in the model name. If the '+' is really not allowed, then we have a bug in cupstestppd, as PPD files do not FAIL because of a '+' in the NickName.

  2. michaelrsweet commented on Jul 7, 2009

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: jsmeix.suse

    According to the Adobe PPD specification the
    NickName value is of type "QuotedValue"
    and a QuotedValue includes the 7-bit printable
    ASCII characters (decimal 32 to 126 inclusive)
    except the characters " < >

    What looks a bit strange is that according to
    the Adobe PPD specification "Printable 7-bit ASCII"
    also includes horizontal tab, line feed, and carriage return
    so that it seems the NickName value could contain them too
    like in

    *NickName: "ACME FunPrinter 1000+
    using ACME FUNdriver version 1.2.3
    which provides the ACME FUN++ technology
    "
    *End

  3. michaelrsweet commented on Jul 7, 2009

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Bumping to P4, since this is a serious regression.

    Tim: Thanks for the clean patch - I don't see any problems with taking it as-is.

    Till: I only close driver issues that are genuine Foomatic bugs. This clearly is not one of those issues.

    Johannes: There isn't a limit in the PPD spec for this, but I'm pretty sure the Microsoft/Adobe PS driver doesn't like multi-line NickName values. In any case, we don't need to escape tabs or newlines in the arguments passed to cups-driverd. The "+" needs to be escaped because we use the same (CGI) path for cups-driverd as for the web interface programs.

  4. michaelrsweet commented on Jul 7, 2009

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Fixed in Subversion repository.

  5. michaelrsweet commented on Jul 7, 2009

    @michaelrsweet
    ContributorAuthor

    "0001-Fixed-cups-driverd-argument-vector-when-model-name-c.patch":

    From 992b6da3622d3d8b7e5c5a522fc74e164ee2d0ee Mon Sep 17 00:00:00 2001
    From: Tim Waugh twaugh@redhat.com
    Date: Mon, 6 Jul 2009 17:06:15 +0100
    Subject: [PATCH] Fixed cups-driverd argument vector when model name contains "+" (bug #509586).

    * scheduler/ipp.c (url_encode_string): Encode "+" as well.

    scheduler/ipp.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/scheduler/ipp.c b/scheduler/ipp.c
    index 23e6b54..ceb7f4e 100644
    --- a/scheduler/ipp.c
    +++ b/scheduler/ipp.c
    @@ -11168,7 +11168,7 @@ url_encode_string(const char s, / I - String */

    while (*s && bufptr < bufend)
    {

    • if (*s == ' ' || *s == '%')
    • if (*s == ' ' || *s == '%' || *s == '+')
      {
      if (bufptr >= (bufend - 2))
      break;
      --
      1.6.2.5
  6. added this to the Stable milestone on Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions