smbd: remove unused create_conn_struct_cwd() function
authorStefan Metzmacher <metze@samba.org>
Fri, 25 May 2018 06:49:29 +0000 (08:49 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jun 2018 18:52:23 +0000 (20:52 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/msdfs.c
source3/smbd/proto.h

index 18fae96f2e58d6009952757d3393298f72c8c6a3..256bb42d778ebcf8110109080156d03521e0323d 100644 (file)
@@ -386,68 +386,6 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
        return status;
 }
 
-/********************************************************
- Fake up a connection struct for the VFS layer.
- Note: this performs a vfs connect and CHANGES CWD !!!! JRA.
-
- The old working directory is returned on *poldcwd, allocated on ctx.
-*********************************************************/
-
-NTSTATUS create_conn_struct_cwd(TALLOC_CTX *ctx,
-                               struct tevent_context *ev,
-                               struct messaging_context *msg,
-                               connection_struct **pconn,
-                               int snum,
-                               const char *path,
-                               const struct auth_session_info *session_info,
-                               struct smb_filename **poldcwd_fname)
-{
-       connection_struct *conn;
-       struct smb_filename *oldcwd_fname = NULL;
-       struct smb_filename smb_fname_connectpath = {0};
-
-       NTSTATUS status = create_conn_struct(ctx, ev,
-                                            msg, &conn,
-                                            snum, path,
-                                            session_info);
-       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.
-        */
-
-       oldcwd_fname = vfs_GetWd(ctx, conn);
-       if (oldcwd_fname == NULL) {
-               status = map_nt_error_from_unix(errno);
-               DEBUG(3, ("vfs_GetWd failed: %s\n", strerror(errno)));
-               conn_free(conn);
-               return status;
-       }
-
-       smb_fname_connectpath = (struct smb_filename) {
-               .base_name = conn->connectpath
-       };
-
-       if (vfs_ChDir(conn, &smb_fname_connectpath) != 0) {
-               status = map_nt_error_from_unix(errno);
-               DEBUG(3,("create_conn_struct: Can't ChDir to new conn path %s. "
-                       "Error was %s\n",
-                       conn->connectpath, strerror(errno) ));
-               TALLOC_FREE(oldcwd_fname);
-               conn_free(conn);
-               return status;
-       }
-
-       *pconn = conn;
-       *poldcwd_fname = oldcwd_fname;
-
-       return NT_STATUS_OK;
-}
-
 static int conn_struct_tos_destructor(struct conn_struct_tos *c)
 {
        if (c->oldcwd_fname != NULL) {
index ed12e504bf8bb3e666080607db8e1bc2e7926463..68dd566efd10a908a73da24980060fe23e520e93 100644 (file)
@@ -506,14 +506,6 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
                            int snum,
                            const char *path,
                            const struct auth_session_info *session_info);
-NTSTATUS create_conn_struct_cwd(TALLOC_CTX *ctx,
-                               struct tevent_context *ev,
-                               struct messaging_context *msg,
-                               connection_struct **pconn,
-                               int snum,
-                               const char *path,
-                               const struct auth_session_info *session_info,
-                               struct smb_filename **poldcwd_fname);
 struct connection_struct;
 struct smb_filename;
 struct conn_struct_tos {