st3fan / dovecot-xaps-plugin

MIT License
90 stars 23 forks source link

Build on Debian Stretch #42

Closed Jc2k closed 5 years ago

Jc2k commented 6 years ago

According to README, Dovecot > 2.2.19 is still supported on master but it doesn't build on stretch (which has 2.2.27).

There are 3 problems AFAICT:

With those changes in place the build completes - will report back on if they actually work.

(This is probably related to #41).

Jc2k commented 6 years ago

This is the patch i'm testing:

diff --git a/xaps-daemon.c b/xaps-daemon.c
index 49efa20..10ceef1 100644
--- a/xaps-daemon.c
+++ b/xaps-daemon.c
@@ -26,7 +26,7 @@
 #include <config.h>
 #include <lib.h>
 #include <net.h>
-#if (DOVECOT_VERSION_MAJOR >= 2u || DOVECOT_VERSION_MINOR >= 3u)
+#if (DOVECOT_VERSION_MAJOR > 2u || (DOVECOT_VERSION_MAJOR == 2 && DOVECOT_VERSION_MINOR >= 31u))
 #include <ostream-unix.h>
 #include <ostream.h>
 #endif
@@ -39,6 +39,7 @@

 #include "xaps-daemon.h"

+const char *str_nescape(const void *str, size_t len);

 /*
  * Send the request to our daemon over a unix domain socket. The
@@ -208,7 +209,7 @@ const char *str_nescape(const void *str, size_t len)

     /* quote */
     ret = t_str_new((size_t)(p - s) + 128);
-    str_append_max(ret, s, (size_t)(p - s));
+    str_append_data(ret, s, (size_t)(p - s));

     for (; (size_t)(p - s) < len; p++) {
         if (IS_ESCAPED_CHAR(*p))
@@ -216,4 +217,4 @@ const char *str_nescape(const void *str, size_t len)
         str_append_data(ret, p, 1);
     }
     return str_c(ret);
-}
\ No newline at end of file
+}
freswa commented 6 years ago

Thx, I am already looking into this. You are right that the version match is wrong.

Thank you for pointing out the str_append_max problem. I'll look into that one too.

Cheers