]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: avoid a smb_fname copy in call_trans2setfilepathinfo()
authorRalph Boehme <slow@samba.org>
Tue, 17 Nov 2020 10:02:31 +0000 (11:02 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 19 Nov 2020 21:24:23 +0000 (21:24 +0000)
There's no point in doing a copy here, we can just point smb_fname at
fsp->fsp_name.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov 19 21:24:23 UTC 2020 on sn-devel-184

source3/smbd/trans2.c

index 14f21b07f420469dde91d26f3e486e13261c3b72..f6e261ed658e54a5a4ec4f9a455684f2238d20c5 100644 (file)
@@ -9309,11 +9309,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
                }
                info_level = SVAL(params,2);
 
-               smb_fname = cp_smb_filename(talloc_tos(), fsp->fsp_name);
-               if (smb_fname == NULL) {
-                       reply_nterror(req, NT_STATUS_NO_MEMORY);
-                       return;
-               }
+               smb_fname = fsp->fsp_name;
 
                if(fsp->fh->fd == -1) {
                        /*