At present, substitutions in the streams directory path are ignored. Fix it
by modifying 'stream_dir' function to call 'lp_parm_talloc_string' which
internally calls 'lp_string' on the path.
Signed-off-by: Shyamsunder Rathi <shyam.rathi@nutanix.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
struct file_id id;
uint8_t id_buf[16];
bool check_valid;
- const char *rootdir;
+ char *rootdir = NULL;
struct smb_filename *rootdir_fname = NULL;
struct smb_filename *tmp_fname = NULL;
goto fail;
}
- rootdir = lp_parm_const_string(
+ rootdir = lp_parm_talloc_string(talloc_tos(),
SNUM(handle->conn), "streams_depot", "directory",
tmp);
+ if (rootdir == NULL) {
+ errno = ENOMEM;
+ goto fail;
+ }
rootdir_fname = synthetic_smb_fname(talloc_tos(),
rootdir,
}
TALLOC_FREE(rootdir_fname);
+ TALLOC_FREE(rootdir);
TALLOC_FREE(tmp_fname);
TALLOC_FREE(smb_fname_hash);
return result;
fail:
TALLOC_FREE(rootdir_fname);
+ TALLOC_FREE(rootdir);
TALLOC_FREE(tmp_fname);
TALLOC_FREE(smb_fname_hash);
TALLOC_FREE(result);