diff --git a/cups-getnameddest.patch b/cups-getnameddest.patch index 111b1b1..dad3d00 100644 --- a/cups-getnameddest.patch +++ b/cups-getnameddest.patch @@ -1,6 +1,6 @@ diff -up cups-1.3.9/berkeley/lpr.c.getnameddest cups-1.3.9/berkeley/lpr.c ---- cups-1.3.9/berkeley/lpr.c.getnameddest 2008-10-10 09:35:05.000000000 +0100 -+++ cups-1.3.9/berkeley/lpr.c 2008-10-10 09:35:05.000000000 +0100 +--- cups-1.3.9/berkeley/lpr.c.getnameddest 2009-03-09 15:56:30.000000000 +0000 ++++ cups-1.3.9/berkeley/lpr.c 2009-03-09 15:56:38.000000000 +0000 @@ -92,9 +92,7 @@ main(int argc, /* I - Number of comm int num_copies; /* Number of copies per file */ int num_files; /* Number of files to print */ @@ -57,7 +57,7 @@ diff -up cups-1.3.9/berkeley/lpr.c.getnameddest cups-1.3.9/berkeley/lpr.c "non-existent destination \"%s\"!\n"), diff -up cups-1.3.9/cups/cups.h.getnameddest cups-1.3.9/cups/cups.h --- cups-1.3.9/cups/cups.h.getnameddest 2008-07-23 01:06:46.000000000 +0100 -+++ cups-1.3.9/cups/cups.h 2008-10-10 09:35:05.000000000 +0100 ++++ cups-1.3.9/cups/cups.h 2009-03-09 15:56:38.000000000 +0000 @@ -248,6 +248,9 @@ extern void cupsSetDefaultDest(const ch int num_dests, cups_dest_t *dests); @@ -70,7 +70,16 @@ diff -up cups-1.3.9/cups/cups.h.getnameddest cups-1.3.9/cups/cups.h } diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c --- cups-1.3.9/cups/dest.c.getnameddest 2008-09-17 00:37:56.000000000 +0100 -+++ cups-1.3.9/cups/dest.c 2008-10-10 09:36:02.000000000 +0100 ++++ cups-1.3.9/cups/dest.c 2009-03-09 15:56:47.000000000 +0000 +@@ -4,7 +4,7 @@ + * User-defined destination (and option) support for the Common UNIX + * Printing System (CUPS). + * +- * Copyright 2007-2008 by Apple Inc. ++ * Copyright 2007-2009 by Apple Inc. + * Copyright 1997-2007 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the @@ -25,6 +25,7 @@ * server. * cupsGetDests2() - Get the list of destinations from the @@ -158,7 +167,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c } /* -@@ -460,6 +463,136 @@ cupsGetDests2(http_t *http, /* I - +@@ -460,6 +463,147 @@ cupsGetDests2(http_t *http, /* I - /* @@ -261,7 +270,18 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c + */ + + if (!cups_get_sdests(http, op, name, 0, &dest)) -+ return (NULL); ++ { ++ if (op == CUPS_GET_DEFAULT) ++ return (NULL); ++ ++ /* ++ * The default printer from environment variables or from a ++ * configuration file does not exist. Find out the real default. ++ */ ++ ++ if (!cups_get_sdests(http, CUPS_GET_DEFAULT, name, 0, &dest)) ++ return (NULL); ++ } + + if (instance) + dest->instance = _cupsStrAlloc(instance); @@ -295,7 +315,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c * 'cupsRemoveDest()' - Remove a destination from the destination list. * * Removing a destination/instance does not delete the class or printer -@@ -556,19 +689,17 @@ void +@@ -556,19 +700,17 @@ void cupsSetDests(int num_dests, /* I - Number of destinations */ cups_dest_t *dests) /* I - Destinations */ { @@ -319,7 +339,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c } -@@ -614,8 +745,8 @@ cupsSetDests2(http_t *http, /* I - +@@ -614,8 +756,8 @@ cupsSetDests2(http_t *http, /* I - * Get the server destinations... */ @@ -330,7 +350,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c /* * Figure out which file to write to... -@@ -630,7 +761,7 @@ cupsSetDests2(http_t *http, /* I - +@@ -630,7 +772,7 @@ cupsSetDests2(http_t *http, /* I - * Merge in server defaults... */ @@ -339,7 +359,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c /* * Point to user defaults... -@@ -797,24 +928,88 @@ cupsSetDests2(http_t *http, /* I - +@@ -797,24 +939,88 @@ cupsSetDests2(http_t *http, /* I - /* @@ -429,7 +449,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c /* * Check environment variables... */ -@@ -824,12 +1019,8 @@ cups_get_dests(const char *filename, /* +@@ -824,12 +1030,8 @@ cups_get_dests(const char *filename, /* if (strcmp(printer, "lp") == 0) printer = NULL; @@ -444,7 +464,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c /* * Read each printer; each line looks like: -@@ -838,28 +1029,22 @@ cups_get_dests(const char *filename, /* +@@ -838,28 +1040,22 @@ cups_get_dests(const char *filename, /* * Default name[/instance] options */ @@ -482,7 +502,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c name = lineptr; -@@ -870,9 +1055,6 @@ cups_get_dests(const char *filename, /* +@@ -870,9 +1066,6 @@ cups_get_dests(const char *filename, /* while (!isspace(*lineptr & 255) && *lineptr && *lineptr != '/') lineptr ++; @@ -492,7 +512,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c if (*lineptr == '/') { /* -@@ -892,30 +1074,49 @@ cups_get_dests(const char *filename, /* +@@ -892,30 +1085,49 @@ cups_get_dests(const char *filename, /* else instance = NULL; @@ -555,7 +575,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c } /* -@@ -926,11 +1127,20 @@ cups_get_dests(const char *filename, /* +@@ -926,11 +1138,20 @@ cups_get_dests(const char *filename, /* &(dest->options)); /* @@ -577,7 +597,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c for (i = 0; i < num_dests; i ++) (*dests)[i].is_default = 0; -@@ -942,7 +1152,7 @@ cups_get_dests(const char *filename, /* +@@ -942,7 +1163,7 @@ cups_get_dests(const char *filename, /* * Close the file and return... */ @@ -586,7 +606,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c return (num_dests); } -@@ -954,7 +1164,8 @@ cups_get_dests(const char *filename, /* +@@ -954,7 +1175,8 @@ cups_get_dests(const char *filename, /* static int /* O - Number of destinations */ cups_get_sdests(http_t *http, /* I - HTTP connection */ @@ -596,7 +616,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c int num_dests, /* I - Number of destinations */ cups_dest_t **dests) /* IO - Destinations */ { -@@ -971,8 +1182,9 @@ cups_get_sdests(http_t *http, /* I +@@ -971,8 +1193,9 @@ cups_get_sdests(http_t *http, /* I const char *info, /* printer-info attribute */ *location, /* printer-location attribute */ *make_model, /* printer-make-and-model attribute */ @@ -608,7 +628,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c auth_info_req[1024], /* auth-info-required attribute */ reasons[1024]; /* printer-state-reasons attribute */ int num_options; /* Number of options */ -@@ -1016,6 +1228,14 @@ cups_get_sdests(http_t *http, /* I +@@ -1016,6 +1239,14 @@ cups_get_sdests(http_t *http, /* I ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser()); @@ -623,7 +643,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c /* * Do the request and get back a response... */ -@@ -1038,17 +1258,17 @@ cups_get_sdests(http_t *http, /* I +@@ -1038,17 +1269,17 @@ cups_get_sdests(http_t *http, /* I * Pull the needed attributes from this printer... */ @@ -652,7 +672,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c auth_info_req[0] = '\0'; job_sheets[0] = '\0'; -@@ -1099,7 +1319,7 @@ cups_get_sdests(http_t *http, /* I +@@ -1099,7 +1330,7 @@ cups_get_sdests(http_t *http, /* I make_model = attr->values[0].string.text; else if (!strcmp(attr->name, "printer-name") && attr->value_tag == IPP_TAG_NAME) @@ -661,7 +681,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c else if (!strcmp(attr->name, "printer-state") && attr->value_tag == IPP_TAG_ENUM) state = attr->values[0].integer; -@@ -1204,7 +1424,7 @@ cups_get_sdests(http_t *http, /* I +@@ -1204,7 +1435,7 @@ cups_get_sdests(http_t *http, /* I * See if we have everything needed... */ @@ -670,7 +690,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c { cupsFreeOptions(num_options, options); -@@ -1214,9 +1434,9 @@ cups_get_sdests(http_t *http, /* I +@@ -1214,9 +1445,9 @@ cups_get_sdests(http_t *http, /* I continue; } @@ -684,7 +704,7 @@ diff -up cups-1.3.9/cups/dest.c.getnameddest cups-1.3.9/cups/dest.c dest->options = options; diff -up cups-1.3.9/cups/libcups.exp.getnameddest cups-1.3.9/cups/libcups.exp --- cups-1.3.9/cups/libcups.exp.getnameddest 2008-04-09 04:39:40.000000000 +0100 -+++ cups-1.3.9/cups/libcups.exp 2008-10-10 09:35:05.000000000 +0100 ++++ cups-1.3.9/cups/libcups.exp 2009-03-09 15:56:38.000000000 +0000 @@ -114,6 +114,7 @@ _cupsGetFd _cupsGetFile _cupsGetJobs @@ -695,7 +715,7 @@ diff -up cups-1.3.9/cups/libcups.exp.getnameddest cups-1.3.9/cups/libcups.exp _cupsGetPPD diff -up cups-1.3.9/cups/Makefile.getnameddest cups-1.3.9/cups/Makefile --- cups-1.3.9/cups/Makefile.getnameddest 2008-09-06 01:30:39.000000000 +0100 -+++ cups-1.3.9/cups/Makefile 2008-10-10 09:35:05.000000000 +0100 ++++ cups-1.3.9/cups/Makefile 2009-03-09 15:56:38.000000000 +0000 @@ -263,7 +263,7 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS) # libcups.2.dylib # @@ -707,7 +727,7 @@ diff -up cups-1.3.9/cups/Makefile.getnameddest cups-1.3.9/cups/Makefile -install_name $(libdir)/$@ \ diff -up cups-1.3.9/cups/testcups.c.getnameddest cups-1.3.9/cups/testcups.c --- cups-1.3.9/cups/testcups.c.getnameddest 2008-07-11 23:48:49.000000000 +0100 -+++ cups-1.3.9/cups/testcups.c 2008-10-10 09:35:05.000000000 +0100 ++++ cups-1.3.9/cups/testcups.c 2009-03-09 15:56:38.000000000 +0000 @@ -16,7 +16,8 @@ * * Contents: @@ -946,11 +966,11 @@ diff -up cups-1.3.9/cups/testcups.c.getnameddest cups-1.3.9/cups/testcups.c + + +/* - * End of "$Id: cups-getnameddest.patch,v 1.3 2008/10/10 08:43:51 twaugh Exp $". + * End of "$Id: cups-getnameddest.patch,v 1.4 2009/04/17 15:07:16 twaugh Exp $". */ diff -up cups-1.3.9/systemv/lp.c.getnameddest cups-1.3.9/systemv/lp.c --- cups-1.3.9/systemv/lp.c.getnameddest 2008-07-11 23:48:49.000000000 +0100 -+++ cups-1.3.9/systemv/lp.c 2008-10-10 09:35:05.000000000 +0100 ++++ cups-1.3.9/systemv/lp.c 2009-03-09 15:56:38.000000000 +0000 @@ -73,9 +73,7 @@ main(int argc, /* I - Number of comm int num_copies; /* Number of copies per file */ int num_files; /* Number of files to print */ diff --git a/cups.spec b/cups.spec index b6d1ff9..53b3008 100644 --- a/cups.spec +++ b/cups.spec @@ -462,6 +462,9 @@ rm -rf $RPM_BUILD_ROOT %{cups_serverbin}/daemon/cups-lpd %changelog +* Fri Apr 17 2009 Tim Waugh +- Fixed getnameddest patch (bug #481481, STR #3082). + * Wed Jan 28 2009 Tim Waugh 1:1.3.9-4 - Always supply document-name when printing a file (STR #3055). - Load MIME type rules correctly (bug #426089, STR #3059).