rpms/cups/devel cups-lspp.patch,1.33,1.34 cups.spec,1.427,1.428

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Fri Jul 18 12:13:46 UTC 2008


Author: twaugh

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

Modified Files:
	cups-lspp.patch cups.spec 
Log Message:
* Fri Jul 18 2008 Tim Waugh <twaugh at redhat.com>
- Removed autoconf requirement by applying autoconf-generated changes
  to patches that caused them.  Affected patches: cups-lspp.


cups-lspp.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.33 -r 1.34 cups-lspp.patch
Index: cups-lspp.patch
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups-lspp.patch,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- cups-lspp.patch	1 Jul 2008 11:34:31 -0000	1.33
+++ cups-lspp.patch	18 Jul 2008 12:12:59 -0000	1.34
@@ -1,5 +1,549 @@
---- 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-30 16:59:10.000000000 +0100
+diff -up cups-1.3.7/config.h.in.lspp cups-1.3.7/config.h.in
+--- cups-1.3.7/config.h.in.lspp	2008-01-07 18:26:57.000000000 +0000
++++ cups-1.3.7/config.h.in	2008-07-18 13:06:51.000000000 +0100
+@@ -530,6 +530,13 @@
+ #undef HAVE_REMOVEFILE
+ 
+ 
++/*
++ * Are we trying to meet LSPP requirements?
++ */
++
++#undef WITH_LSPP
++
++
+ #endif /* !_CUPS_CONFIG_H_ */
+ 
+ /*
+diff -up /dev/null cups-1.3.7/config-scripts/cups-lspp.m4
+--- /dev/null	2008-07-18 08:54:40.909125715 +0100
++++ cups-1.3.7/config-scripts/cups-lspp.m4	2008-07-18 13:06:51.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
+diff -up cups-1.3.7/configure.in.lspp cups-1.3.7/configure.in
+--- cups-1.3.7/configure.in.lspp	2007-07-25 00:47:12.000000000 +0100
++++ cups-1.3.7/configure.in	2008-07-18 13:06:51.000000000 +0100
+@@ -42,6 +42,8 @@ sinclude(config-scripts/cups-pap.m4)
+ sinclude(config-scripts/cups-pdf.m4)
+ sinclude(config-scripts/cups-scripting.m4)
+ 
++sinclude(config-scripts/cups-lspp.m4)
++
+ INSTALL_LANGUAGES=""
+ UNINSTALL_LANGUAGES=""
+ LANGFILES=""
+diff -up cups-1.3.7/configure.lspp cups-1.3.7/configure
+--- cups-1.3.7/configure.lspp	2008-07-18 13:07:30.000000000 +0100
++++ cups-1.3.7/configure	2008-07-18 13:07:35.000000000 +0100
+@@ -806,6 +806,8 @@ PHP
+ PHPCONFIG
+ PHPDIR
+ PYTHON
++LIBAUDIT
++LIBSELINUX
+ INSTALL_LANGUAGES
+ UNINSTALL_LANGUAGES
+ LIBOBJS
+@@ -1429,6 +1431,7 @@ Optional Features:
+                           enable UseNetworkDefault by default, default=auto
+   --enable-raw-printing   enable raw printing by default, default=auto
+   --enable-pdftops        build pdftops filter, default=auto
++  --enable-lspp           turn on auditing and label support, default=no
+ 
+ Optional Packages:
+   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+@@ -9647,10 +9650,10 @@ case "$uname" in
+ 		;;
+ 	Linux* | GNU*)
+ 		# Linux and GNU Hurd
+-		MAN1EXT=1.gz
+-		MAN5EXT=5.gz
+-		MAN7EXT=7.gz
+-		MAN8EXT=8.gz
++		MAN1EXT=1
++		MAN5EXT=5
++		MAN7EXT=7
++		MAN8EXT=8
+ 		MAN8DIR=8
+ 		;;
+ 	*)
+@@ -18413,6 +18416,412 @@ fi
+ 
+ 
+ 
++
++# Check whether --enable-lspp was given.
++if test "${enable_lspp+set}" = set; then
++  enableval=$enable_lspp;
++fi
++
++
++if test x"$enable_lspp" != xno; then
++    case "$uname" in
++        Linux)
++            { echo "$as_me:$LINENO: checking for audit_log_user_message in -laudit" >&5
++echo $ECHO_N "checking for audit_log_user_message in -laudit... $ECHO_C" >&6; }
++if test "${ac_cv_lib_audit_audit_log_user_message+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  ac_check_lib_save_LIBS=$LIBS
++LIBS="-laudit  $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++/* Override any GCC internal prototype to avoid an error.
++   Use char because int might match the return type of a GCC
++   builtin and then its argument prototype would still apply.  */
++#ifdef __cplusplus
++extern "C"
++#endif
++char audit_log_user_message ();
++int
++main ()
++{
++return audit_log_user_message ();
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++  (eval "$ac_link") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && {
++	 test -z "$ac_c_werror_flag" ||
++	 test ! -s conftest.err
++       } && test -s conftest$ac_exeext &&
++       $as_test_x conftest$ac_exeext; then
++  ac_cv_lib_audit_audit_log_user_message=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++	ac_cv_lib_audit_audit_log_user_message=no
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
++      conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ echo "$as_me:$LINENO: result: $ac_cv_lib_audit_audit_log_user_message" >&5
++echo "${ECHO_T}$ac_cv_lib_audit_audit_log_user_message" >&6; }
++if test $ac_cv_lib_audit_audit_log_user_message = yes; then
++  LIBAUDIT="-laudit"
++fi
++
++            if test "${ac_cv_header_libaudit_h+set}" = set; then
++  { echo "$as_me:$LINENO: checking for libaudit.h" >&5
++echo $ECHO_N "checking for libaudit.h... $ECHO_C" >&6; }
++if test "${ac_cv_header_libaudit_h+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
[...4816 lines suppressed...]
++/* (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. */
 +
