rc = mnt_context_merge_mflags(cxt);
if (!rc)
rc = evaluate_permissions(cxt);
- if (!rc)
- rc = mnt_context_prepare_target(cxt);
if (!rc && !cxt->helper) {
* Possible are three attempts:
* 1) compare @target with @fs->target
* 2) realpath(@target) with @fs->target
- * 3) realpath(@target) with realpath(@fs->target).
+ * 3) realpath(@target) with realpath(@fs->target) if @fs is not from
+ * /proc/self/mountinfo.
*
* The 2nd and 3rd attempts are not performed when @cache is NULL.
*
rc = (cn && strcmp(cn, fs->target) == 0);
/* 3) - canonicalized and canonicalized */
- if (!rc && cn) {
+ if (!rc && cn && !mnt_fs_is_kernel(fs)) {
char *tcn = mnt_resolve_path(fs->target, cache);
rc = (tcn && strcmp(cn, tcn) == 0);
}
return fs;
}
- /* non-canonicaled path in struct libmnt_table */
+ /* non-canonicaled path in struct libmnt_table
+ * -- note that mountpoint in /proc/self/mountinfo is already
+ * canonicalized by kernel
+ */
mnt_reset_iter(&itr, direction);
while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
char *p;
- if (!fs->target || mnt_fs_is_swaparea(fs) ||
- (*fs->target == '/' && *(fs->target + 1) == '\0'))
+ if (!fs->target
+ || mnt_fs_is_swaparea(fs)
+ || mnt_fs_is_kernel(fs)
+ || (*fs->target == '/' && *(fs->target + 1) == '\0'))
continue;
p = mnt_resolve_path(fs->target, tb->cache);