summaryrefslogtreecommitdiff
path: root/scheduler
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2009-07-14 23:31:23 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2009-07-14 23:31:23 +0000
commit4a4b4f99149e8241247e0116cc18fec762fdb1ea (patch)
treee05af0ac92a463918e503240f82cb6e832cef2a2 /scheduler
parentf701418f7b9c2f499288510f0ef60d4a8291bda9 (diff)
Merge changes from CUPS 1.4.0 (r8756)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1613 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler')
-rw-r--r--scheduler/client.c35
-rw-r--r--scheduler/ipp.c3
-rw-r--r--scheduler/job.c3
-rw-r--r--scheduler/select.c9
4 files changed, 42 insertions, 8 deletions
diff --git a/scheduler/client.c b/scheduler/client.c
index 2c29e3da4..93fbf3419 100644
--- a/scheduler/client.c
+++ b/scheduler/client.c
@@ -3339,8 +3339,9 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
* 'get_cdsa_certificate()' - Get a SSL/TLS certificate from the System keychain.
*/
-static CFArrayRef /* O - Array of certificates */
-get_cdsa_certificate(cupsd_client_t *con) /* I - Client connection */
+static CFArrayRef /* O - Array of certificates */
+get_cdsa_certificate(
+ cupsd_client_t *con) /* I - Client connection */
{
OSStatus err; /* Error info */
SecKeychainRef keychain; /* Keychain reference */
@@ -3368,6 +3369,7 @@ get_cdsa_certificate(cupsd_client_t *con) /* I - Client connection */
CSSM_DATA options; /* Policy options */
CSSM_APPLE_TP_SSL_OPTIONS
ssl_options; /* SSL Option for hostname */
+ char localname[1024];/* Local hostname */
if (SecPolicySearchCreate(CSSM_CERT_X_509v3, &CSSMOID_APPLE_TP_SSL,
@@ -3410,6 +3412,35 @@ get_cdsa_certificate(cupsd_client_t *con) /* I - Client connection */
err = SecIdentitySearchCreateWithPolicy(policy, NULL, CSSM_KEYUSE_SIGN,
keychain, FALSE, &search);
+ if (err && DNSSDHostName)
+ {
+ /*
+ * Search for the connection server name failed; try the DNS-SD .local
+ * hostname instead...
+ */
+
+ snprintf(localname, sizeof(localname), "%s.local", DNSSDHostName);
+
+ ssl_options.ServerName = localname;
+ ssl_options.ServerNameLen = strlen(localname);
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "get_cdsa_certificate: Looking for certs for \"%s\"...",
+ localname);
+
+ if (SecPolicySetValue(policy, &options))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Cannot set policy value to use for searching");
+ CFRelease(keychain);
+ CFRelease(policy_search);
+ return (NULL);
+ }
+
+ err = SecIdentitySearchCreateWithPolicy(policy, NULL, CSSM_KEYUSE_SIGN,
+ keychain, FALSE, &search);
+ }
+
# else
/*
* Assume there is exactly one SecIdentity in the keychain...
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index 1251628e9..caa620b6b 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -1727,8 +1727,7 @@ add_job(cupsd_client_t *con, /* I - Client connection */
attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD,
"job-hold-until", NULL, val);
}
- if (attr && strcmp(attr->values[0].string.text, "no-hold") &&
- !(printer->type & CUPS_PRINTER_REMOTE))
+ if (attr && strcmp(attr->values[0].string.text, "no-hold"))
{
/*
* Hold job until specified time...
diff --git a/scheduler/job.c b/scheduler/job.c
index 978962421..43060149f 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -3032,7 +3032,8 @@ get_options(cupsd_job_t *job, /* I - Job */
attr->value_tag == IPP_TAG_BEGIN_COLLECTION) /* Not yet supported */
continue;
- if (!strncmp(attr->name, "time-", 5))
+ if (!strncmp(attr->name, "time-", 5) ||
+ !strcmp(attr->name, "job-hold-until"))
continue;
if (!strncmp(attr->name, "job-", 4) &&
diff --git a/scheduler/select.c b/scheduler/select.c
index 0ac6ce063..8896388cc 100644
--- a/scheduler/select.c
+++ b/scheduler/select.c
@@ -750,7 +750,7 @@ cupsdRemoveSelect(int fd) /* I - File descriptor */
{
cupsdLogMessage(CUPSD_LOG_EMERG, "kevent() returned %s",
strerror(errno));
- return;
+ goto cleanup;
}
}
@@ -762,11 +762,10 @@ cupsdRemoveSelect(int fd) /* I - File descriptor */
{
cupsdLogMessage(CUPSD_LOG_EMERG, "kevent() returned %s",
strerror(errno));
- return;
+ goto cleanup;
}
}
-
#elif defined(HAVE_POLL)
/*
* Update the pollfds array...
@@ -781,6 +780,10 @@ cupsdRemoveSelect(int fd) /* I - File descriptor */
FD_CLR(fd, &cupsd_current_output);
#endif /* HAVE_EPOLL */
+#ifdef HAVE_KQUEUE
+ cleanup:
+#endif /* HAVE_KQUEUE */
+
/*
* Remove the file descriptor from the active array and add to the
* inactive array (or release, if we don't need the inactive array...)