diff options
author | Till Kamppeter <till.kamppeter@gmail.com> | 2014-03-06 19:05:27 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2014-03-07 10:58:26 +0100 |
commit | 5b36220bc6962f87d17f12f399c09a220f3a77b9 (patch) | |
tree | a774dc0660816172c420e3928a41bf73b68991e7 | |
parent | 6a409eee80453708fd05a55c257b31de2d5fece8 (diff) | |
download | cups-5b36220bc6962f87d17f12f399c09a220f3a77b9.tar.gz |
Import upstream fix to let cupsEnumDests() fill in is_default field (STR: #4332)
-rw-r--r-- | debian/patches/color-management-extension.patch | 4 | ||||
-rw-r--r-- | debian/patches/cupsenumdests-does-not-set-cb.patch | 2 | ||||
-rw-r--r-- | debian/patches/fix-cupsenumdests-does-not-fill-in-is_default-field.patch | 48 | ||||
-rw-r--r-- | debian/patches/series | 1 |
4 files changed, 52 insertions, 3 deletions
diff --git a/debian/patches/color-management-extension.patch b/debian/patches/color-management-extension.patch index 2f9d03f7..ec3bcd98 100644 --- a/debian/patches/color-management-extension.patch +++ b/debian/patches/color-management-extension.patch @@ -443,7 +443,7 @@ Last-Update: 2014-01-04 * NOT_SHARED | AUTHENTICATED | --- a/cups/dest.c +++ b/cups/dest.c -@@ -1404,11 +1404,13 @@ +@@ -1433,11 +1433,13 @@ #ifdef __APPLE__ "media-supported", #endif /* __APPLE__ */ @@ -458,7 +458,7 @@ Last-Update: 2014-01-04 "printer-location", "printer-make-and-model", "printer-mandatory-job-attributes", -@@ -1513,8 +1515,10 @@ +@@ -1542,8 +1544,10 @@ !strcmp(attr->name, "marker-message") || !strcmp(attr->name, "marker-names") || !strcmp(attr->name, "marker-types") || diff --git a/debian/patches/cupsenumdests-does-not-set-cb.patch b/debian/patches/cupsenumdests-does-not-set-cb.patch index 8548a05d..27fc363a 100644 --- a/debian/patches/cupsenumdests-does-not-set-cb.patch +++ b/debian/patches/cupsenumdests-does-not-set-cb.patch @@ -6,7 +6,7 @@ Bug: https://cups.org/str.php?L4380 Last-Update: 2014-03-05 --- a/cups/dest.c +++ b/cups/dest.c -@@ -953,11 +953,11 @@ +@@ -982,11 +982,11 @@ * Get Bonjour-shared printers... */ diff --git a/debian/patches/fix-cupsenumdests-does-not-fill-in-is_default-field.patch b/debian/patches/fix-cupsenumdests-does-not-fill-in-is_default-field.patch new file mode 100644 index 00000000..0c73229b --- /dev/null +++ b/debian/patches/fix-cupsenumdests-does-not-fill-in-is_default-field.patch @@ -0,0 +1,48 @@ +Description: cupsEnumDests() doesn't fill in is_default field +Author: Michael Sweet <msweet@apple.com> +Bug: http://www.cups.org/str.php?L4332 +--- a/cups/dest.c ++++ b/cups/dest.c +@@ -891,6 +891,10 @@ + num_dests; /* Number of destinations */ + cups_dest_t *dests = NULL, /* Destinations */ + *dest; /* Current destination */ ++ const char *defprinter; /* Default printer */ ++ char name[1024], /* Copy of printer name */ ++ *instance, /* Pointer to instance name */ ++ *user_default; /* User default printer */ + #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) + int count, /* Number of queries started */ + remaining; /* Remainder of timeout */ +@@ -936,6 +940,31 @@ + num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, IPP_OP_CUPS_GET_PRINTERS, NULL, + &dests, type, mask); + ++ if ((user_default = _cupsUserDefault(name, sizeof(name))) != NULL) ++ defprinter = name; ++ else if ((defprinter = cupsGetDefault2(CUPS_HTTP_DEFAULT)) != NULL) ++ { ++ strlcpy(name, defprinter, sizeof(name)); ++ defprinter = name; ++ } ++ ++ if (defprinter) ++ { ++ /* ++ * Separate printer and instance name... ++ */ ++ ++ if ((instance = strchr(name, '/')) != NULL) ++ *instance++ = '\0'; ++ ++ /* ++ * Lookup the printer and instance and make it the default... ++ */ ++ ++ if ((dest = cupsGetDest(name, instance, num_dests, dests)) != NULL) ++ dest->is_default = 1; ++ } ++ + for (i = num_dests, dest = dests; + i > 0 && (!cancel || !*cancel); + i --, dest ++) diff --git a/debian/patches/series b/debian/patches/series index a85eb409..d80f0d48 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,6 +1,7 @@ # patches accepted and committed upstream: fix-race-condition-in-cupsdoiorequest.patch fix-cupsdgetprivateattrs-function-missing-null-check.patch +fix-cupsenumdests-does-not-fill-in-is_default-field.patch cupsenumdests-does-not-set-cb.patch cupsd-support-avahi-daemon-restarting.patch prevent-dnssd-backend-exiting-too-early.patch |