rpms/cups/devel cups-lspp.patch,1.29,1.30 cups.spec,1.410,1.411

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Wed May 28 09:05:05 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/cups/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21548

Modified Files:
	cups-lspp.patch cups.spec 
Log Message:
* Wed May 28 2008 Tim Waugh <twaugh at redhat.com>
- If cupsdTimeoutJob is called when the originating connection is still
  known, pass that to the function so that copy_banner can get at it if
  necessary (bug #447200).


cups-lspp.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.29 -r 1.30 cups-lspp.patch
Index: cups-lspp.patch
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups-lspp.patch,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- cups-lspp.patch	5 Feb 2008 15:37:24 -0000	1.29
+++ cups-lspp.patch	28 May 2008 09:04:18 -0000	1.30
@@ -1,44 +1,6 @@
---- /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
-@@ -0,0 +1,36 @@
-+dnl
-+dnl   LSPP code for the Common UNIX Printing System (CUPS).
-+dnl
-+dnl   Copyright 2005-2006 by Hewlett-Packard Development Company, L.P.
-+dnl
-+dnl   This program is free software; you can redistribute it and/or modify
-+dnl   it under the terms of the GNU General Public License as published by
-+dnl   the Free Software Foundation; version 2.
-+dnl
-+dnl   This program is distributed in the hope that it will be useful, but
-+dnl   WITHOUT ANY WARRANTY; without even the implied warranty of
-+dnl   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+dnl   General Public License for more details.
-+dnl
-+dnl   You should have received a copy of the GNU General Public License
-+dnl   along with this program; if not, write to the Free Software Foundation,
-+dnl   Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA
-+dnl
-+
-+dnl Are we trying to meet LSPP requirements
-+AC_ARG_ENABLE(lspp, [  --enable-lspp           turn on auditing and label support, default=no])
-+
-+if test x"$enable_lspp" != xno; then
-+    case "$uname" in
-+        Linux)
-+            AC_CHECK_LIB(audit,audit_log_user_message, [LIBAUDIT="-laudit" AC_SUBST(LIBAUDIT)])
-+            AC_CHECK_HEADER(libaudit.h)
-+            AC_CHECK_LIB(selinux,getpeercon, [LIBSELINUX="-lselinux" AC_SUBST(LIBSELINUX)])
-+            AC_CHECK_HEADER(selinux/selinux.h)
-+            AC_DEFINE(WITH_LSPP)
-+            ;;
-+        *)
-+            # All others
-+            ;;
-+    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
+diff -up cups-1.3.7/cups/cups.h.lspp cups-1.3.7/cups/cups.h
+--- cups-1.3.7/cups/cups.h.lspp	2008-02-20 00:32:58.000000000 +0000
++++ cups-1.3.7/cups/cups.h	2008-05-28 10:01:11.000000000 +0100
 @@ -15,6 +15,9 @@
   *   This file is subject to the Apple OS-Developed Software exception.
   */
@@ -49,7 +11,7 @@
  #ifndef _CUPS_CUPS_H_
  #  define _CUPS_CUPS_H_
  
