/* access various service details */
-#define PRINTERNAME(snum) (lp_printername(snum))
#define CAN_WRITE(conn) (!conn->read_only)
#define VALID_SNUM(snum) (lp_snum_ok(snum))
#define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum))
/* Get printer name */
- pname = PRINTERNAME(snum);
+ pname = lp_printername(snum);
if (!pname || !*pname) {
errno = EACCES;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- if (!push_utf8_talloc(frame, &printername, PRINTERNAME(snum), &size)) {
+ if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
+ &size)) {
goto out;
}
slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s",
}
if ((response = cupsDoFileRequest(http, request, uri, pjob->filename)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
- DEBUG(0,("Unable to print file to %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
}
} else {
- DEBUG(0,("Unable to print file to `%s' - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to `%s' - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- if (!push_utf8_talloc(frame, &printername, PRINTERNAME(snum), &size)) {
+ if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
+ &size)) {
goto out;
}
slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s",
if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
- DEBUG(0,("Unable to pause printer %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to pause printer %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
- DEBUG(0,("Unable to pause printer %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to pause printer %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- if (!push_utf8_talloc(frame, &printername, PRINTERNAME(snum), &size)) {
+ if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
+ &size)) {
goto out;
}
slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s",
if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
- DEBUG(0,("Unable to resume printer %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to resume printer %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
- DEBUG(0,("Unable to resume printer %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to resume printer %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
/* need to pause the spooled entry */
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
- return print_run_command(snum, PRINTERNAME(snum), True,
+ return print_run_command(snum, lp_printername(snum), True,
lp_lppausecommand(snum), NULL,
"%j", jobstr,
NULL);
/* need to pause the spooled entry */
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
- return print_run_command(snum, PRINTERNAME(snum), True,
+ return print_run_command(snum, lp_printername(snum), True,
lp_lpresumecommand(snum), NULL,
"%j", jobstr,
NULL);
slprintf(job_size, sizeof(job_size)-1, "%lu", (unsigned long)pjob->size);
/* send it to the system spooler */
- ret = print_run_command(snum, PRINTERNAME(snum), True,
+ ret = print_run_command(snum, lp_printername(snum), True,
lp_printcommand(snum), NULL,
"%s", p,
"%J", jobname,
****************************************************************************/
static int generic_queue_pause(int snum)
{
- return print_run_command(snum, PRINTERNAME(snum), True, lp_queuepausecommand(snum), NULL, NULL);
+ return print_run_command(snum, lp_printername(snum), True,
+ lp_queuepausecommand(snum), NULL, NULL);
}
/****************************************************************************
****************************************************************************/
static int generic_queue_resume(int snum)
{
- return print_run_command(snum, PRINTERNAME(snum), True, lp_queueresumecommand(snum), NULL, NULL);
+ return print_run_command(snum, lp_printername(snum), True,
+ lp_queueresumecommand(snum), NULL, NULL);
}
/****************************************************************************
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
* Do the request and get back a response...
*/
- slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
+ lp_printername(snum));
if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
* Do the request and get back a response...
*/
- slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
+ lp_printername(snum));
if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
* Do the request and get back a response...
*/
- slprintf(uri, sizeof(uri) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "/ipp/%s", lp_printername(snum));
if ((response = cupsDoFileRequest(http, request, uri, pjob->filename)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
- DEBUG(0,("Unable to print file to %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
- DEBUG(0,("Unable to print file to `%s' - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to `%s' - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
lpqcommand = talloc_string_sub2(ctx,
lp_lpqcommand(snum),
"%p",
- PRINTERNAME(snum),
+ lp_printername(snum),
false, false, false);
if (!lpqcommand) {
return;
lprmcommand = talloc_string_sub2(ctx,
lp_lprmcommand(snum),
"%p",
- PRINTERNAME(snum),
+ lp_printername(snum),
false, false, false);
if (!lprmcommand) {
return;
if (pjob->spooled && pjob->sysjob != -1)
{
result = (*(current_printif->job_delete))(
- PRINTERNAME(snum),
+ lp_printername(snum),
lp_lprmcommand(snum),
pjob);
"Permission denied-- user not allowed to delete, \
pause, or resume print job. User name: %s. Printer name: %s.",
uidtoname(server_info->utok.uid),
- PRINTERNAME(snum) );
+ lp_printername(snum) );
/* END_ADMIN_LOG */
return False;
"Permission denied-- user not allowed to delete, \
pause, or resume print job. User name: %s. Printer name: %s.",
uidtoname(server_info->utok.uid),
- PRINTERNAME(snum) );
+ lp_printername(snum) );
/* END_ADMIN_LOG */
*errcode = WERR_ACCESS_DENIED;
"Permission denied-- user not allowed to delete, \
pause, or resume print job. User name: %s. Printer name: %s.",
uidtoname(server_info->utok.uid),
- PRINTERNAME(snum) );
+ lp_printername(snum) );
/* END_ADMIN_LOG */
return False;
}
the_acl = old_secdesc_ctr->sd->dacl;
DEBUG(10, ("old_secdesc_ctr for %s has %d aces:\n",
- PRINTERNAME(snum), the_acl->num_aces));
+ lp_printername(snum), the_acl->num_aces));
for (i = 0; i < the_acl->num_aces; i++) {
DEBUG(10, ("%s 0x%08x\n", sid_string_dbg(
if (the_acl) {
DEBUG(10, ("secdesc_ctr for %s has %d aces:\n",
- PRINTERNAME(snum), the_acl->num_aces));
+ lp_printername(snum), the_acl->num_aces));
for (i = 0; i < the_acl->num_aces; i++) {
DEBUG(10, ("%s 0x%08x\n", sid_string_dbg(