[Pkg-cups-devel] r675 - in cupsys/trunk/debian: . local/filters patches
Till Kamppeter
till-guest at alioth.debian.org
Sat Feb 23 16:37:17 UTC 2008
Author: till-guest
Date: Sat Feb 23 16:37:17 2008
New Revision: 675
Log:
Replaced pdftops filter by the one of CUPS 1.4, fixed web interface corrupting default authentication setting.
Added:
cupsys/trunk/debian/patches/pdftops-cups-1.4.dpatch (contents, props changed)
cupsys/trunk/debian/patches/web-interface-breaks-default-auth-setting.dpatch (contents, props changed)
Removed:
cupsys/trunk/debian/local/filters/pdftops
Modified:
cupsys/trunk/debian/changelog
cupsys/trunk/debian/patches/00list
Modified: cupsys/trunk/debian/changelog
==============================================================================
--- cupsys/trunk/debian/changelog (original)
+++ cupsys/trunk/debian/changelog Sat Feb 23 16:37:17 2008
@@ -4,6 +4,15 @@
* debian/cupsys.init.d: Add Should-Start: avahi. (Closes: #459662)
[ Till Kamppeter ]
+ * debian/patches/pdftops-cups-1.4.dpatch, debian/local/filters/pdftops:
+ Replaced Helge Blischke's alternative pdftops wrapper by the pdftops
+ of CUPS 1.4. The old pdftops wrapper did not work with the pdftops
+ filter of Poppler, the new one works with the pdftops filters of both
+ Poppler and XPDF (Ubuntu LP: #182379).
+ * debian/patches/web-interface-breaks-default-auth-setting.dpatch: When
+ modifying server settings with the CUPS web interface, the setting
+ for the default authentication got overwritten with gibberish (CUPS STR
+ #2703, Ubuntu LP: #188426).
* debian/local/backends/dnssd: Updated dnssd to filter out IPv6 entries,
as they clutter the lists of detected printers and make the network
printer discovery process taking more time than needed. Applied also
Modified: cupsys/trunk/debian/patches/00list
==============================================================================
--- cupsys/trunk/debian/patches/00list (original)
+++ cupsys/trunk/debian/patches/00list Sat Feb 23 16:37:17 2008
@@ -14,3 +14,5 @@
include_krb5_h_in_job_h.dpatch
search_mime_files_in_usr_share.dpatch
fix_regression_reactivate_net_ifaces_changes_detection.dpatch
+pdftops-cups-1.4.dpatch
+web-interface-breaks-default-auth-setting.dpatch
Added: cupsys/trunk/debian/patches/pdftops-cups-1.4.dpatch
==============================================================================
--- (empty file)
+++ cupsys/trunk/debian/patches/pdftops-cups-1.4.dpatch Sat Feb 23 16:37:17 2008
@@ -0,0 +1,356 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## pdftops-cups-1.4.dpatch by <till.kamppeter at gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cupsys-1.3.5~/filter/Makefile cupsys-1.3.5/filter/Makefile
+--- cupsys-1.3.5~/filter/Makefile 2007-07-20 01:27:49.000000000 +0200
++++ cupsys-1.3.5/filter/Makefile 2008-02-23 17:02:03.000000000 +0100
+@@ -19,7 +19,7 @@
+
+
+ FILTERS = gziptoany hpgltops texttops pstops $(IMGFILTERS) \
+- rastertolabel rastertoepson rastertohp
++ rastertolabel rastertoepson rastertohp pdftops
+ TARGETS = $(FILTERS) \
+ $(LIBCUPSIMAGE) \
+ libcupsimage.a \
+@@ -41,7 +41,7 @@
+ OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
+ gziptoany.o imagetops.o imagetoraster.o common.o pstops.o \
+ rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
+- testimage.o testraster.o textcommon.o texttops.o
++ testimage.o testraster.o textcommon.o texttops.o pdftops.o
+
+
+ #
+@@ -322,6 +322,9 @@
+ echo Linking $@...
+ $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
+
++pdftops: pdftops.o common.o ../cups/$(LIBCUPS)
++ echo Linking $@...
++ $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS) -lm
+
+ #
+ # rastertolabel
+diff -urNad cupsys-1.3.5~/filter/pdftops.c cupsys-1.3.5/filter/pdftops.c
+--- cupsys-1.3.5~/filter/pdftops.c 1970-01-01 01:00:00.000000000 +0100
++++ cupsys-1.3.5/filter/pdftops.c 2008-02-23 17:02:09.000000000 +0100
+@@ -0,0 +1,314 @@
++/*
++ * "$Id$"
++ *
++ * PDF to PostScript filter front-end for the Common UNIX Printing
++ * System (CUPS).
++ *
++ * Copyright 2007-2008 by Apple Inc.
++ * Copyright 1997-2006 by Easy Software Products.
++ *
++ * These coded instructions, statements, and computer programs are the
++ * property of Apple Inc. 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
++ * file is missing or damaged, see the license at "http://www.cups.org/".
++ *
++ * Contents:
++ *
++ * main() - Main entry for filter...
++ * cancel_job() - Flag the job as canceled.
++ */
++
++/*
++ * Include necessary headers...
++ */
++
++#include <cups/cups.h>
++#include <cups/string.h>
++#include <cups/i18n.h>
++#include <signal.h>
++#include <sys/wait.h>
++
++
++/*
++ * Local functions...
++ */
++
++static void cancel_job(int sig);
++
++
++/*
++ * 'main()' - Main entry for filter...
++ */
++
++int /* O - Exit status */
++main(int argc, /* I - Number of command-line args */
++ char *argv[]) /* I - Command-line arguments */
++{
++ int fd; /* Copy file descriptor */
++ char *filename, /* PDF file to convert */
++ tempfile[1024]; /* Temporary file */
++ char buffer[8192]; /* Copy buffer */
++ int bytes; /* Bytes copied */
++ int num_options; /* Number of options */
++ cups_option_t *options; /* Options */
++ const char *val; /* Option value */
++ int orientation; /* Output orientation */
++ ppd_file_t *ppd; /* PPD file */
++ ppd_size_t *size; /* Current page size */
++ int pdfpid, /* Process ID for pdftops */
++ pdfstatus, /* Status from pdftops */
++ pdfargc; /* Number of args for pdftops */
++ char *pdfargv[100], /* Arguments for pdftops */
++ pdfwidth[255], /* Paper width */
++ pdfheight[255]; /* Paper height */
++#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
++ struct sigaction action; /* Actions for POSIX signals */
++#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
++
++
++ /*
++ * Make sure status messages are not buffered...
++ */
++
++ setbuf(stderr, NULL);
++
++ /*
++ * Make sure we have the right number of arguments for CUPS!
++ */
++
++ if (argc < 6 || argc > 7)
++ {
++ fprintf(stderr,
++ _("Usage: %s job user title copies options [filename]\n"),
++ argv[0]);
++ return (1);
++ }
++
++ /*
++ * Register a signal handler to cleanly cancel a job.
++ */
++
++#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
++ sigset(SIGTERM, cancel_job);
++#elif defined(HAVE_SIGACTION)
++ memset(&action, 0, sizeof(action));
++
++ sigemptyset(&action.sa_mask);
++ action.sa_handler = cancel_job;
++ sigaction(SIGTERM, &action, NULL);
++#else
++ signal(SIGTERM, cancel_job);
++#endif /* HAVE_SIGSET */
++
++ /*
++ * Copy stdin if needed...
++ */
++
++ if (argc == 6)
++ {
++ /*
++ * Copy stdin to a temp file...
++ */
++
++ if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
++ {
++ perror(_("ERROR: Unable to copy PDF file"));
++ return (1);
++ }
++
++ fprintf(stderr, "DEBUG: pdftops - copying to temp print file \"%s\"\n",
++ tempfile);
++
++ while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
++ write(fd, buffer, bytes);
++
++ close(fd);
++
++ filename = tempfile;
++ }
++ else
++ {
++ /*
++ * Use the filename on the command-line...
++ */
++
++ filename = argv[6];
++ tempfile[0] = '\0';
++ }
++
++ /*
++ * Load the PPD file and mark options...
++ */
++
++ ppd = ppdOpenFile(getenv("PPD"));
++ num_options = cupsParseOptions(argv[5], 0, &options);
++
++ ppdMarkDefaults(ppd);
++ cupsMarkOptions(ppd, num_options, options);
++
++ /*
++ * Build the command-line for the pdftops filter...
++ */
++
++ pdfargv[0] = (char *)"pdftops";
++ pdfargc = 1;
++
++ if (ppd)
++ {
++ /*
++ * Set language level and TrueType font handling...
++ */
++
++ if (ppd->language_level == 1)
++ {
++ pdfargv[pdfargc++] = (char *)"-level1";
++ pdfargv[pdfargc++] = (char *)"-noembtt";
++ }
++ else if (ppd->language_level == 2)
++ {
++ pdfargv[pdfargc++] = (char *)"-level2";
++ if (!ppd->ttrasterizer)
++ pdfargv[pdfargc++] = (char *)"-noembtt";
++ }
++ else
++ pdfargv[pdfargc++] = (char *)"-level3";
++
++ /*
++ * Set output page size...
++ */
++
++ size = ppdPageSize(ppd, NULL);
++ if (size)
++ {
++ /*
++ * Got the size, now get the orientation...
++ */
++
++ orientation = 0;
++
++ if ((val = cupsGetOption("landscape", num_options, options)) != NULL)
++ {
++ if (strcasecmp(val, "no") != 0 && strcasecmp(val, "off") != 0 &&
++ strcasecmp(val, "false") != 0)
++ orientation = 1;
++ }
++ else if ((val = cupsGetOption("orientation-requested", num_options, options)) != NULL)
++ {
++ /*
++ * Map IPP orientation values to 0 to 3:
++ *
++ * 3 = 0 degrees = 0
++ * 4 = 90 degrees = 1
++ * 5 = -90 degrees = 3
++ * 6 = 180 degrees = 2
++ */
++
++ orientation = atoi(val) - 3;
++ if (orientation >= 2)
++ orientation ^= 1;
++ }
++
++ if (orientation & 1)
++ {
++ snprintf(pdfwidth, sizeof(pdfwidth), "%d", (int)(size->length));
++ snprintf(pdfheight, sizeof(pdfheight), "%d", (int)(size->width));
++ }
++ else
++ {
++ snprintf(pdfwidth, sizeof(pdfwidth), "%d", (int)(size->width));
++ snprintf(pdfheight, sizeof(pdfheight), "%d", (int)(size->length));
++ }
++
++ pdfargv[pdfargc++] = (char *)"-paperw";
++ pdfargv[pdfargc++] = pdfwidth;
++ pdfargv[pdfargc++] = (char *)"-paperh";
++ pdfargv[pdfargc++] = pdfheight;
++ }
++ }
++
++ if ((val = cupsGetOption("fitplot", num_options, options)) != NULL &&
++ strcasecmp(val, "no") && strcasecmp(val, "off") &&
++ strcasecmp(val, "false"))
++ pdfargv[pdfargc++] = (char *)"-expand";
++
++ pdfargv[pdfargc++] = filename;
++ pdfargv[pdfargc++] = (char *)"-";
++ pdfargv[pdfargc] = NULL;
++
++ if ((pdfpid = fork()) == 0)
++ {
++ /*
++ * Child comes here...
++ */
++
++ execv("/usr/bin/pdftops", pdfargv);
++ perror(_("ERROR: Unable to execute pdftops filter"));
++ exit(1);
++ }
++ else if (pdfpid < 0)
++ {
++ /*
++ * Unable to fork!
++ */
++
++ perror(_("ERROR: Unable to execute pdftops filter"));
++ pdfstatus = 1;
++ }
++ else
++ {
++ /*
++ * Parent comes here...
++ */
++
++ if (wait(&pdfstatus) != pdfpid)
++ {
++ kill(pdfpid, SIGTERM);
++ pdfstatus = 1;
++ }
++ else if (pdfstatus)
++ {
++ if (WIFEXITED(pdfstatus))
++ {
++ pdfstatus = WEXITSTATUS(pdfstatus);
++
++ fprintf(stderr,
++ _("ERROR: pdftops filter exited with status %d!"),
++ pdfstatus);
++ }
++ else
++ {
++ pdfstatus = WTERMSIG(pdfstatus);
++
++ fprintf(stderr,
++ _("ERROR: pdftops filter crashed on signal %d!"),
++ pdfstatus);
++ }
++ }
++ }
++
++ /*
++ * Cleanup and exit...
++ */
++
++ if (tempfile[0])
++ unlink(tempfile);
++
++ return (pdfstatus);
++}
++
++
++/*
++ * 'cancel_job()' - Flag the job as canceled.
++ */
++
++static void
++cancel_job(int sig) /* I - Signal number (unused) */
++{
++ (void)sig;
++}
++
++
++/*
++ * End of "$Id$".
++ */
Added: cupsys/trunk/debian/patches/web-interface-breaks-default-auth-setting.dpatch
==============================================================================
--- (empty file)
+++ cupsys/trunk/debian/patches/web-interface-breaks-default-auth-setting.dpatch Sat Feb 23 16:37:17 2008
@@ -0,0 +1,48 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## web-interface-breaks-default-auth-setting.dpatch by <till.kamppeter at gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cupsys-1.3.5~/cgi-bin/admin.c cupsys-1.3.5/cgi-bin/admin.c
+--- cupsys-1.3.5~/cgi-bin/admin.c 2007-11-30 08:00:59.000000000 +0100
++++ cupsys-1.3.5/cgi-bin/admin.c 2008-02-23 17:16:29.000000000 +0100
+@@ -1333,12 +1333,12 @@
+ *remote_printers,
+ /* REMOTE_PRINTERS value */
+ *share_printers,/* SHARE_PRINTERS value */
++ *user_cancel_any;
++ /* USER_CANCEL_ANY value */
+ #ifdef HAVE_GSSAPI
+- *default_auth_type,
++ char default_auth_type[255];
+ /* DefaultAuthType value */
+ #endif /* HAVE_GSSAPI */
+- *user_cancel_any;
+- /* USER_CANCEL_ANY value */
+
+
+ /*
+@@ -1373,13 +1373,16 @@
+ */
+
+ if (cgiGetVariable("KERBEROS"))
+- default_auth_type = "Negotiate";
++ strlcpy(default_auth_type, "Negotiate", sizeof(default_auth_type));
+ else
+ {
+- default_auth_type = cupsGetOption("DefaultAuthType", num_settings,
+- settings);
+- if (!strcasecmp(default_auth_type, "Negotiate"))
+- default_auth_type = "Basic";
++ const char *val = cupsGetOption("DefaultAuthType", num_settings,
++ settings);
++
++ if (val && !strcasecmp(val, "Negotiate"))
++ strlcpy(default_auth_type, "Basic", sizeof(default_auth_type));
++ else
++ strlcpy(default_auth_type, val, sizeof(default_auth_type));
+ }
+
+ fprintf(stderr, "DEBUG: DefaultAuthType %s\n", default_auth_type);
More information about the Pkg-cups-devel
mailing list