diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2015-02-09 17:59:53 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2015-02-09 19:09:50 +0000 |
commit | 93a6fce2ebf117f490d7ee11f066f75280d32386 (patch) | |
tree | e9df98a846c7114bae65e4e7b962c8fbdf0fc76f /src | |
parent | 8a512ed5b7f75c8aaedbca887257ee01e5c2b621 (diff) |
tidying
Diffstat (limited to 'src')
-rw-r--r-- | src/src/acl.c | 2 | ||||
-rw-r--r-- | src/src/auths/call_pam.c | 4 | ||||
-rw-r--r-- | src/src/auths/call_pwcheck.c | 4 | ||||
-rw-r--r-- | src/src/auths/cyrus_sasl.c | 4 | ||||
-rw-r--r-- | src/src/deliver.c | 2 | ||||
-rw-r--r-- | src/src/expand.c | 6 | ||||
-rw-r--r-- | src/src/functions.h | 10 | ||||
-rw-r--r-- | src/src/malware.c | 24 | ||||
-rw-r--r-- | src/src/readconf.c | 2 | ||||
-rw-r--r-- | src/src/retry.c | 1 | ||||
-rw-r--r-- | src/src/string.c | 11 | ||||
-rw-r--r-- | src/src/tls-openssl.c | 6 |
12 files changed, 38 insertions, 38 deletions
diff --git a/src/src/acl.c b/src/src/acl.c index 0f1d49711..69db5cda7 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -3372,7 +3372,7 @@ for (; cb != NULL; cb = cb->next) /* Too hard to think about for now. We might in future cutthrough the case where both sides handle prdr and this-node prdr acl is "accept" */ - *log_msgptr = string_sprintf(US"PRDR on %s reception\n", arg); + *log_msgptr = string_sprintf("PRDR on %s reception\n", arg); else { if (deliver_freeze) diff --git a/src/src/auths/call_pam.c b/src/src/auths/call_pam.c index 710de7ded..0ce5871df 100644 --- a/src/src/auths/call_pam.c +++ b/src/src/auths/call_pam.c @@ -36,7 +36,7 @@ data pointer passed to the conversation function. However, I was unable to get this to work on Solaris 2.6, so static variables are used instead. */ static int pam_conv_had_error; -static uschar *pam_args; +static const uschar *pam_args; static BOOL pam_arg_ended; @@ -129,7 +129,7 @@ Returns: OK if authentication succeeded */ int -auth_call_pam(uschar *s, uschar **errptr) +auth_call_pam(const uschar *s, uschar **errptr) { pam_handle_t *pamh = NULL; struct pam_conv pamc; diff --git a/src/src/auths/call_pwcheck.c b/src/src/auths/call_pwcheck.c index a4567c1a9..88fccceff 100644 --- a/src/src/auths/call_pwcheck.c +++ b/src/src/auths/call_pwcheck.c @@ -88,8 +88,8 @@ Returns: OK if authentication succeeded */ int -auth_call_saslauthd(uschar *username, uschar *password, uschar *service, - uschar *realm, uschar **errptr) +auth_call_saslauthd(const uschar *username, const uschar *password, + const uschar *service, const uschar *realm, uschar **errptr) { uschar *reply = NULL; diff --git a/src/src/auths/cyrus_sasl.c b/src/src/auths/cyrus_sasl.c index c7fb59348..ef13db9e7 100644 --- a/src/src/auths/cyrus_sasl.c +++ b/src/src/auths/cyrus_sasl.c @@ -97,7 +97,7 @@ auth_cyrus_sasl_init(auth_instance *ablock) { auth_cyrus_sasl_options_block *ob = (auth_cyrus_sasl_options_block *)(ablock->options_block); -uschar *list, *listptr, *buffer; +const uschar *list, *listptr, *buffer; int rc, i; unsigned int len; uschar *rs_point, *expanded_hostname; @@ -146,7 +146,7 @@ if( rc != SASL_OK ) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_FOR, "%s authenticator: " "couldn't initialise Cyrus SASL server connection.", ablock->name); -rc=sasl_listmech(conn, NULL, "", ":", "", (const char **)(&list), &len, &i); +rc=sasl_listmech(conn, NULL, "", ":", "", (const char **)&list, &len, &i); if( rc != SASL_OK ) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_FOR, "%s authenticator: " "couldn't get Cyrus SASL mechanism list.", ablock->name); diff --git a/src/src/deliver.c b/src/src/deliver.c index 7ec94edd7..ec13ca40b 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -3231,7 +3231,7 @@ while (!done) case 'I': if (*ptr) sending_ip_address = string_copy(ptr); while (*ptr++) ; - if (*ptr) sending_port = atoi(ptr); + if (*ptr) sending_port = atoi(CS ptr); while (*ptr++) ; break; diff --git a/src/src/expand.c b/src/src/expand.c index 1f0c5cb3c..145b827dc 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -2026,15 +2026,15 @@ static int eval_acl(uschar ** sub, int nsub, uschar ** user_msgp) { int i; -uschar * tmp = NULL; int sav_narg = acl_narg; int ret; +uschar * dummy_logmsg; extern int acl_where; if(--nsub > sizeof(acl_arg)/sizeof(*acl_arg)) nsub = sizeof(acl_arg)/sizeof(*acl_arg); for (i = 0; i < nsub && sub[i+1]; i++) { - tmp = acl_arg[i]; + uschar * tmp = acl_arg[i]; acl_arg[i] = sub[i+1]; /* place callers args in the globals */ sub[i+1] = tmp; /* stash the old args using our caller's storage */ } @@ -2051,7 +2051,7 @@ DEBUG(D_expand) acl_narg>0 ? acl_arg[0] : US"<none>", acl_narg>1 ? " +more" : ""); -ret = acl_eval(acl_where, sub[0], user_msgp, &tmp); +ret = acl_eval(acl_where, sub[0], user_msgp, &dummy_logmsg); for (i = 0; i < nsub; i++) acl_arg[i] = sub[i+1]; /* restore old args */ diff --git a/src/src/functions.h b/src/src/functions.h index 95720c095..bb3f3f46b 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -88,9 +88,9 @@ extern uschar *auth_b64encode(uschar *, int); extern int auth_b64decode(uschar *, uschar **); extern int auth_call_pam(uschar *, uschar **); extern int auth_call_pwcheck(uschar *, uschar **); -extern int auth_call_radius(uschar *, uschar **); -extern int auth_call_saslauthd(uschar *, uschar *, uschar *, uschar *, - uschar **); +extern int auth_call_radius(const uschar *, uschar **); +extern int auth_call_saslauthd(const uschar *, const uschar *, + const uschar *, const uschar *, uschar **); extern int auth_check_serv_cond(auth_instance *); extern int auth_check_some_cond(auth_instance *, uschar *, uschar *, int); @@ -169,8 +169,8 @@ extern int exp_bool(address_item *addr, uschar *mtype, uschar *mname, unsigned dgb_opt, uschar *oname, BOOL bvalue, uschar *svalue, BOOL *rvalue); extern BOOL expand_check_condition(uschar *, uschar *, uschar *); -extern uschar *expand_string(uschar *); -extern const uschar *expand_cstring(const uschar *); +extern uschar *expand_string(uschar *); /* public, cannot make const */ +extern const uschar *expand_cstring(const uschar *); /* ... so use this one */ extern uschar *expand_string_copy(const uschar *); extern int_eximarith_t expand_string_integer(uschar *, BOOL); extern void modify_variable(uschar *, void *); diff --git a/src/src/malware.c b/src/src/malware.c index c13e70616..9e71afc9b 100644 --- a/src/src/malware.c +++ b/src/src/malware.c @@ -382,7 +382,6 @@ uschar * s; cd->retry = 0; while ((s = string_nextinlist(&optstr, subsep, NULL, 0))) - { if (Ustrncmp(s, "retry=", 6) == 0) { int sec = readconf_readtime((s += 6), '\0', FALSE); @@ -392,7 +391,7 @@ while ((s = string_nextinlist(&optstr, subsep, NULL, 0))) } else return FAIL; - } +return OK; } /************************************************* @@ -887,7 +886,7 @@ if (!malware_ok) string_sprintf("unable to read result (%s)", strerror(errno)), sock); - for (p[bread] = '\0'; q = strchr(p, '\n'); p = q+1) + for (p[bread] = '\0'; q = Ustrchr(p, '\n'); p = q+1) { *q = '\0'; @@ -1098,17 +1097,16 @@ if (!malware_ok) sizeof(linebuffer), tmo))) { if (rcnt < 0) + { + int err = errno; if (rcnt == -1) break; - else - { - int err = errno; - (void) pclose(scanner_out); - signal(SIGCHLD,eximsigchld); signal(SIGPIPE,eximsigpipe); - return m_errlog_defer(scanent, string_sprintf( - "unable to read from scanner (%s): %s", - commandline, strerror(err))); - } + (void) pclose(scanner_out); + signal(SIGCHLD,eximsigchld); signal(SIGPIPE,eximsigpipe); + return m_errlog_defer(scanent, string_sprintf( + "unable to read from scanner (%s): %s", + commandline, strerror(err))); + } if (Ustrlen(linebuffer) > fwrite(linebuffer, 1, Ustrlen(linebuffer), scanner_record)) { @@ -1297,7 +1295,7 @@ if (!malware_ok) string_sprintf("missing port: '%s'", scanner_options)); continue; } - cd->tcp_port = atoi(s); + cd->tcp_port = atoi(CS s); /* parse options */ /*XXX should these options be common over scanner types? */ diff --git a/src/src/readconf.c b/src/src/readconf.c index debe31988..31e04e97e 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -1359,8 +1359,6 @@ return yield; static void fn_smtp_receive_timeout(const uschar * name, const uschar * str) { -int value; - if (*str == '$') smtp_receive_timeout_s = string_copy(str); else diff --git a/src/src/retry.c b/src/src/retry.c index 0b3ed5941..62677c1ca 100644 --- a/src/src/retry.c +++ b/src/src/retry.c @@ -346,7 +346,6 @@ retry_config * retry_find_config(const uschar *key, const uschar *alternate, int basic_errno, int more_errno) { -int replace = 0; const uschar *colon = Ustrchr(key, ':'); retry_config *yield; diff --git a/src/src/string.c b/src/src/string.c index 76e47f418..e169a9f05 100644 --- a/src/src/string.c +++ b/src/src/string.c @@ -1013,12 +1013,17 @@ return new; static const uschar * Ustrnchr(const uschar * s, int c, unsigned * len) { -while (*len) +unsigned siz = *len; +while (siz) { if (!*s) return NULL; - if (*s == c) return s; + if (*s == c) + { + *len = siz; + return s; + } s++; - *len--; + siz--; } return NULL; } diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index eb3dd23d6..ee16bdc9e 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -384,7 +384,7 @@ else { if (rc < 0) { - log_write(0, LOG_MAIN, "[%s] SSL verify error: internal error\n", + log_write(0, LOG_MAIN, "[%s] SSL verify error: internal error", tlsp == &tls_out ? deliver_host_address : sender_host_address); name = NULL; } @@ -393,7 +393,7 @@ else if (!name) { log_write(0, LOG_MAIN, - "[%s] SSL verify error: certificate name mismatch: \"%s\"\n", + "[%s] SSL verify error: certificate name mismatch: \"%s\"", tlsp == &tls_out ? deliver_host_address : sender_host_address, txt); *calledp = TRUE; @@ -407,7 +407,7 @@ else if (!tls_is_name_for_cert(verify_cert_hostnames, cert)) { log_write(0, LOG_MAIN, - "[%s] SSL verify error: certificate name mismatch: \"%s\"\n", + "[%s] SSL verify error: certificate name mismatch: \"%s\"", tlsp == &tls_out ? deliver_host_address : sender_host_address, txt); *calledp = TRUE; |