/* Job cancelled? */
uri_credentials = 0;
/* Credentials supplied in URI? */
-static char username[256] = "",
+static char device_username[256] = "",
/* Username for device URI */
- *password = NULL;
+ *device_password = NULL;
/* Password for device URI */
static const char * const pattrs[] = /* Printer attributes we want */
{
*/
httpSeparateURI(HTTP_URI_CODING_ALL, device_uri, scheme, sizeof(scheme),
- username, sizeof(username), hostname, sizeof(hostname), &port,
+ device_username, sizeof(device_username), hostname, sizeof(hostname), &port,
resource, sizeof(resource));
if (!port)
cupsSetPasswordCB2((cups_password_cb2_t)password_cb, &password_tries);
- if (username[0])
+ if (device_username[0])
{
/*
* Use authentication information in the device URI...
*/
- if ((password = strchr(username, ':')) != NULL)
- *password++ = '\0';
+ if ((device_password = strchr(device_username, ':')) != NULL)
+ *device_password++ = '\0';
- cupsSetUser(username);
+ cupsSetUser(device_username);
uri_credentials = 1;
}
else
if (ptr)
{
- cupsCopyString(username, ptr, sizeof(username));
+ cupsCopyString(device_username, ptr, sizeof(device_username));
cupsSetUser(ptr);
}
- password = getenv("AUTH_PASSWORD");
+ device_password = getenv("AUTH_PASSWORD");
}
/*
http = httpConnect2(monitor->hostname, monitor->port, NULL, AF_UNSPEC,
monitor->encryption, 1, 0, NULL);
httpSetTimeout(http, 30.0, timeout_cb, NULL);
- if (username[0])
- cupsSetUser(username);
+ if (device_username[0])
+ cupsSetUser(device_username);
cupsSetPasswordCB2((cups_password_cb2_t)password_cb, &password_tries);
fprintf(stderr, "DEBUG: password_cb(prompt=\"%s\", http=%p, method=\"%s\", "
- "resource=\"%s\", password_tries=%p(%d)), password=%p\n",
+ "resource=\"%s\", password_tries=%p(%d)), device_password=%p\n",
prompt, (void *)http, method, resource, (void *)password_tries, *password_tries,
- (void *)password);
+ (void *)device_password);
(void)prompt;
(void)method;
}
}
- if (password && *password && *password_tries < 3)
+ if (device_password && *device_password && *password_tries < 3)
{
(*password_tries) ++;
- cupsSetUser(username);
+ cupsSetUser(device_username);
- return (password);
+ return (device_password);
}
else
{