1777457 - hplip-3.19.10-2 breaks support for devices with '_series' in device id

This commit is contained in:
Zdenek Dohnal 2019-11-28 13:20:49 +01:00
parent c07d98eebd
commit 9ea0342f43
2 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,5 @@
diff --git a/io/hpmud/model.c b/io/hpmud/model.c
index d546ec1..288cd75 100644
index d546ec1..5bb6091 100644
--- a/io/hpmud/model.c
+++ b/io/hpmud/model.c
@@ -407,7 +407,10 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
@ -14,21 +14,23 @@ index d546ec1..288cd75 100644
if ((fp = fopen(datFile, "r")) == NULL)
goto bugout;
@@ -423,9 +426,15 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
@@ -422,10 +425,16 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
strncpy(section, rcbuf+1, sizeof(section)); /* found new section */
n = strlen(section);
section[n-2]=0; /* remove ']' and CR */
if (strcasecmp(model, section) == 0 ||
- if (strcasecmp(model, section) == 0 ||
- (section[0] == 'h' && section[1] == 'p' &&
- section[2] == '_' &&
- strcasecmp(model, section + 3) == 0))
+ if ((strcasecmp(model, section) == 0) ||
+ (section[0] == 'h' &&
+ section[1] == 'p' &&
+ section[2] == '_' &&
+ strcasecmp(model, section + 3) == 0) ||
+ (n > model_len &&
+ strncasecmp(section, model, model_len) &&
+ strncasecmp(section + model_len, "_series", strlen("_series"))
+ )
+ strncasecmp(section, model, model_len) == 0 &&
+ strncasecmp(section + model_len, "_series", strlen("_series") == 0)
+ )
+ )
{
/* Found model match. */

View File

@ -7,7 +7,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.19.10
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
Url: https://developers.hp.com/hp-linux-imaging-and-printing
@ -690,6 +690,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
%changelog
* Thu Nov 28 2019 Zdenek Dohnal <zdohnal@redhat.com> - 3.19.10-3
- 1777457 - hplip-3.19.10-2 breaks support for devices with '_series' in device id
* Mon Nov 18 2019 Zdenek Dohnal <zdohnal@redhat.com> - 3.19.10-2
- 1773345 - Problems with HP M281fdw LaserJet