-@@ -66,6 +69,12 @@
+@@ -66,6 +69,12 @@ extern "C" {
  #  define CUPS_DATE_ANY		-1
  
  
@@ -62,984 +24,1557 @@
  /*
   * 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
-@@ -0,0 +1,261 @@
-+%!PS-Adobe-3.0
-+%%BoundingBox: 0 0 612 792
-+%%Pages: 1
-+%%LanguageLevel: 1
-+%%DocumentData: Clean7Bit
-+%%DocumentSuppliedResources: procset bannerprint/1.0
-+%%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman
-+%%Creator: Michael Sweet, Easy Software Products
-+%%CreationDate: May 10, 2000
-+%%Title: Test Page
-+%%EndComments
-+%%BeginProlog
-+%%BeginResource procset bannerprint 1.1 0
-+%
-+%   PostScript banner page for the Common UNIX Printing System ("CUPS").
-+%
-+%   Copyright 1993-2005 by Easy Software Products
-+%
-+%   These coded instructions, statements, and computer programs are the
-+%   property of Easy Software Products and are protected by Federal
-+%   copyright law.  Distribution and use rights are outlined in the file
-+%   "LICENSE.txt" which should have been included with this file.  If this
-+%   file is missing or damaged please contact Easy Software Products
-+%   at:
-+%
-+%       Attn: CUPS Licensing Information
-+%       Easy Software Products
-+%       44141 Airport View Drive, Suite 204
-+%       Hollywood, Maryland 20636 USA
-+%
-+%       Voice: (301) 373-9600
-+%       EMail: cups-info at cups.org
-+%         WWW: http://www.cups.org
-+%
-+/CENTER {			% Draw centered text
-+				% (name) CENTER -
-+  dup stringwidth pop		% Get the width of the string
-+  0.5 mul neg 0 rmoveto		% Shift left 1/2 of the distance
-+  show				% Show the string
-+} bind def
-+/RIGHT {			% Draw right-justified text
-+				% (name) RIGHT -
-+  dup stringwidth pop		% Get the width of the string
-+  neg 0 rmoveto			% Shift left the entire distance
-+  show				% Show the string
-+} bind def
-+/NUMBER {			% Draw a number
-+				% power n NUMBER -
-+  1 index 1 eq {		% power == 1?
-+    round cvi exch pop		% Convert "n" to integer
-+  } {
-+    1 index mul round exch div	% Truncate extra decimal places
-+  } ifelse
-+  100 string cvs show		% Convert to a string and show it...
-+} bind def
-+/CUPSLOGO {			% Draw the CUPS logo
-+				% height CUPSLOGO
-+  % Start with a big C...
-+  /Helvetica findfont 1 index scalefont setfont
-+  0 setgray
-+  0 0 moveto
-+  (C) show
+diff -up cups-1.3.7/scheduler/job.c.lspp cups-1.3.7/scheduler/job.c
+--- cups-1.3.7/scheduler/job.c.lspp	2008-05-28 10:01:11.000000000 +0100
++++ cups-1.3.7/scheduler/job.c	2008-05-28 10:01:11.000000000 +0100
+@@ -60,6 +60,9 @@
+  *   update_job_attrs()         - Update the job-printer-* attributes.
+  */
+ 
++/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */
++/* (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. */
 +
-+  % Then "UNIX Printing System" much smaller...
-+  /Helvetica-Bold findfont 1 index 9 div scalefont setfont
-+  0.25 mul
-+  dup dup 2.0 mul moveto
-+  (UNIX) show
-+  dup dup 1.6 mul moveto
-+  (Printing) show
-+  dup 1.2 mul moveto
-+  (System) show
-+} bind def
-+/ESPLOGO {			% Draw the ESP logo
-+				% height ESPLOGO
-+  % Compute the size of the logo...
-+  0 0
-+  2 index 1.5 mul 3 index
+ /*
+  * Include necessary headers...
+  */
+@@ -69,6 +72,14 @@
+ #include <cups/backend.h>
+ #include <cups/dir.h>
+ 
++#ifdef WITH_LSPP
++#include <libaudit.h>
++#include <selinux/selinux.h>
++#include <selinux/context.h>
++#include <selinux/avc.h>
++#include <selinux/flask.h>
++#include <selinux/av_permissions.h>
++#endif /* WITH_LSPP */
+ 
+ /*
+  * Local globals...
+@@ -380,7 +391,7 @@ cupsdCheckJobs(void)
+       if (job->pending_timeout)
+       {
+        /* Add trailing banner as needed */
+-        if (cupsdTimeoutJob(job))
++        if (cupsdTimeoutJob(job, NULL))
+ 	  continue;
+       }
+ 
+@@ -1100,6 +1111,23 @@ cupsdLoadJob(cupsd_job_t *job)		/* I - J
+     return;
+   }
+ 
++#ifdef WITH_LSPP
++  if ((attr = ippFindAttribute(job->attrs, "security-context", IPP_TAG_NAME)) != NULL)
++    cupsdSetString(&job->scon, attr->values[0].string.text);
++  else if (is_lspp_config())
++  {
++   /*
++    * There was no security context so delete the job
++    */
++    cupsdLogMessage(CUPSD_LOG_ERROR, "LoadAllJobs: Missing or bad security-context attribute in control file \"%s\"!",
++                    jobfile);
[...4606 lines suppressed...]
-+  char		*audit_message;		/* Audit message string */
-+  char		*printerfile;		/* Path to a local printer dev */
-+  char		*rangestr;		/* Printer's range if its available */
-+  security_context_t	devcon;		/* Printer SELinux context */
-+  context_t	printercon;		/* context_t for the printer */
-+#endif /* WITH_LSPP */
- 
- 
-   DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name,
-@@ -1843,6 +1856,44 @@
-       attr->values[1].string.text = _cupsStrAlloc(Classification ?
- 	                                   Classification : p->job_sheets[1]);
-     }
-+#ifdef WITH_LSPP
-+    if (AuditLog != -1)
-+    {
-+      char uri[HTTP_MAX_URI];
-+      audit_message = NULL;
-+      rangestr = NULL;
-+      printercon = 0;
-+      printerfile = strstr(p->device_uri, "/dev/");
-+      if (printerfile == NULL && (strncmp(p->device_uri, "file:/", 6) == 0))
-+        printerfile = strdup(p->device_uri + strlen("file:/"));
++  % Create fonts...
++  /bigFont /Helvetica-Bold findfont	% bigFont = Helvetica-Bold
++  pageHeight 3 mul scalefont def	% size = pageHeight * 3 (nominally 33)
 +
-+      if (printerfile != NULL)
-+      {
-+        if (getfilecon(printerfile, &devcon) == -1)
-+          cupsdLogMessage(CUPSD_LOG_ERROR, "cupsdSetPrinterAttrs: Unable to get printer context");
-+        else
-+        {
-+          printercon = context_new(devcon);
-+          freecon(devcon);
-+        }
-+      }
++  /mediumFont /Helvetica findfont	% mediumFont = Helvetica
++  pageHeight 1.5 mul scalefont def	% size = pageHeight * 1.5 (nominally 16.5)
 +
-+      if (printercon && context_range_get(printercon))
-+        rangestr = strdup(context_range_get(printercon));
-+      else
-+        rangestr = strdup("unknown");
++  % Offset page to account for lower-left margin...
++  pageLeft 72 mul
++  pageBottom 72 mul
++  translate
 +
-+      cupsdSanitizeURI(p->device_uri, uri, sizeof(uri));
-+      cupsdSetStringf(&audit_message, "printer=%s uri=%s banners=%s,%s range=%s",
-+                      p->name, uri, p->job_sheets[0], p->job_sheets[1], rangestr);
-+      audit_log_user_message(AuditLog, AUDIT_LABEL_LEVEL_CHANGE, audit_message,
-+                             ServerName, NULL, NULL, 1);
-+      if (printercon)
-+        context_free(printercon);
-+      free(rangestr);
-+      cupsdClearString(&audit_message);
-+    }
-+#endif /* WITH_LSPP */
-   }
- 
-   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
-@@ -13,6 +13,13 @@
-  *   file is missing or damaged, see the license at "http://www.cups.org/".
-  */
- 
-+/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */
-+/* (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. */
++  % Job information box...
++  pageWidth 36 mul 9 add		% x = pageWidth * 1/2 * 72 + 9
++  boxWidth 0.5 mul sub			% x-= 1/2 box width
++  pageHeight 30 mul 9 sub		% y = pageHeight * 1/2 * 72 - 9
++  boxWidth				% w = box width
++  pageHeight 14 mul			% h = pageHeight * 1/2 * 72
++  0.5 setgray rectfill			% Draw a shadow
 +
