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.

Kerberos authenticated print job gets canceled #3435

Closed

Description

@michaelrsweet

Version: 1.4-current
CUPS.org User: henriccarlstrom

Issue:
All Kerberos authenticated print job from a CUPS 1.4.x client gets canceled.
Print jobs from CUPS 1.3.x gets through without any errors.

Scenario:
Any CUPS 1.4.x client (tested Ubuntu 9.10, Fedora 11, Fedora 12, CentOS 5.4, Solaris 10, MacOSX 10.6) against a Ubuntu 9.10 Server with CUPS 1.4.1.
Using Kerberos authentication (see attached cupsd.conf)
Command "kvno -k /etc/krb5.keytab -S HOST swe-lab-cup-002.swelab.local" gives the output "HOST/swe-lab-cup-002.swelab.local@SWELAB.LOCAL: kvno = 5, keytab entry valid"
Klients are using a client.conf file with one line "ServerName swe-lab-cup-002.swelab.local"

Expected if working:
When running the command "lp -d PrinterQueueName /etc/hosts" we get the reply "lp: successful: ok". Should be getting "request id is PrinterQueueName-ID (1 file(s))".

Possible problem:
In the error log right before "Send-Document" we get the error;
"cupsdAuthorize: Error accepting GSSAPI security context: Unspecified GSS failure. Minor code may provide more information, Request is a replay".
The "Send-Document" command tries to authenticate using no username, fails and then sends "Cancel-Job".
Both the "Create-Job" and "Cancel-Job" authenticates using Kerberos.

Activity

  1. michaelrsweet commented on Dec 7, 2009

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Fixed in Subversion repository.

    Please try the attached patch - basically, we were not seeing the "authentication required" response fast enough from the server, so we canceled while sending the document data. The patch updates the document sending code to retry the entire request.

  2. michaelrsweet commented on Feb 8, 2010

    @michaelrsweet
    ContributorAuthor

    "cupsd.conf":

    LogLevel debug
    MaxLogSize 0
    SystemGroup lpadmin

    Allow remote access

    Port 631
    Listen /var/run/cups/cups.sock
    ServerName swe-lab-cup-002.swelab.local
    ServerAlias swe-lab-cup-002.swelab.local

    Share local printers on the local network.

    Browsing On
    BrowseOrder allow,deny
    BrowseRemoteProtocols
    BrowseAddress @Local
    BrowseLocalProtocols CUPS dnssd

    DefaultAuthType Negotiate

    # Allow shared printing... Order allow,deny Allow all # Restrict access to the admin pages... Order allow,deny AuthType Default Require user @System # Restrict access to the configuration files... Order allow,deny AuthType Default Require valid-user Order deny,allow AuthType Default Require user @owner @System Order deny,allow AuthType Default Require user @System Order deny,allow AuthType Default Require user @System Order deny,allow AuthType Default Require user @owner @System Order deny,allow Order deny,allow
  3. michaelrsweet commented on Feb 8, 2010

    @michaelrsweet
    ContributorAuthor

    "str3435.patch":

    Index: cups/util.c

    --- cups/util.c (revision 8900)
    +++ cups/util.c (working copy)
    @@ -1511,13 +1511,37 @@
    return (0);
    }

    • status = cupsStartDocument(http, name, job_id, docname, format,
    •                           i == (num_files - 1));
      
    • do
    • {
    •  cupsFileRewind(fp);
      
    • while (status == HTTP_CONTINUE &&
    •       (bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
      
    •  status = cupsWriteRequestData(http, buffer, bytes);
      
    •  status = cupsStartDocument(http, name, job_id, docname, format,
      
    •                i == (num_files - 1));
      
    •  while (status == HTTP_CONTINUE &&
      
    •    (bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
      
    •    status = cupsWriteRequestData(http, buffer, bytes);
      
    •  if (status == HTTP_UNAUTHORIZED)
      
    •  {
      
    •    char   resource[1024];     /\* Printer resource */
      
    •    snprintf(resource, sizeof(resource), "/printers/%s", name);
      
    •    if (!cupsDoAuthentication(http, "POST", resource))
      
    •    {
      
    • if (httpReconnect(http))
      
    • {
      
    •   _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
      
    •   return (0);
      
    • }
      
    •    }
      
    • else
    • status = HTTP_AUTHORIZATION_CANCELED;
      
    •  }
      
    • }
    • while (status == HTTP_UNAUTHORIZED);

    cupsFileClose(fp);

    if (status != HTTP_CONTINUE || cupsFinishDocument(http, name) != IPP_OK)

  4. 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