Compare commits

...

2 Commits

Author SHA1 Message Date
Slávek Banko cfbeb5efe9
tdeprint: Use 'httpGetAddress' for 'httpAddrLocalhost' on cups >= 2.0.
4 weeks ago
Slávek Banko 9f72914c1d
tdeprint: Use 'const' for list of files to print.
4 weeks ago

@ -513,13 +513,23 @@ cups_local_auth(http_t *http) /* I - Connection */
* See if we are accessing localhost...
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 (!httpAddrLocalhost(http))
#if (CUPS_VERSION_MAJOR >= 2)
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
if (ntohl(*(int*)&http->hostaddr.sin_addr) != 0x7f000001 &&
strcasecmp(http->hostname, "localhost") != 0)
strcasecmp(http->hostname, "localhost") != 0)
{
return (0);
}
#endif
return (0);
/*
* Try opening a certificate file for this PID. If that fails,

@ -146,7 +146,7 @@ int main(int argc, char* argv[])
char *a;
cups_option_t *options = NULL;
int num_options = 0;
char* files[100] = {0};
const char* files[100] = {0};
int num_files = 0;
int jobID = 0;

Loading…
Cancel
Save