} else {
/* canonicalized path goes outside of
* prefix, keep the original path instead */
+ free(u);
u = orig;
orig = NULL;
}
return r;
h.handle.handle_bytes = MAX_HANDLE_SZ;
- r = name_to_handle_at(AT_FDCWD, parent, &h.handle, &mount_id_parent, 0);
+ r = name_to_handle_at(AT_FDCWD, parent, &h.handle, &mount_id_parent, AT_SYMLINK_FOLLOW);
if (r < 0) {
/* The parent can't do name_to_handle_at() but the
* directory we are interested in can? If so, it must
if (r < 0)
return r;
- r = lstat(parent, &b);
+ r = stat(parent, &b);
if (r < 0)
return -errno;