* Only allow keywords and names...
*/
+ if (printer->temporary)
+ goto temporary_printer;
+
if (attr->value_tag != IPP_TAG_NAME && attr->value_tag != IPP_TAG_KEYWORD)
continue;
}
else if (!strcmp(attr->name, "requesting-user-name-allowed"))
{
+ if (printer->temporary)
+ goto temporary_printer;
+
cupsdFreeStrings(&(printer->users));
printer->deny_users = 0;
}
else if (!strcmp(attr->name, "requesting-user-name-denied"))
{
+ if (printer->temporary)
+ goto temporary_printer;
+
cupsdFreeStrings(&(printer->users));
printer->deny_users = 1;
}
else if (!strcmp(attr->name, "job-quota-period"))
{
+ if (printer->temporary)
+ goto temporary_printer;
+
if (attr->value_tag != IPP_TAG_INTEGER)
continue;
}
else if (!strcmp(attr->name, "job-k-limit"))
{
+ if (printer->temporary)
+ goto temporary_printer;
+
if (attr->value_tag != IPP_TAG_INTEGER)
continue;
}
else if (!strcmp(attr->name, "job-page-limit"))
{
+ if (printer->temporary)
+ goto temporary_printer;
+
if (attr->value_tag != IPP_TAG_INTEGER)
continue;
cupsd_policy_t *p; /* Policy */
+ if (printer->temporary)
+ goto temporary_printer;
+
if (attr->value_tag != IPP_TAG_NAME)
continue;
}
else if (!strcmp(attr->name, "printer-error-policy"))
{
+ if (printer->temporary)
+ goto temporary_printer;
+
if (attr->value_tag != IPP_TAG_NAME && attr->value_tag != IPP_TAG_KEYWORD)
continue;
namelen > (sizeof(name) - 1) || attr->num_values != 1)
continue;
+ if (printer->temporary)
+ goto temporary_printer;
+
/*
* OK, anything else must be a user-defined default...
*/
}
return (1);
+
+ /*
+ * If we get here this is a temporary printer and you can't set defaults for
+ * this kind of queue...
+ */
+
+ temporary_printer:
+
+ send_ipp_status(con, IPP_STATUS_ERROR_NOT_POSSIBLE, _("Unable to save value for \"%s\" with a temporary printer."), attr->name);
+
+ return (0);
}