diff --git a/cups-lspp.patch b/cups-lspp.patch index 6e83006..a967b24 100644 --- a/cups-lspp.patch +++ b/cups-lspp.patch @@ -1,5 +1,177 @@ ---- /dev/null 2007-07-31 09:03:12.827706703 +0100 -+++ cups-1.3rc2/config-scripts/cups-lspp.m4 2007-07-31 12:28:32.000000000 +0100 +diff -up cups-1.3.1/filter/common.c.lspp cups-1.3.1/filter/common.c +--- cups-1.3.1/filter/common.c.lspp 2007-07-11 22:46:42.000000000 +0100 ++++ cups-1.3.1/filter/common.c 2007-09-17 16:48:23.000000000 +0100 +@@ -30,6 +30,12 @@ + * Include necessary headers... + */ + ++#include "config.h" ++#ifdef WITH_LSPP ++#define _GNU_SOURCE ++#include ++#endif /* WITH_LSPP */ ++ + #include "common.h" + #include + +@@ -312,6 +318,18 @@ WriteLabelProlog(const char *label, /* I + { + const char *classification; /* CLASSIFICATION environment variable */ + const char *ptr; /* Temporary string pointer */ ++#ifdef WITH_LSPP ++ int i, /* counter */ ++ n, /* counter */ ++ lines, /* number of lines needed */ ++ line_len, /* index into tmp_label */ ++ label_len, /* length of the label in characters */ ++ label_index, /* index into the label */ ++ longest, /* length of the longest line */ ++ longest_line, /* index to the longest line */ ++ max_width; /* maximum width in characters */ ++ char **wrapped_label; /* label with line breaks */ ++#endif /* WITH_LSPP */ + + + /* +@@ -334,6 +352,124 @@ WriteLabelProlog(const char *label, /* I + return; + } + ++#ifdef WITH_LSPP ++ if (strncmp(classification, "LSPP:", 5) == 0 && label == NULL) ++ { ++ /* ++ * Based on the 12pt fixed width font below determine the max_width ++ */ ++ max_width = width / 8; ++ longest_line = 0; ++ longest = 0; ++ classification += 5; // Skip the "LSPP:" ++ label_len = strlen(classification); ++ ++ if (label_len > max_width) ++ { ++ lines = 1 + (int)(label_len / max_width); ++ line_len = (int)(label_len / lines); ++ wrapped_label = malloc(sizeof(wrapped_label) * lines); ++ label_index = i = n = 0; ++ while (classification[label_index]) ++ { ++ if ((label_index + line_len) > label_len) ++ break; ++ switch (classification[label_index + line_len + i]) ++ { ++ case ':': ++ case ',': ++ case '-': ++ i++; ++ wrapped_label[n++] = strndup(&classification[label_index], (line_len + i)); ++ label_index += line_len + i; ++ i = 0; ++ break; ++ default: ++ i++; ++ break; ++ } ++ if ((i + line_len) == max_width) ++ { ++ wrapped_label[n++] = strndup(&(classification[label_index]), (line_len + i)); ++ label_index = label_index + line_len + i; ++ i = 0; ++ } ++ } ++ wrapped_label[n] = strndup(&classification[label_index], label_len - label_index); ++ } ++ else ++ { ++ lines = 1; ++ wrapped_label = malloc(sizeof(wrapped_label)); ++ wrapped_label[0] = (char*)classification; ++ } ++ ++ for (n = 0; n < lines; n++ ) ++ { ++ printf("userdict/ESPp%c(", ('a' + n)); ++ for (ptr = wrapped_label[n], i = 0; *ptr; ptr ++, i++) ++ if (*ptr < 32 || *ptr > 126) ++ printf("\\%03o", *ptr); ++ else ++ { ++ if (*ptr == '(' || *ptr == ')' || *ptr == '\\') ++ putchar('\\'); ++ ++ printf("%c", *ptr); ++ } ++ if (i > longest) ++ { ++ longest = i; ++ longest_line = n; ++ } ++ printf(")put\n"); ++ } ++ ++ /* ++ * For LSPP use a fixed width font so that line wrapping can be calculated ++ */ ++ ++ puts("userdict/ESPlf /Nimbus-Mono findfont 12 scalefont put"); ++ ++ /* ++ * Finally, the procedure to write the labels on the page... ++ */ ++ ++ printf("userdict/ESPwl{\n" ++ " ESPlf setfont\n"); ++ printf(" ESPp%c stringwidth pop dup 12 add exch -0.5 mul %.0f add\n ", ++ 'a' + longest_line, width * 0.5f); ++ for (n = 1; n < lines; n++) ++ printf(" dup"); ++ printf("\n 1 setgray\n"); ++ printf(" dup 6 sub %.0f %d index %.0f ESPrf\n", ++ (bottom - 2.0), (2 + lines), 6.0 + (16.0 * lines)); ++ printf(" dup 6 sub %.0f %d index %.0f ESPrf\n", ++ (top - 6.0 - (16.0 * lines)), (2 + lines), 4.0 + (16.0 * lines)); ++ printf(" 0 setgray\n"); ++ printf(" dup 6 sub %.0f %d index %.0f ESPrs\n", ++ (bottom - 2.0), (2 + lines), 6.0 + (16.0 * lines)); ++ printf(" dup 6 sub %.0f %d index %.0f ESPrs\n", ++ (top - 6.0 - (16.0 * lines)), (2 + lines), 4.0 + (16.0 * lines)); ++ for (n = 0; n < lines; n ++) ++ { ++ printf(" dup %.0f moveto ESPp%c show\n", ++ bottom + 6.0 + ((lines - (n+1)) * 16.0), 'a' + n); ++ printf(" %.0f moveto ESPp%c show\n", top + 2.0 - ((n + 1) * 16.0), 'a' + n); ++ } ++ printf(" pop\n" ++ "}bind put\n"); ++ ++ /* ++ * Do some clean up at the end of the LSPP special case ++ */ ++ free(wrapped_label); ++ ++ } ++ else ++ { ++#endif /* !WITH_LSPP */ ++ + /* + * Set the classification + page label string... + */ +@@ -414,7 +550,10 @@ WriteLabelProlog(const char *label, /* I + printf(" %.0f moveto ESPpl show\n", top - 14.0); + puts("pop"); + puts("}bind put"); ++ } ++#ifdef WITH_LSPP + } ++#endif /* WITH_LSPP */ + + + /* +diff -up /dev/null cups-1.3.1/config-scripts/cups-lspp.m4 +--- /dev/null 2007-09-17 08:47:57.586358512 +0100 ++++ cups-1.3.1/config-scripts/cups-lspp.m4 2007-09-17 16:48:23.000000000 +0100 @@ -0,0 +1,36 @@ +dnl +dnl LSPP code for the Common UNIX Printing System (CUPS). @@ -37,33 +209,9 @@ + ;; + esac +fi ---- cups-1.3rc2/cups/cups.h.lspp 2007-07-13 02:13:26.000000000 +0100 -+++ cups-1.3rc2/cups/cups.h 2007-07-31 12:28:32.000000000 +0100 -@@ -15,6 +15,9 @@ - * This file is subject to the Apple OS-Developed Software exception. - */ - -+/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */ -+/* (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. */ -+ - #ifndef _CUPS_CUPS_H_ - # define _CUPS_CUPS_H_ - -@@ -66,6 +69,12 @@ - # define CUPS_DATE_ANY -1 - - -+# ifdef WITH_LSPP -+# define MLS_CONFIG "mls" -+# define TE_CONFIG "te" -+# define SELINUX_CONFIG "SELinux" -+# define UNKNOWN_SL "UNKNOWN SL" -+# endif /* WITH_LSPP */ - /* - * Types and structures... - */ ---- /dev/null 2007-07-31 09:03:12.827706703 +0100 -+++ cups-1.3rc2/data/mls 2007-07-31 12:28:32.000000000 +0100 +diff -up /dev/null cups-1.3.1/data/mls +--- /dev/null 2007-09-17 08:47:57.586358512 +0100 ++++ cups-1.3.1/data/mls 2007-09-17 16:48:23.000000000 +0100 @@ -0,0 +1,261 @@ +%!PS-Adobe-3.0 +%%BoundingBox: 0 0 612 792 @@ -326,8 +474,9 @@ +% End of "$Id: mls_template,v 1.1 2005/06/27 18:44:46 colmo Exp $". +% +%%EOF ---- /dev/null 2007-07-31 09:03:12.827706703 +0100 -+++ cups-1.3rc2/data/selinux 2007-07-31 12:28:32.000000000 +0100 +diff -up /dev/null cups-1.3.1/data/selinux +--- /dev/null 2007-09-17 08:47:57.586358512 +0100 ++++ cups-1.3.1/data/selinux 2007-09-17 16:48:23.000000000 +0100 @@ -0,0 +1,261 @@ +%!PS-Adobe-3.0 +%%BoundingBox: 0 0 612 792 @@ -590,9 +739,10 @@ +% End of "$Id: mls_template,v 1.1 2005/06/27 18:44:46 colmo Exp $". +% +%%EOF ---- cups-1.3rc2/data/Makefile.lspp 2007-07-11 22:46:42.000000000 +0100 -+++ cups-1.3rc2/data/Makefile 2007-07-31 12:28:32.000000000 +0100 -@@ -25,7 +25,10 @@ +diff -up cups-1.3.1/data/Makefile.lspp cups-1.3.1/data/Makefile +--- cups-1.3.1/data/Makefile.lspp 2007-07-11 22:46:42.000000000 +0100 ++++ cups-1.3.1/data/Makefile 2007-09-17 16:48:23.000000000 +0100 +@@ -25,7 +25,10 @@ BANNERS = \ secret \ standard \ topsecret \ @@ -604,8 +754,9 @@ CHARMAPS = \ euc-cn.txt \ ---- /dev/null 2007-07-31 09:03:12.827706703 +0100 -+++ cups-1.3rc2/data/te 2007-07-31 12:28:32.000000000 +0100 +diff -up /dev/null cups-1.3.1/data/te +--- /dev/null 2007-09-17 08:47:57.586358512 +0100 ++++ cups-1.3.1/data/te 2007-09-17 16:48:23.000000000 +0100 @@ -0,0 +1,261 @@ +%!PS-Adobe-3.0 +%%BoundingBox: 0 0 612 792 @@ -868,178 +1019,9 @@ +% End of "$Id: mls_template,v 1.1 2005/06/27 18:44:46 colmo Exp $". +% +%%EOF ---- cups-1.3rc2/filter/common.c.lspp 2007-07-11 22:46:42.000000000 +0100 -+++ cups-1.3rc2/filter/common.c 2007-07-31 12:28:32.000000000 +0100 -@@ -30,6 +30,12 @@ - * Include necessary headers... - */ - -+#include "config.h" -+#ifdef WITH_LSPP -+#define _GNU_SOURCE -+#include -+#endif /* WITH_LSPP */ -+ - #include "common.h" - #include - -@@ -312,6 +318,18 @@ - { - const char *classification; /* CLASSIFICATION environment variable */ - const char *ptr; /* Temporary string pointer */ -+#ifdef WITH_LSPP -+ int i, /* counter */ -+ n, /* counter */ -+ lines, /* number of lines needed */ -+ line_len, /* index into tmp_label */ -+ label_len, /* length of the label in characters */ -+ label_index, /* index into the label */ -+ longest, /* length of the longest line */ -+ longest_line, /* index to the longest line */ -+ max_width; /* maximum width in characters */ -+ char **wrapped_label; /* label with line breaks */ -+#endif /* WITH_LSPP */ - - - /* -@@ -334,6 +352,124 @@ - return; - } - -+#ifdef WITH_LSPP -+ if (strncmp(classification, "LSPP:", 5) == 0 && label == NULL) -+ { -+ /* -+ * Based on the 12pt fixed width font below determine the max_width -+ */ -+ max_width = width / 8; -+ longest_line = 0; -+ longest = 0; -+ classification += 5; // Skip the "LSPP:" -+ label_len = strlen(classification); -+ -+ if (label_len > max_width) -+ { -+ lines = 1 + (int)(label_len / max_width); -+ line_len = (int)(label_len / lines); -+ wrapped_label = malloc(sizeof(wrapped_label) * lines); -+ label_index = i = n = 0; -+ while (classification[label_index]) -+ { -+ if ((label_index + line_len) > label_len) -+ break; -+ switch (classification[label_index + line_len + i]) -+ { -+ case ':': -+ case ',': -+ case '-': -+ i++; -+ wrapped_label[n++] = strndup(&classification[label_index], (line_len + i)); -+ label_index += line_len + i; -+ i = 0; -+ break; -+ default: -+ i++; -+ break; -+ } -+ if ((i + line_len) == max_width) -+ { -+ wrapped_label[n++] = strndup(&(classification[label_index]), (line_len + i)); -+ label_index = label_index + line_len + i; -+ i = 0; -+ } -+ } -+ wrapped_label[n] = strndup(&classification[label_index], label_len - label_index); -+ } -+ else -+ { -+ lines = 1; -+ wrapped_label = malloc(sizeof(wrapped_label)); -+ wrapped_label[0] = (char*)classification; -+ } -+ -+ for (n = 0; n < lines; n++ ) -+ { -+ printf("userdict/ESPp%c(", ('a' + n)); -+ for (ptr = wrapped_label[n], i = 0; *ptr; ptr ++, i++) -+ if (*ptr < 32 || *ptr > 126) -+ printf("\\%03o", *ptr); -+ else -+ { -+ if (*ptr == '(' || *ptr == ')' || *ptr == '\\') -+ putchar('\\'); -+ -+ printf("%c", *ptr); -+ } -+ if (i > longest) -+ { -+ longest = i; -+ longest_line = n; -+ } -+ printf(")put\n"); -+ } -+ -+ /* -+ * For LSPP use a fixed width font so that line wrapping can be calculated -+ */ -+ -+ puts("userdict/ESPlf /Nimbus-Mono findfont 12 scalefont put"); -+ -+ /* -+ * Finally, the procedure to write the labels on the page... -+ */ -+ -+ printf("userdict/ESPwl{\n" -+ " ESPlf setfont\n"); -+ printf(" ESPp%c stringwidth pop dup 12 add exch -0.5 mul %.0f add\n ", -+ 'a' + longest_line, width * 0.5f); -+ for (n = 1; n < lines; n++) -+ printf(" dup"); -+ printf("\n 1 setgray\n"); -+ printf(" dup 6 sub %.0f %d index %.0f ESPrf\n", -+ (bottom - 2.0), (2 + lines), 6.0 + (16.0 * lines)); -+ printf(" dup 6 sub %.0f %d index %.0f ESPrf\n", -+ (top - 6.0 - (16.0 * lines)), (2 + lines), 4.0 + (16.0 * lines)); -+ printf(" 0 setgray\n"); -+ printf(" dup 6 sub %.0f %d index %.0f ESPrs\n", -+ (bottom - 2.0), (2 + lines), 6.0 + (16.0 * lines)); -+ printf(" dup 6 sub %.0f %d index %.0f ESPrs\n", -+ (top - 6.0 - (16.0 * lines)), (2 + lines), 4.0 + (16.0 * lines)); -+ for (n = 0; n < lines; n ++) -+ { -+ printf(" dup %.0f moveto ESPp%c show\n", -+ bottom + 6.0 + ((lines - (n+1)) * 16.0), 'a' + n); -+ printf(" %.0f moveto ESPp%c show\n", top + 2.0 - ((n + 1) * 16.0), 'a' + n); -+ } -+ printf(" pop\n" -+ "}bind put\n"); -+ -+ /* -+ * Do some clean up at the end of the LSPP special case -+ */ -+ free(wrapped_label); -+ -+ } -+ else -+ { -+#endif /* !WITH_LSPP */ -+ - /* - * Set the classification + page label string... - */ -@@ -414,7 +550,10 @@ - printf(" %.0f moveto ESPpl show\n", top - 14.0); - puts("pop"); - puts("}bind put"); -+ } -+#ifdef WITH_LSPP - } -+#endif /* WITH_LSPP */ - - - /* ---- cups-1.3rc2/scheduler/client.h.lspp 2007-07-11 22:46:42.000000000 +0100 -+++ cups-1.3rc2/scheduler/client.h 2007-07-31 12:28:32.000000000 +0100 +diff -up cups-1.3.1/scheduler/client.h.lspp cups-1.3.1/scheduler/client.h +--- cups-1.3.1/scheduler/client.h.lspp 2007-09-12 22:09:49.000000000 +0100 ++++ cups-1.3.1/scheduler/client.h 2007-09-17 16:48:23.000000000 +0100 @@ -17,6 +17,13 @@ # include #endif /* HAVE_AUTHORIZATION_H */ @@ -1054,7 +1036,7 @@ /* * HTTP client structure... */ -@@ -62,6 +69,10 @@ +@@ -61,6 +68,10 @@ struct cupsd_client_s #ifdef HAVE_AUTHORIZATION_H AuthorizationRef authref; /* Authorization ref */ #endif /* HAVE_AUTHORIZATION_H */ @@ -1065,7 +1047,7 @@ }; #define HTTP(con) &((con)->http) -@@ -127,6 +138,9 @@ +@@ -128,6 +139,9 @@ extern void cupsdStartListening(void); extern void cupsdStopListening(void); extern void cupsdUpdateCGI(void); extern void cupsdWriteClient(cupsd_client_t *con); @@ -1075,8 +1057,9 @@ /* ---- cups-1.3rc2/scheduler/conf.c.lspp 2007-07-31 12:28:32.000000000 +0100 -+++ cups-1.3rc2/scheduler/conf.c 2007-07-31 12:28:32.000000000 +0100 +diff -up cups-1.3.1/scheduler/conf.c.lspp cups-1.3.1/scheduler/conf.c +--- cups-1.3.1/scheduler/conf.c.lspp 2007-09-17 16:48:23.000000000 +0100 ++++ cups-1.3.1/scheduler/conf.c 2007-09-17 16:50:08.000000000 +0100 @@ -26,6 +26,7 @@ * read_configuration() - Read a configuration file. * read_location() - Read a definition. @@ -1095,9 +1078,9 @@ /* * Configuration variable structure... -@@ -158,6 +162,10 @@ +@@ -160,6 +164,10 @@ static cupsd_var_t variables[] = # if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS) - { "ServerKey", &ServerKey, CUPSD_VARTYPE_STRING }, + { "ServerKey", &ServerKey, CUPSD_VARTYPE_PATHNAME }, # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ +#ifdef WITH_LSPP + { "AuditLog", &AuditLog, CUPSD_VARTYPE_INTEGER }, @@ -1105,18 +1088,18 @@ +#endif /* WITH_LSPP */ #endif /* HAVE_SSL */ { "ServerName", &ServerName, CUPSD_VARTYPE_STRING }, - { "ServerRoot", &ServerRoot, CUPSD_VARTYPE_STRING }, -@@ -348,6 +356,9 @@ - *old_requestroot; /* Old RequestRoot */ + { "ServerRoot", &ServerRoot, CUPSD_VARTYPE_PATHNAME }, +@@ -352,6 +360,9 @@ cupsdReadConfiguration(void) const char *tmpdir; /* TMPDIR environment variable */ struct stat tmpinfo; /* Temporary directory info */ + cupsd_policy_t *p; /* Policy */ +#ifdef WITH_LSPP + char *audit_message; /* Audit message string */ +#endif /* WITH_LSPP */ /* -@@ -609,6 +620,25 @@ +@@ -616,6 +627,25 @@ cupsdReadConfiguration(void) RunUser = getuid(); @@ -1142,7 +1125,7 @@ /* * See if the ServerName is an IP address... */ -@@ -883,11 +913,23 @@ +@@ -890,11 +920,23 @@ cupsdReadConfiguration(void) if (MaxActiveJobs > (MaxFDs / 3)) MaxActiveJobs = MaxFDs / 3; @@ -1167,7 +1150,7 @@ /* * Update the MaxClientsPerHost value, as needed... -@@ -3343,6 +3385,18 @@ +@@ -3393,6 +3435,18 @@ read_policy(cups_file_t *fp, /* I - Con return (0); } @@ -1185,9 +1168,10 @@ + /* - * End of "$Id: conf.c 6746 2007-07-30 16:47:10Z mike $". ---- cups-1.3rc2/scheduler/client.c.lspp 2007-07-26 20:08:40.000000000 +0100 -+++ cups-1.3rc2/scheduler/client.c 2007-07-31 12:28:32.000000000 +0100 + * End of "$Id: conf.c 6930 2007-09-08 00:28:06Z mike $". +diff -up cups-1.3.1/scheduler/client.c.lspp cups-1.3.1/scheduler/client.c +--- cups-1.3.1/scheduler/client.c.lspp 2007-08-15 19:36:14.000000000 +0100 ++++ cups-1.3.1/scheduler/client.c 2007-09-17 16:48:23.000000000 +0100 @@ -39,12 +39,14 @@ * pipe_command() - Pipe the output of a command to the remote client. * write_file() - Send a file via HTTP. @@ -1203,7 +1187,7 @@ #include #include "cupsd.h" -@@ -76,6 +78,12 @@ +@@ -76,6 +78,12 @@ extern const char *cssmErrorString(int e # include #endif /* HAVE_GNUTLS */ @@ -1216,7 +1200,7 @@ /* * Local functions... -@@ -335,6 +343,57 @@ +@@ -339,6 +347,57 @@ cupsdAcceptClient(cupsd_listener_t *lis) } } @@ -1274,7 +1258,7 @@ #ifdef AF_INET6 if (con->http.hostaddr->addr.sa_family == AF_INET6) cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdAcceptClient: %d from %s:%d (IPv6)", -@@ -717,6 +776,13 @@ +@@ -721,6 +780,13 @@ cupsdReadClient(cupsd_client_t *con) /* mime_type_t *type; /* MIME type of file */ cupsd_printer_t *p; /* Printer */ static unsigned request_id = 0; /* Request ID for temp files */ @@ -1288,7 +1272,7 @@ status = HTTP_CONTINUE; -@@ -1989,6 +2055,67 @@ +@@ -1993,6 +2059,67 @@ cupsdReadClient(cupsd_client_t *con) /* fchmod(con->file, 0640); fchown(con->file, RunUser, Group); fcntl(con->file, F_SETFD, fcntl(con->file, F_GETFD) | FD_CLOEXEC); @@ -1356,7 +1340,7 @@ } if (con->http.state != HTTP_POST_SEND) -@@ -4157,6 +4284,50 @@ +@@ -4197,6 +4324,50 @@ make_certificate(cupsd_client_t *con) /* #endif /* HAVE_SSL */ @@ -1407,8 +1391,9 @@ /* * 'pipe_command()' - Pipe the output of a command to the remote client. */ ---- cups-1.3rc2/scheduler/main.c.lspp 2007-07-31 12:28:32.000000000 +0100 -+++ cups-1.3rc2/scheduler/main.c 2007-07-31 12:28:32.000000000 +0100 +diff -up cups-1.3.1/scheduler/main.c.lspp cups-1.3.1/scheduler/main.c +--- cups-1.3.1/scheduler/main.c.lspp 2007-09-17 16:48:23.000000000 +0100 ++++ cups-1.3.1/scheduler/main.c 2007-09-17 16:48:23.000000000 +0100 @@ -35,6 +35,8 @@ * usage() - Show scheduler usage. */ @@ -1428,7 +1413,7 @@ /* * Local functions... -@@ -150,6 +155,9 @@ +@@ -150,6 +155,9 @@ main(int argc, /* I - Number of comm int launchd_idle_exit; /* Idle exit on select timeout? */ #endif /* HAVE_LAUNCHD */ @@ -1437,8 +1422,8 @@ +#endif /* WITH_LSPP */ - /* -@@ -368,6 +376,25 @@ + #ifdef HAVE_GETEUID +@@ -385,6 +393,25 @@ main(int argc, /* I - Number of comm #endif /* DEBUG */ } @@ -1464,7 +1449,7 @@ /* * Set the timezone info... */ -@@ -1019,6 +1046,11 @@ +@@ -1094,6 +1121,11 @@ main(int argc, /* I - Number of comm cupsdStopSelect(); @@ -1476,9 +1461,10 @@ return (!stop_scheduler); } ---- cups-1.3rc2/scheduler/conf.h.lspp 2007-07-31 12:28:32.000000000 +0100 -+++ cups-1.3rc2/scheduler/conf.h 2007-07-31 12:28:32.000000000 +0100 -@@ -190,6 +190,12 @@ +diff -up cups-1.3.1/scheduler/conf.h.lspp cups-1.3.1/scheduler/conf.h +--- cups-1.3.1/scheduler/conf.h.lspp 2007-09-17 16:48:23.000000000 +0100 ++++ cups-1.3.1/scheduler/conf.h 2007-09-17 16:48:23.000000000 +0100 +@@ -190,6 +190,12 @@ VAR char *ServerKey VALUE(NULL); /* Server key file */ # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ #endif /* HAVE_SSL */ @@ -1491,7 +1477,7 @@ #ifdef HAVE_LAUNCHD VAR int LaunchdTimeout VALUE(DEFAULT_TIMEOUT); -@@ -208,6 +214,9 @@ +@@ -208,6 +214,9 @@ VAR char *SystemGroupAuthKey VALUE(NULL /* System group auth key */ #endif /* HAVE_AUTHORIZATION_H */ @@ -1501,8 +1487,9 @@ /* * Prototypes... ---- cups-1.3rc2/scheduler/ipp.c.lspp 2007-07-31 12:28:32.000000000 +0100 -+++ cups-1.3rc2/scheduler/ipp.c 2007-07-31 12:29:34.000000000 +0100 +diff -up cups-1.3.1/scheduler/ipp.c.lspp cups-1.3.1/scheduler/ipp.c +--- cups-1.3.1/scheduler/ipp.c.lspp 2007-09-17 16:48:23.000000000 +0100 ++++ cups-1.3.1/scheduler/ipp.c 2007-09-17 16:48:23.000000000 +0100 @@ -36,6 +36,7 @@ * cancel_all_jobs() - Cancel all print jobs. * cancel_job() - Cancel a print job. @@ -1511,7 +1498,7 @@ * check_quotas() - Check quotas for a printer and user. * copy_attribute() - Copy a single attribute. * copy_attrs() - Copy attributes from one request to another. -@@ -93,6 +94,9 @@ +@@ -94,6 +95,9 @@ * validate_user() - Validate the user for the request. */ @@ -1521,7 +1508,7 @@ /* * Include necessary headers... */ -@@ -120,6 +124,14 @@ +@@ -117,6 +121,14 @@ extern int mbr_check_membership_by_id(uu # endif /* HAVE_MEMBERSHIPPRIV_H */ #endif /* __APPLE__ */ @@ -1536,7 +1523,7 @@ /* * Local functions... -@@ -144,6 +156,9 @@ +@@ -141,6 +153,9 @@ static void authenticate_job(cupsd_clien static void cancel_all_jobs(cupsd_client_t *con, ipp_attribute_t *uri); static void cancel_job(cupsd_client_t *con, ipp_attribute_t *uri); static void cancel_subscription(cupsd_client_t *con, int id); @@ -1546,7 +1533,7 @@ static int check_quotas(cupsd_client_t *con, cupsd_printer_t *p); static ipp_attribute_t *copy_attribute(ipp_t *to, ipp_attribute_t *attr, int quickcopy); -@@ -1235,6 +1250,21 @@ +@@ -1237,6 +1252,21 @@ add_job(cupsd_client_t *con, /* I - Cl int kbytes; /* Size of print file */ int i; /* Looping var */ int lowerpagerange; /* Page range bound */ @@ -1568,7 +1555,7 @@ cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_job(%p[%d], %p(%s), %p(%s/%s))", -@@ -1421,6 +1451,104 @@ +@@ -1423,6 +1453,104 @@ add_job(cupsd_client_t *con, /* I - Cl ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, title = "Untitled"); @@ -1673,7 +1660,7 @@ if ((job = cupsdAddJob(priority, printer->name)) == NULL) { send_ipp_status(con, IPP_INTERNAL_ERROR, -@@ -1429,6 +1557,32 @@ +@@ -1431,6 +1559,32 @@ add_job(cupsd_client_t *con, /* I - Cl return (NULL); } @@ -1706,7 +1693,7 @@ job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT | CUPS_PRINTER_REMOTE); job->attrs = con->request; -@@ -1645,6 +1799,29 @@ +@@ -1647,6 +1801,29 @@ add_job(cupsd_client_t *con, /* I - Cl attr->values[0].string.text = _cupsStrAlloc(printer->job_sheets[0]); attr->values[1].string.text = _cupsStrAlloc(printer->job_sheets[1]); } @@ -1736,7 +1723,7 @@ job->job_sheets = attr; -@@ -1675,6 +1852,9 @@ +@@ -1677,6 +1854,9 @@ add_job(cupsd_client_t *con, /* I - Cl "job-sheets=\"%s,none\", " "job-originating-user-name=\"%s\"", job->id, Classification, job->username); @@ -1746,7 +1733,7 @@ } else if (attr->num_values == 2 && strcmp(attr->values[0].string.text, -@@ -1693,6 +1873,9 @@ +@@ -1695,6 +1875,9 @@ add_job(cupsd_client_t *con, /* I - Cl "job-originating-user-name=\"%s\"", job->id, attr->values[0].string.text, attr->values[1].string.text, job->username); @@ -1756,7 +1743,7 @@ } else if (strcmp(attr->values[0].string.text, Classification) && strcmp(attr->values[0].string.text, "none") && -@@ -1713,6 +1896,9 @@ +@@ -1715,6 +1898,9 @@ add_job(cupsd_client_t *con, /* I - Cl "job-originating-user-name=\"%s\"", job->id, attr->values[0].string.text, attr->values[1].string.text, job->username); @@ -1766,7 +1753,7 @@ } } else if (strcmp(attr->values[0].string.text, Classification) && -@@ -1753,9 +1939,52 @@ +@@ -1755,9 +1941,52 @@ add_job(cupsd_client_t *con, /* I - Cl "job-sheets=\"%s\", " "job-originating-user-name=\"%s\"", job->id, Classification, job->username); @@ -1819,7 +1806,7 @@ /* * See if we need to add the starting sheet... */ -@@ -3317,6 +3546,103 @@ +@@ -3333,6 +3562,103 @@ cancel_subscription( } @@ -1923,7 +1910,7 @@ /* * 'check_quotas()' - Check quotas for a printer and user. */ -@@ -3845,6 +4171,15 @@ +@@ -3861,6 +4187,15 @@ copy_banner(cupsd_client_t *con, /* I - char attrname[255], /* Name of attribute */ *s; /* Pointer into name */ ipp_attribute_t *attr; /* Attribute */ @@ -1939,7 +1926,7 @@ cupsdLogMessage(CUPSD_LOG_DEBUG2, "copy_banner(%p[%d], %p[%d], %s)", -@@ -3879,6 +4214,81 @@ +@@ -3895,6 +4230,81 @@ copy_banner(cupsd_client_t *con, /* I - fchmod(cupsFileNumber(out), 0640); fchown(cupsFileNumber(out), RunUser, Group); @@ -2021,7 +2008,7 @@ /* * Try the localized banner file under the subdirectory... -@@ -3973,6 +4383,24 @@ +@@ -3989,6 +4399,24 @@ copy_banner(cupsd_client_t *con, /* I - else s = attrname; @@ -2046,7 +2033,7 @@ if (!strcmp(s, "printer-name")) { cupsFilePuts(out, job->dest); -@@ -5694,6 +6122,22 @@ +@@ -5858,6 +6286,22 @@ get_job_attrs(cupsd_client_t *con, /* I return; } @@ -2069,7 +2056,7 @@ /* * Copy attributes... */ -@@ -5893,6 +6337,11 @@ +@@ -6057,6 +6501,11 @@ get_jobs(cupsd_client_t *con, /* I - C if (count > 0) ippAddSeparator(con->response); @@ -2081,7 +2068,7 @@ count ++; cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs: count = %d", count); -@@ -9881,6 +10330,11 @@ +@@ -10080,6 +10529,11 @@ validate_user(cupsd_job_t *job, /* I strlcpy(username, get_username(con), userlen); @@ -2093,8 +2080,9 @@ /* * Check the username against the owner... */ ---- cups-1.3rc2/scheduler/job.c.lspp 2007-07-31 12:28:32.000000000 +0100 -+++ cups-1.3rc2/scheduler/job.c 2007-07-31 12:28:32.000000000 +0100 +diff -up cups-1.3.1/scheduler/job.c.lspp cups-1.3.1/scheduler/job.c +--- cups-1.3.1/scheduler/job.c.lspp 2007-09-17 16:48:23.000000000 +0100 ++++ cups-1.3.1/scheduler/job.c 2007-09-17 16:48:23.000000000 +0100 @@ -60,6 +60,9 @@ * update_job_attrs() - Update the job-printer-* attributes. */ @@ -2120,7 +2108,7 @@ /* * Local globals... -@@ -1063,6 +1074,23 @@ +@@ -1077,6 +1088,23 @@ cupsdLoadJob(cupsd_job_t *job) /* I - J return; } @@ -2144,7 +2132,7 @@ job->sheets = ippFindAttribute(job->attrs, "job-media-sheets-completed", IPP_TAG_INTEGER); job->job_sheets = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME); -@@ -1416,6 +1444,13 @@ +@@ -1430,6 +1458,13 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J { char filename[1024]; /* Job control filename */ cups_file_t *fp; /* Job file */ @@ -2158,7 +2146,7 @@ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSaveJob(job=%p(%d)): job->attrs=%p", -@@ -1434,6 +1469,76 @@ +@@ -1448,6 +1483,76 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J fchmod(cupsFileNumber(fp), 0600); fchown(cupsFileNumber(fp), RunUser, Group); @@ -2235,7 +2223,7 @@ job->attrs->state = IPP_IDLE; if (ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL, -@@ -2446,6 +2551,21 @@ +@@ -2456,6 +2561,21 @@ start_job(cupsd_job_t *job, /* I - /* RIP_MAX_CACHE env variable */ static char *options = NULL;/* Full list of options */ static int optlength = 0; /* Length of option buffer */ @@ -2257,7 +2245,7 @@ cupsdLogMessage(CUPSD_LOG_DEBUG2, "[Job %d] start_job: file = %d/%d", -@@ -2697,6 +2817,106 @@ +@@ -2707,6 +2827,106 @@ start_job(cupsd_job_t *job, /* I - fcntl(job->side_pipes[1], F_GETFL) | O_NONBLOCK); } @@ -2364,7 +2352,7 @@ /* * Determine if we are printing a banner page or not... */ -@@ -2837,6 +3057,18 @@ +@@ -2851,6 +3071,18 @@ start_job(cupsd_job_t *job, /* I - banner_page) continue; @@ -2383,7 +2371,7 @@ /* * Otherwise add them to the list... */ -@@ -3053,6 +3285,67 @@ +@@ -3067,6 +3299,67 @@ start_job(cupsd_job_t *job, /* I - envp[envc ++] = final_content_type; } @@ -2451,8 +2439,9 @@ if (Classification && !banner_page) { if ((attr = ippFindAttribute(job->attrs, "job-sheets", ---- cups-1.3rc2/scheduler/printers.c.lspp 2007-07-31 12:28:32.000000000 +0100 -+++ cups-1.3rc2/scheduler/printers.c 2007-07-31 12:28:32.000000000 +0100 +diff -up cups-1.3.1/scheduler/printers.c.lspp cups-1.3.1/scheduler/printers.c +--- cups-1.3.1/scheduler/printers.c.lspp 2007-09-17 16:48:23.000000000 +0100 ++++ cups-1.3.1/scheduler/printers.c 2007-09-17 16:48:23.000000000 +0100 @@ -50,6 +50,8 @@ * printing desktop tools. */ @@ -2462,7 +2451,7 @@ /* * Include necessary headers... */ -@@ -73,6 +75,10 @@ +@@ -73,6 +75,10 @@ static void write_irix_config(cupsd_prin static void write_irix_state(cupsd_printer_t *p); #endif /* __sgi */ @@ -2473,7 +2462,7 @@ /* * 'cupsdAddPrinter()' - Add a printer to the system. -@@ -1700,6 +1706,13 @@ +@@ -1709,6 +1715,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) { /* No authentication */ "none" }; @@ -2487,7 +2476,7 @@ DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name, -@@ -1843,6 +1856,44 @@ +@@ -1852,6 +1865,44 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) attr->values[1].string.text = _cupsStrAlloc(Classification ? Classification : p->job_sheets[1]); } @@ -2532,8 +2521,9 @@ } p->raw = 0; ---- cups-1.3rc2/scheduler/job.h.lspp 2007-07-12 23:58:17.000000000 +0100 -+++ cups-1.3rc2/scheduler/job.h 2007-07-31 12:28:32.000000000 +0100 +diff -up cups-1.3.1/scheduler/job.h.lspp cups-1.3.1/scheduler/job.h +--- cups-1.3.1/scheduler/job.h.lspp 2007-08-01 20:02:47.000000000 +0100 ++++ cups-1.3.1/scheduler/job.h 2007-09-17 16:48:23.000000000 +0100 @@ -13,6 +13,13 @@ * file is missing or damaged, see the license at "http://www.cups.org/". */ @@ -2548,8 +2538,8 @@ /* * Job request structure... */ -@@ -59,6 +66,10 @@ - #ifdef HAVE_GSSAPI +@@ -60,6 +67,10 @@ typedef struct cupsd_job_s + krb5_ccache ccache; /* Kerberos credential cache */ char *ccname; /* KRB5CCNAME environment variable */ #endif /* HAVE_GSSAPI */ +#ifdef WITH_LSPP @@ -2559,9 +2549,36 @@ } cupsd_job_t; ---- cups-1.3rc2/Makedefs.in.lspp 2007-07-18 20:49:45.000000000 +0100 -+++ cups-1.3rc2/Makedefs.in 2007-07-31 12:28:32.000000000 +0100 -@@ -134,7 +134,7 @@ +diff -up cups-1.3.1/cups/cups.h.lspp cups-1.3.1/cups/cups.h +--- cups-1.3.1/cups/cups.h.lspp 2007-08-27 22:13:35.000000000 +0100 ++++ cups-1.3.1/cups/cups.h 2007-09-17 16:48:23.000000000 +0100 +@@ -15,6 +15,9 @@ + * This file is subject to the Apple OS-Developed Software exception. + */ + ++/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */ ++/* (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. */ ++ + #ifndef _CUPS_CUPS_H_ + # define _CUPS_CUPS_H_ + +@@ -66,6 +69,12 @@ extern "C" { + # define CUPS_DATE_ANY -1 + + ++# ifdef WITH_LSPP ++# define MLS_CONFIG "mls" ++# define TE_CONFIG "te" ++# define SELINUX_CONFIG "SELinux" ++# define UNKNOWN_SL "UNKNOWN SL" ++# endif /* WITH_LSPP */ + /* + * Types and structures... + */ +diff -up cups-1.3.1/Makedefs.in.lspp cups-1.3.1/Makedefs.in +--- cups-1.3.1/Makedefs.in.lspp 2007-07-18 20:49:45.000000000 +0100 ++++ cups-1.3.1/Makedefs.in 2007-09-17 16:48:23.000000000 +0100 +@@ -134,7 +134,7 @@ LIBCUPSORDER = @LIBCUPSORDER@ LIBCUPSIMAGEORDER = @LIBCUPSIMAGEORDER@ LINKCUPS = @LINKCUPS@ $(SSLLIBS) LINKCUPSIMAGE = @LINKCUPSIMAGE@ @@ -2570,9 +2587,10 @@ OPTIM = @OPTIM@ OPTIONS = PAMLIBS = @PAMLIBS@ ---- cups-1.3rc2/config.h.in.lspp 2007-07-25 01:40:03.000000000 +0100 -+++ cups-1.3rc2/config.h.in 2007-07-31 12:28:32.000000000 +0100 -@@ -537,6 +537,13 @@ +diff -up cups-1.3.1/config.h.in.lspp cups-1.3.1/config.h.in +--- cups-1.3.1/config.h.in.lspp 2007-09-08 01:28:06.000000000 +0100 ++++ cups-1.3.1/config.h.in 2007-09-17 16:48:23.000000000 +0100 +@@ -552,6 +552,13 @@ #undef HAVE_REMOVEFILE @@ -2586,9 +2604,10 @@ #endif /* !_CUPS_CONFIG_H_ */ /* ---- cups-1.3rc2/configure.in.lspp 2007-07-25 00:47:12.000000000 +0100 -+++ cups-1.3rc2/configure.in 2007-07-31 12:28:32.000000000 +0100 -@@ -42,6 +42,8 @@ +diff -up cups-1.3.1/configure.in.lspp cups-1.3.1/configure.in +--- cups-1.3.1/configure.in.lspp 2007-07-25 00:47:12.000000000 +0100 ++++ cups-1.3.1/configure.in 2007-09-17 16:48:23.000000000 +0100 +@@ -42,6 +42,8 @@ sinclude(config-scripts/cups-pap.m4) sinclude(config-scripts/cups-pdf.m4) sinclude(config-scripts/cups-scripting.m4) diff --git a/cups.spec b/cups.spec index 237bccc..eb87071 100644 --- a/cups.spec +++ b/cups.spec @@ -5,8 +5,8 @@ Summary: Common Unix Printing System Name: cups -Version: 1.3.0 -Release: 2%{?dist} +Version: 1.3.1 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Daemons Source: ftp://ftp.easysw.com/pub/cups/test//cups-%{version}-source.tar.bz2 @@ -172,7 +172,8 @@ export CFLAGS="-DLDAP_DEPRECATED=1" %if %lspp --enable-lspp \ %endif - --with-log-file-perm=0600 --enable-pie --enable-relro + --with-log-file-perm=0600 --enable-pie --enable-relro \ + localedir=%{_datadir}/locale # If we got this far, all prerequisite libraries must be here. make @@ -362,7 +363,7 @@ rm -rf $RPM_BUILD_ROOT /etc/cups/pstoraster.convs %config(noreplace) /etc/pam.d/cups %dir %{_docdir}/cups-%{version} -%{_docdir}/cups-%{version}/favicon.ico +%{_docdir}/cups-%{version}/favicon.* %{_docdir}/cups-%{version}/images %{_docdir}/cups-%{version}/de %{_docdir}/cups-%{version}/es @@ -438,6 +439,9 @@ rm -rf $RPM_BUILD_ROOT %{cups_serverbin}/daemon/cups-lpd %changelog +* Mon Sep 17 2007 Tim Waugh 1:1.3.1-1 +- 1.3.1. + * Wed Aug 29 2007 Tim Waugh 1:1.3.0-2 - More specific license tag. diff --git a/sources b/sources index dc6ac64..0f8b92b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ b0bb017098e8e76b8a25e666c41ce540 postscript.ppd.gz -ae2855d5d1ab5b5fcbb8a2613cefec14 cups-1.3.0-source.tar.bz2 +89ec473d48598cde9b2030743b15448b cups-1.3.1-source.tar.bz2