X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fpopsbr.c;h=fb66a93b6336b0c8921b43e456fca5ac48d75686;hb=8e79ce1919d9cf54f101a812e0fd70a33286b9f3;hp=feb7aa0df429ce30b84e4941f5e5457ee63a849c;hpb=4eaf25e2a1d634b6f7bfa01a96e6e86768837e9b;p=mmh diff --git a/uip/popsbr.c b/uip/popsbr.c old mode 100644 new mode 100755 index feb7aa0..fb66a93 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -12,6 +12,13 @@ #ifdef CYRUS_SASL # include # include +# if SASL_VERSION_FULL < 0x020125 + /* Cyrus SASL 2.1.25 introduced the sasl_callback_ft prototype, + which has an explicit void parameter list, according to best + practice. So we need to cast to avoid compile warnings. + Provide this prototype for earlier versions. */ + typedef int (*sasl_callback_ft)(); +# endif /* SASL_VERSION_FULL < 0x020125 */ #endif /* CYRUS_SASL */ #include @@ -43,9 +50,9 @@ struct pass_context { }; static sasl_callback_t callbacks[] = { - { SASL_CB_USER, sasl_get_user, NULL }, + { SASL_CB_USER, (sasl_callback_ft) sasl_get_user, NULL }, #define POP_SASL_CB_N_USER 0 - { SASL_CB_PASS, sasl_get_pass, NULL }, + { SASL_CB_PASS, (sasl_callback_ft) sasl_get_pass, NULL }, #define POP_SASL_CB_N_PASS 1 { SASL_CB_LOG, NULL, NULL }, { SASL_CB_LIST_END, NULL, NULL }, @@ -343,12 +350,12 @@ sasl_get_user(void *context, int id, const char **result, unsigned *len) static int sasl_get_pass(sasl_conn_t *conn, void *context, int id, sasl_secret_t **psecret) { - NMH_UNUSED (conn); - struct pass_context *p_context = (struct pass_context *) context; char *pass = NULL; int len; + NMH_UNUSED (conn); + if (! psecret || id != SASL_CB_PASS) return SASL_BADPARAM; @@ -418,14 +425,13 @@ int pop_init (char *host, char *port, char *user, char *pass, char *proxy, int snoop, int sasl, char *mech) { + int fd1, fd2; + char buffer[BUFSIZ]; #ifndef CYRUS_SASL NMH_UNUSED (sasl); NMH_UNUSED (mech); #endif /* ! CYRUS_SASL */ - int fd1, fd2; - char buffer[BUFSIZ]; - if (proxy && *proxy) { int pid; int inpipe[2]; /* for reading from the server */