From: Stefan Metzmacher Date: Fri, 25 May 2018 06:49:29 +0000 (+0200) Subject: smbd: remove unused create_conn_struct_cwd() function X-Git-Tag: tevent-0.9.37~343 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cdb875f5f7cc7cd17af34b8dd9352f6e69e492dd;p=thirdparty%2Fsamba.git smbd: remove unused create_conn_struct_cwd() function Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 18fae96f2e5..256bb42d778 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -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) { diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index ed12e504bf8..68dd566efd1 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -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 {