If you pass in dirfsp!=conn->cwd_fsp and a stream fsp, we don't chdir
to the parent pathname, and thus we also don't overwrite
fsp->base_fsp.
fsp->base_fsp!=NULL is thus the wrong condition to restore the
original base fsp name: If we open a stream with a non-cwd_fsp dirfsp,
we would overwrite fsp->base_fsp->fsp_name with NULL.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
out:
fsp->fsp_name = orig_fsp_name;
- if (fsp->base_fsp != NULL) {
+
+ if (orig_base_fsp_name != NULL) {
/* Save off the temporary name. */
struct smb_filename *base_smb_fname_rel =
fsp->base_fsp->fsp_name;