|| !(rvec = split(c->line + 4, &nrvec, SPLIT_QUOTES, 0, 0))
|| nrvec < 1) {
/* Banner told us to go away, or was malformed. We cannot proceed. */
- protocol_error(c, op, c->rc, "%s: %s", c->ident, c->line);
+ protocol_error(c, op, c->rc, "%s [%s]", c->line, c->ident);
disorder_eclient_close(c);
return;
}
challenge = *rvec++;
break;
default:
- protocol_error(c, op, c->rc, "%s: %s", c->ident, c->line);
+ protocol_error(c, op, c->rc, "%s [%s]", c->line, c->ident);
disorder_eclient_close(c);
return;
}
c->protocol = atoi(protocol);
if(c->protocol < 1 || c->protocol > 2) {
- protocol_error(c, op, c->rc, "%s: %s", c->ident, c->line);
+ protocol_error(c, op, c->rc, "%s [%s]", c->line, c->ident);
disorder_eclient_close(c);
return;
}
nonce = unhex(challenge, &nonce_len);
res = authhash(nonce, nonce_len, config->password, algorithm);
if(!res) {
- protocol_error(c, op, c->rc, "%s: unknown authentication algorithm '%s'",
- c->ident, algorithm);
+ protocol_error(c, op, c->rc, "unknown authentication algorithm '%s' [%s]",
+ algorithm, c->ident);
disorder_eclient_close(c);
return;
}
D(("authuser_opcallback"));
if(c->rc / 100 != 2) {
/* Wrong password or something. We cannot proceed. */
- protocol_error(c, op, c->rc, "%s: %s", c->ident, c->line);
+ protocol_error(c, op, c->rc, "%s [%s]", c->line, c->ident);
c->enabled = 0;
disorder_eclient_close(c);
return;
} else if(arg == disorder__body) {
body = va_arg(ap, char **);
nbody = va_arg(ap, int);
+ } else if(arg == disorder__integer) {
+ long n = va_arg(ap, long);
+ char buffer[16];
+ snprintf(buffer, sizeof buffer, "%ld", n);
+ vector_append(&vec, xstrdup(buffer));
+ } else if(arg == disorder__time) {
+ time_t n = va_arg(ap, time_t);
+ char buffer[16];
+ snprintf(buffer, sizeof buffer, "%lld", (long long)n);
+ vector_append(&vec, xstrdup(buffer));
} else
vector_append(&vec, arg);
}
static const char *errorstring(disorder_eclient *c) {
char *s;
- byte_xasprintf(&s, "%s: %s: %d", c->ident, c->line, c->rc);
+ byte_xasprintf(&s, "%s [%s]", c->line, c->ident);
return s;
}