From 4aa703aad53a53d443c364b0c83a2f37531296bf Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Nov 17 2009 13:27:14 +0000 Subject: - Fixed display of current driver (bug #537182, STR #3418). --- diff --git a/cups-str3418.patch b/cups-str3418.patch new file mode 100644 index 0000000..3bb4e3e --- /dev/null +++ b/cups-str3418.patch @@ -0,0 +1,90 @@ +diff -up cups-1.4.2/cgi-bin/admin.c.str3418 cups-1.4.2/cgi-bin/admin.c +--- cups-1.4.2/cgi-bin/admin.c.str3418 2009-11-17 13:23:51.130084685 +0000 ++++ cups-1.4.2/cgi-bin/admin.c 2009-11-17 13:23:56.773209143 +0000 +@@ -1261,7 +1261,7 @@ do_am_printer(http_t *http, /* I - HTTP + * Got the list of PPDs, see if the user has selected a make... + */ + +- if (cgiSetIPPVars(response, NULL, NULL, NULL, 0) == 0) ++ if (cgiSetIPPVars(response, NULL, NULL, NULL, 0) == 0 && !modify) + { + /* + * No PPD files with this make, try again with all makes... +@@ -1297,8 +1297,11 @@ do_am_printer(http_t *http, /* I - HTTP + */ + + cgiStartHTML(title); +- cgiSetVariable("CURRENT_MAKE_AND_MODEL", +- cgiGetArray("PPD_MAKE_AND_MODEL", 0)); ++ if (!cgiGetVariable("PPD_MAKE")) ++ cgiSetVariable("PPD_MAKE", cgiGetVariable("CURRENT_MAKE")); ++ if (!modify) ++ cgiSetVariable("CURRENT_MAKE_AND_MODEL", ++ cgiGetArray("PPD_MAKE_AND_MODEL", 0)); + cgiCopyTemplateLang("choose-model.tmpl"); + cgiEndHTML(); + } +@@ -1590,7 +1593,7 @@ do_config_server(http_t *http) /* I - H + #ifdef HAVE_GSSAPI + char default_auth_type[255]; + /* DefaultAuthType value */ +- const char *val; /* Setting value */ ++ const char *val; /* Setting value */ + #endif /* HAVE_GSSAPI */ + + +@@ -1662,7 +1665,7 @@ do_config_server(http_t *http) /* I - H + strcat(local_protocols, "slp"); + } + #endif /* HAVE_SLP */ +- ++ + if (cgiGetVariable("BROWSE_REMOTE_CUPS")) + strcpy(remote_protocols, "cups"); + else +@@ -1915,7 +1918,7 @@ do_config_server(http_t *http) /* I - H + cgiSetVariable("ERROR", strerror(errno)); + cgiCopyTemplateLang("error.tmpl"); + cgiEndHTML(); +- ++ + perror(tempfile); + return; + } +@@ -1927,7 +1930,7 @@ do_config_server(http_t *http) /* I - H + cgiSetVariable("ERROR", strerror(errno)); + cgiCopyTemplateLang("error.tmpl"); + cgiEndHTML(); +- ++ + perror(tempfile); + close(tempfd); + unlink(tempfile); +@@ -3342,7 +3345,7 @@ do_set_options(http_t *http, /* I - HTT + ((ppdattr = ppdFindAttr(ppd, "cupsCommands", NULL)) != NULL && + ppdattr->value && strstr(ppdattr->value, "AutoConfigure"))) + cgiSetVariable("HAVE_AUTOCONFIGURE", "YES"); +- else ++ else + { + for (i = 0; i < ppd->num_filters; i ++) + if (!strncmp(ppd->filters[i], "application/vnd.cups-postscript", 31)) +@@ -3446,7 +3449,7 @@ do_set_options(http_t *http, /* I - HTT + cgiSetVariable("GROUP", group->text); + + cgiCopyTemplateLang("option-header.tmpl"); +- ++ + for (j = group->num_options, option = group->options; + j > 0; + j --, option ++) +@@ -4090,7 +4093,7 @@ get_option_value( + + snprintf(buffer, bufsize, "Custom.%gx%g%s", width, length, uval); + } +- else if (cupsArrayCount(coption->params) == 1) ++ else if (cupsArrayCount(coption->params) == 1) + { + cparam = ppdFirstCustomParam(coption); + snprintf(keyword, sizeof(keyword), "%s.%s", coption->keyword, cparam->name); +diff -up cups-1.4.2/CHANGES-1.4.txt.str3418 cups-1.4.2/CHANGES-1.4.txt diff --git a/cups.spec b/cups.spec index e270a07..9e8a99f 100644 --- a/cups.spec +++ b/cups.spec @@ -58,6 +58,7 @@ Patch30: cups-str3381.patch Patch31: cups-str3399.patch Patch32: cups-str3403.patch Patch33: cups-str3407.patch +Patch34: cups-str3418.patch Patch100: cups-lspp.patch Epoch: 1 @@ -220,6 +221,7 @@ module. %patch31 -p1 -b .str3399 %patch32 -p1 -b .str3403 %patch33 -p1 -b .str3407 +%patch34 -p1 -b .str3418 %if %lspp %patch100 -p1 -b .lspp @@ -518,6 +520,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Tue Nov 17 2009 Tim Waugh 1:1.4.2-6 +- Fixed display of current driver (bug #537182, STR #3418). - Fixed out-of-memory handling when loading jobs (bug #538054, STR #3407).