Add CAP_NET_BIND_SERVICE everywhere the service is defined (#2549)

The Virtual Printer binds 990 and 322, below 1024, which a service running
as a normal user may not do without CAP_NET_BIND_SERVICE. Without it the
rest of Bambuddy works and only the VP is dead -- sockets never open, the
slicer never finds the printer, and the sole trace is one journal line.

332a7c6ac added the line to install/install.sh in March under the heading
"Fix install.sh missing AmbientCapabilities". Three other places define the
same unit and none of them got it: the manual template, the combined
Bambuddy + SpoolBuddy installer, and the unit the wiki tells you to paste.
The wiki additionally claimed the capability was always included.

Also diagnose it. The VP diagnostic reported only that nothing was listening
on 990, which reads identically to a port conflict. It now checks CapEff for
the capability and names it as the cause -- but stays quiet when the port is
answering (an iptables REDIRECT is the documented alternative and that host
works) and when the capability is held (the port is down for another reason
and blaming this would misdirect). Skips where there is no procfs rather
than putting a systemd instruction in front of a macOS user.
This commit is contained in:
maziggy
2026-08-04 08:33:30 +02:00
parent 4af782cc2f
commit 28a6ca6f4d
20 changed files with 262 additions and 16 deletions
+8
View File
@@ -62,6 +62,14 @@ StandardOutput=journal
StandardError=journal
SyslogIdentifier=bambuddy
# Allow binding to privileged ports (322 RTSP, 990 FTPS) for Virtual Printer
# mode. Without this the VP's sockets never open and the slicer simply never
# sees the printer — with no obvious error, since the bind failure is one line
# in the journal (#2549). Works alongside NoNewPrivileges=true below: systemd
# raises the ambient set at exec, which is not the privilege escalation that
# setting forbids.
AmbientCapabilities=CAP_NET_BIND_SERVICE
# Security hardening
NoNewPrivileges=true
PrivateTmp=true