-+#ifdef WITH_LSPP
-+#include <selinux/selinux.h>
-+#endif /* WITH_LSPP */
++  pageWidth 36 mul			% x = pageWidth * 1/2 * 72
++  boxWidth 0.5 mul sub			% x-= 1/2 box width
++  pageHeight 30 mul			% y = pageHeight * 1/4 * 72
++  boxWidth				% w = box width
++  pageHeight 14 mul			% h = pageHeight * 1/2 * 72
 +
- /*
-  * Job request structure...
-  */
-@@ -59,6 +66,10 @@
- #ifdef HAVE_GSSAPI
-   char			*ccname;	/* KRB5CCNAME environment variable */
- #endif /* HAVE_GSSAPI */
-+#ifdef WITH_LSPP
-+  security_context_t	scon;		/* Security context of job */
-+  uid_t			auid;		/* Audit loginuid for this job */
-+#endif /* WITH_LSPP */
- } 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 @@
- LIBCUPSIMAGEORDER =	@LIBCUPSIMAGEORDER@
- LINKCUPS	=	@LINKCUPS@ $(SSLLIBS)
- LINKCUPSIMAGE	=	@LINKCUPSIMAGE@
--LIBS		=	$(LINKCUPS) $(COMMONLIBS)
-+LIBS		=	$(LINKCUPS) $(COMMONLIBS) @LIBAUDIT@ @LIBSELINUX@
- 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 @@
- #undef HAVE_REMOVEFILE
- 
- 
-+/*
-+ * Are we trying to meet LSPP requirements?
-+ */
++  4 copy 1 setgray rectfill		% Clear the box to white
++  0 setgray rectstroke			% Draw a black box around it...
 +
