Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cc323958 authored by Bowgo Tsai's avatar Bowgo Tsai
Browse files

fs_mgr_fstab: do an exact match when searching a mount point

Currently when searching a mount point from a fstab, it checks whether the
mount point of an fstab entry is the prefix of a given path, and the
next char after the match is either '\0' or '/'.

However, it will always return the fstab entry with mount point
"/vendor" when searching path is "/vendor", "/vendor/abc" or "/vendor/cde"
in the following fstab. Because "/vendor" is the prefix of "/vendor/abc"
and "/vendor/cde", and the next char after the match is '/'.

    /dev/block/platform/.../by-name/vendor   /vendor      ext4  ro  wait
    /dev/block/platform/.../by-name/abc      /vendor/abc  ext4  ro  wait
    /dev/block/platform/.../by-name/cde      /vendor/cde  ext4  ro  wait

Fix this by performing an exact match when searching the mount point.

Bug: 63912287
Test: boot sailfish

Change-Id: I504655f5c71790c5d528085de416ce3c30d21fea
parent dea5e081
Loading
Loading
Loading
Loading
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