tdeprint: Use 'httpGetAddress' for 'httpAddrLocalhost' on cups >= 2.0.

This relates to issue #268.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/269/head
Slávek Banko 1 month ago
parent 9f72914c1d
commit cfbeb5efe9
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -513,13 +513,23 @@ cups_local_auth(http_t *http) /* I - Connection */
* See if we are accessing localhost... * See if we are accessing localhost...
the struct has changed in newer versions - PiggZ (adam@piggz.co.uk) the struct has changed in newer versions - PiggZ (adam@piggz.co.uk)
*/ */
#if CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2) #if (CUPS_VERSION_MAJOR >= 2)
if (!httpAddrLocalhost(http)) if (!httpAddrLocalhost(httpGetAddress(http)))
{
return (0);
}
#elif CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2)
if (!httpAddrLocalhost(http))
{
return (0);
}
#else #else
if (ntohl(*(int*)&http->hostaddr.sin_addr) != 0x7f000001 && if (ntohl(*(int*)&http->hostaddr.sin_addr) != 0x7f000001 &&
strcasecmp(http->hostname, "localhost") != 0) strcasecmp(http->hostname, "localhost") != 0)
{
return (0);
}
#endif #endif
return (0);
/* /*
* Try opening a certificate file for this PID. If that fails, * Try opening a certificate file for this PID. If that fails,

Loading…
Cancel
Save