1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-15 13:49:28 +03:00

s3: smbd: Allow async dosmode to cope with ".." pathnames where we close smb_fname->fsp to prevent meta-data leakage.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14759

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison
2021-07-14 21:30:09 -07:00
committed by Ralph Boehme
parent 696972c832
commit b004ebb1c6

View File

@ -814,15 +814,20 @@ struct tevent_req *dos_mode_at_send(TALLOC_CTX *mem_ctx,
}
if (smb_fname->fsp == NULL) {
/*
* The pathological case where a caller does
* dos_mode_at_send() and smb_fname points at a
* symlink in POSIX context. smb_fname->fsp is NULL.
*
* FIXME ? Should we move to returning
* FILE_ATTRIBUTE_REPARSE_POINT here ?
*/
state->dosmode = FILE_ATTRIBUTE_NORMAL;
if (ISDOTDOT(smb_fname->base_name)) {
/*
* smb_fname->fsp is explicitly closed
* for ".." to prevent meta-data leakage.
*/
state->dosmode = FILE_ATTRIBUTE_DIRECTORY;
} else {
/*
* This is a symlink in POSIX context.
* FIXME ? Should we move to returning
* FILE_ATTRIBUTE_REPARSE_POINT here ?
*/
state->dosmode = FILE_ATTRIBUTE_NORMAL;
}
tevent_req_done(req);
return tevent_req_post(req, ev);
}