Taken from: https://bugzilla.andrew.cmu.edu/cgi-bin/cvsweb.cgi/src/cyrus/imtest/imtest.c.diff?r1=1.107&r2=1.108 Bump PKGREVISION. Reported by Jukka Salmi in PR 35959.
38 lines
860 B
Text
38 lines
860 B
Text
$NetBSD: patch-al,v 1.3 2007/03/09 14:46:08 obache Exp $
|
|
|
|
--- imtest/imtest.c.orig 2006-01-21 05:31:23.000000000 +0900
|
|
+++ imtest/imtest.c
|
|
@@ -47,7 +47,9 @@
|
|
#include <sys/time.h>
|
|
#include <sys/types.h>
|
|
#include <sys/ipc.h>
|
|
+#if !defined(__APPLE__)
|
|
#include <sys/msg.h>
|
|
+#endif
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
|
|
@@ -72,6 +74,10 @@
|
|
#include <netinet/in.h>
|
|
#include <netdb.h>
|
|
|
|
+#ifdef HAVE_SYS_PARAM_H
|
|
+#include <sys/param.h>
|
|
+#endif
|
|
+
|
|
#include <sasl/sasl.h>
|
|
#include <sasl/saslutil.h>
|
|
|
|
@@ -886,6 +892,12 @@ imt_stat getauthline(struct sasl_cmd_t *
|
|
}
|
|
|
|
if (*str != '\r') {
|
|
+ /* trim CRLF */
|
|
+ char *p = str + strlen(str) - 1;
|
|
+ if (p >= str && *p == '\n') *p-- = '\0';
|
|
+ if (p >= str && *p == '\r') *p-- = '\0';
|
|
+
|
|
+ /* alloc space for decoded response */
|
|
len = strlen(str) + 1;
|
|
*line = malloc(len);
|
|
if ((*line) == NULL) {
|