]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Remove unused create_conn_struct_tos_cwd()
authorVolker Lendecke <vl@samba.org>
Mon, 16 Feb 2026 13:21:17 +0000 (14:21 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 1 Mar 2026 20:19:35 +0000 (20:19 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/msdfs.c
source3/smbd/proto.h

index 1efdc7a89e6a5d17bd0451edfed3d3980826ef11..86a2253a61cd2892e303256bf78e06954530e9af 100644 (file)
@@ -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;
 };
index b43b59cc75e703d24e002818fd74099dc59fa56a..d0ec830a06dc17e632041ff078eaf7fef436b39a 100644 (file)
@@ -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,