--- agent/mibgroup/mibII/system_mib.c.orig	Thu Dec 19 16:04:49 2002
+++ agent/mibgroup/mibII/system_mib.c	Sat Jan 27 16:08:38 2007
@@ -76,7 +76,7 @@
 extern oid version_id[];
 extern int version_id_len;
 
-static int sysContactSet = 0, sysLocationSet = 0, sysNameSet = 0;
+static int sysContactSet = 0, sysLocationSet = 0, sysNameSet = 0, sysDescrSet = 0;
 
 WriteMethod writeSystem;
 int header_system(struct variable *,oid *, size_t *, int, size_t *, WriteMethod **);
@@ -208,6 +208,45 @@
   } 
 }
 
+void system_parse_config_sysdescr(const char *token, char *cptr)
+{
+  char tmpbuf[1024];
+
+  if (strlen(cptr) >= sizeof(version_descr)) {
+      snprintf(tmpbuf, 1024,"sysdescr token too long (must be < %d):\n\t%s",
+	       sizeof(version_descr), cptr);
+      config_perror(tmpbuf);
+  }
+
+  if (strcmp(token, "psysdescr") == 0) {
+      if (sysDescrSet < 0) {
+	  /*  This is bogus (and shouldn't happen anyway) -- the sysDescr
+	      is already configured read-only.  */
+	  snmp_log(LOG_WARNING,
+		   "ignoring attempted override of read-only sysDescr.0\n");
+	  return;
+      } else {
+	  sysDescrSet++;
+      }
+  } else {
+       if (sysDescrSet > 0) {
+	  /*  This is bogus (and shouldn't happen anyway) -- we already read a
+	      persistent value of sysDescr, which we should ignore in favour
+	      of this one.  */
+	  snmp_log(LOG_WARNING,
+		   "ignoring attempted override of read-only sysDescr.0\n");
+	  /*  Fall through and copy in this value.  */
+      }     
+      sysDescrSet = -1;
+  }
+  
+  if (strcmp(cptr,"\"\"") == 0) {
+      version_descr[0] = '\0';
+  } else if (strlen(cptr) < sizeof(version_descr)) {
+      strcpy(version_descr,cptr);
+  } 
+}
+
 void system_parse_config_sysServices(const char *token, char *cptr)
 {
   sysServices = atoi(cptr);
@@ -257,6 +296,10 @@
       snprintf(line, SNMP_MAXBUF_SMALL, "psysname %s", sysName);
       snmpd_store_config(line);
   }
+  if (sysDescrSet > 0) {
+      snprintf(line, SNMP_MAXBUF_SMALL, "psysdescr %s", version_descr);
+      snmpd_store_config(line);
+  }
 
   return 0;
 }
@@ -331,6 +374,8 @@
                                 NULL,"contact-name");
   snmpd_register_config_handler("sysname", system_parse_config_sysname,
                                 NULL,"node-name");
+  snmpd_register_config_handler("sysdescr", system_parse_config_sysdescr,
+                                NULL,"system-description");
   snmpd_register_config_handler("psyslocation", system_parse_config_sysloc,
                                 NULL, NULL);
   snmpd_register_config_handler("psyscontact", system_parse_config_syscon,
--- snmplib/asn1.h.orig	Thu Aug 10 18:07:47 2000
+++ snmplib/asn1.h	Sun Nov 19 10:26:00 2006
@@ -1,6 +1,8 @@
 #ifndef ASN1_H
 #define ASN1_H

+#include <sys/types.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff -u -r config.h.in.orig config.h.in
--- config.h.in.orig    Thu Dec 19 16:04:42 2002
+++ config.h.in Mon Feb  5 14:56:24 2007
@@ -52,7 +52,8 @@
 /* debugging stuff */
 #undef SNMP_NO_DEBUGGING           /* if defined, we optimize the code
                                       to exclude all debugging calls. */
-#define SNMP_ALWAYS_DEBUG 0        /* Always print debugging information and
+#define SNMP_ALWAYS_DEBUG 0
+                                                          /* Always
print debugging information and
                                       ignore the -D flag passed to the cmds */

 /* reverse encoding BER packets is both faster and more efficient in space. */
