Skip to content
Snippets Groups Projects
Commit cee3e18f authored by Helge Deller's avatar Helge Deller Committed by maximilian attems
Browse files

get_fstype: initialize FSTYPE variable


On the hppa platform the fstype program from klibc crashed (details in Bug#745660) which exposed a problem in the
get_fstype() shell function in file scripts/functions.

In this script, fstype is called like this:
        eval $(fstype "${FS}" 2> /dev/null)
        if [ "$FSTYPE" = "unknown" ] ....
Since fstype crashed and returned nothing in the variable "FSTYPE", FSTYPE stayed empty instead of the value "unknown" and as such no further analysis via blkid was done.

I think it makes sense to pre-initialize FSTYPE to the value "unknown" before
calling fstype. That way the program logic will continue correctly if something
with the fstype program is wrong.

Closes: #745731

Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarmaximilian attems <maks@debian.org>
parent 27b076c5
No related branches found
No related tags found
No related merge requests found
......@@ -307,6 +307,7 @@ get_fstype ()
# blkid has a more complete list of file systems,
# but fstype is more robust
FSTYPE="unknown"
eval $(fstype "${FS}" 2> /dev/null)
if [ "$FSTYPE" = "unknown" ] && command -v blkid >/dev/null 2>&1 ; then
FSTYPE=$(blkid -o value -s TYPE "${FS}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment