]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Don't automatically add "Address @LOCAL" line to snmp.conf since that prevents
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 5 Jul 2007 23:20:55 +0000 (23:20 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 5 Jul 2007 23:20:55 +0000 (23:20 +0000)
users from disabling the SNMP backend (STR #2434)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@6611 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
backend/snmp.c
conf/Makefile
conf/snmp.conf.in [new file with mode: 0644]
config-scripts/cups-defaults.m4
configure.in

index 87b207913e50a90a3904e4a70bfe05e71376ff1d..cc2e24773db4ce92aaa3a5aa13a5de9bedeb967b 100644 (file)
@@ -5,6 +5,9 @@ CHANGES IN CUPS V1.3
 
        - Documentation updates (STR #1775, STR #2130, STR #2131,
          STR #2263, STR #2356, STR #2397)
+       - The SNMP backend no longer adds a default Address line
+         when none is specified in the snmp.conf file; this allows
+         the backend to be easily disabled as needed (STR #2434)
        - Added a new cupsctl command for doing basic changes to
          the cupsd.conf file (STR #1777)
        - Added a new ppdLocalizeIPPReason() function to get the
index e4f6078f40c7bb1b583947eea069dc963f26b8ec..7b3c8b79c6cc0880c60f6fbb4599f9f61250e78f 100644 (file)
@@ -1826,8 +1826,14 @@ read_snmp_conf(const char *address)      /* I - Single address to probe */
 
   if (cupsArrayCount(Addresses) == 0)
   {
-    fputs("INFO: Using default SNMP Address @LOCAL\n", stderr);
-    add_array(Addresses, "@LOCAL");
+   /*
+    * If we have no addresses, exit immediately...
+    */
+
+    fprintf(stderr,
+            "DEBUG: No address specified and no Address line in %s...\n",
+           filename);
+    exit(0);
   }
 
   if (cupsArrayCount(Communities) == 0)
index af0ddbb5afdf80614073aa6dadcfc2951ddbecbe..20e4c0bbc8f3cf4ced133a97f25213b9c1f48f30 100644 (file)
@@ -28,7 +28,7 @@ include ../Makedefs
 # Config files...
 #
 
-KEEP   =       cupsd.conf
+KEEP   =       cupsd.conf snmp.conf
 REPLACE        =       mime.convs mime.types
 
 
diff --git a/conf/snmp.conf.in b/conf/snmp.conf.in
new file mode 100644 (file)
index 0000000..a85dbc7
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# "$Id$"
+#
+#   Sample SNMP configuration file for CUPS.  See "man smnp.conf" for a
+#   complete description of this file.
+#
+
+@CUPS_SNMP_ADDRESS@
+@CUPS_SNMP_COMMUNITY@
+
+#
+# End of "$Id$".
+#
index cf772880ffeba1f6c3d4c8b8d872fd76314b7906..3c1576bd5bf3c3313de43ed589f73b65423f3f0f 100644 (file)
@@ -309,6 +309,26 @@ else
 fi
 AC_SUBST(DEFAULT_RAW_PRINTING)
 
+dnl Default SNMP options...
+AC_ARG_WITH(snmp-address, [  --with-snmp-address     set SNMP query address, default=auto ],
+       if test "x$withval" = x; then
+               CUPS_SNMP_ADDRESS=""
+       else
+               CUPS_SNMP_ADDRESS="Address $withval"
+       fi,
+       if test "x$uname" = xDarwin; then
+               CUPS_SNMP_ADDRESS=""
+       else
+               CUPS_SNMP_ADDRESS="Address @LOCAL"
+       fi)
+
+AC_ARG_WITH(snmp-community, [  --with-snmp-community   set SNMP community, default=public ],
+       CUPS_SNMP_COMMUNITY="Community $withval",
+       CUPS_SNMP_COMMUNITY="Community public")
+
+AC_SUBST(CUPS_SNMP_ADDRESS)
+AC_SUBST(CUPS_SNMP_COMMUNITY)
+
 dnl
 dnl End of "$Id$".
 dnl
index cf57c27ee0537f646399a2c0d8e832193b9fdadd..ad735c4cb4f34c925a967bca35468ce5f4bd41da 100644 (file)
@@ -76,8 +76,8 @@ AC_SUBST(INSTALL_LANGUAGES)
 AC_SUBST(UNINSTALL_LANGUAGES)
 
 AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
-         conf/cupsd.conf conf/mime.convs conf/pam.std doc/index.html
-         doc/help/ref-cupsd-conf.html doc/help/standard.html
+         conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
+         doc/index.html doc/help/ref-cupsd-conf.html doc/help/standard.html
          man/client.conf.man man/cups-deviced.man man/cups-driverd.man
          man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
          man/cupsd.conf.man man/lpoptions.man