-+  % Job information text...
-+  mediumFont setfont			% Medium sized font
+ /*
+  * Include necessary headers...
+  */
+@@ -73,6 +75,9 @@
+ #  include <dlfcn.h>
+ #endif /* __APPLE__ && HAVE_DLFCN_H */
+ 
++#ifdef WITH_LSPP
++#  include <libaudit.h>
++#endif /* WITH_LSPP */
+ 
+ /*
+  * Local functions...
+@@ -154,6 +159,9 @@ main(int  argc,				/* I - Number of comm
+   int			launchd_idle_exit;
+ 					/* Idle exit on select timeout? */
+ #endif	/* HAVE_LAUNCHD */
++#if WITH_LSPP
++  auditfail_t           failmode;       /* Action for audit_open failure */
++#endif /* WITH_LSPP */
+ 
+ 
+ #ifdef HAVE_GETEUID
+@@ -413,6 +421,25 @@ main(int  argc,				/* I - Number of comm
+ #endif /* DEBUG */
+   }
+ 
++#ifdef WITH_LSPP
++  if ((AuditLog = audit_open()) < 0 )
++  {
++    if (get_auditfail_action(&failmode) == 0)
++    {
++      if (failmode == FAIL_LOG)
++      {
++        cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to connect to audit subsystem.");
++        AuditLog = -1;
++      }
++      else if (failmode == FAIL_TERMINATE)
++      {
++        fprintf(stderr, "cupsd: unable to start auditing, terminating");
++        return -1;
++      }
++    }
++  }
++#endif /* WITH_LSPP */
 +
-+  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
+  /*
+   * Set the timezone info...
+   */
+@@ -1160,6 +1187,11 @@ main(int  argc,				/* I - Number of comm
+ 
+   cupsdStopSelect();
+ 
++#ifdef WITH_LSPP
++  if (AuditLog != -1)
++    audit_close(AuditLog);
++#endif /* WITH_LSPP */
 +
-+  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
+   return (!stop_scheduler);
+ }
+ 
+diff -up cups-1.3.7/scheduler/printers.c.lspp cups-1.3.7/scheduler/printers.c
+--- cups-1.3.7/scheduler/printers.c.lspp	2008-07-18 13:06:51.000000000 +0100
++++ cups-1.3.7/scheduler/printers.c	2008-07-18 13:06:51.000000000 +0100
+@@ -51,6 +51,8 @@
+  *                                 printing desktop tools.
+  */
+ 
++/* (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. */
 +
-+  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
+ /*
+  * Include necessary headers...
+  */
+@@ -74,6 +76,10 @@ static void	write_irix_config(cupsd_prin
+ static void	write_irix_state(cupsd_printer_t *p);
+ #endif /* __sgi */
+ 
++#ifdef WITH_LSPP
++#  include <libaudit.h>
++#  include <selinux/context.h>
++#endif /* WITH_LSPP */
+ 
+ /*
+  * 'cupsdAddPrinter()' - Add a printer to the system.
+@@ -1817,6 +1823,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
+ 		{			/* No authentication */
+ 		  "none"
+ 		};
++#ifdef WITH_LSPP
++  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,
+@@ -1960,6 +1973,44 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
+       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:/"));
 +
-+  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
++      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);
++        }
++      }
 +
-+  % Then the CUPS logo....
-+  gsave
-+    pageWidth 4 mul
-+    pageWidth 6 mul
-+    translate
-+    pageWidth 9 mul CUPSLOGO
-+  grestore
++      if (printercon && context_range_get(printercon))
++        rangestr = strdup(context_range_get(printercon));
++      else
++        rangestr = strdup("unknown");
 +
-+  % 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
++      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;


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups.spec,v
retrieving revision 1.427
retrieving revision 1.428
diff -u -r1.427 -r1.428
--- cups.spec	15 Jul 2008 12:56:56 -0000	1.427
+++ cups.spec	18 Jul 2008 12:12:59 -0000	1.428
@@ -80,7 +80,6 @@
 BuildRequires: libtiff-devel
 BuildRequires: krb5-devel
 BuildRequires: avahi-compat-libdns_sd-devel
-BuildRequires: autoconf
 
 %if %lspp
 BuildPrereq: libselinux-devel >= 1.23
@@ -179,7 +178,6 @@
 %endif
 
 sed -i -e '1iMaxLogSize 0' conf/cupsd.conf.in
-autoconf
 
 cp %{SOURCE5} cups-lpd.real
 perl -pi -e "s,\@LIBDIR\@,%{_libdir},g" cups-lpd.real
@@ -447,6 +445,10 @@
 %{cups_serverbin}/daemon/cups-lpd
 
 %changelog
+* Fri Jul 18 2008 Tim Waugh <twaugh at redhat.com>
+- Removed autoconf requirement by applying autoconf-generated changes
+  to patches that caused them.  Affected patches: cups-lspp.
+
 * Tue Jul 15 2008 Tim Waugh <twaugh at redhat.com> 1:1.3.7-13
 - CVE-2008-1373 patch is no longer needed (applied upstream).
 - Mark HTML files and templates config(noreplace) for site-local




More information about the scm-commits mailing list