Add auth_serversupplied_info to create_conn_struct
authorVolker Lendecke <vl@samba.org>
Sun, 23 Nov 2008 21:21:26 +0000 (22:21 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 23 Nov 2008 21:41:59 +0000 (22:41 +0100)
srvsvc needs it, as will printing

source3/include/proto.h
source3/rpc_server/srv_srvsvc_nt.c
source3/smbd/msdfs.c

index 2cf1a9645ec69e6f6e2d0a9e7f4abeef71b1a424..a024d683f349a45c7bec66e4e790129105d80134 100644 (file)
@@ -7957,7 +7957,8 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
                                connection_struct **pconn,
                                int snum,
                                const char *path,
-                           char **poldcwd);
+                               struct auth_serversupplied_info *server_info,
+                               char **poldcwd);
 
 /* The following definitions come from smbd/negprot.c  */
 
index 9d9e9af59b0391eea5a5757de6b4cc90901f2e09..274deab88b1102677917809cf7a706d935f7609f 100644 (file)
@@ -2050,7 +2050,8 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p,
        }
 
        nt_status = create_conn_struct(talloc_tos(), &conn, snum,
-                                      lp_pathname(snum), &oldcwd);
+                                      lp_pathname(snum), p->server_info,
+                                      &oldcwd);
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(10, ("create_conn_struct failed: %s\n",
                           nt_errstr(nt_status)));
@@ -2058,8 +2059,6 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p,
                goto error_exit;
        }
 
-       conn->server_info = p->server_info;
-
        nt_status = create_file(
                conn,                                   /* conn */
                NULL,                                   /* req */
@@ -2165,7 +2164,8 @@ WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p,
        }
 
        nt_status = create_conn_struct(talloc_tos(), &conn, snum,
-                                      lp_pathname(snum), &oldcwd);
+                                      lp_pathname(snum), p->server_info,
+                                      &oldcwd);
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(10, ("create_conn_struct failed: %s\n",
                           nt_errstr(nt_status)));
@@ -2173,8 +2173,6 @@ WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p,
                goto error_exit;
        }
 
-       conn->server_info = p->server_info;
-
        nt_status = create_file(
                conn,                                   /* conn */
                NULL,                                   /* req */
index 1504b19169b90a75befc1b1bbcfd0db71492de8a..d46be6426252343701c7ac48643533fd40bcfbe8 100644 (file)
@@ -219,6 +219,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
                                connection_struct **pconn,
                                int snum,
                                const char *path,
+                               struct auth_serversupplied_info *server_info,
                                char **poldcwd)
 {
        connection_struct *conn;
@@ -254,6 +255,15 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
 
        conn->params->service = snum;
 
+       if (server_info != NULL) {
+               conn->server_info = copy_serverinfo(conn, server_info);
+               if (conn->server_info == NULL) {
+                       DEBUG(0, ("copy_serverinfo failed\n"));
+                       TALLOC_FREE(conn);
+                       return NT_STATUS_NO_MEMORY;
+               }
+       }
+
        set_conn_connectpath(conn, connpath);
 
        if (!smbd_vfs_init(conn)) {
@@ -881,7 +891,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
        }
 
        status = create_conn_struct(ctx, &conn, snum, lp_pathname(snum),
-                                   &oldpath);
+                                   NULL, &oldpath);
        if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(pdp);
                return status;
@@ -1321,7 +1331,7 @@ static bool junction_to_local_path(const struct junction_map *jucn,
                return False;
        }
        status = create_conn_struct(talloc_tos(), conn_out, snum,
-                                   lp_pathname(snum), oldpath);
+                                   lp_pathname(snum), NULL, oldpath);
        if (!NT_STATUS_IS_OK(status)) {
                return False;
        }
@@ -1455,7 +1465,7 @@ static int count_dfs_links(TALLOC_CTX *ctx, int snum)
         */
 
        status = create_conn_struct(talloc_tos(), &conn, snum, connect_path,
-                                   &cwd);
+                                   NULL, &cwd);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(3, ("create_conn_struct failed: %s\n",
                          nt_errstr(status)));
@@ -1523,7 +1533,8 @@ static int form_junctions(TALLOC_CTX *ctx,
         * Fake up a connection struct for the VFS layer.
         */
 
-       status = create_conn_struct(ctx, &conn, snum, connect_path, &cwd);
+       status = create_conn_struct(ctx, &conn, snum, connect_path, NULL,
+                                   &cwd);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(3, ("create_conn_struct failed: %s\n",
                          nt_errstr(status)));