authd: minor cleanups

This commit is contained in:
Elizabeth Myers 2016-04-02 04:51:11 -05:00
parent ae0a058544
commit 6d0fafec99
2 changed files with 4 additions and 23 deletions

View file

@ -50,7 +50,6 @@ void authd_initiate_client(struct Client *);
void authd_accept_client(struct Client *client_p, const char *ident, const char *host); void authd_accept_client(struct Client *client_p, const char *ident, const char *host);
void authd_reject_client(struct Client *client_p, const char *ident, const char *host, char cause, const char *data, const char *reason); void authd_reject_client(struct Client *client_p, const char *ident, const char *host, char cause, const char *data, const char *reason);
void authd_abort_client(struct Client *); void authd_abort_client(struct Client *);
const char *get_provider_string(char cause);
void add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters); void add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters);
void del_blacklist(const char *host); void del_blacklist(const char *host);

View file

@ -182,7 +182,7 @@ static void
cmd_accept_client(int parc, char **parv) cmd_accept_client(int parc, char **parv)
{ {
struct Client *client_p; struct Client *client_p;
/* cid to uid (retrieve and delete) */ /* cid to uid (retrieve and delete) */
if((client_p = str_cid_to_client(parv[1], true)) == NULL) if((client_p = str_cid_to_client(parv[1], true)) == NULL)
return; return;
@ -273,15 +273,14 @@ parse_authd_reply(rb_helper * helper)
{ {
ssize_t len; ssize_t len;
int parc; int parc;
char authdBuf[READBUF_SIZE]; char buf[READBUF_SIZE];
char *parv[MAXPARA + 1]; char *parv[MAXPARA + 1];
while((len = rb_helper_read(helper, authdBuf, sizeof(authdBuf))) > 0) while((len = rb_helper_read(helper, buf, sizeof(buf))) > 0)
{ {
struct authd_cb *cmd; struct authd_cb *cmd;
parc = rb_string_to_array(authdBuf, parv, MAXPARA+1); parc = rb_string_to_array(buf, parv, MAXPARA+1);
cmd = &authd_cmd_tab[*parv[0]]; cmd = &authd_cmd_tab[*parv[0]];
if(cmd->fn != NULL) if(cmd->fn != NULL)
{ {
@ -495,23 +494,6 @@ timeout_dead_authd_clients(void *notused __unused)
} }
} }
/* Turn a cause char (who rejected us) into the name of the provider */
const char *
get_provider_string(char cause)
{
switch(cause)
{
case 'B':
return "Blacklist";
case 'D':
return "rDNS";
case 'I':
return "Ident";
default:
return "Unknown";
}
}
/* Send a new blacklist to authd */ /* Send a new blacklist to authd */
void void
add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters) add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters)