A follow up...

openldap needs libsasl7-dev to compile, that package wasn't in the
Debian archive so I had to patch it too. Here is the patch.

Igor


diff -ur cyrus-sasl-1.5.24/include/saslplug.h 
cyrus-sasl-1.5.24.new/include/saslplug.h
--- cyrus-sasl-1.5.24/include/saslplug.h        Sun Feb 27 17:39:02 2000
+++ cyrus-sasl-1.5.24.new/include/saslplug.h    Mon Oct 30 03:17:20 2000
@@ -116,7 +116,7 @@
               int priority,
               const char *plugin_name,
               int sasl_error,  /* %z */
-              int errno,       /* %m */
+              int errn,        /* %m */
               const char *format,
               ...);
 } sasl_utils_t;
diff -ur cyrus-sasl-1.5.24/lib/common.c cyrus-sasl-1.5.24.new/lib/common.c
--- cyrus-sasl-1.5.24/lib/common.c      Mon Jul 17 13:21:02 2000
+++ cyrus-sasl-1.5.24.new/lib/common.c  Mon Oct 30 03:14:09 2000
@@ -245,11 +245,25 @@
   conn->global_callbacks = global_callbacks;
 
   if (serverFQDN==NULL) {
+#ifdef MAXHOSTNAMELEN
     char name[MAXHOSTNAMELEN];
     memset(name, 0, sizeof(name));
     gethostname(name, MAXHOSTNAMELEN);
+#else
+    char *name = NULL;
+    size_t name_len = 0;
+    do {
+      name_len += 64;
+      name = sasl_REALLOC(name, name_len);
+                       if (!name) return SASL_NOMEM;
+      gethostname(name, name_len);
+    } while (errno == ENAMETOOLONG);
+#endif
 
     result = _sasl_strdup(name, &conn->serverFQDN, NULL);
+#ifndef MAXHOSTNAMELEN
+    free(name);
+#endif
     if (result != SASL_OK)
       goto cleanup_mutex;
   } else {
@@ -843,7 +857,7 @@
           int priority,
           const char *plugin_name,
           int sasl_error,      /* %z */
-          int errno,   /* %m */
+          int errn,    /* %m */
           const char *format,
           ...)
 {
@@ -924,9 +938,9 @@
            done=1;
            break;
 
-         case 'm': /* insert the errno string */
+         case 'm': /* insert the errn string */
            result = add_string(&out, &alloclen, &outlen,
-                               strerror(errno));
+                               strerror(errn));
            if (result != SASL_OK)
              return result;
            done=1;

Reply via email to