]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Remove unused create_conn_struct_tos()
authorVolker Lendecke <vl@samba.org>
Mon, 16 Feb 2026 14:16:07 +0000 (15:16 +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 86a2253a61cd2892e303256bf78e06954530e9af..b8de5143b1744633cd5e1e85aa17764526f63be2 100644 (file)
@@ -309,54 +309,6 @@ static NTSTATUS create_conn_struct_as_root(
        return NT_STATUS_OK;
 }
 
-static int conn_struct_tos_destructor(struct conn_struct_tos *c)
-{
-       SMB_VFS_DISCONNECT(c->conn);
-       TALLOC_FREE(c->conn);
-       return 0;
-}
-
-/********************************************************
- Fake up a connection struct for the VFS layer, for use in
- applications (such as the python bindings), that do not want the
- global working directory changed under them.
-
- SMB_VFS_CONNECT requires root privileges.
- This temporary uses become_root() and unbecome_root().
-
- But further impersonation has to be done by the caller.
-*********************************************************/
-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)
-{
-       struct conn_struct_tos *c = NULL;
-       NTSTATUS status;
-
-       *_c = NULL;
-
-       c = talloc_zero(talloc_tos(), struct conn_struct_tos);
-       if (c == NULL) {
-               return NT_STATUS_NO_MEMORY;
-       }
-
-       become_root();
-       status = create_conn_struct_as_root(
-               c, msg, &c->conn, snum, path, session_info);
-       unbecome_root();
-       if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(c);
-               return status;
-       }
-
-       talloc_set_destructor(c, conn_struct_tos_destructor);
-
-       *_c = c;
-       return NT_STATUS_OK;
-}
-
 struct conn_wrap {
        struct connection_struct *conn;
 };
index d0ec830a06dc17e632041ff078eaf7fef436b39a..927a9249b328ee6f45ae72547a64e12cff9cea3e 100644 (file)
@@ -505,15 +505,6 @@ NTSTATUS parse_dfs_path_strict(TALLOC_CTX *ctx,
                               char **_servicename,
                               char **_remaining_path);
 
-struct conn_struct_tos {
-       struct connection_struct *conn;
-};
-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);
-
 struct conn_wrap;
 NTSTATUS create_conn_struct_chdir(TALLOC_CTX *mem_ctx,
                                  struct messaging_context *msg,