Skip to content

feat(udev): let the logged-in user print to USB printers - #1696

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
hive/adopt-1682
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
hive/adopt-1682

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #1682 (adopted after CI went red and the contributor was unavailable; original commits by @Danathar preserved).

Fixes #1681

This branch is #1682's head 590a6441e397 as pushed by @Danathar (fork projectbluefin/common), unchanged. Last lane reason on the original: optional-check-failing:E2E — composed common suite / e2e / GNOME — common.

Hive fix agent: rebase this branch on main, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and their Signed-off-by; add your own sign-off on your commits. Do not open another PR.

Hardware testing: No real-printer getfacl /dev/bus/usb/<bus>/<device> check was done; only the bats rule tests were run. A maintainer with a USB printer should verify the user shows rw-.

A USB printer's node is root:lp 0664 and nobody is in lp on a default
install, so a printer application running as the user can read the
printer but not send it a job. Tag USB printer-class (0701) devices with
uaccess so the active seat user gets an ACL; lp keeps its access.

Fixes #1681

Hive-Run: #1681
Hive-Plan: issue-1681
Hive-Spec: issue-1681#what-to-do
Assisted-by: Claude Opus 5.5 via Claude Code
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: castrojo

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off stage/050-review-pending Review swarm requested; awaiting a verdict for the current head role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) labels Nov 17, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Summary: This change lets the person signed in at the computer send print jobs to a USB printer, without changing who else can use it. The rule matches the plan in the original request and comes with tests. The only gap: the request asked the PR to say whether it was tried with a real printer, and the PR description says nothing about that.

What I need from you: Add one line to the PR description saying whether the change was checked on a real USB printer.


intent-alignment

  • (low, in-scope) Issue #1681 lists as an acceptance item: "On a machine with a USB printer, after login, getfacl /dev/bus/usb/<bus>/<device> shows user:<you>:rw-. Say in the PR if you couldn't test with a real printer." The PR body only has the supersede/handoff text. It does not say whether this was tested on hardware. Fix: add a line to the PR body with the getfacl result, or state that no real-printer test was done. The unit-level items are met:
    • The rule in system_files/shared/usr/lib/udev/rules.d/70-usb-printer-uaccess.rules:8 is word-for-word the line the issue asked for.
    • The file is named 70-…, so it sorts before 73-seat-late.rules. The existing ordering test at tests/test_udev_rules.bats:58-69 covers it.
    • Tests at tests/test_udev_rules.bats:38-56 check that the file exists, the class 0701 match, usb_device, TAG+="uaccess", and that there is no MODE/GROUP. The suite is already registered at Justfile:57.

Notes, not findings:

  • Security: the change only adds a uaccess tag, which gives an ACL to the active local user. It sets no MODE or GROUP, so root:lp 0664 stays as it is and other users get nothing new. This follows the same pattern as 70-viia.rules.
  • CI at 590a6441e397: build, test and validate are green. E2E — composed common suite / e2e / GNOME — common was still in progress when I reviewed. It is the check that failed on #1682.

No findings from: correctness, security, style, docs-currency.

Confidence: 3/5 (needs attention) — 1 perspective requested changes

— hive: agent=reviewer-2 backend=claude model=claude-opus-5-5 effort=medium claude=2.1.325

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

E2E GNOME (run 44151444841) failed on 12 portal/dconf/desktop-entry scenarios (xdg-desktop-portal*, Searchlight, HTML MIME handler). None touch the udev rule or its bats test, which this PR alone changes; the same scenarios failed on earlier main runs, and recent main E2E is green. Treating as infra flake: needs a failed-job rerun (blocked for the agent by the gh allowlist). DEFER.


🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: 3b5011367fa1ee1098348497f337fdc5425cccc8

— hive: agent=scanner backend=copilot model=claude-sonnet-5.5 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Nov 17, 2026
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 17, 2026

@juanresendiz813 juanresendiz813 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving. I checked the rule and how it behaves, not only the bats lines.

  • udevadm verify passes on the new file, on my host (systemd 262) and inside the published Utah image (systemd 261).
  • udevadm test --action=add --extra-rules-dir=… against a real USB device: the rule as written does not match a non-printer (the device keeps only seat). With a copy that matches the device's own interface class, the device gets TAGS=:seat:uaccess: and 73-seat-late.rules queues RUN{builtin}+="uaccess". So the 70- name sorts early enough, and the ACL goes only to the active seat user. root:lp 0664 from 50-udev-default.rules:91 is left alone.
  • It fits ChairLift's passthrough. The quadlet uses UserNS=keep-id:uid=65532 plus AddDevice=-/dev/bus/usb/BBB/DDD, so the container user is the host user, and that is the user the seat ACL covers.
  • bats tests/test_udev_rules.bats passes, and the full bats run shows no new failures compared with main. pre-commit run --all-files passes.

Notes, not blockers:

  • Nobody has tested this with a real printer yet. The getfacl /dev/bus/usb/<bus>/<dev> check from #1681 is still open. I don't have a USB printer here.
  • On an MFP the ACL covers the whole USB device, scanner included. I think that's fine, but it's worth one line in the comment.
  • Utah ships ipp-usb (71-ipp-usb.rules, which claims IPP-over-USB printers) and system-config-printer-udev (70-printers.rules, which adds USB printers to host CUPS). On Utah, a rootless printer app can end up fighting the host for the same device. Dakota has neither, only CUPS itself. That doesn't block this PR, but chairlift#753 should know about it.

@hivecommons-hive hivecommons-hive Bot removed the stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it label Nov 18, 2026
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 18, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

stage 060-reviewed → 050-review-pending: repo-auto-merge-disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

udev: give the logged-in user access to USB printers (uaccess), so rootless printer apps can print

3 participants