]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/backend.c
Merge changes from CUPS 1.5svn-r9763.
[thirdparty/cups.git] / cups / backend.c
index 818455f452ba76c9e8f0002960d93fe4ad2f3eaa..db4ce22e55b6e0376199aa0fd44ded3962cc0934 100644 (file)
@@ -50,8 +50,10 @@ static void  quote_string(const char *s);
 const char *                           /* O - Device URI or @code NULL@ */
 cupsBackendDeviceURI(char **argv)      /* I - Command-line arguments */
 {
-  const char   *device_uri;            /* Device URI */
+  const char   *device_uri,            /* Device URI */
+               *auth_info_required;    /* AUTH_INFO_REQUIRED env var */
   _cups_globals_t *cg = _cupsGlobals();        /* Global info */
+  int          options;                /* Resolve options */
 
 
   if ((device_uri = getenv("DEVICE_URI")) == NULL)
@@ -62,8 +64,13 @@ cupsBackendDeviceURI(char **argv)    /* I - Command-line arguments */
     device_uri = argv[0];
   }
 
+  options = _HTTP_RESOLVE_STDERR;
+  if ((auth_info_required = getenv("AUTH_INFO_REQUIRED")) != NULL &&
+      !strcmp(auth_info_required, "negotiate"))
+    options |= _HTTP_RESOLVE_FQDN;
+
   return (_httpResolveURI(device_uri, cg->resolved_uri,
-                          sizeof(cg->resolved_uri), 1, NULL, NULL));
+                          sizeof(cg->resolved_uri), options, NULL, NULL));
 }