Looks more complex, but this avoids calling openat_pathref_fsp, which
eventually calls into non_widelink_open(). We need to open the pretty paranoid
SMB_ASSERT in openat_pathref_fsp_lcomp() a little bit.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
}
if (dirname[0] == '\0') {
- status = synthetic_pathref(mem_ctx,
- basedir,
- ".",
- NULL,
- NULL,
- 0,
- posix ? SMB_FILENAME_POSIX_PATH : 0,
- &smb_dirname);
+ smb_dirname = synthetic_smb_fname(
+ mem_ctx,
+ ".",
+ NULL,
+ NULL,
+ 0,
+ posix ? SMB_FILENAME_POSIX_PATH : 0);
+ if (smb_dirname == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ status = openat_pathref_fsp_lcomp(basedir,
+ smb_dirname,
+ UCF_POSIX_PATHNAMES);
} else {
status = normalize_filename_case(conn, dirname, ucf_flags);
if (!NT_STATUS_IS_OK(status)) {
*/
SMB_ASSERT((smb_fname_rel->fsp == NULL) &&
- (dirfsp != dirfsp->conn->cwd_fsp) &&
+ ((dirfsp != dirfsp->conn->cwd_fsp) ||
+ ISDOT(smb_fname_rel->base_name)) &&
(strchr_m(smb_fname_rel->base_name, '/') == NULL) &&
!is_named_stream(smb_fname_rel));