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 daemon is not set to listen on port 631 in the whole network when user wants CUPS to show printers #2557

Closed
michaelrsweet opened this Issue Oct 11, 2007 · 4 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Copy link
Collaborator

michaelrsweet commented Oct 11, 2007

Version: 1.3-current
CUPS.org User: till.kamppeter

Using cupsctl, the CUPS web interface, or system-config-printer (Ubuntu Gutsy or Fedora Rawhide) to set the CUPS server option for showing shared CUPS printers from remote CUPS servers CUPS sets correctly

Browsing On
BrowseAllow @Local

in cupsd.conf

but misses to replace

Listen localhost:631

by

Port 631

So CUPS does not listen to the broadcasts.

To reproduce:

Open the web interface, http://localhost:631/, go to "Administration", in the "Server" section check "Show printers shared by other systems" and uncheck all the rest.

If you still see the remote printers after that, clear the cache:

/etc/init.d/cups stop
rm /var/cache/cups/remote.cache
/etc/init.d/cups start

and observe for more than 30 seconds. The remote printers will not appear.

Many users did not see this problem as they have both "Show printers shared by other systems" and "Share published printers connected to this system" activated. The latter sets "Port 631" correctly.

Patch to fix this is attached.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Oct 11, 2007

CUPS.org User: till.kamppeter

See also the original report at Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/151510

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Oct 11, 2007

CUPS.org User: martin.pitt.canonical

Please note that this patch is far from ideal.

There is no real need for opening the TCP port to the public just for browsing. Only the UDP port should listen to the world when browsing is enabled, and sharing is disabled.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Oct 11, 2007

CUPS.org User: mike

No, this patch is bogus.

Showing remote printers does not require an open Port 631 - that is only required to share printers with other systems.

CUPS browsing happens on UDP port 631, which is bound when Browsing is On and either of the BrowseLocalProtocols and BrowseRemoteProtocols lists CUPS (which is the default configuration on all operating systems).

If I was to guess at a cause, look at Ubuntu patches to CUPS and/or to firewall settings that would be blocking UDP port 631 when the scheduler is not configured to share printers.

This is not a CUPS bug.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Oct 11, 2007

"fix-show-remote-printers.patch":

#! /bin/sh /usr/share/dpatch/dpatch-run

fix-show-remote-printers.dpatch by till.kamppeter@gmail.com

All lines beginning with `## DP:' are a description of the patch.

DP: No description.

@dpatch@
diff -urNad cupsys-1.3.2~/cups/adminutil.c cupsys-1.3.2/cups/adminutil.c
--- cupsys-1.3.2~/cups/adminutil.c 2007-07-27 20:26:53.000000000 +0100
+++ cupsys-1.3.2/cups/adminutil.c 2007-10-11 14:51:59.000000000 +0100
@@ -1423,13 +1423,13 @@
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
{
if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) &&

  •    (share_printers >= 0 || remote_admin >= 0))
    
  •    (share_printers >= 0 || remote_printers >= 0 || remote_admin >= 0))
    

    {
    if (!wrote_port_listen)
    {
    wrote_port_listen = 1;

  • if (share_printers > 0 || remote_admin > 0)

  • if (share_printers > 0 || remote_printers > 0 || remote_admin > 0)
    {
    cupsFilePuts(temp, "# Allow remote access\n");
    cupsFilePrintf(temp, "Port %d\n", server_port);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.