From 86048c14a070e3382577dd22519319bce77c70b9 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Wed, 21 Jan 2009 19:38:36 +0000 Subject: [PATCH] Fix warning in getaddrinfo() call. Add missing support for -port in whatnow. Make sure the SASL input buffer is allocated when using the sendmail mts. --- mts/smtp/smtp.c | 9 ++++++++- sbr/client.c | 2 +- uip/whatnowsbr.c | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 37a7b07..7af8d30 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -144,7 +144,7 @@ static char *EHLOset (char *); static int sm_fwrite(char *, int); static int sm_fputs(char *); static int sm_fputc(int); -static int sm_getc(void); +static int sm_fgetc(FILE *); static void sm_fflush(void); static int sm_fgets(char *, int, FILE *); @@ -326,6 +326,13 @@ sendmail_init (char *client, char *server, int watch, int verbose, client = "localhost"; #endif +#ifdef CYRUS_SASL + sasl_inbuffer = malloc(SASL_MAXRECVBUF); + if (!sasl_inbuffer) + return sm_ierror("Unable to allocate %d bytes for read buffer", + SASL_MAXRECVBUF); +#endif /* CYRUS_SASL */ + if (pipe (pdi) == NOTOK) return sm_ierror ("no pipes"); if (pipe (pdo) == NOTOK) { diff --git a/sbr/client.c b/sbr/client.c index 732fb47..a03809e 100644 --- a/sbr/client.c +++ b/sbr/client.c @@ -85,7 +85,7 @@ client (char *args, char *service, char *response, int len_response, int debug) char address[NI_MAXHOST]; rc = getnameinfo(ai->ai_addr, ai->ai_addrlen, address, - sizeof(address), NULL, NULL, NI_NUMERICHOST); + sizeof(address), NULL, 0, NI_NUMERICHOST); fprintf(stderr, "Connecting to %s...\n", rc ? "unknown" : address); diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 42e0d61..5fcba33 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -1229,6 +1229,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case SERVSW: case SASLMECHSW: case USERSW: + case PORTSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') { advise (NULL, "missing argument to %s", argp[-2]); -- 1.7.10.4