Accepting request 594083 from Base:System

- Added s390-tools-sles15-hmcdrvfs-fix-parsing-of-link-count.patch
  (bsc#1087452)
  * hmcdrvfs: fix parsing of link count >= 1000

OBS-URL: https://build.opensuse.org/request/show/594083
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=18
This commit is contained in:
Yuchen Lin 2018-04-10 07:52:57 +00:00 committed by Git OBS Bridge
commit 6735555ff1
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,41 @@
Subject: [PATCH] [BZ 164881] hmcdrvfs: fix parsing of link count >= 1000
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
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 <gerald.schaefer@de.ibm.com>
---
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 */

View File

@ -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

View File

@ -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