Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cups-browsed cannot bind to port 631 as non-root user #17

Closed
m0rgn opened this issue Jul 4, 2023 · 1 comment
Closed

cups-browsed cannot bind to port 631 as non-root user #17

m0rgn opened this issue Jul 4, 2023 · 1 comment

Comments

@m0rgn
Copy link

m0rgn commented Jul 4, 2023

Describe the bug
After upgrading to Ubuntu 23.04, my laptop failed to discover our print server.
The problem seems to have been caused by a new change in cups-browsed that was added to Ubuntu 23.04.
I looked into it and found a small fix that seems to solve my issue.

Using the debug configuration for cupsd and cups-browsed, I looked through the logs and noticed the following line:
failed to bind CUPS Browsing socket: Permission denied

After reading more about printer advertisement and cups-browsed, I concluded that the printer is shared to my Ubuntu 23.04 laptop via CUPS on port 631.
When I connected an Ubuntu 22.04 laptop to the WIFI network, I saw the printer really was being shared with CUPS on port 631.
Cups-browsed was running as root on 22.04 while on 23.04 it is running as a new user - cups-browsed, but this new user didn't seem to have the necessary permissions to open a listening socket on port 631.
The solution I tried was granting the relevant binding permissions to the binary with this command (on the 23.04):
setcap cap_net_bind_service+ep /usr/sbin/cups-browsed

After giving the permissions, my computer successfully discovered the printer, just like it used to on 22.04!
I think the command should be added to the post install script or maybe the capability should be granted to the new cups-browsed user.

@zdohnal
Copy link
Member

zdohnal commented Jul 12, 2023

Hi @m0rgn ,

this looks like an issue Ubuntu packaging of project cups-browsed (cups-browsed runs as root on Fedora Linux), please report the issue to Ubuntu.

Thank you in advance!

@zdohnal zdohnal closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2023
@zdohnal zdohnal changed the title Cups not working on Ubuntu 23.04 cups-browsed cannot bind to port 631 as non-root user Jul 12, 2023
@zdohnal zdohnal transferred this issue from OpenPrinting/cups Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants