From: Ralph Boehme Date: Mon, 14 Dec 2020 14:53:11 +0000 (+0100) Subject: smbd: check for absolute paths in full_path_from_dirfsp_atname() X-Git-Tag: samba-4.14.0rc1~197 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c3fb27d92b82241183ae811e5ee7ca90e53b7284;p=thirdparty%2Fsamba.git smbd: check for absolute paths in full_path_from_dirfsp_atname() If the "atname" is an absolute path we can ignore the dirfsp and just return a copy of the atname. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 748d1effc16..184a293f205 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -2068,7 +2068,8 @@ struct smb_filename *full_path_from_dirfsp_atname( char *path = NULL; if (dirfsp == dirfsp->conn->cwd_fsp || - ISDOT(dirfsp->fsp_name->base_name)) + ISDOT(dirfsp->fsp_name->base_name) || + atname->base_name[0] == '/') { path = talloc_strdup(mem_ctx, atname->base_name); } else {