1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: vfs: Remove use of lp_posix_pathnames() below the VFS.

We don't have access to a struct smb_filename here and
can't get one, so simply always set AT_SYMLINK_NOFOLLOW
and remove the optimization if we ended up fstatat()'ing
a symlink, as we don't know if the caller wanted a link
stat or not.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
This commit is contained in:
Jeremy Allison 2016-03-18 21:31:22 -07:00
parent dc5dad4813
commit 91c385cfd3

View File

@ -419,13 +419,20 @@ static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
if (result != NULL) {
/* See if we can efficiently return this. */
struct stat st;
int flags = (lp_posix_pathnames() ?
AT_SYMLINK_NOFOLLOW : 0);
int flags = AT_SYMLINK_NOFOLLOW;
int ret = fstatat(dirfd(dirp),
result->d_name,
&st,
flags);
if (ret == 0) {
/*
* As this is an optimization,
* ignore it if we stat'ed a
* symlink. Make the caller
* do it again as we don't
* know if they wanted the link
* info, or its target info.
*/
if ((ret == 0) && (!S_ISLNK(st.st_mode))) {
init_stat_ex_from_stat(sbuf,
&st,
lp_fake_directory_create_times(