/*
* "$Id$"
*
- * IPP backend for CUPS.
+ * IPP backend for CUPS.
*
- * Copyright 2007-2013 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ * Copyright 2007-2013 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
- * "LICENSE" which should have been included with this file. If this
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * "LICENSE" which should have been included with this file. If this
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
- * This file is subject to the Apple OS-Developed Software exception.
- *
- * Contents:
- *
- * main() - Send a file to the printer or server.
- * cancel_job() - Cancel a print job.
- * check_printer_state() - Check the printer state.
- * monitor_printer() - Monitor the printer state.
- * new_request() - Create a new print creation or validation
- * request.
- * password_cb() - Disable the password prompt for
- * cupsDoFileRequest().
- * quote_string() - Quote a string value.
- * report_attr() - Report an IPP attribute value.
- * report_printer_state() - Report the printer state.
- * run_as_user() - Run the IPP backend as the printing user.
- * sigterm_handler() - Handle 'terminate' signals that stop the backend.
- * timeout_cb() - Handle HTTP timeouts.
- * update_reasons() - Update the printer-state-reasons values.
+ * This file is subject to the Apple OS-Developed Software exception.
*/
/*
"media-col-supported",
"multiple-document-handling-supported",
"operations-supported",
+ "print-color-mode-supported",
"printer-alert",
"printer-alert-description",
"printer-is-accepting-jobs",
* that way.
*/
- if (!getuid() && (value = getenv("AUTH_UID")) != NULL)
+ if (!getuid() && (value = getenv("AUTH_UID")) != NULL &&
+ !getenv("AUTH_PASSWORD"))
{
uid_t uid = (uid_t)atoi(value);
/* User ID */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, argv[2]);
- if ((i + 1) >= num_files)
- ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
+ ippAddBoolean(request, IPP_TAG_OPERATION, "last-document",
+ (i + 1) >= num_files);
if (document_format)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
if (!job_id || !waitjob || !get_job_attrs)
continue;
+ fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
+
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete."));
for (delay = _cupsNextDelay(0, &prev_delay); !job_canceled;)
"job-password-encryption", NULL, keyword);
}
- if (pc->account_id &&
- (keyword = cupsGetOption("job-account-id", num_options,
- options)) != NULL)
- ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id",
- NULL, keyword);
+ if (pc->account_id)
+ {
+ if ((keyword = cupsGetOption("job-account-id", num_options,
+ options)) == NULL)
+ keyword = cupsGetOption("job-billing", num_options, options);
- if (pc->accounting_user_id &&
- (keyword = cupsGetOption("job-accounting-user-id", num_options,
- options)) != NULL)
- ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME,
- "job-accounting-user-id", NULL, keyword);
+ if (keyword)
+ ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id",
+ NULL, keyword);
+ }
+
+ if (pc->accounting_user_id)
+ {
+ if ((keyword = cupsGetOption("job-accounting-user-id", num_options,
+ options)) == NULL)
+ keyword = user;
+
+ if (keyword)
+ ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME,
+ "job-accounting-user-id", NULL, keyword);
+ }
for (mandatory = (char *)cupsArrayFirst(pc->mandatory);
mandatory;
{
if (*s == '\\' || *s == '\"' || *s == '\'')
{
- if (q < (qend - 3))
+ if (qptr < (qend - 4))
{
*qptr++ = '\\';
*qptr++ = '\\';
if (conn)
{
- xpc_connection_suspend(conn);
xpc_connection_cancel(conn);
xpc_release(conn);
}