summaryrefslogtreecommitdiff
path: root/scheduler
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2014-01-02 23:05:18 +0100
committerDidier Raboud <odyx@debian.org>2014-01-02 23:05:18 +0100
commitb4db6beca042dcbfd5530ef8c559bfab71a11ade (patch)
treea2d41ae625d277d3285167fc64b73b58bc010065 /scheduler
parentd13746555c30d1d1bd617dcf64d5b92e319ae2b5 (diff)
downloadcups-upstream/1.7.0.tar.gz
Imported Upstream version 1.7.0upstream/1.7.0
Diffstat (limited to 'scheduler')
-rw-r--r--scheduler/client.c91
-rw-r--r--scheduler/client.h6
-rw-r--r--scheduler/colorman.c40
-rw-r--r--scheduler/conf.c8
-rw-r--r--scheduler/conf.h8
-rw-r--r--scheduler/cups-exec.c21
-rw-r--r--scheduler/dirsvc.c10
-rw-r--r--scheduler/file.c27
-rw-r--r--scheduler/ipp.c47
-rw-r--r--scheduler/job.c7
-rw-r--r--scheduler/select.c7
11 files changed, 162 insertions, 110 deletions
diff --git a/scheduler/client.c b/scheduler/client.c
index fefd0586..c867bd67 100644
--- a/scheduler/client.c
+++ b/scheduler/client.c
@@ -1,5 +1,5 @@
/*
- * "$Id: client.c 10999 2013-05-30 00:48:16Z msweet $"
+ * "$Id: client.c 11308 2013-09-27 14:09:25Z msweet $"
*
* Client routines for the CUPS scheduler.
*
@@ -1905,7 +1905,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
}
else if (!WebInterface)
{
- if (!cupsdSendHeader(con, HTTP_OK, line, CUPSD_AUTH_NONE))
+ if (!cupsdSendHeader(con, HTTP_OK, NULL, CUPSD_AUTH_NONE))
{
cupsdCloseClient(con);
return;
@@ -4139,11 +4139,27 @@ valid_host(cupsd_client_t *con) /* I - Client connection */
{
cupsd_alias_t *a; /* Current alias */
cupsd_netif_t *netif; /* Current network interface */
- const char *host, /* Host field */
- *end; /* End character */
+ const char *end; /* End character */
+ char *ptr; /* Pointer into host value */
+
+
+ /*
+ * Copy the Host: header for later use...
+ */
+ strlcpy(con->clientname, con->http.fields[HTTP_FIELD_HOST],
+ sizeof(con->clientname));
+ if ((ptr = strrchr(con->clientname, ':')) != NULL && !strchr(ptr, ']'))
+ {
+ *ptr++ = '\0';
+ con->clientport = atoi(ptr);
+ }
+ else
+ con->clientport = con->serverport;
- host = con->http.fields[HTTP_FIELD_HOST];
+ /*
+ * Then validate...
+ */
if (httpAddrLocalhost(con->http.hostaddr))
{
@@ -4152,18 +4168,13 @@ valid_host(cupsd_client_t *con) /* I - Client connection */
* addresses when accessing CUPS via the loopback interface...
*/
- return (!_cups_strcasecmp(host, "localhost") ||
- !_cups_strncasecmp(host, "localhost:", 10) ||
- !_cups_strcasecmp(host, "localhost.") ||
- !_cups_strncasecmp(host, "localhost.:", 11) ||
+ return (!_cups_strcasecmp(con->clientname, "localhost") ||
+ !_cups_strcasecmp(con->clientname, "localhost.") ||
#ifdef __linux
- !_cups_strcasecmp(host, "localhost.localdomain") ||
- !_cups_strncasecmp(host, "localhost.localdomain:", 22) ||
+ !_cups_strcasecmp(con->clientname, "localhost.localdomain") ||
#endif /* __linux */
- !strcmp(host, "127.0.0.1") ||
- !strncmp(host, "127.0.0.1:", 10) ||
- !strcmp(host, "[::1]") ||
- !strncmp(host, "[::1]:", 6));
+ !strcmp(con->clientname, "127.0.0.1") ||
+ !strcmp(con->clientname, "[::1]"));
}
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
@@ -4171,19 +4182,18 @@ valid_host(cupsd_client_t *con) /* I - Client connection */
* Check if the hostname is something.local (Bonjour); if so, allow it.
*/
- if ((end = strrchr(host, '.')) != NULL && end > host &&
- (!end[1] || end[1] == ':'))
+ if ((end = strrchr(con->clientname, '.')) != NULL && end > con->clientname &&
+ !end[1])
{
/*
* "." on end, work back to second-to-last "."...
*/
- for (end --; end > host && *end != '.'; end --);
+
+ for (end --; end > con->clientname && *end != '.'; end --);
}
if (end && (!_cups_strcasecmp(end, ".local") ||
- !_cups_strncasecmp(end, ".local:", 7) ||
- !_cups_strcasecmp(end, ".local.") ||
- !_cups_strncasecmp(end, ".local.:", 8)))
+ !_cups_strcasecmp(end, ".local.")))
return (1);
#endif /* HAVE_DNSSD || HAVE_AVAHI */
@@ -4191,22 +4201,16 @@ valid_host(cupsd_client_t *con) /* I - Client connection */
* Check if the hostname is an IP address...
*/
- if (isdigit(*host & 255) || *host == '[')
+ if (isdigit(con->clientname[0] & 255) || con->clientname[0] == '[')
{
/*
* Possible IPv4/IPv6 address...
*/
- char temp[1024], /* Temporary string */
- *ptr; /* Pointer into temporary string */
http_addrlist_t *addrlist; /* List of addresses */
- strlcpy(temp, host, sizeof(temp));
- if ((ptr = strrchr(temp, ':')) != NULL && !strchr(ptr, ']'))
- *ptr = '\0'; /* Strip :port from host value */
-
- if ((addrlist = httpAddrGetList(temp, AF_UNSPEC, NULL)) != NULL)
+ if ((addrlist = httpAddrGetList(con->clientname, AF_UNSPEC, NULL)) != NULL)
{
/*
* Good IPv4/IPv6 address...
@@ -4232,16 +4236,15 @@ valid_host(cupsd_client_t *con) /* I - Client connection */
if (!strcmp(a->name, "*"))
return (1);
- if (!_cups_strncasecmp(host, a->name, a->namelen))
+ if (!_cups_strncasecmp(con->clientname, a->name, a->namelen))
{
/*
- * Prefix matches; check the character at the end - it must be ":", ".",
- * ".:", or nul...
+ * Prefix matches; check the character at the end - it must be "." or nul.
*/
- end = host + a->namelen;
+ end = con->clientname + a->namelen;
- if (!*end || *end == ':' || (*end == '.' && (!end[1] || end[1] == ':')))
+ if (!*end || (*end == '.' && !end[1]))
return (1);
}
}
@@ -4258,16 +4261,15 @@ valid_host(cupsd_client_t *con) /* I - Client connection */
if (!strcmp(a->name, "*"))
return (1);
- if (!_cups_strncasecmp(host, a->name, a->namelen))
+ if (!_cups_strncasecmp(con->clientname, a->name, a->namelen))
{
/*
- * Prefix matches; check the character at the end - it must be ":", ".",
- * ".:", or nul...
+ * Prefix matches; check the character at the end - it must be "." or nul.
*/
- end = host + a->namelen;
+ end = con->clientname + a->namelen;
- if (!*end || *end == ':' || (*end == '.' && (!end[1] || end[1] == ':')))
+ if (!*end || (*end == '.' && !end[1]))
return (1);
}
}
@@ -4281,16 +4283,15 @@ valid_host(cupsd_client_t *con) /* I - Client connection */
netif;
netif = (cupsd_netif_t *)cupsArrayNext(NetIFList))
{
- if (!_cups_strncasecmp(host, netif->hostname, netif->hostlen))
+ if (!_cups_strncasecmp(con->clientname, netif->hostname, netif->hostlen))
{
/*
- * Prefix matches; check the character at the end - it must be ":", ".",
- * ".:", or nul...
+ * Prefix matches; check the character at the end - it must be "." or nul.
*/
- end = host + netif->hostlen;
+ end = con->clientname + netif->hostlen;
- if (!*end || *end == ':' || (*end == '.' && (!end[1] || end[1] == ':')))
+ if (!*end || (*end == '.' && !end[1]))
return (1);
}
}
@@ -4378,5 +4379,5 @@ write_pipe(cupsd_client_t *con) /* I - Client connection */
/*
- * End of "$Id: client.c 10999 2013-05-30 00:48:16Z msweet $".
+ * End of "$Id: client.c 11308 2013-09-27 14:09:25Z msweet $".
*/
diff --git a/scheduler/client.h b/scheduler/client.h
index 840e7f72..fe6c473f 100644
--- a/scheduler/client.h
+++ b/scheduler/client.h
@@ -1,5 +1,5 @@
/*
- * "$Id: client.h 10996 2013-05-29 11:51:34Z msweet $"
+ * "$Id: client.h 11213 2013-08-01 22:23:18Z msweet $"
*
* Client definitions for the CUPS scheduler.
*
@@ -54,6 +54,8 @@ struct cupsd_client_s
int auto_ssl; /* Automatic test for SSL/TLS */
#endif /* HAVE_SSL */
http_addr_t clientaddr; /* Client address */
+ char clientname[256];/* Client's server name for connection */
+ int clientport; /* Client's server port for connection */
char servername[256];/* Server name for connection */
int serverport; /* Server port for connection */
#ifdef HAVE_GSSAPI
@@ -140,5 +142,5 @@ extern int cupsdStartTLS(cupsd_client_t *con);
/*
- * End of "$Id: client.h 10996 2013-05-29 11:51:34Z msweet $".
+ * End of "$Id: client.h 11213 2013-08-01 22:23:18Z msweet $".
*/
diff --git a/scheduler/colorman.c b/scheduler/colorman.c
index e076a6ad..9e6c7103 100644
--- a/scheduler/colorman.c
+++ b/scheduler/colorman.c
@@ -1,9 +1,9 @@
/*
- * "$Id: colorman.c 4297 2013-05-10 16:04:59Z msweet $"
+ * "$Id: colorman.c 11150 2013-07-17 13:03:56Z msweet $"
*
* Color management routines for the CUPS scheduler.
*
- * Copyright 2007-2012 by Apple Inc.
+ * 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
@@ -103,11 +103,10 @@ extern CFUUIDRef ColorSyncCreateUUIDFromUInt32(unsigned id);
# define COLORD_KIND_PRINTER "printer"
/* printing output device */
-# define COLORD_DBUS_MSG(p,m) dbus_message_new_method_call(\
- "org.freedesktop.ColorManager", (p),\
- "org.freedesktop.ColorManager", (m))
- /* Macro to make new colord messages */
-# define COLORD_DBUS_PATH "/org/freedesktop/ColorManager"
+# define COLORD_DBUS_SERVICE "org.freedesktop.ColorManager"
+# define COLORD_DBUS_INTERFACE "org.freedesktop.ColorManager"
+# define COLORD_DBUS_INTERFACE_DEVICE "org.freedesktop.ColorManager.Device"
+# define COLORD_DBUS_PATH "/org/freedesktop/ColorManager"
/* Path for color management system */
# define COLORD_DBUS_TIMEOUT 5000 /* Timeout for connecting to colord in ms */
#endif /* __APPLE__ */
@@ -939,7 +938,10 @@ colord_create_device(
snprintf(device_id, sizeof(device_id), "cups-%s", p->name);
device_path = device_id;
- message = COLORD_DBUS_MSG(COLORD_DBUS_PATH, "CreateDevice");
+ message = dbus_message_new_method_call(COLORD_DBUS_SERVICE,
+ COLORD_DBUS_PATH,
+ COLORD_DBUS_INTERFACE,
+ "CreateDevice");
dbus_message_iter_init_append(message, &args);
dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &device_path);
@@ -1048,7 +1050,10 @@ colord_create_profile(
* Create the profile...
*/
- message = COLORD_DBUS_MSG(COLORD_DBUS_PATH, "CreateProfile");
+ message = dbus_message_new_method_call(COLORD_DBUS_SERVICE,
+ COLORD_DBUS_PATH,
+ COLORD_DBUS_INTERFACE,
+ "CreateProfile");
idstrlen = strlen(printer_name) + 1 + strlen(qualifier) + 1;
if ((idstr = malloc(idstrlen)) == NULL)
@@ -1144,7 +1149,10 @@ colord_delete_device(
* Delete the device...
*/
- message = COLORD_DBUS_MSG(COLORD_DBUS_PATH, "DeleteDevice");
+ message = dbus_message_new_method_call(COLORD_DBUS_SERVICE,
+ COLORD_DBUS_PATH,
+ COLORD_DBUS_INTERFACE,
+ "DeleteDevice");
dbus_message_iter_init_append(message, &args);
dbus_message_iter_append_basic(&args, DBUS_TYPE_OBJECT_PATH, &device_path);
@@ -1196,7 +1204,10 @@ colord_device_add_profile(
DBusError error; /* D-Bus error */
- message = COLORD_DBUS_MSG(device_path, "AddProfile");
+ message = dbus_message_new_method_call(COLORD_DBUS_SERVICE,
+ device_path,
+ COLORD_DBUS_INTERFACE_DEVICE,
+ "AddProfile");
dbus_message_iter_init_append(message, &args);
dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &relation);
@@ -1266,7 +1277,10 @@ colord_find_device(
char *device_path = NULL; /* Device object path */
- message = COLORD_DBUS_MSG(COLORD_DBUS_PATH, "FindDeviceById");
+ message = dbus_message_new_method_call(COLORD_DBUS_SERVICE,
+ COLORD_DBUS_PATH,
+ COLORD_DBUS_INTERFACE,
+ "FindDeviceById");
dbus_message_iter_init_append(message, &args);
dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &device_id);
@@ -1524,5 +1538,5 @@ colord_unregister_printer(
/*
- * End of "$Id: colorman.c 4297 2013-05-10 16:04:59Z msweet $".
+ * End of "$Id: colorman.c 11150 2013-07-17 13:03:56Z msweet $".
*/
diff --git a/scheduler/conf.c b/scheduler/conf.c
index 3863c4d8..62d4bf57 100644
--- a/scheduler/conf.c
+++ b/scheduler/conf.c
@@ -1,9 +1,9 @@
/*
- * "$Id: conf.c 10996 2013-05-29 11:51:34Z msweet $"
+ * "$Id: conf.c 11201 2013-07-26 21:27:27Z msweet $"
*
* Configuration routines for the CUPS scheduler.
*
- * Copyright 2007-2012 by Apple Inc.
+ * 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
@@ -174,6 +174,7 @@ static const cupsd_var_t cupsfiles_vars[] =
{ "ServerRoot", &ServerRoot, CUPSD_VARTYPE_PATHNAME },
{ "SMBConfigFile", &SMBConfigFile, CUPSD_VARTYPE_STRING },
{ "StateDir", &StateDir, CUPSD_VARTYPE_STRING },
+ { "SyncOnClose", &SyncOnClose, CUPSD_VARTYPE_BOOLEAN },
#ifdef HAVE_AUTHORIZATION_H
{ "SystemGroupAuthKey", &SystemGroupAuthKey, CUPSD_VARTYPE_STRING },
#endif /* HAVE_AUTHORIZATION_H */
@@ -734,6 +735,7 @@ cupsdReadConfiguration(void)
ReloadTimeout = DEFAULT_KEEPALIVE;
RootCertDuration = 300;
StrictConformance = FALSE;
+ SyncOnClose = FALSE;
Timeout = DEFAULT_TIMEOUT;
WebInterface = CUPS_DEFAULT_WEBIF;
@@ -4079,5 +4081,5 @@ set_policy_defaults(cupsd_policy_t *pol)/* I - Policy */
/*
- * End of "$Id: conf.c 10996 2013-05-29 11:51:34Z msweet $".
+ * End of "$Id: conf.c 11201 2013-07-26 21:27:27Z msweet $".
*/
diff --git a/scheduler/conf.h b/scheduler/conf.h
index a1729d3d..485383e4 100644
--- a/scheduler/conf.h
+++ b/scheduler/conf.h
@@ -1,9 +1,9 @@
/*
- * "$Id: conf.h 10996 2013-05-29 11:51:34Z msweet $"
+ * "$Id: conf.h 11202 2013-07-26 21:31:54Z msweet $"
*
* Configuration file definitions for the CUPS scheduler.
*
- * Copyright 2007-2012 by Apple Inc.
+ * 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
@@ -172,6 +172,8 @@ VAR int ClassifyOverride VALUE(0),
/* Which errors are fatal? */
StrictConformance VALUE(FALSE),
/* Require strict IPP conformance? */
+ SyncOnClose VALUE(FALSE),
+ /* Call fsync() when closing files? */
LogFilePerm VALUE(0644);
/* Permissions for log files */
VAR cupsd_loglevel_t LogLevel VALUE(CUPSD_LOG_WARN);
@@ -295,5 +297,5 @@ extern int cupsdWriteErrorLog(int level, const char *message);
/*
- * End of "$Id: conf.h 10996 2013-05-29 11:51:34Z msweet $".
+ * End of "$Id: conf.h 11202 2013-07-26 21:31:54Z msweet $".
*/
diff --git a/scheduler/cups-exec.c b/scheduler/cups-exec.c
index 004045fb..3474c6e3 100644
--- a/scheduler/cups-exec.c
+++ b/scheduler/cups-exec.c
@@ -1,9 +1,9 @@
/*
- * "$Id: cups-exec.c 4274 2013-04-09 20:10:23Z msweet $"
+ * "$Id: cups-exec.c 11144 2013-07-17 02:45:55Z msweet $"
*
* Sandbox helper for CUPS.
*
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -43,7 +43,6 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line arguments */
{
- int i; /* Looping var */
#ifdef HAVE_SANDBOX_H
char *sandbox_error = NULL; /* Sandbox error, if any */
#endif /* HAVE_SANDBOX_H */
@@ -76,20 +75,6 @@ main(int argc, /* I - Number of command-line args */
#endif /* HAVE_SANDBOX_H */
/*
- * Close file descriptors we don't need (insurance):
- *
- * 0 = stdin
- * 1 = stdout
- * 2 = stderr
- * 3 = back-channel
- * 4 = side-channel
- * 5-N = unused
- */
-
- for (i = 5; i < 1024; i ++)
- close(i);
-
- /*
* Execute the program...
*/
@@ -105,5 +90,5 @@ main(int argc, /* I - Number of command-line args */
/*
- * End of "$Id: cups-exec.c 4274 2013-04-09 20:10:23Z msweet $".
+ * End of "$Id: cups-exec.c 11144 2013-07-17 02:45:55Z msweet $".
*/
diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c
index 0b5c5962..959fd803 100644
--- a/scheduler/dirsvc.c
+++ b/scheduler/dirsvc.c
@@ -1,9 +1,9 @@
/*
- * "$Id: dirsvc.c 10996 2013-05-29 11:51:34Z msweet $"
+ * "$Id: dirsvc.c 11193 2013-07-26 03:12:37Z msweet $"
*
* Directory services routines for the CUPS scheduler.
*
- * Copyright 2007-2012 by Apple Inc.
+ * 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
@@ -639,7 +639,9 @@ dnssdBuildTxtRecord(
if (p->type & CUPS_PRINTER_FAX)
{
keyvalue[count ][0] = "Fax";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_FAX) ? "T" : "F";
+ keyvalue[count++][1] = "T";
+ keyvalue[count ][0] = "rfo";
+ keyvalue[count++][1] = rp_str;
}
if (p->type & CUPS_PRINTER_COLOR)
@@ -1668,5 +1670,5 @@ update_smb(int onoff) /* I - 1 = turn on, 0 = turn off */
/*
- * End of "$Id: dirsvc.c 10996 2013-05-29 11:51:34Z msweet $".
+ * End of "$Id: dirsvc.c 11193 2013-07-26 03:12:37Z msweet $".
*/
diff --git a/scheduler/file.c b/scheduler/file.c
index 75df6a18..1d252905 100644
--- a/scheduler/file.c
+++ b/scheduler/file.c
@@ -1,5 +1,5 @@
/*
- * "$Id: file.c 4216 2013-03-11 13:57:36Z msweet $"
+ * "$Id: file.c 11201 2013-07-26 21:27:27Z msweet $"
*
* File functions for the CUPS scheduler.
*
@@ -109,6 +109,29 @@ cupsdCloseCreatedConfFile(
/*
+ * Synchronize changes to disk if SyncOnClose is enabled.
+ */
+
+ if (SyncOnClose)
+ {
+ if (cupsFileFlush(fp))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to write changes to \"%s\": %s",
+ filename, strerror(errno));
+ cupsFileClose(fp);
+ return (-1);
+ }
+
+ if (fsync(cupsFileNumber(fp)))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to sync changes to \"%s\": %s",
+ filename, strerror(errno));
+ cupsFileClose(fp);
+ return (-1);
+ }
+ }
+
+ /*
* First close the file...
*/
@@ -438,5 +461,5 @@ overwrite_data(int fd, /* I - File descriptor */
/*
- * End of "$Id: file.c 4216 2013-03-11 13:57:36Z msweet $".
+ * End of "$Id: file.c 11201 2013-07-26 21:27:27Z msweet $".
*/
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index 0963e5c5..170016b3 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp.c 10998 2013-05-30 00:41:43Z msweet $"
+ * "$Id: ipp.c 11311 2013-09-27 14:23:42Z msweet $"
*
* IPP routines for the CUPS scheduler.
*
@@ -353,7 +353,20 @@ cupsdProcessIPPRequest(
if (attr && attr->name &&
!strcmp(attr->name, "attributes-natural-language") &&
(attr->value_tag & IPP_TAG_MASK) == IPP_TAG_LANGUAGE)
+ {
language = attr;
+
+ /*
+ * Reset language for this request if different from Accept-Language.
+ */
+
+ if (!con->language ||
+ strcmp(attr->values[0].string.text, con->language->language))
+ {
+ cupsLangFree(con->language);
+ con->language = cupsLangGet(attr->values[0].string.text);
+ }
+ }
else
language = NULL;
@@ -1979,7 +1992,7 @@ add_job(cupsd_client_t *con, /* I - Client connection */
*/
httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL,
- con->servername, con->serverport, "/jobs/%d", job->id);
+ con->clientname, con->clientport, "/jobs/%d", job->id);
ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-uri", NULL,
job_uri);
@@ -4051,7 +4064,7 @@ close_job(cupsd_client_t *con, /* I - Client connection */
*/
httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL,
- con->servername, con->serverport, "/jobs/%d", job->id);
+ con->clientname, con->clientport, "/jobs/%d", job->id);
ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-uri", NULL,
job_uri);
@@ -4803,7 +4816,7 @@ copy_job_attrs(cupsd_client_t *con, /* I - Client connection */
(!ra || cupsArrayFind(ra, "job-more-info")))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "http",
- NULL, con->servername, con->serverport, "/jobs/%d",
+ NULL, con->clientname, con->clientport, "/jobs/%d",
job->id);
ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI,
"job-more-info", NULL, job_uri);
@@ -4824,7 +4837,7 @@ copy_job_attrs(cupsd_client_t *con, /* I - Client connection */
if (!ra || cupsArrayFind(ra, "job-printer-uri"))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL,
- con->servername, con->serverport,
+ con->clientname, con->clientport,
(job->dtype & CUPS_PRINTER_CLASS) ? "/classes/%s" :
"/printers/%s",
job->dest);
@@ -4835,7 +4848,7 @@ copy_job_attrs(cupsd_client_t *con, /* I - Client connection */
if (!ra || cupsArrayFind(ra, "job-uri"))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL,
- con->servername, con->serverport, "/jobs/%d",
+ con->clientname, con->clientport, "/jobs/%d",
job->id);
ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI,
"job-uri", NULL, job_uri);
@@ -4898,8 +4911,8 @@ copy_printer_attrs(
else
{
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri,
- sizeof(printer_uri), "ipp", NULL, con->servername,
- con->serverport,
+ sizeof(printer_uri), "ipp", NULL, con->clientname,
+ con->clientport,
(p2->type & CUPS_PRINTER_CLASS) ?
"/classes/%s" : "/printers/%s", p2->name);
member_uris->values[i].string.text = _cupsStrAlloc(printer_uri);
@@ -4960,7 +4973,7 @@ copy_printer_attrs(
if (!ra || cupsArrayFind(ra, "printer-icons"))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_icons, sizeof(printer_icons),
- "http", NULL, con->servername, con->serverport,
+ "http", NULL, con->clientname, con->clientport,
"/icons/%s.png", printer->name);
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, "printer-icons",
NULL, printer_icons);
@@ -4978,7 +4991,7 @@ copy_printer_attrs(
if (!ra || cupsArrayFind(ra, "printer-more-info"))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
- "http", NULL, con->servername, con->serverport,
+ "http", NULL, con->clientname, con->clientport,
(printer->type & CUPS_PRINTER_CLASS) ?
"/classes/%s" : "/printers/%s", printer->name);
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI,
@@ -5034,7 +5047,7 @@ copy_printer_attrs(
if (!ra || cupsArrayFind(ra, "printer-uri-supported"))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
- "ipp", NULL, con->servername, con->serverport,
+ "ipp", NULL, con->clientname, con->clientport,
(printer->type & CUPS_PRINTER_CLASS) ?
"/classes/%s" : "/printers/%s", printer->name);
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI,
@@ -5161,7 +5174,7 @@ copy_subscription_attrs(
if (sub->dest && (!ra || cupsArrayFind(ra, "notify-printer-uri")))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
- "ipp", NULL, con->servername, con->serverport,
+ "ipp", NULL, con->clientname, con->clientport,
"/printers/%s", sub->dest->name);
ippAddString(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI,
"notify-printer-uri", NULL, printer_uri);
@@ -5728,10 +5741,16 @@ delete_printer(cupsd_client_t *con, /* I - Client connection */
snprintf(filename, sizeof(filename), "%s/interfaces/%s", ServerRoot,
printer->name);
unlink(filename);
+ snprintf(filename, sizeof(filename), "%s/interfaces/%s.O", ServerRoot,
+ printer->name);
+ unlink(filename);
snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot,
printer->name);
unlink(filename);
+ snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd.O", ServerRoot,
+ printer->name);
+ unlink(filename);
snprintf(filename, sizeof(filename), "%s/%s.png", CacheDir, printer->name);
unlink(filename);
@@ -9545,7 +9564,7 @@ send_document(cupsd_client_t *con, /* I - Client connection */
*/
httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL,
- con->servername, con->serverport, "/jobs/%d", jobid);
+ con->clientname, con->clientport, "/jobs/%d", jobid);
ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-uri", NULL,
job_uri);
@@ -11080,5 +11099,5 @@ validate_user(cupsd_job_t *job, /* I - Job */
/*
- * End of "$Id: ipp.c 10998 2013-05-30 00:41:43Z msweet $".
+ * End of "$Id: ipp.c 11311 2013-09-27 14:23:42Z msweet $".
*/
diff --git a/scheduler/job.c b/scheduler/job.c
index 968b70e7..562ea1f8 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -1,5 +1,5 @@
/*
- * "$Id: job.c 10996 2013-05-29 11:51:34Z msweet $"
+ * "$Id: job.c 11147 2013-07-17 02:54:31Z msweet $"
*
* Job management routines for the CUPS scheduler.
*
@@ -671,6 +671,9 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */
"FINAL_CONTENT_TYPE=%s/%s", filter->dst->super,
filter->dst->type);
}
+ else
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=printer/%s", job->printer->name);
}
/*
@@ -5200,5 +5203,5 @@ update_job_attrs(cupsd_job_t *job, /* I - Job to update */
/*
- * End of "$Id: job.c 10996 2013-05-29 11:51:34Z msweet $".
+ * End of "$Id: job.c 11147 2013-07-17 02:54:31Z msweet $".
*/
diff --git a/scheduler/select.c b/scheduler/select.c
index c442839c..b31fb97c 100644
--- a/scheduler/select.c
+++ b/scheduler/select.c
@@ -1,9 +1,9 @@
/*
- * "$Id: select.c 10999 2013-05-30 00:48:16Z msweet $"
+ * "$Id: select.c 11142 2013-07-17 01:07:00Z msweet $"
*
* Select abstraction functions for the CUPS scheduler.
*
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -30,7 +30,6 @@
*/
#include "cupsd.h"
-#undef HAVE_KQUEUE
#ifdef HAVE_EPOLL
# include <sys/epoll.h>
@@ -947,5 +946,5 @@ find_fd(int fd) /* I - File descriptor */
/*
- * End of "$Id: select.c 10999 2013-05-30 00:48:16Z msweet $".
+ * End of "$Id: select.c 11142 2013-07-17 01:07:00Z msweet $".
*/