* When talking to another CUPS server, send all options...
*/
- cupsEncodeOptions(request, num_options, options);
+ cupsEncodeOptions2(request, num_options, options, IPP_TAG_JOB);
}
if (copies > 1 && (!pc || copies <= pc->max_copies))
if (title)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
title);
- cupsEncodeOptions(request, num_options, options);
+ cupsEncodeOptions2(request, num_options, options, IPP_TAG_JOB);
+ cupsEncodeOptions2(request, num_options, options, IPP_TAG_SUBSCRIPTION);
/*
* Send the request and get the job-id...
can be specified to listen on multiple ports.</P>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.6</SPAN><A NAME="StrictConformance">StrictConformance</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+StrictConformance No
+StrictConformance Yes
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>StrictConformance</CODE> directive specifies whether the scheduler
+requires strict IPP conformance for client requests, for example to not allow
+document attributes in a Create-Job request. The default is
+<code>No</code>.</P>
+
+
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.5</SPAN><A NAME="SubscriptionPrivateAccess">SubscriptionPrivateAccess</A></H2>
<H3>Examples</H3>
.\" which should have been included with this file. If this file is
.\" file is missing or damaged, see the license at "http://www.cups.org/".
.\"
-.TH cupsd.conf 5 "CUPS" "15 February 2012" "Apple Inc."
+.TH cupsd.conf 5 "CUPS" "18 May 2012" "Apple Inc."
.SH NAME
cupsd.conf \- server configuration file for cups
.SH DESCRIPTION
.br
Listens on the specified port for encrypted connections.
.TP 5
+StrictConformance Yes
+.TP 5
+StrictConformance No
+.br
+Specifies whether the scheduler requires clients to strictly adhere to the IPP
+specifications. The default is No.
+.TP 5
SubscriptionPrivateAccess all
.TP 5
SubscriptionPrivateAccess default
{ "ServerRoot", &ServerRoot, CUPSD_VARTYPE_PATHNAME },
{ "SMBConfigFile", &SMBConfigFile, CUPSD_VARTYPE_STRING },
{ "StateDir", &StateDir, CUPSD_VARTYPE_STRING },
+ { "StrictConformance", &StrictConformance, CUPSD_VARTYPE_BOOLEAN },
#ifdef HAVE_AUTHORIZATION_H
{ "SystemGroupAuthKey", &SystemGroupAuthKey, CUPSD_VARTYPE_STRING },
#endif /* HAVE_AUTHORIZATION_H */
MaxLogSize = 1024 * 1024;
MaxRequestSize = 0;
MultipleOperationTimeout = DEFAULT_TIMEOUT;
+ NumSystemGroups = 0;
ReloadTimeout = DEFAULT_KEEPALIVE;
RootCertDuration = 300;
+ StrictConformance = FALSE;
Timeout = DEFAULT_TIMEOUT;
- NumSystemGroups = 0;
WebInterface = CUPS_DEFAULT_WEBIF;
BrowseLocalProtocols = parse_protocols(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS);
/* Amount of automatic debug history */
FatalErrors VALUE(CUPSD_FATAL_CONFIG),
/* Which errors are fatal? */
+ StrictConformance VALUE(FALSE),
+ /* Require strict IPP conformance? */
LogFilePerm VALUE(0644);
/* Permissions for log files */
VAR cupsd_loglevel_t LogLevel VALUE(CUPSD_LOG_WARN);
create_job(cupsd_client_t *con, /* I - Client connection */
ipp_attribute_t *uri) /* I - Printer URI */
{
+ int i; /* Looping var */
cupsd_printer_t *printer; /* Printer */
cupsd_job_t *job; /* New job */
+ static const char * const forbidden_attrs[] =
+ { /* List of forbidden attributes */
+ "compression",
+ "document-format",
+ "document-name",
+ "document-natural-language"
+ };
cupsdLogMessage(CUPSD_LOG_DEBUG2, "create_job(%p[%d], %s)", con,
return;
}
+ /*
+ * Check for invalid Create-Job attributes and log a warning or error depending
+ * on whether cupsd is running in "strict conformance" mode...
+ */
+
+ for (i = 0;
+ i < (int)(sizeof(forbidden_attrs) / sizeof(forbidden_attrs[0]));
+ i ++)
+ if (ippFindAttribute(con->request, forbidden_attrs[i], IPP_TAG_ZERO))
+ {
+ if (StrictConformance)
+ {
+ send_ipp_status(con, IPP_BAD_REQUEST,
+ _("The '%s' operation attribute cannot be supplied in a "
+ "Create-Job request."), forbidden_attrs[i]);
+ return;
+ }
+
+ cupsdLogMessage(CUPSD_LOG_WARN,
+ "Unexpected '%s' operation attribute in a Create-Job "
+ "request.", forbidden_attrs[i]);
+ }
+
/*
* Create the job object...
*/
fi
cat >/tmp/cups-$user/cupsd.conf <<EOF
+StrictConformance Yes
Browsing Off
FileDevice yes
Printcap