diff options
| author | Volker Lendecke <vl@samba.org> | 2026-02-16 14:21:17 +0100 |
|---|---|---|
| committer | Volker Lendecke <vl@samba.org> | 2026-03-01 20:19:35 +0000 |
| commit | bd87333d6e2efce84fb4141c4cf3e687ddfa6cd0 (patch) | |
| tree | 6dec538987b0ef3df900ccea48ecc10f37b8eaa9 | |
| parent | aa123c8516ee1c364747cda3f8e4ab73d40d9b33 (diff) | |
| download | samba-bd87333d6e2efce84fb4141c4cf3e687ddfa6cd0.tar.gz samba-bd87333d6e2efce84fb4141c4cf3e687ddfa6cd0.tar.bz2 samba-bd87333d6e2efce84fb4141c4cf3e687ddfa6cd0.zip | |
smbd: Remove unused create_conn_struct_tos_cwd()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
| -rw-r--r-- | source3/smbd/msdfs.c | 62 | ||||
| -rw-r--r-- | source3/smbd/proto.h | 6 |
2 files changed, 0 insertions, 68 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 1efdc7a89e6..86a2253a61c 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -311,10 +311,6 @@ static NTSTATUS create_conn_struct_as_root( static int conn_struct_tos_destructor(struct conn_struct_tos *c) { - if (c->oldcwd_fname != NULL) { - vfs_ChDir(c->conn, c->oldcwd_fname); - TALLOC_FREE(c->oldcwd_fname); - } SMB_VFS_DISCONNECT(c->conn); TALLOC_FREE(c->conn); return 0; @@ -361,64 +357,6 @@ NTSTATUS create_conn_struct_tos(struct messaging_context *msg, return NT_STATUS_OK; } -/******************************************************** - Fake up a connection struct for the VFS layer. - Note: this performs a vfs connect and CHANGES CWD !!!! JRA. - - See also the comment for create_conn_struct_tos() above! - - The CWD change is reverted by the destructor of - conn_struct_tos when the current talloc_tos() is destroyed. -*********************************************************/ -NTSTATUS create_conn_struct_tos_cwd(struct messaging_context *msg, - int snum, - const char *path, - const struct auth_session_info *session_info, - struct conn_struct_tos **_c) -{ - struct conn_struct_tos *c = NULL; - NTSTATUS status; - int ret; - - *_c = NULL; - - status = create_conn_struct_tos(msg, - snum, - path, - session_info, - &c); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - /* - * Windows seems to insist on doing trans2getdfsreferral() calls on - * the IPC$ share as the anonymous user. If we try to chdir as that - * user we will fail.... WTF ? JRA. - */ - - c->oldcwd_fname = vfs_GetWd(c, c->conn); - if (c->oldcwd_fname == NULL) { - status = map_nt_error_from_unix(errno); - DEBUG(3, ("vfs_GetWd failed: %s\n", strerror(errno))); - TALLOC_FREE(c); - return status; - } - - ret = vfs_ChDir_shareroot(c->conn); - if (ret != 0) { - status = map_nt_error_from_unix(errno); - DBG_NOTICE("Can't ChDir to new conn path %s. " - "Error was %s\n", - c->conn->connectpath, strerror(errno)); - TALLOC_FREE(c); - return status; - } - - *_c = c; - return NT_STATUS_OK; -} - struct conn_wrap { struct connection_struct *conn; }; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index b43b59cc75e..d0ec830a06d 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -507,18 +507,12 @@ NTSTATUS parse_dfs_path_strict(TALLOC_CTX *ctx, struct conn_struct_tos { struct connection_struct *conn; - struct smb_filename *oldcwd_fname; }; NTSTATUS create_conn_struct_tos(struct messaging_context *msg, int snum, const char *path, const struct auth_session_info *session_info, struct conn_struct_tos **_c); -NTSTATUS create_conn_struct_tos_cwd(struct messaging_context *msg, - int snum, - const char *path, - const struct auth_session_info *session_info, - struct conn_struct_tos **_c); struct conn_wrap; NTSTATUS create_conn_struct_chdir(TALLOC_CTX *mem_ctx, |
