authd: fix API boo boo

This commit is contained in:
Elizabeth Myers 2016-04-01 02:56:03 -05:00
parent 6da256dc93
commit 34f16c467d
2 changed files with 3 additions and 15 deletions

View file

@ -56,6 +56,6 @@ void del_blacklist(const char *host);
void del_blacklist_all(void);
bool set_authd_timeout(const char *key, int timeout);
void ident_check_enable(bool enabled);
bool create_opm_listener(struct rb_sockaddr_storage *addr);
bool create_opm_listener(const char *ip, uint16_t port);
#endif

View file

@ -564,20 +564,8 @@ ident_check_enable(bool enabled)
/* Create an OPM listener */
bool
create_opm_listener(struct rb_sockaddr_storage *addr)
create_opm_listener(const char *ip, uint16_t port)
{
char addrbuf[HOSTIPLEN];
if(!rb_inet_ntop_sock((struct sockaddr *)addr, addrbuf, sizeof(addrbuf)))
return false;
if(addrbuf[0] == ':')
{
/* Reformat for authd sending */
memmove(addrbuf + 1, addrbuf, sizeof(addrbuf) - 1);
addrbuf[0] = '0';
}
rb_helper_write(authd_helper, "O opm_listener %s %hu", addrbuf, ntohs(GET_SS_PORT(addr)));
rb_helper_write(authd_helper, "O opm_listener %s %hu", ip, port);
return true;
}