*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/* check whether the response is right */
res = authhash(c->nonce, sizeof c->nonce, password,
config->authorization_algorithm);
/* check whether the response is right */
res = authhash(c->nonce, sizeof c->nonce, password,
config->authorization_algorithm);
revoke_cookie(c->cookie);
sink_writes(ev_writer_sink(c->w), "250 OK\n");
} else
revoke_cookie(c->cookie);
sink_writes(ev_writer_sink(c->w), "250 OK\n");
} else
if(!config->remote_userman && !(c->rights & RIGHT__LOCAL)) {
disorder_error(0, "S%x: remote adduser", c->tag);
if(!config->remote_userman && !(c->rights & RIGHT__LOCAL)) {
disorder_error(0, "S%x: remote adduser", c->tag);
if(!config->remote_userman && !(c->rights & RIGHT__LOCAL)) {
disorder_error(0, "S%x: remote deluser", c->tag);
if(!config->remote_userman && !(c->rights & RIGHT__LOCAL)) {
disorder_error(0, "S%x: remote deluser", c->tag);
if(!config->remote_userman && !(c->rights & RIGHT__LOCAL)) {
disorder_error(0, "S%x: remote edituser", c->tag);
if(!config->remote_userman && !(c->rights & RIGHT__LOCAL)) {
disorder_error(0, "S%x: remote edituser", c->tag);
&& !(c->rights & RIGHT__LOCAL)
&& strcmp(vec[1], "rights")) {
disorder_error(0, "S%x: remote userinfo %s %s", c->tag, vec[0], vec[1]);
&& !(c->rights & RIGHT__LOCAL)
&& strcmp(vec[1], "rights")) {
disorder_error(0, "S%x: remote userinfo %s %s", c->tag, vec[0], vec[1]);
}
user = xstrndup(vec[0], sep - vec[0]);
if(trackdb_confirm(user, vec[0], &rights))
}
user = xstrndup(vec[0], sep - vec[0]);
if(trackdb_confirm(user, vec[0], &rights))
const char *who = kvp_get(actiondata, "who");
if(!who || !c->who || strcmp(who, c->who)) {
const char *who = kvp_get(actiondata, "who");
if(!who || !c->who || strcmp(who, c->who)) {
int server_start(ev_source *ev, int pf,
size_t socklen, const struct sockaddr *sa,
int server_start(ev_source *ev, int pf,
size_t socklen, const struct sockaddr *sa,
- D(("server_init socket %s", name));
+ D(("server_init socket %s privileged=%d", name, privileged));
+ /* Sanity check */
+ if(privileged && pf != AF_UNIX)
+ disorder_fatal(0, "cannot create a privileged listener on a non-local port");
fd = xsocket(pf, SOCK_STREAM, 0);
xsetsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof one);
if(bind(fd, sa, socklen) < 0) {
fd = xsocket(pf, SOCK_STREAM, 0);
xsetsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof one);
if(bind(fd, sa, socklen) < 0) {
if(ev_listen(ev, fd, listen_callback, l, "server listener"))
exit(EXIT_FAILURE);
disorder_info("listening on %s", name);
if(ev_listen(ev, fd, listen_callback, l, "server listener"))
exit(EXIT_FAILURE);
disorder_info("listening on %s", name);