Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ippeveprinter: collection-valued job attributes are never exported to the command (IPP_MEDIA_COL always empty)

Open
#1,725 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@michaelrsweet is already working on this.

Since Sep 29, 2026.

Assessment

This issue has not been assessed yet.

Description

bug documentation priority-low

Summary

ippeveprinter does not export collection-valued Job Template attributes to the command environment. IPP_MEDIA_COL is created but always empty.

This matters because modern clients — including CUPS itself and macOS — send the selected media as media-col, not as the media keyword. The result is that a -c command can never discover which media the user chose: IPP_MEDIA is empty because media was not sent, and IPP_MEDIA_COL is empty because collections are dropped.

For a label printer this is the difference between working and not. The whole point of a -c command is to act on the selected media, and there is no way to obtain it.

Expected

ippeveprinter(1) states, without qualification:

ippeveprinter adds environment variables starting with "IPP_" for all IPP Job attributes in the print request. For example, when executing a command for an IPP Job containing the "media" Job Template attribute, the "IPP_MEDIA" environment variable will be set to the value of that attribute.

"all IPP Job attributes" should include collections, or the manual should say they are excluded.

Reproducer

Tested against CUPS 2.4.19 (Homebrew, macOS 15.6 arm64). Also reproduces on Apple CUPS 2.3.4.

media.conf:

ATTR keyword media-supported om_tape9_9x100mm,om_tape24_24x100mm
ATTR keyword media-default om_tape24_24x100mm
ATTR keyword urf-supported V1.4,CP1,RS360,W8,DM1
ATTR resolution printer-resolution-supported 360dpi
ATTR resolution pwg-raster-document-resolution-supported 360dpi
ATTR keyword pwg-raster-document-type-supported black_1,sgray_8
ATTR keyword pwg-raster-document-sheet-back normal
ATTR integer media-top-margin-supported 0
ATTR integer media-bottom-margin-supported 0
ATTR integer media-left-margin-supported 0
ATTR integer media-right-margin-supported 0
ATTR collection media-col-database {
  MEMBER collection media-size {
    MEMBER integer x-dimension 900
    MEMBER integer y-dimension 10000
  }
  MEMBER keyword media-size-name om_tape9_9x100mm
  MEMBER integer media-top-margin 0
  MEMBER integer media-bottom-margin 0
  MEMBER integer media-left-margin 0
  MEMBER integer media-right-margin 0
},{
  MEMBER collection media-size {
    MEMBER integer x-dimension 2400
    MEMBER integer y-dimension 10000
  }
  MEMBER keyword media-size-name om_tape24_24x100mm
  MEMBER integer media-top-margin 0
  MEMBER integer media-bottom-margin 0
  MEMBER integer media-left-margin 0
  MEMBER integer media-right-margin 0
}

show-env.sh:

#!/bin/sh
env | grep '^IPP_MEDIA' > /tmp/ippeve-env.txt

Run:

ippeveprinter -p 8631 -a media.conf -c ./show-env.sh "MediaTest" &
lpadmin -p MediaTest -E -v ipp://localhost:8631/ipp/print -m everywhere
lp -d MediaTest -o media=om_tape9_9x100mm somefile.txt
cat /tmp/ippeve-env.txt

Actual

IPP_MEDIA=
IPP_MEDIA_COL=
IPP_MEDIA_DEFAULT=om_tape24_24x100mm

media-col was sent by the client and accepted by the server (no Unsupported media-col in the log), yet neither variable carries it. Only the printer default comes through, which is not the user's selection.

Serialising a collection into a single env var needs a format decision. Two options that would both solve it:

  1. Flatten members into separate variables, e.g. IPP_MEDIA_COL_MEDIA_SIZE_X_DIMENSION=900.
  2. Resolve media-col back to its matching media-col-database entry and set IPP_MEDIA to that entry's media-size-name.

Option 2 is smaller and would make existing IPP_MEDIA-reading commands work unchanged.

Secondary: -a silently conflicts with -M / -m

Separate and much smaller. Combining -a with -M or -m makes ippeveprinter exit with a bare usage dump naming no option:

ippeveprinter -p 8631 -a media.conf -M Brother "X"   # usage dump, exits
ippeveprinter -p 8631 -a media.conf -m Model "X"     # usage dump, exits
ippeveprinter -p 8631 -a media.conf "X"              # starts fine

The manual documents all three options with no hint they are mutually exclusive. If the conflict is intended, an error naming the conflicting options would save a lot of guessing. Reproduces on both versions tested.

Dominant language
C
Stars
1.8k
Forks
349
Avg merge
3d 4h
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenPrinting/cups

All issues in OpenPrinting/cups

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.