]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: use pathref fsp in call_trans2setfilepathinfo()
authorRalph Boehme <slow@samba.org>
Tue, 17 Nov 2020 11:14:19 +0000 (12:14 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
This means we're now passing a valid fsp to all setinfo functions. The only
special case being when dealing with a symlink in POSIX context.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/trans2.c

index 7dbcf922aa9ae706f766db38f74909679bac8762..b883685cddbf658dc2137401e782fc5be1e4b4ab 100644 (file)
@@ -9475,6 +9475,13 @@ static void call_trans2setfilepathinfo(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 (INFO_LEVEL_IS_UNIX(info_level)) {
                        /*
                         * For CIFS UNIX extensions the target name may not exist.