If we pass / path toget_mount_device function it will return incorrect device. This happens because we check if entire line from MTAB_PATH contains given path. This work fine for long paths but fails if paths is / because any path contains / and this function will always return first line from MTAB_PATH. Fixed by splitting line before check.
If we pass
/
path toget_mount_device
function it will return incorrect device. This happens because we check if entire line fromMTAB_PATH
contains given path. This work fine for long paths but fails if paths is/
because any path contains/
and this function will always return first line fromMTAB_PATH
. Fixed by splitting line before check.