]> git.ipfire.org Git - thirdparty/util-linux.git/commit
findmnt: error on --target /non-exist
authorKarel Zak <kzak@redhat.com>
Fri, 16 Dec 2016 11:46:45 +0000 (12:46 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 17 Jan 2017 14:56:39 +0000 (15:56 +0100)
commit89332dd30649207d08d10f73448dd720bf43c43e
tree23070fcc0915a04f62306e513d25b9a63556cecd
parent5cbb15d1a5f826954b41dfde0e5d843cea9e24bd
findmnt: error on --target /non-exist

The original --target implementation (< v2.27) has been based on
stat(), so it was usable for valid paths only.

The new implementation is based on search in the mountinfo file, so it
works for arbitrary crazy path. This is not backwardly compatible and
if the path does not exist then it still returns at least root
directory mount entry.

This patch forces mnt_table_find_mountpoint() to check if the path is
valid before we search in the mountinfo file.

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab.c