mirror of
https://github.com/samba-team/samba.git
synced 2025-08-30 17:49:30 +03:00
Make the logic a lot clearer and fix the comment to match.
Jeremy
This commit is contained in:
@ -429,24 +429,19 @@ bool file_find_subpath(files_struct *dir_fsp)
|
|||||||
fsp->conn->connectpath,
|
fsp->conn->connectpath,
|
||||||
fsp->fsp_name->base_name);
|
fsp->fsp_name->base_name);
|
||||||
|
|
||||||
if (strnequal(d_fullname, d1_fullname, dlen)) {
|
|
||||||
/*
|
/*
|
||||||
* If the open file is a second file handle to the
|
* If the open file has a path that is a longer
|
||||||
* same name or is a stream on the original file, then
|
* component, then it's a subpath.
|
||||||
* don't return true.
|
|
||||||
*/
|
*/
|
||||||
if (d1_fullname[dlen] != '/') {
|
if (strnequal(d_fullname, d1_fullname, dlen) &&
|
||||||
|
(d1_fullname[dlen] == '/')) {
|
||||||
|
TALLOC_FREE(d1_fullname);
|
||||||
|
TALLOC_FREE(d_fullname);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
TALLOC_FREE(d1_fullname);
|
TALLOC_FREE(d1_fullname);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TALLOC_FREE(d1_fullname);
|
|
||||||
ret = true;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
TALLOC_FREE(d1_fullname);
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
TALLOC_FREE(d_fullname);
|
TALLOC_FREE(d_fullname);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user