]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix logic error in cupsGetPPD3 - was not checking the hostname of the connection.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 12 Dec 2012 17:31:48 +0000 (17:31 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 12 Dec 2012 17:31:48 +0000 (17:31 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10750 7a7537e8-13f0-0310-91df-b6672ffda945

cups/util.c

index dac9c76976d77d38c66f1c7276f1ade88f8e5503..4bb82109aac1fb49d06530ae3f34e3438d6a6252 100644 (file)
@@ -948,10 +948,16 @@ cupsGetPPD3(http_t     *http,             /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
   * See if the PPD file is available locally...
   */
 
-  if (!cg->servername[0])
-    cupsServer();
+  if (http)
+    httpGetHostname(http, hostname, sizeof(hostname));
+  else
+  {
+    strlcpy(hostname, cupsServer(), sizeof(hostname));
+    if (hostname[0] == '/')
+      strlcpy(hostname, "localhost", sizeof(hostname));
+  }
 
-  if (!_cups_strcasecmp(cg->servername, "localhost"))
+  if (!_cups_strcasecmp(hostname, "localhost"))
   {
     char       ppdname[1024];          /* PPD filename */
     struct stat        ppdinfo;                /* PPD file information */