authproc: pad leading 0 for localhost IP's

This avoids misparsing by rb's helper stuff..
This commit is contained in:
Elizabeth Myers 2016-04-02 19:28:19 -05:00
parent 839f2fa23e
commit d9364d2913

View file

@ -582,7 +582,15 @@ ident_check_enable(bool enabled)
void
create_opm_listener(const char *ip, uint16_t port)
{
rb_helper_write(authd_helper, "O opm_listener %s %hu", ip, port);
char ipbuf[HOSTIPLEN];
rb_strlcpy(ipbuf, ip, sizeof(ipbuf));
if(ipbuf[0] == ':')
{
memmove(ipbuf + 1, ipbuf, sizeof(ipbuf) - 1);
ipbuf[0] = '0';
}
rb_helper_write(authd_helper, "O opm_listener %s %hu", ipbuf, port);
}
/* Disable all OPM scans */