rpms/cups/F-11 cups-socket-snmp.patch, NONE, 1.1 cups.spec, 1.490, 1.491

Tim Waugh twaugh at fedoraproject.org
Tue Jul 28 16:58:02 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/cups/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12999

Modified Files:
	cups.spec 
Added Files:
	cups-socket-snmp.patch 
Log Message:
* Tue Jul 28 2009 Tim Waugh <twaugh at redhat.com> 1:1.4-0.rc1.11
- Temporarily added snmp option to socket backend for debugging purposes.


cups-socket-snmp.patch:
 socket.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

--- NEW FILE cups-socket-snmp.patch ---
diff -up cups-1.4rc1/backend/socket.c.socket-snmp cups-1.4rc1/backend/socket.c
--- cups-1.4rc1/backend/socket.c.socket-snmp	2009-03-03 20:29:23.000000000 +0000
+++ cups-1.4rc1/backend/socket.c	2009-07-28 17:50:02.770752676 +0100
@@ -78,6 +78,7 @@ main(int  argc,				/* I - Number of comm
   int		recoverable;		/* Recoverable error shown? */
   int		contimeout;		/* Connection timeout */
   int		waiteof;		/* Wait for end-of-file? */
+  int		use_snmp;		/* Whether to use SNMP */
   int		port;			/* Port number */
   char		portname[255];		/* Port name */
   int		delay;			/* Delay for retries... */
@@ -182,6 +183,7 @@ main(int  argc,				/* I - Number of comm
 
   waiteof    = 1;
   contimeout = 7 * 24 * 60 * 60;
+  use_snmp   = 1;
 
   if ((options = strchr(resource, '?')) != NULL)
   {
@@ -249,6 +251,15 @@ main(int  argc,				/* I - Number of comm
 	if (atoi(value) > 0)
 	  contimeout = atoi(value);
       }
+      else if (!strcasecmp(name, "snmp"))
+      {
+       /*
+	* Set whether SNMP is allowed...
+	*/
+
+	use_snmp = (!value[0] || !strcasecmp(value, "on") ||
+		    !strcasecmp(value, "yes") || !strcasecmp(value, "true"));
+      }
     }
   }
 
@@ -373,13 +384,16 @@ main(int  argc,				/* I - Number of comm
   * See if the printer supports SNMP...
   */
 
-  if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
+  if (use_snmp && (snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
   {
     have_supplies = !backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count,
                                          NULL);
   }
   else
+  {
     have_supplies = start_count = 0;
+    snmp_fd = -1;
+  }
 
  /*
   * Print everything...


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/F-11/cups.spec,v
retrieving revision 1.490
retrieving revision 1.491
diff -u -p -r1.490 -r1.491
--- cups.spec	28 Jul 2009 12:21:44 -0000	1.490
+++ cups.spec	28 Jul 2009 16:58:02 -0000	1.491
@@ -58,7 +58,8 @@ Patch31: cups-str3254.patch
 Patch32: cups-str3253.patch
 Patch33: cups-str3266.patch
 Patch34: cups-str3262.patch
-Patch35: cups-avahi.patch
+Patch35: cups-socket-snmp.patch
+Patch36: cups-avahi.patch
 Patch100: cups-lspp.patch
 Epoch: 1
 Url: http://www.cups.org/
@@ -214,7 +215,8 @@ module. 
 %patch32 -p1 -b .str3253
 %patch33 -p1 -b .str3266
 %patch34 -p1 -b .str3262
-#%patch35 -p1 -b .avahi
+%patch35 -p1 -b .socket-snmp
+#%patch36 -p1 -b .avahi
 
 %if %lspp
 %patch100 -p1 -b .lspp
@@ -508,6 +510,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %changelog
 * Tue Jul 28 2009 Tim Waugh <twaugh at redhat.com> 1:1.4-0.rc1.11
+- Temporarily added snmp option to socket backend for debugging purposes.
 - Prevent ipp backend looping with bad IPP devices (bug #476424,
   STR #3262).
 - Fixed Device ID reporting in the usb backend (STR #3266).




More information about the scm-commits mailing list