Skip to content

Disable print by reference by default - #157

Open
acts-1631 wants to merge 1 commit into
OpenPrinting:masterfrom
acts-1631:disable-uri-print-jobs
Open

Disable print by reference by default#157
acts-1631 wants to merge 1 commit into
OpenPrinting:masterfrom
acts-1631:disable-uri-print-jobs

Conversation

@acts-1631

@acts-1631 acts-1631 commented Jul 28, 2026

Copy link
Copy Markdown

Print-URI and Send-URI are deprecated operations that let a client provide a
document URI for the server to retrieve.

Keep print by reference disabled and unadvertised by default. An operator can
enable the operations explicitly for development and testing.

@michaelrsweet michaelrsweet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

Since the official stance in the IPP workgroup is that these operations are deprecated, I think it makes sense to update ippeveprinter to default to not supporting these operations, but if a user wants to allow print-by-reference without authentication, that is perfectly OK and is a local security policy choice. Authentication doesn't make these operations any safer.

Ultimately, ippeveprinter is a developer/testing tool and not a production-ready server, so it necessarily has to be more permissive than we might want for a service in general.

Comment thread tools/ippeveprinter.c Outdated
ippAddIntegers(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "operations-supported", sizeof(ops) / sizeof(ops[0]), ops);
if (printer->uri_jobs)
{
attr = ippFindAttribute(printer->attrs, "operations-supported", IPP_TAG_ENUM);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just move the Print-URI and Send-URI operations to the end of the list and adjust the number of values you add.

Comment thread tools/ippeveprinter.c Outdated
*command; // Command to run with job file
int port; // Port
bool web_forms; // Enable web interface forms?
bool uri_jobs, // Enable URI job operations?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to print_by_ref (print by reference) which is how we refer to these operations in IPP.

Comment thread tools/ippeveprinter.c Outdated
static ipp_t *create_media_size(int width, int length);
static ipp_t *create_media_size_range(int min_width, int max_width, int min_length, int max_length);
static ippeve_printer_t *create_printer(const char *servername, int serverport, const char *name, const char *location, const char *icons, const char *strings, cups_array_t *docformats, const char *subtypes, const char *directory, const char *command, const char *device_uri, const char *output_format, ipp_t *attrs);
static ippeve_printer_t *create_printer(const char *servername, int serverport, const char *name, const char *location, const char *icons, const char *strings, cups_array_t *docformats, const char *subtypes, const char *directory, const char *command, const char *device_uri, const char *output_format, bool uri_jobs, ipp_t *attrs);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Comment thread tools/ippeveprinter.c Outdated
*strings = NULL, // Strings file
*subtypes = "_print"; // DNS-SD service subtype
bool legacy = false, // Legacy mode?
bool uri_jobs = false, // Enable URI job operations?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Comment thread tools/ippeveprinter.c Outdated
{
web_forms = false;
}
else if (!strcmp(argv[i], "--enable-uri-jobs"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"--enable-print-by-reference"

Comment thread tools/ippeveprinter.c Outdated
return (usage(stderr));
}

#if !HAVE_LIBPAM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print-by-reference and authentication are orthogonal issues, so don't bother with this.

Comment thread tools/ippeveprinter.c Outdated
if (!client->printer->uri_jobs)
{
flush_document_data(client);
respond_ipp(client, IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED, "URI jobs are disabled.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Print by reference is disabled."

Comment thread tools/ippeveprinter.c Outdated
if (!client->printer->uri_jobs)
{
flush_document_data(client);
respond_ipp(client, IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED, "URI jobs are disabled.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Comment thread tools/ippeveprinter.c Outdated
cupsLangPuts(out, _("Usage: ippeveprinter [OPTIONS] \"NAME\""));
cupsLangPuts(out, _("Options:"));
cupsLangPuts(out, _("--help Show this help"));
cupsLangPuts(out, _("--enable-uri-jobs Enable authenticated Print-URI and Send-URI operations"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"--enable-print-by-reference Enable the Print-URI and Send-URI operations."

@michaelrsweet michaelrsweet self-assigned this Jul 29, 2026
@michaelrsweet michaelrsweet added the enhancement New feature or request label Jul 29, 2026
@michaelrsweet michaelrsweet added this to the Future milestone Jul 29, 2026
Print-URI and Send-URI are deprecated IPP operations that let clients
provide a document URI for the server to retrieve. The printer
application currently advertises and enables them by default.

Disable print by reference and its related capability attributes by
default. Allow an operator to enable the operations explicitly for
development and testing with --enable-print-by-reference.
@acts-1631
acts-1631 force-pushed the disable-uri-print-jobs branch from b2e66cd to 73fe656 Compare July 29, 2026 18:25
@acts-1631 acts-1631 changed the title Require explicit authenticated URI job support Disable print by reference by default Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants