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

It is impossible to disable SNMP queries for network printers #4422

Closed
michaelrsweet opened this issue May 30, 2014 · 2 comments
Closed

It is impossible to disable SNMP queries for network printers #4422

michaelrsweet opened this issue May 30, 2014 · 2 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.7-current
CUPS.org User: mmucha

In cups-1.7.3 it is impossible to disable SNMP lookups for supply levels using "snmp" argument in printer URI as stated in https://www.cups.org/documentation.php/doc-1.7/network.html.
Bug is present in IPP, SOCKET and LPD protocols due to code duplication.
Problem exists because of invalid expression used for parsing argument's value and can be solved by applying attached patch.
I can't verify if problem exists in the git repository because I receive errors when I try to clone it.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"cups-1.7.3-snmp.patch":

diff -rupN cups-1.7.3/backend/ipp.c cups-1.7.3-snmpfix/backend/ipp.c
--- cups-1.7.3/backend/ipp.c 2014-05-22 15:59:21.000000000 +0200
+++ cups-1.7.3-snmpfix/backend/ipp.c 2014-05-30 16:37:43.127973343 +0200
@@ -528,8 +528,8 @@ main(int argc, /* I - Number of comm
*/

      snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
  •                    _cups_strcasecmp(value, "yes") ||
    
  •                    _cups_strcasecmp(value, "true");
    
  •                    !_cups_strcasecmp(value, "yes") ||
    
  •                    !_cups_strcasecmp(value, "true");
    

    }
    else if (!_cups_strcasecmp(name, "version"))
    {
    diff -rupN cups-1.7.3/backend/lpd.c cups-1.7.3-snmpfix/backend/lpd.c
    --- cups-1.7.3/backend/lpd.c 2013-05-29 13:51:34.000000000 +0200
    +++ cups-1.7.3-snmpfix/backend/lpd.c 2014-05-30 16:37:32.317973181 +0200
    @@ -393,8 +393,8 @@ main(int argc, /* I - Number of comm
    */

      snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
    
  •                    _cups_strcasecmp(value, "yes") ||
    
  •                    _cups_strcasecmp(value, "true");
    
  •                    !_cups_strcasecmp(value, "yes") ||
    
  •                    !_cups_strcasecmp(value, "true");
    

    }
    else if (!_cups_strcasecmp(name, "timeout"))
    {
    diff -rupN cups-1.7.3/backend/socket.c cups-1.7.3-snmpfix/backend/socket.c
    --- cups-1.7.3/backend/socket.c 2013-05-29 13:51:34.000000000 +0200
    +++ cups-1.7.3-snmpfix/backend/socket.c 2014-05-30 16:37:56.687973546 +0200
    @@ -250,8 +250,8 @@ main(int argc, /* I - Number of comm
    */

      snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
    
  •                    _cups_strcasecmp(value, "yes") ||
    
  •                    _cups_strcasecmp(value, "true");
    
  •                    !_cups_strcasecmp(value, "yes") ||
    
  •                    !_cups_strcasecmp(value, "true");
    

    }
    else if (!_cups_strcasecmp(name, "contimeout"))
    {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant