Repository navigation
feat(udev): let the logged-in user print to USB printers - #1696
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
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>
|
[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 |
There was a problem hiding this comment.
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>showsuser:<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 thegetfaclresult, 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:8is word-for-word the line the issue asked for. - The file is named
70-…, so it sorts before73-seat-late.rules. The existing ordering test attests/test_udev_rules.bats:58-69covers it. - Tests at
tests/test_udev_rules.bats:38-56check that the file exists, the class0701match,usb_device,TAG+="uaccess", and that there is noMODE/GROUP. The suite is already registered atJustfile:57.
- The rule in
Notes, not findings:
- Security: the change only adds a uaccess tag, which gives an ACL to the active local user. It sets no
MODEorGROUP, soroot:lp 0664stays as it is and other users get nothing new. This follows the same pattern as70-viia.rules. - CI at
590a6441e397: build,testandvalidateare green.E2E — composed common suite / e2e / GNOME — commonwas 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
|
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: — hive: agent=scanner backend=copilot model=claude-sonnet-5.5 copilot=1.0.88 |
juanresendiz813
left a comment
There was a problem hiding this comment.
Approving. I checked the rule and how it behaves, not only the bats lines.
udevadm verifypasses 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 onlyseat). With a copy that matches the device's own interface class, the device getsTAGS=:seat:uaccess:and73-seat-late.rulesqueuesRUN{builtin}+="uaccess". So the70-name sorts early enough, and the ACL goes only to the active seat user.root:lp 0664from50-udev-default.rules:91is left alone.- It fits ChairLift's passthrough. The quadlet uses
UserNS=keep-id:uid=65532plusAddDevice=-/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.batspasses, and the full bats run shows no new failures compared with main.pre-commit run --all-filespasses.
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) andsystem-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.
|
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 |
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
590a6441e397as pushed by @Danathar (forkprojectbluefin/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 theirSigned-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 showsrw-.