diff options
-rw-r--r-- | sutils/fstab.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sutils/fstab.c b/sutils/fstab.c index e40572e2..19b03f50 100644 --- a/sutils/fstab.c +++ b/sutils/fstab.c @@ -497,7 +497,29 @@ fstab_find_mount (const struct fstab *fstab, const char *name) inline struct fs * fstab_find (const struct fstab *fstab, const char *name) { - return fstab_find_device (fstab, name) ?: fstab_find_mount (fstab, name); + struct fs *ret; + const char *real_name; + + ret = fstab_find_device (fstab, name); + if (ret) + return ret; + + ret = fstab_find_mount (fstab, name); + if (ret) + return ret; + + real_name = realpath (name, NULL); + + ret = fstab_find_device (fstab, real_name); + if (ret) { + free (real_name); + return ret; + } + + ret = fstab_find_mount (fstab, real_name); + free (real_name); + + return ret; } /* Cons FS onto the beginning of FSTAB's entry list. */ |