conn->origpath is always a duplicate of conn->connectpath.
The only function that sets conn->connectpath is set_conn_connectpath() and
everywhere it's called, there's a subsequent talloc_strdup() into
conn->origpath.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
and directories when setting time ? */
enum timestamp_set_resolution ts_res;
char *connectpath;
- char *origpath;
struct files_struct *cwd_fsp; /* Working directory. */
bool tcon_done;
TALLOC_FREE(conn);
return NULL;
}
- conn->origpath = talloc_strdup(conn, "");
- if (conn->origpath == NULL) {
- DBG_ERR("talloc_zero failed\n");
- TALLOC_FREE(conn);
- return NULL;
- }
conn->cwd_fsp = talloc_zero(conn, struct files_struct);
if (conn->cwd_fsp == NULL) {
DBG_ERR("talloc_zero failed\n");
return NT_STATUS_ACCESS_DENIED;
}
- talloc_free(conn->origpath);
- conn->origpath = talloc_strdup(conn, conn->connectpath);
- if (conn->origpath == NULL) {
- conn_free(conn);
- return NT_STATUS_NO_MEMORY;
- }
-
conn->fs_capabilities = SMB_VFS_FS_CAPABILITIES(conn, &conn->ts_res);
conn->tcon_done = true;
*pconn = talloc_move(ctx, &conn);
const struct smb_filename connectpath_fname = {
.base_name = conn->connectpath,
};
- const struct smb_filename origpath_fname = {
- .base_name = conn->origpath,
- };
int saved_errno = 0;
char *utok_str = NULL;
int ret;
strerror(saved_errno),
utok_str);
- ret = vfs_ChDir(conn, &origpath_fname);
- if (ret == 0) {
- TALLOC_FREE(utok_str);
- return true;
- }
- saved_errno = errno;
-
- DBG_ERR("vfs_ChDir(%s) failed: %s. Current token: %s\n",
- conn->origpath,
- strerror(saved_errno),
- utok_str);
-
if (saved_errno != 0) {
errno = saved_errno;
}
}
conn->base_share_dev = smb_fname_cpath->st.st_ex_dev;
- talloc_free(conn->origpath);
- conn->origpath = talloc_strdup(conn, conn->connectpath);
-
/* Figure out the characteristics of the underlying filesystem. This
* assumes that all the filesystem mounted within a share path have
* the same characteristics, which is likely but not guaranteed.