- map_max_allowed_access(p->server_info->ptok, &des_access);
-
- make_samr_object_sd(p->mem_ctx, &psd, &sd_size, &sam_generic_mapping, NULL, 0);
- se_map_generic(&des_access, &sam_generic_mapping);
-
- nt_status = access_check_samr_object(psd, p->server_info->ptok,
- NULL, 0, des_access, &acc_granted, "_samr_Connect5");
-
- if ( !NT_STATUS_IS_OK(nt_status) )
- return nt_status;
-
- /* associate the user's SID and access granted with the new handle. */
- if ((info = get_samr_info_by_sid(NULL)) == NULL)
- return NT_STATUS_NO_MEMORY;
-
- info->acc_granted = acc_granted;
- info->status = r->in.access_mask; /* ??? */
-
- /* get a (unique) handle. open a policy on it. */
- if (!create_policy_hnd(p, r->out.connect_handle, free_samr_info, (void *)info))
- return NT_STATUS_OBJECT_NAME_NOT_FOUND;
-
- DEBUG(5,("_samr_Connect5: %d\n", __LINE__));
-
- info1.client_version = SAMR_CONNECT_AFTER_W2K;
- info1.unknown2 = 0;
-