[systemd-devel] [PATCH] path-util.c: fix path_is_mount_point() for symlinks

Lennart Poettering lennart at poettering.net
Fri Feb 20 02:39:32 PST 2015


On Fri, 20.02.15 10:32, harald at redhat.com (harald at redhat.com) wrote:

> From: Harald Hoyer <harald at redhat.com>
> 
> path_is_mount_point() compares the mount_id of a directory and the
> mount_id of the parent directory. When following symlinks, the function
> to get the parent directory does not take the symlink into account.

I figure we should open the dir as an fd, and then always use that fd
to query both the data of the dir itself, and of its parent. i.e. use
the fact that fstatat() and name_to_handle_at() can take a filename
and an fd...

And I figure the call should never follow symlinks...

I am not convinced that realpath() is really a good choice here...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list