From 2bcb268b1837371c9b8a384ca310ac6e54a812d6 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 17 Nov 2020 07:54:42 +0100 Subject: [PATCH] smbd: use pathref fsp in call_trans2qfilepathinfo() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/smbd/trans2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 41ed5e8a0b7..7dbcf922aa9 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -6192,6 +6192,13 @@ static void call_trans2qfilepathinfo(connection_struct *conn, return; } + /* + * smb_fname->fsp may be NULL if smb_fname points at a symlink + * and we're in POSIX context, so be careful when using fsp + * below, it can still be NULL. + */ + fsp = smb_fname->fsp; + /* If this is a stream, check if there is a delete_pending. */ if ((conn->fs_capabilities & FILE_NAMED_STREAMS) && is_ntfs_stream_smb_fname(smb_fname)) { -- 2.47.3