mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
hmcdrvfs: fix parsing of link count >= 1000
hmcdrvfs will ignore files with a link count >= 1000, due to an inconsistency in the input data. 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. The "mode" field will never contain digits, so in order to fix this issue, the parser can recognize the "link count" field by the presence of a digit. Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
811152c08a
commit
983a72dab9
@@ -9,6 +9,7 @@ Release history for s390-tools (MIT version)
|
||||
- dbginfo: Gather nvme related data
|
||||
|
||||
Bug Fixes:
|
||||
- hmcdrvfs: fix parsing of link count >= 1000
|
||||
|
||||
* __v2.3.0 (2018-01-30)__
|
||||
|
||||
|
||||
@@ -821,10 +821,13 @@ static char *hmcdrv_parse_line(char *line, char *namebuf,
|
||||
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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user