CUPS @LOCAL value

I have two cars. One with CUPS 1.5.0, and the other with CUPS 1.6.1. These two machines are on the same local network. I need the full opening of printers on the network. If I run the following command:

CUPS_DEBUG_LEVEL=2 /usr/lib/cups/backend/snmp 2>&1 

on both machines I get different results. The one who has CUPS 1.5.0 is the result I want to get from another machine using CUPS 1.6.1.

I got the problem! CUPS has a variable called @LOCAL . The top command is:

 CUPS_DEBUG_LEVEL=2 /usr/lib/cups/backend/snmp @LOCAL 2>&1 

The problem is that in the second case (CUPS 1.6.1), the @LOCAL value is the local IP (192.168.3.69) of the machine instead of broadcast (192.168.3.255).

If I run the following command on the machine, everything works fine:

 CUPS_DEBUG_LEVEL=2 /usr/lib/cups/backend/snmp 192.168.3.255 2>&1 

Please explain to me how to adjust the value of @LOCAL variable. Or why does CUPS 1.5.0 configure it well during installation and 1.6.1 doesn't? (After installation, I did nothing, and it worked perfectly)

+4
source share
1 answer

First ...

... make it clear what @LOCAL means:

The @LOCAL line @LOCAL not exactly a variable - in the context of the CUPS configuration (/etc/cups/cupsd.conf) it is called a macro. You can use more macros: @IF , @GROUP , @ACL , @OWNER and @SYSTEM .

The @LOCAL macro was introduced in CUPS with version 1.1.15. The corresponding CHANGELOG entry reads:

  - The Allow, Deny, BrowseAllow, BrowseDeny, and BrowseAddress directives now support the network interface names "@LOCAL" and "@IF(name)" for access control and browsing based on the current interface addresses instead of fixed names or IP addresses. 

In other words: before introducing it into the CUPS code base, you had to hard-code the current host IPs in cupsd.conf . After that, you had the opportunity to simply write @LOCAL or @IF(eth0) or @IF(wlan1) in cupsd.conf , and CUPS will use the current IP address ( all local IP addresses if the field has several!), Even if he has changed. (Addresses for PPP / dialup connections are not considered local IP addresses ...)

Second...

... see why you can see the differences:

Without access to the full configuration of CUPS and network devices of both of your two machines, it is impossible to answer the question.

Perhaps one server has more network interfaces and / or more different IP addresses than others (for example, using the eth0:1 trick to use an additional virtual network interface).

You may also have stumbled upon a mistake in one of the two incarnations of CUPS of your machines.

+1
source

Source: https://habr.com/ru/post/1442931/


All Articles