summaryrefslogtreecommitdiffstats
path: root/tdeprint
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2024-04-12 01:58:30 +0200
committerSlávek Banko <slavek.banko@axis.cz>2024-04-12 23:09:51 +0200
commitcfbeb5efe9335d9a47bd5beebd81304cabab9f61 (patch)
tree0bc0355545e3138c9e6214610495fee548ed06ce /tdeprint
parent9f72914c1d93167b7c36b08bafa660a42e33e681 (diff)
downloadtdelibs-cfbeb5efe9335d9a47bd5beebd81304cabab9f61.tar.gz
tdelibs-cfbeb5efe9335d9a47bd5beebd81304cabab9f61.zip
tdeprint: Use 'httpGetAddress' for 'httpAddrLocalhost' on cups >= 2.0.
This relates to issue #268. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdeprint')
-rw-r--r--tdeprint/cups/cupsdconf2/cups-util.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/tdeprint/cups/cupsdconf2/cups-util.c b/tdeprint/cups/cupsdconf2/cups-util.c
index e3039ea94..907459c65 100644
--- a/tdeprint/cups/cupsdconf2/cups-util.c
+++ b/tdeprint/cups/cupsdconf2/cups-util.c
@@ -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,