-+#undef WITH_LSPP
++  % Job information text...
++  mediumFont setfont			% Medium sized font
++
++  pageWidth 36 mul			% x = pageWidth * 1/2 * 72
++  pageHeight 36 mul			% y = pageHeight * 1/2 * 72
++  pageHeight 5 mul add			% y += 2 lines
++  2 copy				% Copy X & Y
++  moveto
++  (Job ID: ) RIGHT
++  moveto
++  ({printer-name}-{job-id}) show
 +
++  pageWidth 36 mul			% x = pageWidth * 1/2 * 72
++  pageHeight 36 mul			% y = pageHeight * 1/2 * 72
++  pageHeight 2 mul add			% y += 1 line
++  2 copy				% Copy X & Y
++  moveto
++  (Title: ) RIGHT
++  moveto
++  ({job-name}) show
 +
- #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 @@
- sinclude(config-scripts/cups-pdf.m4)
- sinclude(config-scripts/cups-scripting.m4)
- 
-+sinclude(config-scripts/cups-lspp.m4)
++  pageWidth 36 mul			% x = pageWidth * 1/2 * 72
++  pageHeight 36 mul			% y = pageHeight * 1/2 * 72
++  pageHeight -1 mul add			% y -= 1 line
++  2 copy				% Copy X & Y
++  moveto
++  (Requesting User: ) RIGHT
++  moveto
++  ({job-originating-user-name}) show
 +
- INSTALL_LANGUAGES=""
- UNINSTALL_LANGUAGES=""
- LANGFILES=""
++  pageWidth 36 mul			% x = pageWidth * 1/2 * 72
++  pageHeight 36 mul			% y = pageHeight * 1/2 * 72
++  pageHeight -4 mul add			% y -= 2 lines
++  2 copy				% Copy X & Y
++  moveto
++  (Billing Info: ) RIGHT
++  moveto
++  ({?job-billing}) show
++
++  % Then the CUPS logo....
++  gsave
++    pageWidth 4 mul
++    pageWidth 6 mul
++    translate
++    pageWidth 9 mul CUPSLOGO
++  grestore
++
++  % And the ESP logo....
++  gsave
++    pageWidth 59 mul
++    pageWidth 6 mul
++    translate
++    pageWidth 6 mul ESPLOGO
++  grestore
++% Show the page...
++grestore
++showpage
++%
++% End of "$Id$".
++%
++%%EOF


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups.spec,v
retrieving revision 1.410
retrieving revision 1.411
diff -u -r1.410 -r1.411
--- cups.spec	9 May 2008 10:29:47 -0000	1.410
+++ cups.spec	28 May 2008 09:04:18 -0000	1.411
@@ -442,6 +442,11 @@
 %{cups_serverbin}/daemon/cups-lpd
 
 %changelog
+* Wed May 28 2008 Tim Waugh <twaugh at redhat.com>
+- If cupsdTimeoutJob is called when the originating connection is still
+  known, pass that to the function so that copy_banner can get at it if
+  necessary (bug #447200).
+
 * Fri May  9 2008 Tim Waugh <twaugh at redhat.com> 1:1.3.7-2
 - Applied patch to fix CVE-2008-1722 (integer overflow in image filter,
   bug #441692, STR #2790).




More information about the scm-commits mailing list