diff --git a/s390-tools-sles15-hmcdrvfs-fix-parsing-of-link-count.patch b/s390-tools-sles15-hmcdrvfs-fix-parsing-of-link-count.patch new file mode 100644 index 0000000..fa5d1c7 --- /dev/null +++ b/s390-tools-sles15-hmcdrvfs-fix-parsing-of-link-count.patch @@ -0,0 +1,41 @@ +Subject: [PATCH] [BZ 164881] hmcdrvfs: fix parsing of link count >= 1000 +From: Gerald Schaefer + +Description: hmcdrvfs: fix parsing of link count >= 1000 +Symptom: hmcdrvfs will ignore files with a link count >= 1000 +Problem: The parsing code relies on having spaces between the different + fields in its input data. When a file has a link count >= 1000, + there will be no space, and the "link count" field will be + placed directly after the previous "mode" field. This will + confuse the parser, and all such files will not be accesible. +Solution: The "mode" field will never contain digits, so the parser can + recognize the "link count" field by the presence of a digit. +Reproduction: Use a medium containing files with link count >= 1000 in + hmcdrvfs, and try to access/list them. +Upstream-ID: - +Problem-ID: 164881 + +Signed-off-by: Gerald Schaefer +--- + hmcdrvfs/hmcdrvfs.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/hmcdrvfs/hmcdrvfs.c ++++ b/hmcdrvfs/hmcdrvfs.c +@@ -821,10 +821,13 @@ static char *hmcdrv_parse_line(char *lin + if ((*line != '\0') && (*line != '\n')) { + field = hmcdrv_parse_ntoken(field, line, &attr); + +- while ((*line != '\0') && +- (*line != '\n') && +- !isspace(*line)) ++ while ((*line != '\0') && (*line != '\n')) { ++ if (isspace(*line)) ++ break; ++ if (field == 1 && isdigit(*line)) ++ break; + ++line; /* search end of field */ ++ } + } + } /* while */ + diff --git a/s390-tools.changes b/s390-tools.changes index b252665..1774f96 100644 --- a/s390-tools.changes +++ b/s390-tools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Apr 6 17:44:55 UTC 2018 - mpost@suse.com + +- Added s390-tools-sles15-hmcdrvfs-fix-parsing-of-link-count.patch + (bsc#1087452) + * hmcdrvfs: fix parsing of link count >= 1000 + ------------------------------------------------------------------- Thu Mar 22 21:16:00 UTC 2018 - mpost@suse.com diff --git a/s390-tools.spec b/s390-tools.spec index 6e95ed2..2c432f8 100644 --- a/s390-tools.spec +++ b/s390-tools.spec @@ -140,6 +140,7 @@ Patch29: s390-tools-sles15-lsluns-document-restriction-to-zfcp-only-syste Patch30: s390-tools-sles15-lsluns-complement-alternative-tools-with-lszdev.patch Patch31: s390-tools-sles15-zdev-Enable-running-chzdev-from-unknown-root-devices.patch Patch32: s390-tools-sles15-zdev-Fix-zdev-dracut-module-aborting-on-unknown-root.patch +Patch33: s390-tools-sles15-hmcdrvfs-fix-parsing-of-link-count.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: s390 s390x @@ -228,6 +229,7 @@ to list files and directories. %patch30 -p1 %patch31 -p1 %patch32 -p1 +%patch33 -p1 cp -vi %{S:22} CAUTION