diff options
Diffstat (limited to 'source3')
70 files changed, 892 insertions, 892 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index 4262d15a95..ad45d81e94 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -25,9 +25,9 @@ #include "ntlmssp_wrap.h" #include "../librpc/gen_ndr/netlogon.h" -NTSTATUS auth_ntlmssp_steal_server_info(TALLOC_CTX *mem_ctx, +NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx, struct auth_ntlmssp_state *auth_ntlmssp_state, - struct auth_serversupplied_info **server_info) + struct auth_serversupplied_info **session_info) { /* Free the current server_info user_session_key and reset it from the * current ntlmssp_state session_key */ @@ -40,11 +40,11 @@ NTSTATUS auth_ntlmssp_steal_server_info(TALLOC_CTX *mem_ctx, auth_ntlmssp_state->ntlmssp_state->session_key.length); if (auth_ntlmssp_state->ntlmssp_state->session_key.length && !auth_ntlmssp_state->server_info->user_session_key.data) { - *server_info = NULL; + *session_info = NULL; return NT_STATUS_NO_MEMORY; } - /* Steal server_info away from auth_ntlmssp_state */ - *server_info = talloc_move(mem_ctx, &auth_ntlmssp_state->server_info); + /* Steal session_info away from auth_ntlmssp_state */ + *session_info = talloc_move(mem_ctx, &auth_ntlmssp_state->server_info); return NT_STATUS_OK; } diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 3143710986..59406283b3 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -745,12 +745,12 @@ done: } /*************************************************************************** - Make (and fill) a user_info struct for a system user login. + Make (and fill) a auth_session_info struct for a system user login. This *must* succeed for smbd to start. ***************************************************************************/ -static NTSTATUS make_new_server_info_system(TALLOC_CTX *mem_ctx, - struct auth_serversupplied_info **server_info) +static NTSTATUS make_new_session_info_system(TALLOC_CTX *mem_ctx, + struct auth_serversupplied_info **session_info) { struct passwd *pwd; NTSTATUS status; @@ -763,20 +763,20 @@ static NTSTATUS make_new_server_info_system(TALLOC_CTX *mem_ctx, status = make_serverinfo_from_username(mem_ctx, pwd->pw_name, false, - server_info); + session_info); TALLOC_FREE(pwd); if (!NT_STATUS_IS_OK(status)) { return status; } - (*server_info)->system = true; + (*session_info)->system = true; - status = add_sid_to_array_unique((*server_info)->security_token->sids, + status = add_sid_to_array_unique((*session_info)->security_token->sids, &global_sid_System, - &(*server_info)->security_token->sids, - &(*server_info)->security_token->num_sids); + &(*session_info)->security_token->sids, + &(*session_info)->security_token->num_sids); if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE((*server_info)); + TALLOC_FREE((*session_info)); return status; } @@ -888,7 +888,7 @@ struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx, * SMB level session key with SystemLibraryDTC */ -bool server_info_set_session_key(struct auth_serversupplied_info *info, +bool session_info_set_session_key(struct auth_serversupplied_info *info, DATA_BLOB session_key) { TALLOC_FREE(info->user_session_key.data); @@ -923,18 +923,18 @@ NTSTATUS init_system_info(void) if (system_info != NULL) return NT_STATUS_OK; - return make_new_server_info_system(NULL, &system_info); + return make_new_session_info_system(NULL, &system_info); } -NTSTATUS make_server_info_system(TALLOC_CTX *mem_ctx, - struct auth_serversupplied_info **server_info) +NTSTATUS make_session_info_system(TALLOC_CTX *mem_ctx, + struct auth_serversupplied_info **session_info) { if (system_info == NULL) return NT_STATUS_UNSUCCESSFUL; - *server_info = copy_serverinfo(mem_ctx, system_info); - return (*server_info != NULL) ? NT_STATUS_OK : NT_STATUS_NO_MEMORY; + *session_info = copy_serverinfo(mem_ctx, system_info); + return (*session_info != NULL) ? NT_STATUS_OK : NT_STATUS_NO_MEMORY; } -const struct auth_serversupplied_info *get_server_info_system(void) +const struct auth_serversupplied_info *get_session_info_system(void) { return system_info; } diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index ba4f3928d6..48ad876e34 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -119,7 +119,7 @@ struct pipes_struct { struct client_address *client_id; - struct auth_serversupplied_info *server_info; + struct auth_serversupplied_info *session_info; struct messaging_context *msg_ctx; struct ndr_syntax_id syntax; diff --git a/source3/include/proto.h b/source3/include/proto.h index f6c77b6d5e..31ebd37518 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -57,9 +57,9 @@ NTSTATUS auth_netlogond_init(void); /* The following definitions come from auth/auth_ntlmssp.c */ -NTSTATUS auth_ntlmssp_steal_server_info(TALLOC_CTX *mem_ctx, +NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx, struct auth_ntlmssp_state *auth_ntlmssp_state, - struct auth_serversupplied_info **server_info); + struct auth_serversupplied_info **session_info); NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state **auth_ntlmssp_state); @@ -144,13 +144,13 @@ struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx, const struct auth_serversupplied_info *src); bool init_guest_info(void); NTSTATUS init_system_info(void); -bool server_info_set_session_key(struct auth_serversupplied_info *info, +bool session_info_set_session_key(struct auth_serversupplied_info *info, DATA_BLOB session_key); NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx, struct auth_serversupplied_info **server_info); -NTSTATUS make_server_info_system(TALLOC_CTX *mem_ctx, - struct auth_serversupplied_info **server_info); -const struct auth_serversupplied_info *get_server_info_system(void); +NTSTATUS make_session_info_system(TALLOC_CTX *mem_ctx, + struct auth_serversupplied_info **session_info); +const struct auth_serversupplied_info *get_session_info_system(void); bool copy_current_user(struct current_user *dst, struct current_user *src); struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, const char *domuser, char **p_save_username, bool create ); @@ -4094,12 +4094,12 @@ struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c); struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax, struct client_address *client_id, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx); NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx, const struct ndr_interface_table *ndr_table, struct client_address *client_id, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct dcerpc_binding_handle **binding_handle); NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, @@ -4110,7 +4110,7 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, struct rpc_pipe_client **presult); NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct client_address *client_id, struct messaging_context *msg_ctx, struct rpc_pipe_client **cli_pipe); @@ -4307,7 +4307,7 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, const struct tsocket_address *local_address, const struct tsocket_address *remote_address, struct client_address *client_id, - struct auth_serversupplied_info *server_info, + struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct fake_file_handle **phandle); bool np_read_in_progress(struct fake_file_handle *handle); @@ -4854,7 +4854,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx, connection_struct **pconn, int snum, const char *path, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, char **poldcwd); /* The following definitions come from smbd/negprot.c */ @@ -5084,7 +5084,7 @@ int register_initial_vuid(struct smbd_server_connection *sconn); int register_homes_share(const char *username); int register_existing_vuid(struct smbd_server_connection *sconn, uint16 vuid, - struct auth_serversupplied_info *server_info, + struct auth_serversupplied_info *session_info, DATA_BLOB response_blob, const char *smb_name); void add_session_user(struct smbd_server_connection *sconn, const char *user); @@ -5408,7 +5408,7 @@ int sessionid_traverse_read(int (*fn)(const char *key, /* The following definitions come from smbd/sesssetup.c */ NTSTATUS do_map_to_guest(NTSTATUS status, - struct auth_serversupplied_info **server_info, + struct auth_serversupplied_info **session_info, const char *user, const char *domain); NTSTATUS parse_spnego_mechanisms(TALLOC_CTX *ctx, diff --git a/source3/include/smb.h b/source3/include/smb.h index ff3817ae31..c01a156152 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -375,7 +375,7 @@ struct client_address { }; struct vuid_cache_entry { - struct auth_serversupplied_info *server_info; + struct auth_serversupplied_info *session_info; uint16_t vuid; bool read_only; }; @@ -476,7 +476,7 @@ typedef struct connection_struct { * This represents the user information on this connection. Depending * on the vuid using this tid, this might change per SMB request. */ - struct auth_serversupplied_info *server_info; + struct auth_serversupplied_info *session_info; /* * If the "force group" parameter is set, this is the primary gid that @@ -1711,7 +1711,7 @@ typedef struct user_struct { TDB key string */ int homes_snum; - struct auth_serversupplied_info *server_info; + struct auth_serversupplied_info *session_info; struct auth_ntlmssp_state *auth_ntlmssp_state; } user_struct; diff --git a/source3/lib/afs.c b/source3/lib/afs.c index 117f6fa0b7..d73e9df4c0 100644 --- a/source3/lib/afs.c +++ b/source3/lib/afs.c @@ -231,16 +231,16 @@ bool afs_login(connection_struct *conn) } afs_username = talloc_sub_advanced(ctx, - SNUM(conn), conn->server_info->unix_name, - conn->connectpath, conn->server_info->utok.gid, - conn->server_info->sanitized_username, - pdb_get_domain(conn->server_info->sam_account), + SNUM(conn), conn->session_info->unix_name, + conn->connectpath, conn->session_info->utok.gid, + conn->session_info->sanitized_username, + pdb_get_domain(conn->session_info->sam_account), afs_username); if (!afs_username) { return false; } - user_sid = &conn->server_info->security_token->user_sids[0]; + user_sid = &conn->session_info->security_token->user_sids[0]; afs_username = talloc_string_sub(talloc_tos(), afs_username, "%s", diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index 399ef1daa3..629c4b63d7 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -917,9 +917,9 @@ char *standard_sub_conn(TALLOC_CTX *ctx, connection_struct *conn, const char *st { return talloc_sub_advanced(ctx, lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, + conn->session_info->utok.gid, get_smb_user_name(), "", str); diff --git a/source3/librpc/rpc/dcerpc_ep.c b/source3/librpc/rpc/dcerpc_ep.c index 37d69b0326..f4ebc041cb 100644 --- a/source3/librpc/rpc/dcerpc_ep.c +++ b/source3/librpc/rpc/dcerpc_ep.c @@ -161,7 +161,7 @@ static NTSTATUS ep_register(const struct ndr_interface_table *iface, status = rpcint_binding_handle(tmp_ctx, &ndr_table_epmapper, &client_id, - get_server_info_system(), + get_session_info_system(), server_messaging_context(), &h); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c index c2f2979044..fb4b89a88e 100644 --- a/source3/modules/onefs_open.c +++ b/source3/modules/onefs_open.c @@ -326,7 +326,7 @@ static NTSTATUS onefs_open_file(files_struct *fsp, fsp->wcp = NULL; /* Write cache pointer. */ DEBUG(2,("%s opened file %s read=%s write=%s (numopen=%d)\n", - conn->server_info->unix_name, + conn->session_info->unix_name, smb_fname_str_dbg(smb_fname), BOOLSTR(fsp->can_read), BOOLSTR(fsp->can_write), conn->num_files_open)); @@ -1309,7 +1309,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn, new_file_created = True; } - set_share_mode(lck, fsp, conn->server_info->utok.uid, 0, + set_share_mode(lck, fsp, conn->session_info->utok.uid, 0, fsp->oplock_type); /* Handle strange delete on close create semantics. */ @@ -1665,7 +1665,7 @@ static NTSTATUS onefs_open_directory(connection_struct *conn, return NT_STATUS_DELETE_PENDING; } - set_share_mode(lck, fsp, conn->server_info->utok.uid, 0, NO_OPLOCK); + set_share_mode(lck, fsp, conn->session_info->utok.uid, 0, NO_OPLOCK); /* * For directories the delete on close bit at open time seems diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c index 003be02b9c..e01ac4ec5f 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -462,8 +462,8 @@ static NTSTATUS inherit_new_acl(vfs_handle_struct *handle, &psd, &size, parent_desc, - &handle->conn->server_info->security_token->sids[PRIMARY_USER_SID_INDEX], - &handle->conn->server_info->security_token->sids[PRIMARY_GROUP_SID_INDEX], + &handle->conn->session_info->security_token->sids[PRIMARY_USER_SID_INDEX], + &handle->conn->session_info->security_token->sids[PRIMARY_GROUP_SID_INDEX], is_directory); if (!NT_STATUS_IS_OK(status)) { return status; diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c index d2d334808f..96f68e02c8 100644 --- a/source3/modules/vfs_expand_msdfs.c +++ b/source3/modules/vfs_expand_msdfs.c @@ -146,11 +146,11 @@ static char *expand_msdfs_target(TALLOC_CTX *ctx, targethost = talloc_sub_advanced(ctx, lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, targethost); DEBUG(10, ("Expanded targethost to %s\n", targethost)); diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c index 3073a128e9..af8b410657 100644 --- a/source3/modules/vfs_fake_perms.c +++ b/source3/modules/vfs_fake_perms.c @@ -38,8 +38,8 @@ static int fake_perms_stat(vfs_handle_struct *handle, } else { smb_fname->st.st_ex_mode = S_IRWXU; } - smb_fname->st.st_ex_uid = handle->conn->server_info->utok.uid; - smb_fname->st.st_ex_gid = handle->conn->server_info->utok.gid; + smb_fname->st.st_ex_uid = handle->conn->session_info->utok.uid; + smb_fname->st.st_ex_gid = handle->conn->session_info->utok.gid; } return ret; @@ -56,8 +56,8 @@ static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_ST } else { sbuf->st_ex_mode = S_IRWXU; } - sbuf->st_ex_uid = handle->conn->server_info->utok.uid; - sbuf->st_ex_gid = handle->conn->server_info->utok.gid; + sbuf->st_ex_uid = handle->conn->session_info->utok.uid; + sbuf->st_ex_gid = handle->conn->session_info->utok.gid; } return ret; } diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index a81f3b5870..0ff05f4b0f 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -397,11 +397,11 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn) } result = talloc_sub_advanced(ctx, lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, prefix); TALLOC_FREE(prefix); return result; diff --git a/source3/modules/vfs_readonly.c b/source3/modules/vfs_readonly.c index 09cbf50bd0..c19f5941be 100644 --- a/source3/modules/vfs_readonly.c +++ b/source3/modules/vfs_readonly.c @@ -83,7 +83,7 @@ static int readonly_connect(vfs_handle_struct *handle, for (i=0; i< VUID_CACHE_SIZE; i++) { struct vuid_cache_entry *ent = ent = &conn->vuid_cache.array[i]; ent->vuid = UID_FIELD_INVALID; - TALLOC_FREE(ent->server_info); + TALLOC_FREE(ent->session_info); ent->read_only = false; } conn->vuid_cache.next_entry = 0; diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index c6f2836763..626147ca83 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -464,11 +464,11 @@ static int recycle_unlink(vfs_handle_struct *handle, int rc = -1; repository = talloc_sub_advanced(NULL, lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, recycle_repository(handle)); ALLOC_CHECK(repository, done); /* shouldn't we allow absolute path names here? --metze */ diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c index cf90960540..c4f2c390d5 100644 --- a/source3/modules/vfs_smb_traffic_analyzer.c +++ b/source3/modules/vfs_smb_traffic_analyzer.c @@ -332,7 +332,7 @@ static char *smb_traffic_analyzer_create_string( TALLOC_CTX *ctx, * anonymized if needed, by the calling function. */ usersid = dom_sid_string( common_data_count_str, - &handle->conn->server_info->security_token->sids[0]); + &handle->conn->session_info->security_token->sids[0]); sidstr = smb_traffic_analyzer_anonymize( common_data_count_str, @@ -363,8 +363,8 @@ static char *smb_traffic_analyzer_create_string( TALLOC_CTX *ctx, (unsigned int) strlen(service_name), service_name, (unsigned int) - strlen(handle->conn->server_info->info3->base.domain.string), - handle->conn->server_info->info3->base.domain.string, + strlen(handle->conn->session_info->info3->base.domain.string), + handle->conn->session_info->info3->base.domain.string, (unsigned int) strlen(timestr), timestr, (unsigned int) strlen(handle->conn->sconn->client_id.addr), @@ -438,7 +438,7 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle, * function. */ username = smb_traffic_analyzer_anonymize( talloc_tos(), - handle->conn->server_info->sanitized_username, + handle->conn->session_info->sanitized_username, handle); if (!username) { @@ -469,7 +469,7 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle, "\"%04d-%02d-%02d %02d:%02d:%02d.%03d\"\n", (unsigned int) s_data->len, username, - handle->conn->server_info->info3->base.domain.string, + handle->conn->session_info->info3->base.domain.string, Write ? 'W' : 'R', handle->conn->connectpath, s_data->filename, diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 67c2d8732c..68b53c747c 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -618,7 +618,7 @@ static uint32 get_correct_cversion(struct pipes_struct *p, nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum, lp_pathname(printdollar_snum), - p->server_info, &oldcwd); + p->session_info, &oldcwd); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0,("get_correct_cversion: create_conn_struct " "returned %s\n", nt_errstr(nt_status))); @@ -989,7 +989,7 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum, lp_pathname(printdollar_snum), - p->server_info, &oldcwd); + p->session_info, &oldcwd); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0,("move_driver_to_download_area: create_conn_struct " "returned %s\n", nt_errstr(nt_status))); @@ -1564,7 +1564,7 @@ bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r, ****************************************************************************/ bool printer_driver_in_use(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const struct spoolss_DriverInfo8 *r) { @@ -1587,7 +1587,7 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx, continue; } - result = winreg_get_printer(mem_ctx, server_info, msg_ctx, + result = winreg_get_printer(mem_ctx, session_info, msg_ctx, lp_servicename(snum), &pinfo2); if (!W_ERROR_IS_OK(result)) { @@ -1613,18 +1613,18 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx, "Windows NT x86" version 2 or 3 left */ if (!strequal("Windows NT x86", r->architecture)) { - werr = winreg_get_driver(mem_ctx, server_info, msg_ctx, + werr = winreg_get_driver(mem_ctx, session_info, msg_ctx, "Windows NT x86", r->driver_name, DRIVER_ANY_VERSION, &driver); } else if (r->version == 2) { - werr = winreg_get_driver(mem_ctx, server_info, msg_ctx, + werr = winreg_get_driver(mem_ctx, session_info, msg_ctx, "Windows NT x86", r->driver_name, 3, &driver); } else if (r->version == 3) { - werr = winreg_get_driver(mem_ctx, server_info, msg_ctx, + werr = winreg_get_driver(mem_ctx, session_info, msg_ctx, "Windows NT x86", r->driver_name, 2, &driver); @@ -1792,7 +1792,7 @@ static bool trim_overlap_drv_files(TALLOC_CTX *mem_ctx, ****************************************************************************/ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_DriverInfo8 *info) { @@ -1815,7 +1815,7 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx, /* get the list of drivers */ - result = winreg_get_driver_list(mem_ctx, server_info, msg_ctx, + result = winreg_get_driver_list(mem_ctx, session_info, msg_ctx, info->architecture, version, &num_drivers, &drivers); if (!W_ERROR_IS_OK(result)) { @@ -1832,7 +1832,7 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx, driver = NULL; - result = winreg_get_driver(mem_ctx, server_info, msg_ctx, + result = winreg_get_driver(mem_ctx, session_info, msg_ctx, info->architecture, drivers[i], version, &driver); if (!W_ERROR_IS_OK(result)) { @@ -1886,7 +1886,7 @@ static NTSTATUS driver_unlink_internals(connection_struct *conn, this. ****************************************************************************/ -bool delete_driver_files(const struct auth_serversupplied_info *server_info, +bool delete_driver_files(const struct auth_serversupplied_info *session_info, const struct spoolss_DriverInfo8 *r) { int i = 0; @@ -1916,7 +1916,7 @@ bool delete_driver_files(const struct auth_serversupplied_info *server_info, nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum, lp_pathname(printdollar_snum), - server_info, &oldcwd); + session_info, &oldcwd); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0,("delete_driver_files: create_conn_struct " "returned %s\n", nt_errstr(nt_status))); @@ -2076,7 +2076,7 @@ void map_job_permissions(struct security_descriptor *sd) 3) "printer admins" (may result in numerous calls to winbind) ****************************************************************************/ -bool print_access_check(const struct auth_serversupplied_info *server_info, +bool print_access_check(const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, int snum, int access_type) { @@ -2092,8 +2092,8 @@ bool print_access_check(const struct auth_serversupplied_info *server_info, /* Always allow root or SE_PRINT_OPERATROR to do anything */ - if (server_info->utok.uid == sec_initial_uid() - || security_token_has_privilege(server_info->security_token, SEC_PRIV_PRINT_OPERATOR)) { + if (session_info->utok.uid == sec_initial_uid() + || security_token_has_privilege(session_info->security_token, SEC_PRIV_PRINT_OPERATOR)) { return True; } @@ -2114,7 +2114,7 @@ bool print_access_check(const struct auth_serversupplied_info *server_info, } result = winreg_get_printer_secdesc(mem_ctx, - get_server_info_system(), + get_session_info_system(), msg_ctx, pname, &secdesc); @@ -2149,7 +2149,7 @@ bool print_access_check(const struct auth_serversupplied_info *server_info, } /* Check access */ - status = se_access_check(secdesc, server_info->security_token, access_type, + status = se_access_check(secdesc, session_info->security_token, access_type, &access_granted); DEBUG(4, ("access check was %s\n", NT_STATUS_IS_OK(status) ? "SUCCESS" : "FAILURE")); @@ -2157,9 +2157,9 @@ bool print_access_check(const struct auth_serversupplied_info *server_info, /* see if we need to try the printer admin list */ if (!NT_STATUS_IS_OK(status) && - (token_contains_name_in_list(uidtoname(server_info->utok.uid), - server_info->info3->base.domain.string, - NULL, server_info->security_token, + (token_contains_name_in_list(uidtoname(session_info->utok.uid), + session_info->info3->base.domain.string, + NULL, session_info->security_token, lp_printer_admin(snum)))) { talloc_destroy(mem_ctx); return True; @@ -2178,7 +2178,7 @@ bool print_access_check(const struct auth_serversupplied_info *server_info, Check the time parameters allow a print operation. *****************************************************************************/ -bool print_time_access_check(const struct auth_serversupplied_info *server_info, +bool print_time_access_check(const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servicename) { @@ -2189,7 +2189,7 @@ bool print_time_access_check(const struct auth_serversupplied_info *server_info, struct tm *t; uint32 mins; - result = winreg_get_printer(NULL, server_info, msg_ctx, + result = winreg_get_printer(NULL, session_info, msg_ctx, servicename, &pinfo2); if (!W_ERROR_IS_OK(result)) { return False; @@ -2216,13 +2216,13 @@ bool print_time_access_check(const struct auth_serversupplied_info *server_info, } void nt_printer_remove(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer) { WERROR result; - result = winreg_delete_printer_key(mem_ctx, server_info, msg_ctx, + result = winreg_delete_printer_key(mem_ctx, session_info, msg_ctx, printer, ""); if (!W_ERROR_IS_OK(result)) { DEBUG(0, ("nt_printer_remove: failed to remove rpinter %s", diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c index b375d94c2b..70057ffad3 100644 --- a/source3/printing/nt_printing_ads.c +++ b/source3/printing/nt_printing_ads.c @@ -35,7 +35,7 @@ static void store_printer_guid(struct messaging_context *msg_ctx, const char *printer, struct GUID guid) { TALLOC_CTX *tmp_ctx; - struct auth_serversupplied_info *server_info = NULL; + struct auth_serversupplied_info *session_info = NULL; const char *guid_str; DATA_BLOB blob; NTSTATUS status; @@ -47,10 +47,10 @@ static void store_printer_guid(struct messaging_context *msg_ctx, return; } - status = make_server_info_system(tmp_ctx, &server_info); + status = make_session_info_system(tmp_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("store_printer_guid: " - "Could not create system server_info\n")); + "Could not create system session_info\n")); goto done; } @@ -70,7 +70,7 @@ static void store_printer_guid(struct messaging_context *msg_ctx, goto done; } - result = winreg_set_printer_dataex(tmp_ctx, server_info, msg_ctx, + result = winreg_set_printer_dataex(tmp_ctx, session_info, msg_ctx, printer, SPOOL_DSSPOOLER_KEY, "objectGUID", REG_SZ, blob.data, blob.length); @@ -233,14 +233,14 @@ static WERROR nt_printer_unpublish_ads(ADS_STRUCT *ads, * Publish a printer in the directory * * @param mem_ctx memory context - * @param server_info server_info to access winreg pipe + * @param session_info session_info to access winreg pipe * @param pinfo2 printer information * @param action publish/unpublish action * @return WERROR indicating status of publishing ***************************************************************************/ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_PrinterInfo2 *pinfo2, int action) @@ -271,7 +271,7 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx, sinfo2->attributes = pinfo2->attributes; - win_rc = winreg_update_printer(mem_ctx, server_info, msg_ctx, + win_rc = winreg_update_printer(mem_ctx, session_info, msg_ctx, pinfo2->sharename, info2_mask, sinfo2, NULL, NULL); if (!W_ERROR_IS_OK(win_rc)) { @@ -322,7 +322,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx) int snum; int n_services = lp_numservices(); TALLOC_CTX *tmp_ctx = NULL; - struct auth_serversupplied_info *server_info = NULL; + struct auth_serversupplied_info *session_info = NULL; struct spoolss_PrinterInfo2 *pinfo2; NTSTATUS status; WERROR result; @@ -348,10 +348,10 @@ WERROR check_published_printers(struct messaging_context *msg_ctx) goto done; } - status = make_server_info_system(tmp_ctx, &server_info); + status = make_session_info_system(tmp_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("check_published_printers: " - "Could not create system server_info\n")); + "Could not create system session_info\n")); result = WERR_ACCESS_DENIED; goto done; } @@ -361,7 +361,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx) continue; } - result = winreg_get_printer(tmp_ctx, server_info, msg_ctx, + result = winreg_get_printer(tmp_ctx, session_info, msg_ctx, lp_servicename(snum), &pinfo2); if (!W_ERROR_IS_OK(result)) { @@ -384,7 +384,7 @@ done: } bool is_printer_published(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, char *printer, struct GUID *guid, struct spoolss_PrinterInfo2 **info2) @@ -396,7 +396,7 @@ bool is_printer_published(TALLOC_CTX *mem_ctx, WERROR result; NTSTATUS status; - result = winreg_get_printer(mem_ctx, server_info, msg_ctx, + result = winreg_get_printer(mem_ctx, session_info, msg_ctx, printer, &pinfo2); if (!W_ERROR_IS_OK(result)) { return false; @@ -413,7 +413,7 @@ bool is_printer_published(TALLOC_CTX *mem_ctx, /* fetching printer guids really ought to be a separate function. */ - result = winreg_get_printer_dataex(mem_ctx, server_info, msg_ctx, + result = winreg_get_printer_dataex(mem_ctx, session_info, msg_ctx, printer, SPOOL_DSSPOOLER_KEY, "objectGUID", &type, &data, &data_size); @@ -456,7 +456,7 @@ done: } #else WERROR nt_printer_publish(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_PrinterInfo2 *pinfo2, int action) @@ -470,7 +470,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx) } bool is_printer_published(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, char *printer, struct GUID *guid, struct spoolss_PrinterInfo2 **info2) diff --git a/source3/printing/nt_printing_migrate.c b/source3/printing/nt_printing_migrate.c index 61fb9a602b..59fd04067b 100644 --- a/source3/printing/nt_printing_migrate.c +++ b/source3/printing/nt_printing_migrate.c @@ -631,7 +631,7 @@ bool nt_printing_tdb_migrate(struct messaging_context *msg_ctx) bool drivers_exists = file_exist(drivers_path); bool printers_exists = file_exist(printers_path); bool forms_exists = file_exist(forms_path); - struct auth_serversupplied_info *server_info; + struct auth_serversupplied_info *session_info; struct rpc_pipe_client *spoolss_pipe = NULL; TALLOC_CTX *tmp_ctx = talloc_stackframe(); NTSTATUS status; @@ -640,9 +640,9 @@ bool nt_printing_tdb_migrate(struct messaging_context *msg_ctx) return true; } - status = make_server_info_system(tmp_ctx, &server_info); + status = make_session_info_system(tmp_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("Couldn't create server_info: %s\n", + DEBUG(0, ("Couldn't create session_info: %s\n", nt_errstr(status))); talloc_free(tmp_ctx); return false; @@ -650,7 +650,7 @@ bool nt_printing_tdb_migrate(struct messaging_context *msg_ctx) status = rpc_pipe_open_internal(tmp_ctx, &ndr_table_spoolss.syntax_id, - server_info, + session_info, NULL, msg_ctx, &spoolss_pipe); diff --git a/source3/printing/printspoolss.c b/source3/printing/printspoolss.c index 9b06ece307..d7ce9713f9 100644 --- a/source3/printing/printspoolss.c +++ b/source3/printing/printspoolss.c @@ -125,7 +125,7 @@ NTSTATUS print_spool_open(files_struct *fsp, status = rpc_pipe_open_interface(fsp->conn, &ndr_table_spoolss.syntax_id, - fsp->conn->server_info, + fsp->conn->session_info, &fsp->conn->sconn->client_id, fsp->conn->sconn->msg_ctx, &fsp->conn->spoolss_pipe); @@ -278,7 +278,7 @@ void print_spool_end(files_struct *fsp, enum file_close_type close_type) status = rpc_pipe_open_interface(fsp->conn, &ndr_table_spoolss.syntax_id, - fsp->conn->server_info, + fsp->conn->session_info, &fsp->conn->sconn->client_id, fsp->conn->sconn->msg_ctx, &fsp->conn->spoolss_pipe); @@ -321,7 +321,7 @@ void print_spool_terminate(struct connection_struct *conn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &conn->spoolss_pipe); diff --git a/source3/rpc_client/cli_winreg_int.c b/source3/rpc_client/cli_winreg_int.c index 6b3b82e405..8e11ae832d 100644 --- a/source3/rpc_client/cli_winreg_int.c +++ b/source3/rpc_client/cli_winreg_int.c @@ -85,7 +85,7 @@ static WERROR _split_hive_key(TALLOC_CTX *mem_ctx, } static NTSTATUS _winreg_int_openkey(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct dcerpc_binding_handle **h, uint32_t reg_type, @@ -108,7 +108,7 @@ static NTSTATUS _winreg_int_openkey(TALLOC_CTX *mem_ctx, status = rpcint_binding_handle(mem_ctx, &ndr_table_winreg, &client_id, - server_info, + session_info, msg_ctx, &binding_handle); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/rpc_client/cli_winreg_int.h b/source3/rpc_client/cli_winreg_int.h index f991559cba..b979988882 100644 --- a/source3/rpc_client/cli_winreg_int.h +++ b/source3/rpc_client/cli_winreg_int.h @@ -29,7 +29,7 @@ * * @param[in] mem_ctx The memory context to use. * - * @param[in] server_info The supplied server info. + * @param[in] session_info The supplied server info. * * @param[in] key The key to open. This needs to start with the name * of the hive like HKLM. @@ -85,7 +85,7 @@ NTSTATUS dcerpc_winreg_int_openkey(TALLOC_CTX *mem_ctx, * code if something gone wrong. */ NTSTATUS dcerpc_winreg_int_hklm_openkey(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct dcerpc_binding_handle **h, const char *key, diff --git a/source3/rpc_server/dcesrv_gssapi.h b/source3/rpc_server/dcesrv_gssapi.h index 1b7b6bca4c..f770efbf6c 100644 --- a/source3/rpc_server/dcesrv_gssapi.h +++ b/source3/rpc_server/dcesrv_gssapi.h @@ -37,6 +37,6 @@ NTSTATUS gssapi_server_check_flags(struct gse_context *gse_ctx); NTSTATUS gssapi_server_get_user_info(struct gse_context *gse_ctx, TALLOC_CTX *mem_ctx, struct client_address *client_id, - struct auth_serversupplied_info **server_info); + struct auth_serversupplied_info **session_info); #endif /* _DCESRV_GSSAPI_H_ */ diff --git a/source3/rpc_server/dcesrv_ntlmssp.c b/source3/rpc_server/dcesrv_ntlmssp.c index ac13607473..75bb2ed147 100644 --- a/source3/rpc_server/dcesrv_ntlmssp.c +++ b/source3/rpc_server/dcesrv_ntlmssp.c @@ -114,11 +114,11 @@ NTSTATUS ntlmssp_server_check_flags(struct auth_ntlmssp_state *ctx, NTSTATUS ntlmssp_server_get_user_info(struct auth_ntlmssp_state *ctx, TALLOC_CTX *mem_ctx, - struct auth_serversupplied_info **server_info) + struct auth_serversupplied_info **session_info) { NTSTATUS status; - status = auth_ntlmssp_steal_server_info(mem_ctx, ctx, server_info); + status = auth_ntlmssp_steal_session_info(mem_ctx, ctx, session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, (__location__ ": Failed to get authenticated user " "info: %s\n", nt_errstr(status))); diff --git a/source3/rpc_server/dcesrv_ntlmssp.h b/source3/rpc_server/dcesrv_ntlmssp.h index ddb38f69df..a21c512f9e 100644 --- a/source3/rpc_server/dcesrv_ntlmssp.h +++ b/source3/rpc_server/dcesrv_ntlmssp.h @@ -37,6 +37,6 @@ NTSTATUS ntlmssp_server_check_flags(struct auth_ntlmssp_state *ctx, bool do_sign, bool do_seal); NTSTATUS ntlmssp_server_get_user_info(struct auth_ntlmssp_state *ctx, TALLOC_CTX *mem_ctx, - struct auth_serversupplied_info **server_info); + struct auth_serversupplied_info **session_info); #endif /* _DCESRV_NTLMSSP_H_ */ diff --git a/source3/rpc_server/dfs/srv_dfs_nt.c b/source3/rpc_server/dfs/srv_dfs_nt.c index 17b90505d6..01ecf792b3 100644 --- a/source3/rpc_server/dfs/srv_dfs_nt.c +++ b/source3/rpc_server/dfs/srv_dfs_nt.c @@ -49,7 +49,7 @@ WERROR _dfs_Add(struct pipes_struct *p, struct dfs_Add *r) NTSTATUS status; TALLOC_CTX *ctx = talloc_tos(); - if (p->server_info->utok.uid != sec_initial_uid()) { + if (p->session_info->utok.uid != sec_initial_uid()) { DEBUG(10,("_dfs_add: uid != 0. Access denied.\n")); return WERR_ACCESS_DENIED; } @@ -114,7 +114,7 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r) TALLOC_CTX *ctx = talloc_tos(); char *altpath = NULL; - if (p->server_info->utok.uid != sec_initial_uid()) { + if (p->session_info->utok.uid != sec_initial_uid()) { DEBUG(10,("_dfs_remove: uid != 0. Access denied.\n")); return WERR_ACCESS_DENIED; } diff --git a/source3/rpc_server/epmapper/srv_epmapper.c b/source3/rpc_server/epmapper/srv_epmapper.c index 5bfb176b84..c364890afa 100644 --- a/source3/rpc_server/epmapper/srv_epmapper.c +++ b/source3/rpc_server/epmapper/srv_epmapper.c @@ -227,7 +227,7 @@ error_status_t _epm_Insert(struct pipes_struct *p, uint32_t i; /* If this is not a priviledged users, return */ - if (!is_priviledged_pipe(p->server_info)) { + if (!is_priviledged_pipe(p->session_info)) { return EPMAPPER_STATUS_CANT_PERFORM_OP; } @@ -343,7 +343,7 @@ error_status_t _epm_Delete(struct pipes_struct *p, r->in.num_ents)); /* If this is not a priviledged users, return */ - if (!is_priviledged_pipe(p->server_info)) { + if (!is_priviledged_pipe(p->session_info)) { return EPMAPPER_STATUS_CANT_PERFORM_OP; } diff --git a/source3/rpc_server/eventlog/srv_eventlog_nt.c b/source3/rpc_server/eventlog/srv_eventlog_nt.c index ff8a49526e..f6b508b089 100644 --- a/source3/rpc_server/eventlog/srv_eventlog_nt.c +++ b/source3/rpc_server/eventlog/srv_eventlog_nt.c @@ -236,7 +236,7 @@ static NTSTATUS elog_open( struct pipes_struct * p, const char *logname, struct elog->logname = talloc_strdup( elog, ELOG_APPL ); /* do the access check */ - if ( !elog_check_access( elog, p->server_info->security_token ) ) { + if ( !elog_check_access( elog, p->session_info->security_token ) ) { TALLOC_FREE( elog ); return NT_STATUS_ACCESS_DENIED; } @@ -254,7 +254,7 @@ static NTSTATUS elog_open( struct pipes_struct * p, const char *logname, struct /* now do the access check. Close the tdb if we fail here */ - if ( !elog_check_access( elog, p->server_info->security_token ) ) { + if ( !elog_check_access( elog, p->session_info->security_token ) ) { TALLOC_FREE( elog ); return NT_STATUS_ACCESS_DENIED; } @@ -350,7 +350,7 @@ static bool sync_eventlog_params(TALLOC_CTX *mem_ctx, } status = dcerpc_winreg_int_hklm_openkey(ctx, - get_server_info_system(), + get_session_info_system(), msg_ctx, &h, path, diff --git a/source3/rpc_server/eventlog/srv_eventlog_reg.c b/source3/rpc_server/eventlog/srv_eventlog_reg.c index 8e85abf488..8021c2bfad 100644 --- a/source3/rpc_server/eventlog/srv_eventlog_reg.c +++ b/source3/rpc_server/eventlog/srv_eventlog_reg.c @@ -60,7 +60,7 @@ bool eventlog_init_winreg(struct messaging_context *msg_ctx) key = talloc_strdup(tmp_ctx, TOP_LEVEL_EVENTLOG_KEY); status = dcerpc_winreg_int_hklm_openkey(tmp_ctx, - get_server_info_system(), + get_session_info_system(), msg_ctx, &h, key, diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c index 697b287a0f..70e7ba59aa 100644 --- a/source3/rpc_server/lsa/srv_lsa_nt.c +++ b/source3/rpc_server/lsa/srv_lsa_nt.c @@ -430,8 +430,8 @@ NTSTATUS _lsa_OpenPolicy2(struct pipes_struct *p, NTSTATUS status; /* Work out max allowed. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &des_access); /* map the generic bits to the lsa policy ones */ @@ -444,7 +444,7 @@ NTSTATUS _lsa_OpenPolicy2(struct pipes_struct *p, return status; } - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_INVALID, SEC_PRIV_INVALID, 0, des_access, &acc_granted, "_lsa_OpenPolicy2" ); if (!NT_STATUS_IS_OK(status)) { @@ -1503,8 +1503,8 @@ static NTSTATUS _lsa_OpenTrustedDomain_base(struct pipes_struct *p, * handle - so don't check against policy handle. */ /* Work out max allowed. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &access_mask); /* map the generic bits to the lsa account ones */ @@ -1518,7 +1518,7 @@ static NTSTATUS _lsa_OpenTrustedDomain_base(struct pipes_struct *p, return status; } - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_INVALID, SEC_PRIV_INVALID, 0, access_mask, &acc_granted, "_lsa_OpenTrustedDomain"); @@ -1702,14 +1702,14 @@ NTSTATUS _lsa_CreateTrustedDomainEx2(struct pipes_struct *p, return NT_STATUS_ACCESS_DENIED; } - if (p->server_info->utok.uid != sec_initial_uid() && - !nt_token_check_domain_rid(p->server_info->security_token, DOMAIN_RID_ADMINS)) { + if (p->session_info->utok.uid != sec_initial_uid() && + !nt_token_check_domain_rid(p->session_info->security_token, DOMAIN_RID_ADMINS)) { return NT_STATUS_ACCESS_DENIED; } /* Work out max allowed. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &r->in.access_mask); /* map the generic bits to the lsa policy ones */ @@ -1722,7 +1722,7 @@ NTSTATUS _lsa_CreateTrustedDomainEx2(struct pipes_struct *p, return status; } - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_INVALID, SEC_PRIV_INVALID, 0, r->in.access_mask, &acc_granted, "_lsa_CreateTrustedDomainEx2"); @@ -1752,7 +1752,7 @@ NTSTATUS _lsa_CreateTrustedDomainEx2(struct pipes_struct *p, auth_blob.data = r->in.auth_info->auth_blob.data; arcfour_crypt_blob(auth_blob.data, auth_blob.length, - &p->server_info->user_session_key); + &p->session_info->user_session_key); ndr_err = ndr_pull_struct_blob(&auth_blob, p->mem_ctx, &auth_struct, @@ -2398,7 +2398,7 @@ NTSTATUS _lsa_GetUserName(struct pipes_struct *p, return NT_STATUS_INVALID_PARAMETER; } - if (p->server_info->guest) { + if (p->session_info->guest) { /* * I'm 99% sure this is not the right place to do this, * global_sid_Anonymous should probably be put into the token @@ -2409,8 +2409,8 @@ NTSTATUS _lsa_GetUserName(struct pipes_struct *p, return NT_STATUS_NO_MEMORY; } } else { - username = p->server_info->sanitized_username; - domname = p->server_info->info3->base.domain.string; + username = p->session_info->sanitized_username; + domname = p->session_info->info3->base.domain.string; } account_name = TALLOC_P(p->mem_ctx, struct lsa_String); @@ -2463,8 +2463,8 @@ NTSTATUS _lsa_CreateAccount(struct pipes_struct *p, } /* Work out max allowed. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &r->in.access_mask); /* map the generic bits to the lsa policy ones */ @@ -2477,7 +2477,7 @@ NTSTATUS _lsa_CreateAccount(struct pipes_struct *p, return status; } - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_INVALID, SEC_PRIV_INVALID, 0, r->in.access_mask, &acc_granted, "_lsa_CreateAccount"); if (!NT_STATUS_IS_OK(status)) { @@ -2527,8 +2527,8 @@ NTSTATUS _lsa_OpenAccount(struct pipes_struct *p, * handle - so don't check against policy handle. */ /* Work out max allowed. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &des_access); /* map the generic bits to the lsa account ones */ @@ -2542,7 +2542,7 @@ NTSTATUS _lsa_OpenAccount(struct pipes_struct *p, return status; } - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_INVALID, SEC_PRIV_INVALID, 0, des_access, &acc_granted, "_lsa_OpenAccount" ); if (!NT_STATUS_IS_OK(status)) { @@ -2897,7 +2897,7 @@ NTSTATUS _lsa_AddAccountRights(struct pipes_struct *p, * on the account sid. We don't check here so just use the latter. JRA. */ - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_INVALID, SEC_PRIV_INVALID, 0, LSA_ACCOUNT_ADJUST_PRIVILEGES|LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS|LSA_ACCOUNT_VIEW, &acc_granted, "_lsa_AddAccountRights" ); @@ -2967,7 +2967,7 @@ NTSTATUS _lsa_RemoveAccountRights(struct pipes_struct *p, * and DELETE on the account sid. */ - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_INVALID, SEC_PRIV_INVALID, 0, LSA_ACCOUNT_ADJUST_PRIVILEGES|LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS| LSA_ACCOUNT_VIEW|SEC_STD_DELETE, diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c index f5dace2753..8e766328f5 100644 --- a/source3/rpc_server/netlogon/srv_netlog_nt.c +++ b/source3/rpc_server/netlogon/srv_netlog_nt.c @@ -205,15 +205,15 @@ WERROR _netr_LogonControl2Ex(struct pipes_struct *p, return WERR_INVALID_PARAM; } - acct_ctrl = p->server_info->info3->base.acct_flags; + acct_ctrl = p->session_info->info3->base.acct_flags; switch (r->in.function_code) { case NETLOGON_CONTROL_TC_VERIFY: case NETLOGON_CONTROL_CHANGE_PASSWORD: case NETLOGON_CONTROL_REDISCOVER: if ((geteuid() != sec_initial_uid()) && - !nt_token_check_domain_rid(p->server_info->security_token, DOMAIN_RID_ADMINS) && - !nt_token_check_sid(&global_sid_Builtin_Administrators, p->server_info->security_token) && + !nt_token_check_domain_rid(p->session_info->security_token, DOMAIN_RID_ADMINS) && + !nt_token_check_sid(&global_sid_Builtin_Administrators, p->session_info->security_token) && !(acct_ctrl & (ACB_WSTRUST | ACB_SVRTRUST))) { return WERR_ACCESS_DENIED; } @@ -415,7 +415,7 @@ NTSTATUS _netr_NetrEnumerateTrustedDomains(struct pipes_struct *p, status = rpcint_binding_handle(p->mem_ctx, &ndr_table_lsarpc, p->client_id, - p->server_info, + p->session_info, p->msg_ctx, &h); if (!NT_STATUS_IS_OK(status)) { @@ -646,7 +646,7 @@ static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct, struct dom_sid *domain_sid; uint32_t acct_ctrl; union samr_UserInfo *info; - struct auth_serversupplied_info *server_info; + struct auth_serversupplied_info *session_info; #if 0 /* @@ -672,7 +672,7 @@ static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct, goto out; } - status = make_server_info_system(mem_ctx, &server_info); + status = make_session_info_system(mem_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { goto out; } @@ -685,7 +685,7 @@ static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct, status = rpcint_binding_handle(mem_ctx, &ndr_table_samr, &client_id, - server_info, + session_info, msg_ctx, &h); if (!NT_STATUS_IS_OK(status)) { @@ -1087,7 +1087,7 @@ static NTSTATUS netr_creds_server_step_check(struct pipes_struct *p, *************************************************************************/ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx, - struct auth_serversupplied_info *server_info, + struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *account_name, struct samr_Password *nt_hash) @@ -1110,7 +1110,7 @@ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx, status = rpcint_binding_handle(mem_ctx, &ndr_table_samr, &client_id, - server_info, + session_info, msg_ctx, &h); if (!NT_STATUS_IS_OK(status)) { @@ -1160,7 +1160,7 @@ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx, in = data_blob_const(nt_hash->hash, 16); out = data_blob_talloc_zero(mem_ctx, 16); - sess_crypt_blob(&out, &in, &server_info->user_session_key, true); + sess_crypt_blob(&out, &in, &session_info->user_session_key, true); memcpy(info18.nt_pwd.hash, out.data, out.length); info18.nt_pwd_active = true; @@ -1229,7 +1229,7 @@ NTSTATUS _netr_ServerPasswordSet(struct pipes_struct *p, DEBUG(100,("\n")); status = netr_set_machine_account_password(p->mem_ctx, - p->server_info, + p->session_info, p->msg_ctx, creds->account_name, r->in.new_password); @@ -1276,7 +1276,7 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p, mdfour(nt_hash.hash, plaintext.data, plaintext.length); status = netr_set_machine_account_password(p->mem_ctx, - p->server_info, + p->session_info, p->msg_ctx, creds->account_name, &nt_hash); diff --git a/source3/rpc_server/ntsvcs/srv_ntsvcs_nt.c b/source3/rpc_server/ntsvcs/srv_ntsvcs_nt.c index ad1ba93746..87b267da26 100644 --- a/source3/rpc_server/ntsvcs/srv_ntsvcs_nt.c +++ b/source3/rpc_server/ntsvcs/srv_ntsvcs_nt.c @@ -145,7 +145,7 @@ WERROR _PNP_GetDeviceRegProp(struct pipes_struct *p, result = svcctl_lookup_dispname(mem_ctx, p->msg_ctx, - p->server_info, + p->session_info, ptr); if (result == NULL) { return WERR_GENERAL_FAILURE; diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c index 481bb56ee7..223d32b9a8 100644 --- a/source3/rpc_server/rpc_handles.c +++ b/source3/rpc_server/rpc_handles.c @@ -326,7 +326,7 @@ bool pipe_access_check(struct pipes_struct *p) return True; } - if (p->server_info->guest) { + if (p->session_info->guest) { return False; } } diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c index c5c7f617f8..c652c5882a 100644 --- a/source3/rpc_server/rpc_ncacn_np.c +++ b/source3/rpc_server/rpc_ncacn_np.c @@ -118,7 +118,7 @@ int close_internal_rpc_pipe_hnd(struct pipes_struct *p) struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax, struct client_address *client_id, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx) { struct pipes_struct *p; @@ -148,8 +148,8 @@ struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, return NULL; } - p->server_info = copy_serverinfo(p, server_info); - if (p->server_info == NULL) { + p->session_info = copy_serverinfo(p, session_info); + if (p->session_info == NULL) { DEBUG(0, ("open_rpc_pipe_p: copy_serverinfo failed\n")); close_policy_by_pipe(p); TALLOC_FREE(p); @@ -431,7 +431,7 @@ static NTSTATUS rpcint_binding_handle_ex(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax, const struct ndr_interface_table *ndr_table, struct client_address *client_id, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct dcerpc_binding_handle **binding_handle) { @@ -455,7 +455,7 @@ static NTSTATUS rpcint_binding_handle_ex(TALLOC_CTX *mem_ctx, hs->p = make_internal_rpc_pipe_p(hs, abstract_syntax, client_id, - server_info, + session_info, msg_ctx); if (hs->p == NULL) { TALLOC_FREE(h); @@ -491,7 +491,7 @@ static NTSTATUS rpcint_binding_handle_ex(TALLOC_CTX *mem_ctx, * status = rpcint_binding_handle(tmp_ctx, * &ndr_table_winreg, * p->client_id, - * p->server_info, + * p->session_info, * p->msg_ctx * &winreg_binding); * @endcode @@ -499,12 +499,12 @@ static NTSTATUS rpcint_binding_handle_ex(TALLOC_CTX *mem_ctx, NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx, const struct ndr_interface_table *ndr_table, struct client_address *client_id, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct dcerpc_binding_handle **binding_handle) { return rpcint_binding_handle_ex(mem_ctx, NULL, ndr_table, client_id, - server_info, msg_ctx, binding_handle); + session_info, msg_ctx, binding_handle); } /** @@ -532,7 +532,7 @@ NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx, * status = rpc_pipe_open_internal(tmp_ctx, * &ndr_table_winreg.syntax_id, * rpc_winreg_dispatch, - * p->server_info, + * p->session_info, * &winreg_pipe); * @endcode */ @@ -589,14 +589,14 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, const char *pipe_name, const struct tsocket_address *local_address, const struct tsocket_address *remote_address, - const struct auth_serversupplied_info *server_info) + const struct auth_serversupplied_info *session_info) { struct np_proxy_state *result; char *socket_np_dir; const char *socket_dir; struct tevent_context *ev; struct tevent_req *subreq; - struct auth_session_info_transport *session_info; + struct auth_session_info_transport *session_info_t; struct auth_user_info_dc *user_info_dc; union netr_Validation val; NTSTATUS status; @@ -641,17 +641,17 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, goto fail; } - session_info = talloc_zero(talloc_tos(), struct auth_session_info_transport); - if (session_info == NULL) { + session_info_t = talloc_zero(talloc_tos(), struct auth_session_info_transport); + if (session_info_t == NULL) { DEBUG(0, ("talloc failed\n")); goto fail; } /* Send the named_pipe_auth server the user's full token */ - session_info->security_token = server_info->security_token; - session_info->session_key = server_info->user_session_key; + session_info_t->security_token = session_info->security_token; + session_info_t->session_key = session_info->user_session_key; - val.sam3 = server_info->info3; + val.sam3 = session_info->info3; /* Convert into something we can build a struct * auth_session_info_transport from. Most of the work here @@ -663,7 +663,7 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, goto fail; } - session_info->info = talloc_move(session_info, &user_info_dc->info); + session_info_t->info = talloc_move(session_info_t, &user_info_dc->info); talloc_free(user_info_dc); become_root(); @@ -674,13 +674,13 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, NULL, /* client_name */ local_address, /* server_addr */ NULL, /* server_name */ - session_info); + session_info_t); if (subreq == NULL) { unbecome_root(); DEBUG(0, ("tstream_npa_connect_send to %s for pipe %s and " "user %s\\%s failed\n", - socket_np_dir, pipe_name, session_info->info->domain_name, - session_info->info->account_name)); + socket_np_dir, pipe_name, session_info_t->info->domain_name, + session_info_t->info->account_name)); goto fail; } ok = tevent_req_poll(subreq, ev); @@ -688,8 +688,8 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, if (!ok) { DEBUG(0, ("tevent_req_poll to %s for pipe %s and user %s\\%s " "failed for tstream_npa_connect: %s\n", - socket_np_dir, pipe_name, session_info->info->domain_name, - session_info->info->account_name, + socket_np_dir, pipe_name, session_info_t->info->domain_name, + session_info_t->info->account_name, strerror(errno))); goto fail; @@ -704,8 +704,8 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, if (ret != 0) { DEBUG(0, ("tstream_npa_connect_recv to %s for pipe %s and " "user %s\\%s failed: %s\n", - socket_np_dir, pipe_name, session_info->info->domain_name, - session_info->info->account_name, + socket_np_dir, pipe_name, session_info_t->info->domain_name, + session_info_t->info->account_name, strerror(sys_errno))); goto fail; } @@ -720,7 +720,7 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, static NTSTATUS rpc_pipe_open_external(TALLOC_CTX *mem_ctx, const char *pipe_name, const struct ndr_syntax_id *abstract_syntax, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct rpc_pipe_client **_result) { struct tsocket_address *local, *remote; @@ -743,7 +743,7 @@ static NTSTATUS rpc_pipe_open_external(TALLOC_CTX *mem_ctx, } proxy_state = make_external_rpc_pipe_p(mem_ctx, pipe_name, - local, remote, server_info); + local, remote, session_info); if (!proxy_state) { return NT_STATUS_UNSUCCESSFUL; } @@ -817,7 +817,7 @@ done: * @param mem_ctx The memory context on which thje pipe will ultimately * be allocated * @param name The pipe name to connect to. - * @param server_info Credentials to use for the connection. + * @param session_info Credentials to use for the connection. * @param pipe [in|out] Checks if a pipe is connected, and connects it * if not * @@ -827,7 +827,7 @@ done: NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct client_address *client_id, struct messaging_context *msg_ctx, struct rpc_pipe_client **cli_pipe) @@ -867,7 +867,7 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx, if (StrCaseCmp(server_type, "embedded") == 0) { status = rpc_pipe_open_internal(tmp_ctx, - syntax, server_info, + syntax, session_info, client_id, msg_ctx, &cli); if (!NT_STATUS_IS_OK(status)) { @@ -880,7 +880,7 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx, status = rpc_pipe_open_external(tmp_ctx, pipe_name, syntax, - server_info, + session_info, &cli); if (!NT_STATUS_IS_OK(status)) { goto done; diff --git a/source3/rpc_server/rpc_ncacn_np.h b/source3/rpc_server/rpc_ncacn_np.h index 747e4b6eba..7c8619b46d 100644 --- a/source3/rpc_server/rpc_ncacn_np.h +++ b/source3/rpc_server/rpc_ncacn_np.h @@ -32,17 +32,17 @@ struct np_proxy_state { struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax, struct client_address *client_id, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx); struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, const char *pipe_name, const struct tsocket_address *local_address, const struct tsocket_address *remote_address, - const struct auth_serversupplied_info *server_info); + const struct auth_serversupplied_info *session_info); NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx, const struct ndr_interface_table *ndr_table, struct client_address *client_id, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct dcerpc_binding_handle **binding_handle); NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, @@ -53,7 +53,7 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, struct rpc_pipe_client **presult); NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct client_address *client_id, struct messaging_context *msg_ctx, struct rpc_pipe_client **cli_pipe); diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c index 1e1e707860..c019d09127 100644 --- a/source3/rpc_server/rpc_server.c +++ b/source3/rpc_server/rpc_server.c @@ -115,7 +115,7 @@ static int make_server_pipes_struct(TALLOC_CTX *mem_ctx, p->endian = RPC_LITTLE_ENDIAN; - /* Fake up an auth_user_info_dc for now, to make an info3, to make the server_info structure */ + /* Fake up an auth_user_info_dc for now, to make an info3, to make the session_info structure */ auth_user_info_dc = talloc_zero(p, struct auth_user_info_dc); if (!auth_user_info_dc) { TALLOC_FREE(p); @@ -142,7 +142,7 @@ static int make_server_pipes_struct(TALLOC_CTX *mem_ctx, status = make_server_info_info3(p, info3->base.account_name.string, info3->base.domain.string, - &p->server_info, info3); + &p->session_info, info3); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("Failed to init server info\n")); TALLOC_FREE(p); @@ -154,7 +154,7 @@ static int make_server_pipes_struct(TALLOC_CTX *mem_ctx, * Some internal functions need a local token to determine access to * resoutrces. */ - status = create_local_token(p->server_info); + status = create_local_token(p->session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("Failed to init local auth token\n")); TALLOC_FREE(p); @@ -162,14 +162,14 @@ static int make_server_pipes_struct(TALLOC_CTX *mem_ctx, return -1; } - /* Now override the server_info->security_token with the exact + /* Now override the session_info->security_token with the exact * security_token we were given from the other side, * regardless of what we just calculated */ - p->server_info->security_token = talloc_move(p->server_info, &session_info->security_token); + p->session_info->security_token = talloc_move(p->session_info, &session_info->security_token); /* Also set the session key to the correct value */ - p->server_info->user_session_key = session_info->session_key; - p->server_info->user_session_key.data = talloc_move(p->server_info, &session_info->session_key.data); + p->session_info->user_session_key = session_info->session_key; + p->session_info->user_session_key.data = talloc_move(p->session_info, &session_info->session_key.data); p->client_id = talloc_zero(p, struct client_address); if (!p->client_id) { diff --git a/source3/rpc_server/samr/srv_samr_nt.c b/source3/rpc_server/samr/srv_samr_nt.c index 7a07643597..b5d5111b20 100644 --- a/source3/rpc_server/samr/srv_samr_nt.c +++ b/source3/rpc_server/samr/srv_samr_nt.c @@ -561,8 +561,8 @@ NTSTATUS _samr_OpenDomain(struct pipes_struct *p, } /*check if access can be granted as requested by client. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &des_access); make_samr_object_sd( p->mem_ctx, &psd, &sd_size, &dom_generic_mapping, NULL, 0 ); @@ -572,7 +572,7 @@ NTSTATUS _samr_OpenDomain(struct pipes_struct *p, * Users with SeAddUser get the ability to manipulate groups * and aliases. */ - if (security_token_has_privilege(p->server_info->security_token, SEC_PRIV_ADD_USERS)) { + if (security_token_has_privilege(p->session_info->security_token, SEC_PRIV_ADD_USERS)) { extra_access |= (SAMR_DOMAIN_ACCESS_CREATE_GROUP | SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS | SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT | @@ -585,7 +585,7 @@ NTSTATUS _samr_OpenDomain(struct pipes_struct *p, * SAMR_DOMAIN_ACCESS_CREATE_USER access. */ - status = access_check_object( psd, p->server_info->security_token, + status = access_check_object( psd, p->session_info->security_token, SEC_PRIV_MACHINE_ACCOUNT, SEC_PRIV_ADD_USERS, extra_access, des_access, &acc_granted, "_samr_OpenDomain" ); @@ -2296,8 +2296,8 @@ NTSTATUS _samr_OpenUser(struct pipes_struct *p, return NT_STATUS_NO_SUCH_USER; /* check if access can be granted as requested by client. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &des_access); make_samr_object_sd(p->mem_ctx, &psd, &sd_size, &usr_generic_mapping, &sid, SAMR_USR_RIGHTS_WRITE_PW); @@ -2345,7 +2345,7 @@ NTSTATUS _samr_OpenUser(struct pipes_struct *p, * DOMAIN_RID_ADMINS. */ if (acb_info & (ACB_SVRTRUST|ACB_DOMTRUST)) { - if (lp_enable_privileges() && nt_token_check_domain_rid(p->server_info->security_token, + if (lp_enable_privileges() && nt_token_check_domain_rid(p->session_info->security_token, DOMAIN_RID_ADMINS)) { des_access &= ~GENERIC_RIGHTS_USER_WRITE; extra_access = GENERIC_RIGHTS_USER_WRITE; @@ -2358,7 +2358,7 @@ NTSTATUS _samr_OpenUser(struct pipes_struct *p, TALLOC_FREE(sampass); - nt_status = access_check_object(psd, p->server_info->security_token, + nt_status = access_check_object(psd, p->session_info->security_token, needed_priv_1, needed_priv_2, GENERIC_RIGHTS_USER_WRITE, des_access, &acc_granted, "_samr_OpenUser"); @@ -2789,7 +2789,7 @@ static NTSTATUS get_user_info_18(struct pipes_struct *p, ZERO_STRUCTP(r); - if (p->server_info->system) { + if (p->session_info->system) { goto query; } @@ -3860,24 +3860,24 @@ NTSTATUS _samr_CreateUser2(struct pipes_struct *p, can_add_account = true; } else if (acb_info & ACB_WSTRUST) { needed_priv = SEC_PRIV_MACHINE_ACCOUNT; - can_add_account = security_token_has_privilege(p->server_info->security_token, SEC_PRIV_MACHINE_ACCOUNT); + can_add_account = security_token_has_privilege(p->session_info->security_token, SEC_PRIV_MACHINE_ACCOUNT); } else if (acb_info & ACB_NORMAL && (account[strlen(account)-1] != '$')) { /* usrmgr.exe (and net rpc trustdom grant) creates a normal user account for domain trusts and changes the ACB flags later */ needed_priv = SEC_PRIV_ADD_USERS; - can_add_account = security_token_has_privilege(p->server_info->security_token, SEC_PRIV_ADD_USERS); + can_add_account = security_token_has_privilege(p->session_info->security_token, SEC_PRIV_ADD_USERS); } else if (lp_enable_privileges()) { /* implicit assumption of a BDC or domain trust account here * (we already check the flags earlier) */ /* only Domain Admins can add a BDC or domain trust */ can_add_account = nt_token_check_domain_rid( - p->server_info->security_token, + p->session_info->security_token, DOMAIN_RID_ADMINS ); } DEBUG(5, ("_samr_CreateUser2: %s can add this account : %s\n", - uidtoname(p->server_info->utok.uid), + uidtoname(p->session_info->utok.uid), can_add_account ? "True":"False" )); if (!can_add_account) { @@ -3902,8 +3902,8 @@ NTSTATUS _samr_CreateUser2(struct pipes_struct *p, sid_compose(&sid, get_global_sam_sid(), *r->out.rid); - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &des_access); make_samr_object_sd(p->mem_ctx, &psd, &sd_size, &usr_generic_mapping, @@ -3917,7 +3917,7 @@ NTSTATUS _samr_CreateUser2(struct pipes_struct *p, * just assume we have all the rights we need ? */ - nt_status = access_check_object(psd, p->server_info->security_token, + nt_status = access_check_object(psd, p->session_info->security_token, needed_priv, SEC_PRIV_INVALID, GENERIC_RIGHTS_USER_WRITE, des_access, &acc_granted, "_samr_CreateUser2"); @@ -3985,8 +3985,8 @@ NTSTATUS _samr_Connect(struct pipes_struct *p, was observed from a win98 client trying to enumerate users (when configured user level access control on shares) --jerry */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &des_access); se_map_generic( &des_access, &sam_generic_mapping ); @@ -4047,14 +4047,14 @@ NTSTATUS _samr_Connect2(struct pipes_struct *p, return NT_STATUS_ACCESS_DENIED; } - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &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_object(psd, p->server_info->security_token, + nt_status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_INVALID, SEC_PRIV_INVALID, 0, des_access, &acc_granted, fn); @@ -4262,14 +4262,14 @@ NTSTATUS _samr_OpenAlias(struct pipes_struct *p, /*check if access can be granted as requested by client. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &des_access); make_samr_object_sd(p->mem_ctx, &psd, &sd_size, &ali_generic_mapping, NULL, 0); se_map_generic(&des_access,&ali_generic_mapping); - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_ADD_USERS, SEC_PRIV_INVALID, GENERIC_RIGHTS_ALIAS_ALL_ACCESS, des_access, &acc_granted, "_samr_OpenAlias"); @@ -5267,7 +5267,7 @@ NTSTATUS _samr_SetUserInfo(struct pipes_struct *p, /* Used by AS/U JRA. */ status = set_user_info_18(&info->info18, p->mem_ctx, - &p->server_info->user_session_key, + &p->session_info->user_session_key, pwd); break; @@ -5279,16 +5279,16 @@ NTSTATUS _samr_SetUserInfo(struct pipes_struct *p, case 21: status = set_user_info_21(&info->info21, p->mem_ctx, - &p->server_info->user_session_key, + &p->session_info->user_session_key, pwd); break; case 23: - if (!p->server_info->user_session_key.length) { + if (!p->session_info->user_session_key.length) { status = NT_STATUS_NO_USER_SESSION_KEY; } arcfour_crypt_blob(info->info23.password.data, 516, - &p->server_info->user_session_key); + &p->session_info->user_session_key); dump_data(100, info->info23.password.data, 516); @@ -5299,12 +5299,12 @@ NTSTATUS _samr_SetUserInfo(struct pipes_struct *p, break; case 24: - if (!p->server_info->user_session_key.length) { + if (!p->session_info->user_session_key.length) { status = NT_STATUS_NO_USER_SESSION_KEY; } arcfour_crypt_blob(info->info24.password.data, 516, - &p->server_info->user_session_key); + &p->session_info->user_session_key); dump_data(100, info->info24.password.data, 516); @@ -5314,12 +5314,12 @@ NTSTATUS _samr_SetUserInfo(struct pipes_struct *p, break; case 25: - if (!p->server_info->user_session_key.length) { + if (!p->session_info->user_session_key.length) { status = NT_STATUS_NO_USER_SESSION_KEY; } encode_or_decode_arc4_passwd_buffer( info->info25.password.data, - &p->server_info->user_session_key); + &p->session_info->user_session_key); dump_data(100, info->info25.password.data, 532); @@ -5329,12 +5329,12 @@ NTSTATUS _samr_SetUserInfo(struct pipes_struct *p, break; case 26: - if (!p->server_info->user_session_key.length) { + if (!p->session_info->user_session_key.length) { status = NT_STATUS_NO_USER_SESSION_KEY; } encode_or_decode_arc4_passwd_buffer( info->info26.password.data, - &p->server_info->user_session_key); + &p->session_info->user_session_key); dump_data(100, info->info26.password.data, 516); @@ -6336,14 +6336,14 @@ NTSTATUS _samr_OpenGroup(struct pipes_struct *p, } /*check if access can be granted as requested by client. */ - map_max_allowed_access(p->server_info->security_token, - &p->server_info->utok, + map_max_allowed_access(p->session_info->security_token, + &p->session_info->utok, &des_access); make_samr_object_sd(p->mem_ctx, &psd, &sd_size, &grp_generic_mapping, NULL, 0); se_map_generic(&des_access,&grp_generic_mapping); - status = access_check_object(psd, p->server_info->security_token, + status = access_check_object(psd, p->session_info->security_token, SEC_PRIV_ADD_USERS, SEC_PRIV_INVALID, GENERIC_RIGHTS_GROUP_ALL_ACCESS, des_access, &acc_granted, "_samr_OpenGroup"); diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index d2552ae47b..a303a7a321 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -453,7 +453,7 @@ static WERROR delete_printer_handle(struct pipes_struct *p, struct policy_handle done on the handle already */ result = winreg_delete_printer_key(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, Printer->sharename, ""); @@ -462,7 +462,7 @@ static WERROR delete_printer_handle(struct pipes_struct *p, struct policy_handle return WERR_BADFID; } - result = delete_printer_hook(p->mem_ctx, p->server_info->security_token, + result = delete_printer_hook(p->mem_ctx, p->session_info->security_token, Printer->sharename, p->msg_ctx); if (!W_ERROR_IS_OK(result)) { return result; @@ -540,7 +540,7 @@ static void prune_printername_cache(void) ****************************************************************************/ static WERROR set_printer_hnd_name(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct printer_handle *Printer, const char *handlename) @@ -675,7 +675,7 @@ static WERROR set_printer_hnd_name(TALLOC_CTX *mem_ctx, } result = winreg_get_printer(mem_ctx, - server_info, + session_info, msg_ctx, sname, &info2); @@ -761,7 +761,7 @@ static WERROR open_printer_hnd(struct pipes_struct *p, } result = set_printer_hnd_name(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, new_printer, name); if (!W_ERROR_IS_OK(result)) { @@ -1522,7 +1522,7 @@ void do_drv_upgrade_printer(struct messaging_context *msg, DATA_BLOB *data) { TALLOC_CTX *tmp_ctx; - struct auth_serversupplied_info *server_info = NULL; + struct auth_serversupplied_info *session_info = NULL; struct spoolss_PrinterInfo2 *pinfo2; NTSTATUS status; WERROR result; @@ -1533,10 +1533,10 @@ void do_drv_upgrade_printer(struct messaging_context *msg, tmp_ctx = talloc_new(NULL); if (!tmp_ctx) return; - status = make_server_info_system(tmp_ctx, &server_info); + status = make_session_info_system(tmp_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("do_drv_upgrade_printer: " - "Could not create system server_info\n")); + "Could not create system session_info\n")); goto done; } @@ -1561,7 +1561,7 @@ void do_drv_upgrade_printer(struct messaging_context *msg, continue; } - result = winreg_get_printer(tmp_ctx, server_info, msg, + result = winreg_get_printer(tmp_ctx, session_info, msg, lp_const_servicename(snum), &pinfo2); @@ -1581,7 +1581,7 @@ void do_drv_upgrade_printer(struct messaging_context *msg, /* all we care about currently is the change_id */ result = winreg_printer_update_changeid(tmp_ctx, - server_info, + session_info, msg, pinfo2->printername); @@ -1801,14 +1801,14 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p, /* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege, and not a printer admin, then fail */ - if ((p->server_info->utok.uid != sec_initial_uid()) && - !security_token_has_privilege(p->server_info->security_token, SEC_PRIV_PRINT_OPERATOR) && - !nt_token_check_sid(&global_sid_Builtin_Print_Operators, p->server_info->security_token) && + if ((p->session_info->utok.uid != sec_initial_uid()) && + !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) && + !nt_token_check_sid(&global_sid_Builtin_Print_Operators, p->session_info->security_token) && !token_contains_name_in_list( - uidtoname(p->server_info->utok.uid), - p->server_info->info3->base.domain.string, + uidtoname(p->session_info->utok.uid), + p->session_info->info3->base.domain.string, NULL, - p->server_info->security_token, + p->session_info->security_token, lp_printer_admin(snum))) { close_printer_handle(p, r->out.handle); ZERO_STRUCTP(r->out.handle); @@ -1873,9 +1873,9 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p, return WERR_ACCESS_DENIED; } - if (!user_ok_token(uidtoname(p->server_info->utok.uid), NULL, - p->server_info->security_token, snum) || - !print_access_check(p->server_info, + if (!user_ok_token(uidtoname(p->session_info->utok.uid), NULL, + p->session_info->security_token, snum) || + !print_access_check(p->session_info, p->msg_ctx, snum, r->in.access_mask)) { @@ -1901,7 +1901,7 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p, ? "PRINTER_ACCESS_ADMINISTER" : "PRINTER_ACCESS_USE" )); winreg_create_printer(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum)); @@ -1992,7 +1992,7 @@ WERROR _spoolss_DeletePrinter(struct pipes_struct *p, if (get_printer_snum(p, r->in.handle, &snum, NULL)) { winreg_delete_printer_key(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum), ""); @@ -2049,13 +2049,13 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p, /* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege, and not a printer admin, then fail */ - if ( (p->server_info->utok.uid != sec_initial_uid()) - && !security_token_has_privilege(p->server_info->security_token, SEC_PRIV_PRINT_OPERATOR) + if ( (p->session_info->utok.uid != sec_initial_uid()) + && !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) && !token_contains_name_in_list( - uidtoname(p->server_info->utok.uid), - p->server_info->info3->base.domain.string, + uidtoname(p->session_info->utok.uid), + p->session_info->info3->base.domain.string, NULL, - p->server_info->security_token, + p->session_info->security_token, lp_printer_admin(-1)) ) { return WERR_ACCESS_DENIED; @@ -2067,7 +2067,7 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p, return WERR_INVALID_ENVIRONMENT; status = winreg_get_driver(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.architecture, r->in.driver, version, &info); @@ -2078,7 +2078,7 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p, version = 3; status = winreg_get_driver(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.architecture, r->in.driver, @@ -2097,7 +2097,7 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p, } if (printer_driver_in_use(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info)) { status = WERR_PRINTER_DRIVER_IN_USE; @@ -2106,7 +2106,7 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p, if (version == 2) { status = winreg_get_driver(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.architecture, r->in.driver, 3, &info_win2k); @@ -2115,7 +2115,7 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p, /* remove the Win2k driver first*/ status = winreg_del_driver(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info_win2k, 3); talloc_free(info_win2k); @@ -2128,7 +2128,7 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p, } status = winreg_del_driver(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info, version); @@ -2154,13 +2154,13 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, /* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege, and not a printer admin, then fail */ - if ( (p->server_info->utok.uid != sec_initial_uid()) - && !security_token_has_privilege(p->server_info->security_token, SEC_PRIV_PRINT_OPERATOR) + if ( (p->session_info->utok.uid != sec_initial_uid()) + && !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) && !token_contains_name_in_list( - uidtoname(p->server_info->utok.uid), - p->server_info->info3->base.domain.string, + uidtoname(p->session_info->utok.uid), + p->session_info->info3->base.domain.string, NULL, - p->server_info->security_token, lp_printer_admin(-1)) ) + p->session_info->security_token, lp_printer_admin(-1)) ) { return WERR_ACCESS_DENIED; } @@ -2175,7 +2175,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, version = r->in.version; status = winreg_get_driver(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.architecture, r->in.driver, @@ -2197,7 +2197,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, version = 3; status = winreg_get_driver(info, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.architecture, r->in.driver, @@ -2209,7 +2209,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, } if (printer_driver_in_use(info, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info)) { status = WERR_PRINTER_DRIVER_IN_USE; @@ -2235,7 +2235,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, if (delete_files && (r->in.delete_flags & DPD_DELETE_ALL_FILES) && printer_driver_files_in_use(info, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info)) { /* no idea of the correct error here */ @@ -2248,7 +2248,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, if ( (version == 2) && ((r->in.delete_flags & DPD_DELETE_SPECIFIC_VERSION) != DPD_DELETE_SPECIFIC_VERSION) ) { status = winreg_get_driver(info, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.architecture, r->in.driver, 3, &info_win2k); @@ -2257,7 +2257,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, if (delete_files && (r->in.delete_flags & DPD_DELETE_ALL_FILES) && printer_driver_files_in_use(info, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info_win2k)) { /* no idea of the correct error here */ @@ -2270,7 +2270,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, /* remove the Win2k driver first*/ status = winreg_del_driver(info, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info_win2k, 3); @@ -2287,14 +2287,14 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, * because the driver doesn not exist any more */ if (delete_files) { - delete_driver_files(get_server_info_system(), + delete_driver_files(get_session_info_system(), info_win2k); } } } status = winreg_del_driver(info, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info, version); @@ -2308,7 +2308,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p, * because the driver doesn not exist any more */ if (delete_files) { - delete_driver_files(get_server_info_system(), info); + delete_driver_files(get_session_info_system(), info); } done: @@ -3560,9 +3560,9 @@ static WERROR printserver_notify_info(struct pipes_struct *p, continue; /* skip */ } - /* Maybe we should use the SYSTEM server_info here... */ + /* Maybe we should use the SYSTEM session_info here... */ result = winreg_get_printer(mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_servicename(snum), &pinfo2); @@ -3646,9 +3646,9 @@ static WERROR printer_notify_info(struct pipes_struct *p, get_printer_snum(p, hnd, &snum, NULL); - /* Maybe we should use the SYSTEM server_info here... */ + /* Maybe we should use the SYSTEM session_info here... */ result = winreg_get_printer(mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_servicename(snum), &pinfo2); if (!W_ERROR_IS_OK(result)) { @@ -3823,7 +3823,7 @@ static void compose_devicemode_devicename(struct spoolss_DeviceMode *dm, ********************************************************************/ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_PrinterInfo2 *info2, const char *servername, @@ -3896,7 +3896,7 @@ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx, r->high_part_total_bytes = 0x0; /* ChangeID in milliseconds*/ - winreg_printer_get_changeid(mem_ctx, server_info, msg_ctx, + winreg_printer_get_changeid(mem_ctx, session_info, msg_ctx, info2->sharename, &r->change_id); r->last_error = WERR_OK; @@ -4151,18 +4151,18 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx, struct spoolss_PrinterInfo7 *r, int snum) { - struct auth_serversupplied_info *server_info; + struct auth_serversupplied_info *session_info; struct GUID guid; NTSTATUS status; - status = make_server_info_system(mem_ctx, &server_info); + status = make_session_info_system(mem_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("construct_printer_info7: " - "Could not create system server_info\n")); + "Could not create system session_info\n")); return WERR_NOMEM; } - if (is_printer_published(mem_ctx, server_info, msg_ctx, + if (is_printer_published(mem_ctx, session_info, msg_ctx, servername, lp_servicename(snum), &guid, NULL)) { r->guid = talloc_strdup_upper(mem_ctx, GUID_string2(mem_ctx, &guid)); @@ -4173,7 +4173,7 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx, } W_ERROR_HAVE_NO_MEMORY(r->guid); - TALLOC_FREE(server_info); + TALLOC_FREE(session_info); return WERR_OK; } @@ -4220,7 +4220,7 @@ static bool snum_is_shared_printer(int snum) ********************************************************************/ static WERROR enum_all_printers_info_level(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, uint32_t level, @@ -4252,7 +4252,7 @@ static WERROR enum_all_printers_info_level(TALLOC_CTX *mem_ctx, printer, snum)); result = winreg_create_printer(mem_ctx, - server_info, + session_info, msg_ctx, printer); if (!W_ERROR_IS_OK(result)) { @@ -4267,7 +4267,7 @@ static WERROR enum_all_printers_info_level(TALLOC_CTX *mem_ctx, goto out; } - result = winreg_get_printer(mem_ctx, server_info, msg_ctx, + result = winreg_get_printer(mem_ctx, session_info, msg_ctx, printer, &info2); if (!W_ERROR_IS_OK(result)) { goto out; @@ -4275,7 +4275,7 @@ static WERROR enum_all_printers_info_level(TALLOC_CTX *mem_ctx, switch (level) { case 0: - result = construct_printer_info0(info, server_info, + result = construct_printer_info0(info, session_info, msg_ctx, info2, servername, &info[count].info0, snum); @@ -4332,7 +4332,7 @@ static WERROR enum_all_printers_info_level(TALLOC_CTX *mem_ctx, ********************************************************************/ static WERROR enumprinters_level0(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, uint32_t flags, const char *servername, @@ -4341,7 +4341,7 @@ static WERROR enumprinters_level0(TALLOC_CTX *mem_ctx, { DEBUG(4,("enum_all_printers_info_0\n")); - return enum_all_printers_info_level(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_level(mem_ctx, session_info, msg_ctx, servername, 0, flags, info, count); } @@ -4350,7 +4350,7 @@ static WERROR enumprinters_level0(TALLOC_CTX *mem_ctx, ********************************************************************/ static WERROR enum_all_printers_info_1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, uint32_t flags, @@ -4359,7 +4359,7 @@ static WERROR enum_all_printers_info_1(TALLOC_CTX *mem_ctx, { DEBUG(4,("enum_all_printers_info_1\n")); - return enum_all_printers_info_level(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_level(mem_ctx, session_info, msg_ctx, servername, 1, flags, info, count); } @@ -4368,7 +4368,7 @@ static WERROR enum_all_printers_info_1(TALLOC_CTX *mem_ctx, *********************************************************************/ static WERROR enum_all_printers_info_1_local(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, union spoolss_PrinterInfo **info, @@ -4376,7 +4376,7 @@ static WERROR enum_all_printers_info_1_local(TALLOC_CTX *mem_ctx, { DEBUG(4,("enum_all_printers_info_1_local\n")); - return enum_all_printers_info_1(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_1(mem_ctx, session_info, msg_ctx, servername, PRINTER_ENUM_ICON8, info, count); } @@ -4385,7 +4385,7 @@ static WERROR enum_all_printers_info_1_local(TALLOC_CTX *mem_ctx, *********************************************************************/ static WERROR enum_all_printers_info_1_name(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, union spoolss_PrinterInfo **info, @@ -4403,7 +4403,7 @@ static WERROR enum_all_printers_info_1_name(TALLOC_CTX *mem_ctx, return WERR_INVALID_NAME; } - return enum_all_printers_info_1(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_1(mem_ctx, session_info, msg_ctx, servername, PRINTER_ENUM_ICON8, info, count); } @@ -4412,7 +4412,7 @@ static WERROR enum_all_printers_info_1_name(TALLOC_CTX *mem_ctx, *********************************************************************/ static WERROR enum_all_printers_info_1_network(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, union spoolss_PrinterInfo **info, @@ -4438,7 +4438,7 @@ static WERROR enum_all_printers_info_1_network(TALLOC_CTX *mem_ctx, return WERR_CAN_NOT_COMPLETE; } - return enum_all_printers_info_1(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_1(mem_ctx, session_info, msg_ctx, servername, PRINTER_ENUM_NAME, info, count); } @@ -4449,7 +4449,7 @@ static WERROR enum_all_printers_info_1_network(TALLOC_CTX *mem_ctx, ********************************************************************/ static WERROR enum_all_printers_info_2(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, union spoolss_PrinterInfo **info, @@ -4457,7 +4457,7 @@ static WERROR enum_all_printers_info_2(TALLOC_CTX *mem_ctx, { DEBUG(4,("enum_all_printers_info_2\n")); - return enum_all_printers_info_level(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_level(mem_ctx, session_info, msg_ctx, servername, 2, 0, info, count); } @@ -4466,7 +4466,7 @@ static WERROR enum_all_printers_info_2(TALLOC_CTX *mem_ctx, ********************************************************************/ static WERROR enumprinters_level1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, uint32_t flags, const char *servername, @@ -4476,18 +4476,18 @@ static WERROR enumprinters_level1(TALLOC_CTX *mem_ctx, /* Not all the flags are equals */ if (flags & PRINTER_ENUM_LOCAL) { - return enum_all_printers_info_1_local(mem_ctx, server_info, + return enum_all_printers_info_1_local(mem_ctx, session_info, msg_ctx, servername, info, count); } if (flags & PRINTER_ENUM_NAME) { - return enum_all_printers_info_1_name(mem_ctx, server_info, + return enum_all_printers_info_1_name(mem_ctx, session_info, msg_ctx, servername, info, count); } if (flags & PRINTER_ENUM_NETWORK) { - return enum_all_printers_info_1_network(mem_ctx, server_info, + return enum_all_printers_info_1_network(mem_ctx, session_info, msg_ctx, servername, info, count); } @@ -4500,7 +4500,7 @@ static WERROR enumprinters_level1(TALLOC_CTX *mem_ctx, ********************************************************************/ static WERROR enumprinters_level2(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, uint32_t flags, const char *servername, @@ -4509,7 +4509,7 @@ static WERROR enumprinters_level2(TALLOC_CTX *mem_ctx, { if (flags & PRINTER_ENUM_LOCAL) { - return enum_all_printers_info_2(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_2(mem_ctx, session_info, msg_ctx, servername, info, count); } @@ -4519,7 +4519,7 @@ static WERROR enumprinters_level2(TALLOC_CTX *mem_ctx, return WERR_INVALID_NAME; } - return enum_all_printers_info_2(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_2(mem_ctx, session_info, msg_ctx, servername, info, count); } @@ -4536,7 +4536,7 @@ static WERROR enumprinters_level2(TALLOC_CTX *mem_ctx, ********************************************************************/ static WERROR enumprinters_level4(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, uint32_t flags, const char *servername, @@ -4545,7 +4545,7 @@ static WERROR enumprinters_level4(TALLOC_CTX *mem_ctx, { DEBUG(4,("enum_all_printers_info_4\n")); - return enum_all_printers_info_level(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_level(mem_ctx, session_info, msg_ctx, servername, 4, flags, info, count); } @@ -4555,7 +4555,7 @@ static WERROR enumprinters_level4(TALLOC_CTX *mem_ctx, ********************************************************************/ static WERROR enumprinters_level5(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, uint32_t flags, const char *servername, @@ -4564,7 +4564,7 @@ static WERROR enumprinters_level5(TALLOC_CTX *mem_ctx, { DEBUG(4,("enum_all_printers_info_5\n")); - return enum_all_printers_info_level(mem_ctx, server_info, msg_ctx, + return enum_all_printers_info_level(mem_ctx, session_info, msg_ctx, servername, 5, flags, info, count); } @@ -4575,7 +4575,7 @@ static WERROR enumprinters_level5(TALLOC_CTX *mem_ctx, WERROR _spoolss_EnumPrinters(struct pipes_struct *p, struct spoolss_EnumPrinters *r) { - const struct auth_serversupplied_info *server_info = get_server_info_system(); + const struct auth_serversupplied_info *session_info = get_session_info_system(); WERROR result; /* that's an [in out] buffer */ @@ -4609,31 +4609,31 @@ WERROR _spoolss_EnumPrinters(struct pipes_struct *p, switch (r->in.level) { case 0: - result = enumprinters_level0(p->mem_ctx, server_info, + result = enumprinters_level0(p->mem_ctx, session_info, p->msg_ctx, r->in.flags, r->in.server, r->out.info, r->out.count); break; case 1: - result = enumprinters_level1(p->mem_ctx, server_info, + result = enumprinters_level1(p->mem_ctx, session_info, p->msg_ctx, r->in.flags, r->in.server, r->out.info, r->out.count); break; case 2: - result = enumprinters_level2(p->mem_ctx, server_info, + result = enumprinters_level2(p->mem_ctx, session_info, p->msg_ctx, r->in.flags, r->in.server, r->out.info, r->out.count); break; case 4: - result = enumprinters_level4(p->mem_ctx, server_info, + result = enumprinters_level4(p->mem_ctx, session_info, p->msg_ctx, r->in.flags, r->in.server, r->out.info, r->out.count); break; case 5: - result = enumprinters_level5(p->mem_ctx, server_info, + result = enumprinters_level5(p->mem_ctx, session_info, p->msg_ctx, r->in.flags, r->in.server, r->out.info, r->out.count); @@ -4685,7 +4685,7 @@ WERROR _spoolss_GetPrinter(struct pipes_struct *p, } result = winreg_get_printer(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum), &info2); @@ -4696,7 +4696,7 @@ WERROR _spoolss_GetPrinter(struct pipes_struct *p, switch (r->in.level) { case 0: result = construct_printer_info0(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info2, Printer->servername, @@ -5445,7 +5445,7 @@ static WERROR fill_printer_driver_info101(TALLOC_CTX *mem_ctx, ********************************************************************/ static WERROR construct_printer_driver_info_level(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, uint32_t level, union spoolss_DriverInfo *r, @@ -5463,7 +5463,7 @@ static WERROR construct_printer_driver_info_level(TALLOC_CTX *mem_ctx, } result = winreg_get_printer(mem_ctx, - server_info, + session_info, msg_ctx, lp_const_servicename(snum), &pinfo2); @@ -5475,7 +5475,7 @@ static WERROR construct_printer_driver_info_level(TALLOC_CTX *mem_ctx, return WERR_INVALID_PRINTER_NAME; } - result = winreg_get_driver(mem_ctx, server_info, msg_ctx, + result = winreg_get_driver(mem_ctx, session_info, msg_ctx, architecture, pinfo2->drivername, version, &driver); @@ -5494,7 +5494,7 @@ static WERROR construct_printer_driver_info_level(TALLOC_CTX *mem_ctx, /* Yes - try again with a WinNT driver. */ version = 2; - result = winreg_get_driver(mem_ctx, server_info, msg_ctx, + result = winreg_get_driver(mem_ctx, session_info, msg_ctx, architecture, pinfo2->drivername, version, &driver); @@ -5578,7 +5578,7 @@ WERROR _spoolss_GetPrinterDriver2(struct pipes_struct *p, } result = construct_printer_driver_info_level(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.level, r->out.info, snum, printer->servername, @@ -5694,7 +5694,7 @@ WERROR _spoolss_StartDocPrinter(struct pipes_struct *p, return WERR_BADFID; } - werr = print_job_start(p->server_info, + werr = print_job_start(p->session_info, p->msg_ctx, p->client_id->name, snum, @@ -5797,7 +5797,7 @@ WERROR _spoolss_WritePrinter(struct pipes_struct *p, static WERROR control_printer(struct policy_handle *handle, uint32_t command, struct pipes_struct *p) { - const struct auth_serversupplied_info *server_info = p->server_info; + const struct auth_serversupplied_info *session_info = p->session_info; int snum; WERROR errcode = WERR_BADFUNC; struct printer_handle *Printer = find_printer_index_by_hnd(p, handle); @@ -5813,14 +5813,14 @@ static WERROR control_printer(struct policy_handle *handle, uint32_t command, switch (command) { case SPOOLSS_PRINTER_CONTROL_PAUSE: - errcode = print_queue_pause(server_info, p->msg_ctx, snum); + errcode = print_queue_pause(session_info, p->msg_ctx, snum); break; case SPOOLSS_PRINTER_CONTROL_RESUME: case SPOOLSS_PRINTER_CONTROL_UNPAUSE: - errcode = print_queue_resume(server_info, p->msg_ctx, snum); + errcode = print_queue_resume(session_info, p->msg_ctx, snum); break; case SPOOLSS_PRINTER_CONTROL_PURGE: - errcode = print_queue_purge(server_info, p->msg_ctx, snum); + errcode = print_queue_purge(session_info, p->msg_ctx, snum); break; default: return WERR_UNKNOWN_LEVEL; @@ -5856,7 +5856,7 @@ WERROR _spoolss_AbortPrinter(struct pipes_struct *p, return WERR_SPL_NO_STARTDOC; } - errcode = print_job_delete(p->server_info, + errcode = print_job_delete(p->session_info, p->msg_ctx, snum, Printer->jobid); @@ -5910,7 +5910,7 @@ static WERROR update_printer_sec(struct policy_handle *handle, /* NT seems to like setting the security descriptor even though nothing may have actually changed. */ result = winreg_get_printer_secdesc(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer, &old_secdesc); @@ -5962,7 +5962,7 @@ static WERROR update_printer_sec(struct policy_handle *handle, } result = winreg_set_printer_secdesc(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer, new_secdesc); @@ -6156,7 +6156,7 @@ static bool add_printer_hook(TALLOC_CTX *ctx, struct security_token *token, } static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, int snum, struct spoolss_SetPrinterInfo2 *printer, @@ -6173,7 +6173,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (force_update || !strequal(printer->drivername, old_printer->drivername)) { push_reg_sz(mem_ctx, &buffer, printer->drivername); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6195,7 +6195,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (force_update || !strequal(printer->comment, old_printer->comment)) { push_reg_sz(mem_ctx, &buffer, printer->comment); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6214,7 +6214,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (force_update || !strequal(printer->sharename, old_printer->sharename)) { push_reg_sz(mem_ctx, &buffer, printer->sharename); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6243,7 +6243,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, push_reg_sz(mem_ctx, &buffer, p); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6261,7 +6261,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (force_update || !strequal(printer->portname, old_printer->portname)) { push_reg_sz(mem_ctx, &buffer, printer->portname); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6280,7 +6280,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (force_update || !strequal(printer->location, old_printer->location)) { push_reg_sz(mem_ctx, &buffer, printer->location); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6300,7 +6300,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (force_update || !strequal(printer->sepfile, old_printer->sepfile)) { push_reg_sz(mem_ctx, &buffer, printer->sepfile); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6321,7 +6321,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, buffer = data_blob_talloc(mem_ctx, NULL, 4); SIVAL(buffer.data, 0, printer->starttime); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6335,7 +6335,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, buffer = data_blob_talloc(mem_ctx, NULL, 4); SIVAL(buffer.data, 0, printer->untiltime); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6349,7 +6349,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, buffer = data_blob_talloc(mem_ctx, NULL, 4); SIVAL(buffer.data, 0, printer->priority); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6364,7 +6364,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, SIVAL(buffer.data, 0, (printer->attributes & PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS)); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6388,7 +6388,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, } push_reg_sz(mem_ctx, &buffer, spooling); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6400,7 +6400,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, push_reg_sz(mem_ctx, &buffer, global_myname()); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6422,7 +6422,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, push_reg_sz(mem_ctx, &buffer, longname); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6435,7 +6435,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, global_myname(), printer->sharename); push_reg_sz(mem_ctx, &buffer, uncname); winreg_set_printer_dataex(mem_ctx, - server_info, + session_info, msg_ctx, printer->sharename, SPOOL_DSSPOOLER_KEY, @@ -6484,7 +6484,7 @@ static WERROR update_printer(struct pipes_struct *p, } result = winreg_get_printer(tmp_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum), &old_printer); @@ -6519,7 +6519,7 @@ static WERROR update_printer(struct pipes_struct *p, !strequal(printer->location, old_printer->location)) ) { /* add_printer_hook() will call reload_services() */ - if (!add_printer_hook(tmp_ctx, p->server_info->security_token, + if (!add_printer_hook(tmp_ctx, p->session_info->security_token, printer, p->client_id->addr, p->msg_ctx)) { result = WERR_ACCESS_DENIED; @@ -6528,7 +6528,7 @@ static WERROR update_printer(struct pipes_struct *p, } update_dsspooler(tmp_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, snum, printer, @@ -6540,7 +6540,7 @@ static WERROR update_printer(struct pipes_struct *p, printer_mask &= ~SPOOLSS_PRINTER_INFO_DEVMODE; } result = winreg_update_printer(tmp_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer->sharename, printer_mask, @@ -6581,7 +6581,7 @@ static WERROR publish_or_unpublish_printer(struct pipes_struct *p, return WERR_BADFID; result = winreg_get_printer(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_servicename(snum), &pinfo2); @@ -6590,7 +6590,7 @@ static WERROR publish_or_unpublish_printer(struct pipes_struct *p, } nt_printer_publish(pinfo2, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, pinfo2, info7->action); @@ -6630,7 +6630,7 @@ static WERROR update_printer_devmode(struct pipes_struct *p, } return winreg_update_printer(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum), info2_mask, @@ -7044,7 +7044,7 @@ WERROR _spoolss_EnumJobs(struct pipes_struct *p, } result = winreg_get_printer(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum), &pinfo2); @@ -7141,7 +7141,7 @@ static WERROR spoolss_setjob_1(TALLOC_CTX *mem_ctx, WERROR _spoolss_SetJob(struct pipes_struct *p, struct spoolss_SetJob *r) { - const struct auth_serversupplied_info *server_info = p->server_info; + const struct auth_serversupplied_info *session_info = p->session_info; int snum; WERROR errcode = WERR_BADFUNC; @@ -7156,21 +7156,21 @@ WERROR _spoolss_SetJob(struct pipes_struct *p, switch (r->in.command) { case SPOOLSS_JOB_CONTROL_CANCEL: case SPOOLSS_JOB_CONTROL_DELETE: - errcode = print_job_delete(server_info, p->msg_ctx, + errcode = print_job_delete(session_info, p->msg_ctx, snum, r->in.job_id); if (W_ERROR_EQUAL(errcode, WERR_PRINTER_HAS_JOBS_QUEUED)) { errcode = WERR_OK; } break; case SPOOLSS_JOB_CONTROL_PAUSE: - if (print_job_pause(server_info, p->msg_ctx, + if (print_job_pause(session_info, p->msg_ctx, snum, r->in.job_id, &errcode)) { errcode = WERR_OK; } break; case SPOOLSS_JOB_CONTROL_RESTART: case SPOOLSS_JOB_CONTROL_RESUME: - if (print_job_resume(server_info, p->msg_ctx, + if (print_job_resume(session_info, p->msg_ctx, snum, r->in.job_id, &errcode)) { errcode = WERR_OK; } @@ -7212,7 +7212,7 @@ WERROR _spoolss_SetJob(struct pipes_struct *p, ****************************************************************************/ static WERROR enumprinterdrivers_level_by_architecture(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, const char *architecture, @@ -7233,7 +7233,7 @@ static WERROR enumprinterdrivers_level_by_architecture(TALLOC_CTX *mem_ctx, *info_p = NULL; for (version=0; version<DRIVER_MAX_VERSION; version++) { - result = winreg_get_driver_list(mem_ctx, server_info, msg_ctx, + result = winreg_get_driver_list(mem_ctx, session_info, msg_ctx, architecture, version, &num_drivers, &drivers); if (!W_ERROR_IS_OK(result)) { @@ -7258,7 +7258,7 @@ static WERROR enumprinterdrivers_level_by_architecture(TALLOC_CTX *mem_ctx, for (i = 0; i < num_drivers; i++) { DEBUG(5, ("\tdriver: [%s]\n", drivers[i])); - result = winreg_get_driver(mem_ctx, server_info, + result = winreg_get_driver(mem_ctx, session_info, msg_ctx, architecture, drivers[i], version, &driver); @@ -7330,7 +7330,7 @@ static WERROR enumprinterdrivers_level_by_architecture(TALLOC_CTX *mem_ctx, ****************************************************************************/ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *servername, const char *architecture, @@ -7349,7 +7349,7 @@ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx, uint32_t count = 0; result = enumprinterdrivers_level_by_architecture(mem_ctx, - server_info, + session_info, msg_ctx, servername, archi_table[a].long_archi, @@ -7370,7 +7370,7 @@ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx, } return enumprinterdrivers_level_by_architecture(mem_ctx, - server_info, + session_info, msg_ctx, servername, architecture, @@ -7408,7 +7408,7 @@ WERROR _spoolss_EnumPrinterDrivers(struct pipes_struct *p, } result = enumprinterdrivers_level(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, cservername, r->in.environment, @@ -7455,7 +7455,7 @@ WERROR _spoolss_EnumForms(struct pipes_struct *p, switch (r->in.level) { case 1: result = winreg_printer_enumforms1(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->out.count, r->out.info); @@ -7505,7 +7505,7 @@ WERROR _spoolss_GetForm(struct pipes_struct *p, switch (r->in.level) { case 1: result = winreg_printer_getform1(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.form_name, &r->out.info->info1); @@ -7836,7 +7836,7 @@ static WERROR spoolss_addprinterex_level_2(struct pipes_struct *p, trying to add a printer like this --jerry */ if (*lp_addprinter_cmd() ) { - if ( !add_printer_hook(p->mem_ctx, p->server_info->security_token, + if ( !add_printer_hook(p->mem_ctx, p->session_info->security_token, info2, p->client_id->addr, p->msg_ctx) ) { return WERR_ACCESS_DENIED; @@ -7853,7 +7853,7 @@ static WERROR spoolss_addprinterex_level_2(struct pipes_struct *p, } /* you must be a printer admin to add a new printer */ - if (!print_access_check(p->server_info, + if (!print_access_check(p->session_info, p->msg_ctx, snum, PRINTER_ACCESS_ADMINISTER)) { @@ -7873,14 +7873,14 @@ static WERROR spoolss_addprinterex_level_2(struct pipes_struct *p, } update_dsspooler(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, 0, info2, NULL); err = winreg_update_printer(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, info2->sharename, info2_mask, @@ -8007,7 +8007,7 @@ WERROR _spoolss_AddPrinterDriverEx(struct pipes_struct *p, } err = winreg_add_driver(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, r->in.info_ctr, &driver_name, @@ -8427,12 +8427,12 @@ WERROR _spoolss_AddForm(struct pipes_struct *p, /* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege, and not a printer admin, then fail */ - if ((p->server_info->utok.uid != sec_initial_uid()) && - !security_token_has_privilege(p->server_info->security_token, SEC_PRIV_PRINT_OPERATOR) && - !token_contains_name_in_list(uidtoname(p->server_info->utok.uid), - p->server_info->info3->base.domain.string, + if ((p->session_info->utok.uid != sec_initial_uid()) && + !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) && + !token_contains_name_in_list(uidtoname(p->session_info->utok.uid), + p->session_info->info3->base.domain.string, NULL, - p->server_info->security_token, + p->session_info->security_token, lp_printer_admin(snum))) { DEBUG(2,("_spoolss_Addform: denied by insufficient permissions.\n")); return WERR_ACCESS_DENIED; @@ -8448,7 +8448,7 @@ WERROR _spoolss_AddForm(struct pipes_struct *p, } status = winreg_printer_addform1(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, form); if (!W_ERROR_IS_OK(status)) { @@ -8464,7 +8464,7 @@ WERROR _spoolss_AddForm(struct pipes_struct *p, } status = winreg_printer_update_changeid(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum)); if (!W_ERROR_IS_OK(status)) { @@ -8495,19 +8495,19 @@ WERROR _spoolss_DeleteForm(struct pipes_struct *p, return WERR_BADFID; } - if ((p->server_info->utok.uid != sec_initial_uid()) && - !security_token_has_privilege(p->server_info->security_token, SEC_PRIV_PRINT_OPERATOR) && - !token_contains_name_in_list(uidtoname(p->server_info->utok.uid), - p->server_info->info3->base.domain.string, + if ((p->session_info->utok.uid != sec_initial_uid()) && + !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) && + !token_contains_name_in_list(uidtoname(p->session_info->utok.uid), + p->session_info->info3->base.domain.string, NULL, - p->server_info->security_token, + p->session_info->security_token, lp_printer_admin(snum))) { DEBUG(2,("_spoolss_DeleteForm: denied by insufficient permissions.\n")); return WERR_ACCESS_DENIED; } status = winreg_printer_deleteform1(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, form_name); if (!W_ERROR_IS_OK(status)) { @@ -8523,7 +8523,7 @@ WERROR _spoolss_DeleteForm(struct pipes_struct *p, } status = winreg_printer_update_changeid(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum)); if (!W_ERROR_IS_OK(status)) { @@ -8559,19 +8559,19 @@ WERROR _spoolss_SetForm(struct pipes_struct *p, /* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege, and not a printer admin, then fail */ - if ((p->server_info->utok.uid != sec_initial_uid()) && - !security_token_has_privilege(p->server_info->security_token, SEC_PRIV_PRINT_OPERATOR) && - !token_contains_name_in_list(uidtoname(p->server_info->utok.uid), - p->server_info->info3->base.domain.string, + if ((p->session_info->utok.uid != sec_initial_uid()) && + !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) && + !token_contains_name_in_list(uidtoname(p->session_info->utok.uid), + p->session_info->info3->base.domain.string, NULL, - p->server_info->security_token, + p->session_info->security_token, lp_printer_admin(snum))) { DEBUG(2,("_spoolss_Setform: denied by insufficient permissions.\n")); return WERR_ACCESS_DENIED; } status = winreg_printer_setform1(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, form_name, form); @@ -8588,7 +8588,7 @@ WERROR _spoolss_SetForm(struct pipes_struct *p, } status = winreg_printer_update_changeid(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum)); if (!W_ERROR_IS_OK(status)) { @@ -9082,7 +9082,7 @@ WERROR _spoolss_GetJob(struct pipes_struct *p, } result = winreg_get_printer(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum), &pinfo2); @@ -9209,7 +9209,7 @@ WERROR _spoolss_GetPrinterDataEx(struct pipes_struct *p, uint32_t changeid = 0; result = winreg_printer_get_changeid(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer, &changeid); @@ -9224,7 +9224,7 @@ WERROR _spoolss_GetPrinterDataEx(struct pipes_struct *p, } result = winreg_get_printer_dataex(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer, r->in.key_name, @@ -9299,7 +9299,7 @@ WERROR _spoolss_SetPrinterDataEx(struct pipes_struct *p, } result = winreg_get_printer(Printer, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_servicename(snum), &pinfo2); @@ -9318,7 +9318,7 @@ WERROR _spoolss_SetPrinterDataEx(struct pipes_struct *p, /* save the registry data */ result = winreg_set_printer_dataex(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, pinfo2->sharename, r->in.key_name, @@ -9344,7 +9344,7 @@ WERROR _spoolss_SetPrinterDataEx(struct pipes_struct *p, * this is right. --jerry */ winreg_set_printer_dataex(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, pinfo2->sharename, str, @@ -9355,7 +9355,7 @@ WERROR _spoolss_SetPrinterDataEx(struct pipes_struct *p, } result = winreg_printer_update_changeid(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum)); @@ -9403,14 +9403,14 @@ WERROR _spoolss_DeletePrinterDataEx(struct pipes_struct *p, printer = lp_const_servicename(snum); status = winreg_delete_printer_dataex(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer, r->in.key_name, r->in.value_name); if (W_ERROR_IS_OK(status)) { status = winreg_printer_update_changeid(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer); } @@ -9445,7 +9445,7 @@ WERROR _spoolss_EnumPrinterKey(struct pipes_struct *p, } result = winreg_enum_printer_key(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum), r->in.key_name, @@ -9519,13 +9519,13 @@ WERROR _spoolss_DeletePrinterKey(struct pipes_struct *p, /* delete the key and all subkeys */ status = winreg_delete_printer_key(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer, r->in.key_name); if (W_ERROR_IS_OK(status)) { status = winreg_printer_update_changeid(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, printer); } @@ -9576,7 +9576,7 @@ WERROR _spoolss_EnumPrinterDataEx(struct pipes_struct *p, /* now look for a match on the key name */ result = winreg_enum_printer_dataex(p->mem_ctx, - get_server_info_system(), + get_session_info_system(), p->msg_ctx, lp_const_servicename(snum), r->in.key_name, @@ -9984,14 +9984,14 @@ WERROR _spoolss_XcvData(struct pipes_struct *p, switch ( Printer->printer_type ) { case SPLHND_PORTMON_TCP: werror = process_xcvtcp_command(p->mem_ctx, - p->server_info->security_token, + p->session_info->security_token, r->in.function_name, &r->in.in_data, &out_data, r->out.needed); break; case SPLHND_PORTMON_LOCAL: werror = process_xcvlocal_command(p->mem_ctx, - p->server_info->security_token, + p->session_info->security_token, r->in.function_name, &r->in.in_data, &out_data, r->out.needed); diff --git a/source3/rpc_server/spoolss/srv_spoolss_util.c b/source3/rpc_server/spoolss/srv_spoolss_util.c index 9d654ec20c..896a9ed7c5 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.c +++ b/source3/rpc_server/spoolss/srv_spoolss_util.c @@ -224,7 +224,7 @@ static uint32_t winreg_printer_rev_changeid(void) * * @param[in] mem_ctx The memory context to use. * - * @param[in] server_info The supplied server info. + * @param[in] session_info The supplied server info. * * @param[out] binding_handle A pointer for the winreg dcerpc binding handle. * @@ -245,7 +245,7 @@ static uint32_t winreg_printer_rev_changeid(void) * code if something gone wrong. */ static WERROR winreg_printer_openkey(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct dcerpc_binding_handle **winreg_binding_handle, const char *path, @@ -268,7 +268,7 @@ static WERROR winreg_printer_openkey(TALLOC_CTX *mem_ctx, status = rpcint_binding_handle(mem_ctx, &ndr_table_winreg, &client_id, - server_info, + session_info, msg_ctx, &binding_handle); if (!NT_STATUS_IS_OK(status)) { @@ -656,7 +656,7 @@ done: } static WERROR winreg_printer_opendriver(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *drivername, const char *architecture, @@ -678,7 +678,7 @@ static WERROR winreg_printer_opendriver(TALLOC_CTX *mem_ctx, } result = winreg_printer_openkey(mem_ctx, - server_info, + session_info, msg_ctx, winreg_binding_handle, key_name, @@ -912,7 +912,7 @@ static WERROR winreg_printer_ver_to_dword(const char *str, uint64_t *data) ********************************************************************/ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *sharename) { @@ -944,7 +944,7 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -966,7 +966,7 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx, /* Create the main key */ result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -1226,7 +1226,7 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx, */ result = winreg_update_printer(tmp_ctx, - server_info, + session_info, msg_ctx, sharename, info2_mask, @@ -1251,7 +1251,7 @@ done: } WERROR winreg_update_printer(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *sharename, uint32_t info2_mask, @@ -1285,7 +1285,7 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -1553,7 +1553,7 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx, } } result = winreg_set_printer_secdesc(tmp_ctx, - server_info, + session_info, msg_ctx, sharename, secdesc); @@ -1668,7 +1668,7 @@ done: } WERROR winreg_get_printer(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, struct spoolss_PrinterInfo2 **pinfo2) @@ -1701,7 +1701,7 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx, } result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -1900,7 +1900,7 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx, } result = winreg_get_printer_secdesc(info2, - server_info, + session_info, msg_ctx, printer, &info2->secdesc); @@ -1935,7 +1935,7 @@ done: } WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *sharename, struct spoolss_security_descriptor **psecdesc) @@ -1964,7 +1964,7 @@ WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2005,7 +2005,7 @@ WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, create_default: result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2092,7 +2092,7 @@ done: } WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *sharename, const struct spoolss_security_descriptor *secdesc) @@ -2130,7 +2130,7 @@ WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx, size_t size; result = winreg_get_printer_secdesc(tmp_ctx, - server_info, + session_info, msg_ctx, sharename, &old_secdesc); @@ -2175,7 +2175,7 @@ WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2216,7 +2216,7 @@ done: /* Set printer data over the winreg pipe. */ WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -2251,7 +2251,7 @@ WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx, DEBUG(8, ("winreg_set_printer_dataex: Open printer key %s, value %s, access_mask: 0x%05x for [%s]\n", key, value, access_mask, printer)); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2299,7 +2299,7 @@ done: /* Get printer data over a winreg pipe. */ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -2336,7 +2336,7 @@ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2428,7 +2428,7 @@ done: /* Enumerate on the values of a given key and provide the data. */ WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -2458,7 +2458,7 @@ WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx, } result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2508,7 +2508,7 @@ done: /* Delete printer data over a winreg pipe. */ WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -2539,7 +2539,7 @@ WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2584,7 +2584,7 @@ done: /* Enumerate on the subkeys of a given key and provide the data. */ WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -2618,7 +2618,7 @@ WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2672,7 +2672,7 @@ done: /* Delete a key with subkeys of a given printer. */ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key) @@ -2697,7 +2697,7 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx, } result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2763,7 +2763,7 @@ done: } WERROR winreg_printer_update_changeid(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer) { @@ -2790,7 +2790,7 @@ WERROR winreg_printer_update_changeid(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2836,7 +2836,7 @@ done: } WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, uint32_t *pchangeid) @@ -2865,7 +2865,7 @@ WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, path, @@ -2924,7 +2924,7 @@ done: */ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_AddFormInfo1 *form) { @@ -2949,7 +2949,7 @@ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, TOP_LEVEL_CONTROL_FORMS_KEY, @@ -2964,7 +2964,7 @@ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx, goto done; } - result = winreg_printer_enumforms1(tmp_ctx, server_info, msg_ctx, + result = winreg_printer_enumforms1(tmp_ctx, session_info, msg_ctx, &num_info, &info); if (!W_ERROR_IS_OK(result)) { DEBUG(0, ("winreg_printer_addform: Could not enum keys %s: %s\n", @@ -3024,7 +3024,7 @@ done: } WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, uint32_t *pnum_info, union spoolss_FormInfo **pinfo) @@ -3049,7 +3049,7 @@ WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, TOP_LEVEL_CONTROL_FORMS_KEY, @@ -3142,7 +3142,7 @@ done: } WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *form_name) { @@ -3171,7 +3171,7 @@ WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, TOP_LEVEL_CONTROL_FORMS_KEY, @@ -3224,7 +3224,7 @@ done: } WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *form_name, struct spoolss_AddFormInfo1 *form) @@ -3256,7 +3256,7 @@ WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, TOP_LEVEL_CONTROL_FORMS_KEY, @@ -3273,7 +3273,7 @@ WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx, /* If form_name != form->form_name then we renamed the form */ if (strequal(form_name, form->form_name)) { - result = winreg_printer_deleteform1(tmp_ctx, server_info, + result = winreg_printer_deleteform1(tmp_ctx, session_info, msg_ctx, form_name); if (!W_ERROR_IS_OK(result)) { DEBUG(0, ("winreg_printer_setform1: Could not open key %s: %s\n", @@ -3325,7 +3325,7 @@ done: } WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *form_name, struct spoolss_FormInfo1 *r) @@ -3361,7 +3361,7 @@ WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx, ZERO_STRUCT(key_hnd); result = winreg_printer_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &winreg_handle, TOP_LEVEL_CONTROL_FORMS_KEY, @@ -3461,7 +3461,7 @@ done: } WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_AddDriverInfoCtr *r, const char **driver_name, @@ -3490,7 +3490,7 @@ WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, } result = winreg_printer_opendriver(tmp_ctx, - server_info, + session_info, msg_ctx, info8.driver_name, info8.architecture, @@ -3803,7 +3803,7 @@ done: } WERROR winreg_get_driver(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *architecture, const char *driver_name, @@ -3833,7 +3833,7 @@ WERROR winreg_get_driver(TALLOC_CTX *mem_ctx, if (driver_version == DRIVER_ANY_VERSION) { /* look for Win2k first and then for NT4 */ result = winreg_printer_opendriver(tmp_ctx, - server_info, + session_info, msg_ctx, driver_name, architecture, @@ -3844,7 +3844,7 @@ WERROR winreg_get_driver(TALLOC_CTX *mem_ctx, &key_hnd); if (!W_ERROR_IS_OK(result)) { result = winreg_printer_opendriver(tmp_ctx, - server_info, + session_info, msg_ctx, driver_name, architecture, @@ -3857,7 +3857,7 @@ WERROR winreg_get_driver(TALLOC_CTX *mem_ctx, } else { /* ok normal case */ result = winreg_printer_opendriver(tmp_ctx, - server_info, + session_info, msg_ctx, driver_name, architecture, @@ -4075,7 +4075,7 @@ done: } WERROR winreg_del_driver(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_DriverInfo8 *info8, uint32_t version) @@ -4097,7 +4097,7 @@ WERROR winreg_del_driver(TALLOC_CTX *mem_ctx, /* test that the key exists */ result = winreg_printer_opendriver(tmp_ctx, - server_info, + session_info, msg_ctx, info8->driver_name, info8->architecture, @@ -4166,7 +4166,7 @@ done: } WERROR winreg_get_driver_list(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *architecture, uint32_t version, @@ -4195,7 +4195,7 @@ WERROR winreg_get_driver_list(TALLOC_CTX *mem_ctx, /* use NULL for the driver name so we open the key that is * parent of all drivers for this architecture and version */ result = winreg_printer_opendriver(tmp_ctx, - server_info, + session_info, msg_ctx, NULL, architecture, diff --git a/source3/rpc_server/spoolss/srv_spoolss_util.h b/source3/rpc_server/spoolss/srv_spoolss_util.h index d425bd1bba..4588db54a7 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.h +++ b/source3/rpc_server/spoolss/srv_spoolss_util.h @@ -72,7 +72,7 @@ enum spoolss_PrinterInfo2Mask { SPOOLSS_PRINTER_INFO_UNTILTIME WERROR winreg_create_printer(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *sharename); @@ -83,7 +83,7 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] sharename The share name. * @@ -99,7 +99,7 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *sharename, uint32_t info2_mask, @@ -113,7 +113,7 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The name of the printer to get. * @@ -123,7 +123,7 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, struct spoolss_PrinterInfo2 **pinfo2); @@ -133,7 +133,7 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] sharename The share name. * @@ -143,7 +143,7 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *sharename, struct spoolss_security_descriptor **psecdesc); @@ -153,7 +153,7 @@ WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] sharename The share name. * @@ -163,7 +163,7 @@ WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *sharename, const struct spoolss_security_descriptor *secdesc); @@ -175,7 +175,7 @@ WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The printer name. * @@ -193,7 +193,7 @@ WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -209,7 +209,7 @@ WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The printer name. * @@ -227,7 +227,7 @@ WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -243,7 +243,7 @@ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The printer name. * @@ -257,7 +257,7 @@ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx, * code if something gone wrong. */ WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -271,7 +271,7 @@ WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The printer name. * @@ -283,7 +283,7 @@ WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -296,7 +296,7 @@ WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The printer name. * @@ -311,7 +311,7 @@ WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx, * code if something gone wrong. */ WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key, @@ -325,7 +325,7 @@ WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The printer name. * @@ -335,7 +335,7 @@ WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, const char *key); @@ -351,7 +351,7 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The printer name. * @@ -359,7 +359,7 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_printer_update_changeid(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer); @@ -368,7 +368,7 @@ WERROR winreg_printer_update_changeid(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] printer The printer name. * @@ -378,7 +378,7 @@ WERROR winreg_printer_update_changeid(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *printer, uint32_t *pchangeid); @@ -391,7 +391,7 @@ WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] form The form to add. * @@ -401,7 +401,7 @@ WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx, * A corresponding DOS error is something went wrong. */ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_AddFormInfo1 *form); @@ -410,7 +410,7 @@ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[out] pnum_info A pointer to store the FormInfo count. * @@ -420,7 +420,7 @@ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, uint32_t *pnum_info, union spoolss_FormInfo **pinfo); @@ -430,7 +430,7 @@ WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] form_name The name of the form to delete. * @@ -440,7 +440,7 @@ WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx, * A corresponding DOS error is something went wrong. */ WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *form_name); @@ -452,7 +452,7 @@ WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] form_name The name of the form to set or rename. * @@ -463,7 +463,7 @@ WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx, * A corresponding DOS error is something went wrong. */ WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *form_name, struct spoolss_AddFormInfo1 *form); @@ -473,7 +473,7 @@ WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx The talloc memory context to use. * - * @param[in] server_info The server supplied session info. + * @param[in] session_info The server supplied session info. * * @param[in] form_name The name of the form to query. * @@ -483,7 +483,7 @@ WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *form_name, struct spoolss_FormInfo1 *form); @@ -493,7 +493,7 @@ WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx A talloc memory context. * - * @param[in] server_info Auth info to open the pipe. + * @param[in] session_info Auth info to open the pipe. * * @param[in] r The structure containing the new driver data. * @@ -505,7 +505,7 @@ WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx, * something went wrong. */ WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_AddDriverInfoCtr *r, const char **driver_name, @@ -516,7 +516,7 @@ WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx A talloc memory context. * - * @param[in] server_info Auth info to open the pipe. + * @param[in] session_info Auth info to open the pipe. * * @param[in] architecture The architecture type. * @@ -531,7 +531,7 @@ WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, */ WERROR winreg_get_driver(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *architecture, const char *driver_name, @@ -543,7 +543,7 @@ WERROR winreg_get_driver(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx A talloc memory context. * - * @param[in] server_info Auth info to open the pipe. + * @param[in] session_info Auth info to open the pipe. * * @param[out] info8 The structure that holds the full driver information. * @@ -554,7 +554,7 @@ WERROR winreg_get_driver(TALLOC_CTX *mem_ctx, */ WERROR winreg_del_driver(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct spoolss_DriverInfo8 *info8, uint32_t version); @@ -565,7 +565,7 @@ WERROR winreg_del_driver(TALLOC_CTX *mem_ctx, * * @param[in] mem_ctx A talloc memory context. * - * @param[in] server_info Auth info to open the pipe. + * @param[in] session_info Auth info to open the pipe. * * @param[in] architecture The architecture type. * @@ -580,7 +580,7 @@ WERROR winreg_del_driver(TALLOC_CTX *mem_ctx, */ WERROR winreg_get_driver_list(TALLOC_CTX *mem_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, const char *architecture, uint32_t version, diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 57b5a0fac5..bb10902e4e 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -526,12 +526,12 @@ static bool pipe_schannel_auth_bind(struct pipes_struct *p, return false; } - ret = server_info_set_session_key(p->server_info, session_key); + ret = session_info_set_session_key(p->session_info, session_key); data_blob_free(&session_key); if (!ret) { - DEBUG(0, ("server_info_set_session_key failed\n")); + DEBUG(0, ("session_info_set_session_key failed\n")); return false; } @@ -622,7 +622,7 @@ static bool pipe_ntlmssp_verify_final(TALLOC_CTX *mem_ctx, enum dcerpc_AuthLevel auth_level, struct client_address *client_id, struct ndr_syntax_id *syntax, - struct auth_serversupplied_info **server_info) + struct auth_serversupplied_info **session_info) { DATA_BLOB session_key; NTSTATUS status; @@ -647,17 +647,17 @@ static bool pipe_ntlmssp_verify_final(TALLOC_CTX *mem_ctx, return false; } - TALLOC_FREE(*server_info); + TALLOC_FREE(*session_info); status = ntlmssp_server_get_user_info(ntlmssp_ctx, - mem_ctx, server_info); + mem_ctx, session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, (__location__ ": failed to obtain the server info " "for authenticated user: %s\n", nt_errstr(status))); return false; } - if ((*server_info)->security_token == NULL) { + if ((*session_info)->security_token == NULL) { DEBUG(1, ("Auth module failed to provide nt_user_token\n")); return false; } @@ -673,7 +673,7 @@ static bool pipe_ntlmssp_verify_final(TALLOC_CTX *mem_ctx, return false; } - ret = server_info_set_session_key((*server_info), session_key); + ret = session_info_set_session_key((*session_info), session_key); data_blob_free(&session_key); if (!ret) { DEBUG(0, ("Failed to set session key!\n")); @@ -728,7 +728,7 @@ err: static NTSTATUS pipe_gssapi_verify_final(TALLOC_CTX *mem_ctx, struct gse_context *gse_ctx, struct client_address *client_id, - struct auth_serversupplied_info **server_info) + struct auth_serversupplied_info **session_info) { DATA_BLOB session_key; NTSTATUS status; @@ -745,15 +745,15 @@ static NTSTATUS pipe_gssapi_verify_final(TALLOC_CTX *mem_ctx, } status = gssapi_server_get_user_info(gse_ctx, mem_ctx, - client_id, server_info); + client_id, session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, (__location__ ": failed to obtain the server info " "for authenticated user: %s\n", nt_errstr(status))); return status; } - if ((*server_info)->security_token == NULL) { - status = create_local_token(*server_info); + if ((*session_info)->security_token == NULL) { + status = create_local_token(*session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("Failed to create local user token (%s)\n", nt_errstr(status))); @@ -775,7 +775,7 @@ static NTSTATUS pipe_gssapi_verify_final(TALLOC_CTX *mem_ctx, return NT_STATUS_ACCESS_DENIED; } - bret = server_info_set_session_key((*server_info), session_key); + bret = session_info_set_session_key((*session_info), session_key); data_blob_free(&session_key); if (!bret) { return NT_STATUS_ACCESS_DENIED; @@ -800,7 +800,7 @@ static NTSTATUS pipe_auth_verify_final(struct pipes_struct *p) if (!pipe_ntlmssp_verify_final(p, ntlmssp_ctx, p->auth.auth_level, p->client_id, &p->syntax, - &p->server_info)) { + &p->session_info)) { return NT_STATUS_ACCESS_DENIED; } break; @@ -809,7 +809,7 @@ static NTSTATUS pipe_auth_verify_final(struct pipes_struct *p) struct gse_context); status = pipe_gssapi_verify_final(p, gse_ctx, p->client_id, - &p->server_info); + &p->session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("gssapi bind failed with: %s", nt_errstr(status))); @@ -832,7 +832,7 @@ static NTSTATUS pipe_auth_verify_final(struct pipes_struct *p) struct gse_context); status = pipe_gssapi_verify_final(p, gse_ctx, p->client_id, - &p->server_info); + &p->session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("gssapi bind failed with: %s", nt_errstr(status))); @@ -846,7 +846,7 @@ static NTSTATUS pipe_auth_verify_final(struct pipes_struct *p) p->auth.auth_level, p->client_id, &p->syntax, - &p->server_info)) { + &p->session_info)) { return NT_STATUS_ACCESS_DENIED; } break; diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index f531d04cde..778fa81b86 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -411,7 +411,7 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, const struct tsocket_address *local_address, const struct tsocket_address *remote_address, struct client_address *client_id, - struct auth_serversupplied_info *server_info, + struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx, struct fake_file_handle **phandle) { @@ -447,7 +447,7 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, p = make_external_rpc_pipe_p(handle, name, local_address, remote_address, - server_info); + session_info); handle->type = FAKE_FILE_TYPE_NAMED_PIPE_PROXY; handle->private_data = p; @@ -461,7 +461,7 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, } p = make_internal_rpc_pipe_p(handle, &syntax, client_id, - server_info, msg_ctx); + session_info, msg_ctx); handle->type = FAKE_FILE_TYPE_NAMED_PIPE; handle->private_data = p; diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c index cd4ada1b90..31df4886bb 100644 --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c @@ -271,7 +271,7 @@ static void init_srv_share_info_1(struct pipes_struct *p, remark = talloc_sub_advanced( p->mem_ctx, lp_servicename(snum), get_current_username(), lp_pathname(snum), - p->server_info->utok.uid, get_current_username(), + p->session_info->utok.uid, get_current_username(), "", remark); } @@ -299,7 +299,7 @@ static void init_srv_share_info_2(struct pipes_struct *p, remark = talloc_sub_advanced( p->mem_ctx, lp_servicename(snum), get_current_username(), lp_pathname(snum), - p->server_info->utok.uid, get_current_username(), + p->session_info->utok.uid, get_current_username(), "", remark); } path = talloc_asprintf(p->mem_ctx, @@ -364,7 +364,7 @@ static void init_srv_share_info_501(struct pipes_struct *p, remark = talloc_sub_advanced( p->mem_ctx, lp_servicename(snum), get_current_username(), lp_pathname(snum), - p->server_info->utok.uid, get_current_username(), + p->session_info->utok.uid, get_current_username(), "", remark); } @@ -393,7 +393,7 @@ static void init_srv_share_info_502(struct pipes_struct *p, remark = talloc_sub_advanced( p->mem_ctx, lp_servicename(snum), get_current_username(), lp_pathname(snum), - p->server_info->utok.uid, get_current_username(), + p->session_info->utok.uid, get_current_username(), "", remark); } path = talloc_asprintf(ctx, "C:%s", lp_pathname(snum)); @@ -434,7 +434,7 @@ static void init_srv_share_info_1004(struct pipes_struct *p, remark = talloc_sub_advanced( p->mem_ctx, lp_servicename(snum), get_current_username(), lp_pathname(snum), - p->server_info->utok.uid, get_current_username(), + p->session_info->utok.uid, get_current_username(), "", remark); } @@ -520,7 +520,7 @@ static bool is_enumeration_allowed(struct pipes_struct *p, if (!lp_access_based_share_enum(snum)) return true; - return share_access_check(p->server_info->security_token, lp_servicename(snum), + return share_access_check(p->session_info->security_token, lp_servicename(snum), FILE_READ_DATA); } @@ -1055,7 +1055,7 @@ WERROR _srvsvc_NetFileEnum(struct pipes_struct *p, } if (!nt_token_check_sid(&global_sid_Builtin_Administrators, - p->server_info->security_token)) { + p->session_info->security_token)) { DEBUG(1, ("Enumerating files only allowed for " "administrators\n")); return WERR_ACCESS_DENIED; @@ -1214,7 +1214,7 @@ WERROR _srvsvc_NetConnEnum(struct pipes_struct *p, DEBUG(5,("_srvsvc_NetConnEnum: %d\n", __LINE__)); if (!nt_token_check_sid(&global_sid_Builtin_Administrators, - p->server_info->security_token)) { + p->session_info->security_token)) { DEBUG(1, ("Enumerating connections only allowed for " "administrators\n")); return WERR_ACCESS_DENIED; @@ -1252,7 +1252,7 @@ WERROR _srvsvc_NetSessEnum(struct pipes_struct *p, DEBUG(5,("_srvsvc_NetSessEnum: %d\n", __LINE__)); if (!nt_token_check_sid(&global_sid_Builtin_Administrators, - p->server_info->security_token)) { + p->session_info->security_token)) { DEBUG(1, ("Enumerating sessions only allowed for " "administrators\n")); return WERR_ACCESS_DENIED; @@ -1310,8 +1310,8 @@ WERROR _srvsvc_NetSessDel(struct pipes_struct *p, /* fail out now if you are not root or not a domain admin */ - if ((p->server_info->utok.uid != sec_initial_uid()) && - ( ! nt_token_check_domain_rid(p->server_info->security_token, + if ((p->session_info->utok.uid != sec_initial_uid()) && + ( ! nt_token_check_domain_rid(p->session_info->security_token, DOMAIN_RID_ADMINS))) { goto done; @@ -1324,7 +1324,7 @@ WERROR _srvsvc_NetSessDel(struct pipes_struct *p, NTSTATUS ntstat; - if (p->server_info->utok.uid != sec_initial_uid()) { + if (p->session_info->utok.uid != sec_initial_uid()) { not_root = True; become_root(); } @@ -1579,15 +1579,15 @@ WERROR _srvsvc_NetShareSetInfo(struct pipes_struct *p, if (lp_print_ok(snum)) return WERR_ACCESS_DENIED; - is_disk_op = security_token_has_privilege(p->server_info->security_token, SEC_PRIV_DISK_OPERATOR); + is_disk_op = security_token_has_privilege(p->session_info->security_token, SEC_PRIV_DISK_OPERATOR); /* fail out now if you are not root and not a disk op */ - if ( p->server_info->utok.uid != sec_initial_uid() && !is_disk_op ) { + if ( p->session_info->utok.uid != sec_initial_uid() && !is_disk_op ) { DEBUG(2,("_srvsvc_NetShareSetInfo: uid %u doesn't have the " "SeDiskOperatorPrivilege privilege needed to modify " "share %s\n", - (unsigned int)p->server_info->utok.uid, + (unsigned int)p->session_info->utok.uid, share_name )); return WERR_ACCESS_DENIED; } @@ -1782,9 +1782,9 @@ WERROR _srvsvc_NetShareAdd(struct pipes_struct *p, *r->out.parm_error = 0; } - is_disk_op = security_token_has_privilege(p->server_info->security_token, SEC_PRIV_DISK_OPERATOR); + is_disk_op = security_token_has_privilege(p->session_info->security_token, SEC_PRIV_DISK_OPERATOR); - if (p->server_info->utok.uid != sec_initial_uid() && !is_disk_op ) + if (p->session_info->utok.uid != sec_initial_uid() && !is_disk_op ) return WERR_ACCESS_DENIED; if (!lp_add_share_cmd() || !*lp_add_share_cmd()) { @@ -1988,9 +1988,9 @@ WERROR _srvsvc_NetShareDel(struct pipes_struct *p, if (lp_print_ok(snum)) return WERR_ACCESS_DENIED; - is_disk_op = security_token_has_privilege(p->server_info->security_token, SEC_PRIV_DISK_OPERATOR); + is_disk_op = security_token_has_privilege(p->session_info->security_token, SEC_PRIV_DISK_OPERATOR); - if (p->server_info->utok.uid != sec_initial_uid() && !is_disk_op ) + if (p->session_info->utok.uid != sec_initial_uid() && !is_disk_op ) return WERR_ACCESS_DENIED; if (!lp_delete_share_cmd() || !*lp_delete_share_cmd()) { @@ -2141,7 +2141,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p, } nt_status = create_conn_struct(talloc_tos(), &conn, snum, - lp_pathname(snum), p->server_info, + lp_pathname(snum), p->session_info, &oldcwd); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(10, ("create_conn_struct failed: %s\n", @@ -2280,7 +2280,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p, } nt_status = create_conn_struct(talloc_tos(), &conn, snum, - lp_pathname(snum), p->server_info, + lp_pathname(snum), p->session_info, &oldcwd); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(10, ("create_conn_struct failed: %s\n", @@ -2554,9 +2554,9 @@ WERROR _srvsvc_NetFileClose(struct pipes_struct *p, DEBUG(5,("_srvsvc_NetFileClose: %d\n", __LINE__)); - is_disk_op = security_token_has_privilege(p->server_info->security_token, SEC_PRIV_DISK_OPERATOR); + is_disk_op = security_token_has_privilege(p->session_info->security_token, SEC_PRIV_DISK_OPERATOR); - if (p->server_info->utok.uid != sec_initial_uid() && !is_disk_op) { + if (p->session_info->utok.uid != sec_initial_uid() && !is_disk_op) { return WERR_ACCESS_DENIED; } diff --git a/source3/rpc_server/svcctl/srv_svcctl_nt.c b/source3/rpc_server/svcctl/srv_svcctl_nt.c index a7af089e7e..e8890e062b 100644 --- a/source3/rpc_server/svcctl/srv_svcctl_nt.c +++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c @@ -278,7 +278,7 @@ WERROR _svcctl_OpenSCManagerW(struct pipes_struct *p, return WERR_NOMEM; se_map_generic( &r->in.access_mask, &scm_generic_map ); - status = svcctl_access_check( sec_desc, p->server_info->security_token, + status = svcctl_access_check( sec_desc, p->session_info->security_token, r->in.access_mask, &access_granted ); if ( !NT_STATUS_IS_OK(status) ) return ntstatus_to_werror( status ); @@ -310,12 +310,12 @@ WERROR _svcctl_OpenServiceW(struct pipes_struct *p, return WERR_BADFID; /* - * Perform access checks. Use the system server_info in order to ensure + * Perform access checks. Use the system session_info in order to ensure * that we retrieve the security descriptor */ sec_desc = svcctl_get_secdesc(p->mem_ctx, p->msg_ctx, - get_server_info_system(), + get_session_info_system(), service); if (sec_desc == NULL) { DEBUG(0, ("_svcctl_OpenServiceW: Failed to get a valid security " @@ -324,7 +324,7 @@ WERROR _svcctl_OpenServiceW(struct pipes_struct *p, } se_map_generic( &r->in.access_mask, &svc_generic_map ); - status = svcctl_access_check( sec_desc, p->server_info->security_token, + status = svcctl_access_check( sec_desc, p->session_info->security_token, r->in.access_mask, &access_granted ); if ( !NT_STATUS_IS_OK(status) ) return ntstatus_to_werror( status ); @@ -367,7 +367,7 @@ WERROR _svcctl_GetServiceDisplayNameW(struct pipes_struct *p, display_name = svcctl_lookup_dispname(p->mem_ctx, p->msg_ctx, - p->server_info, + p->session_info, service); if (!display_name) { display_name = ""; @@ -406,7 +406,7 @@ WERROR _svcctl_QueryServiceStatus(struct pipes_struct *p, static int enumerate_status(TALLOC_CTX *ctx, struct messaging_context *msg_ctx, - struct auth_serversupplied_info *server_info, + struct auth_serversupplied_info *session_info, struct ENUM_SERVICE_STATUSW **status) { int num_services = 0; @@ -428,7 +428,7 @@ static int enumerate_status(TALLOC_CTX *ctx, display_name = svcctl_lookup_dispname(ctx, msg_ctx, - server_info, + session_info, svcctl_ops[i].name); st[i].display_name = talloc_strdup(st, display_name ? display_name : ""); @@ -466,7 +466,7 @@ WERROR _svcctl_EnumServicesStatusW(struct pipes_struct *p, num_services = enumerate_status(p->mem_ctx, p->msg_ctx, - p->server_info, + p->session_info, &services); if (num_services == -1 ) { return WERR_NOMEM; @@ -667,7 +667,7 @@ WERROR _svcctl_QueryServiceStatusEx(struct pipes_struct *p, static WERROR fill_svc_config(TALLOC_CTX *ctx, struct messaging_context *msg_ctx, - struct auth_serversupplied_info *server_info, + struct auth_serversupplied_info *session_info, const char *name, struct QUERY_SERVICE_CONFIG *config) { @@ -678,12 +678,12 @@ static WERROR fill_svc_config(TALLOC_CTX *ctx, config->displayname = svcctl_lookup_dispname(mem_ctx, msg_ctx, - server_info, + session_info, name); result = svcctl_get_string_value(mem_ctx, msg_ctx, - server_info, + session_info, name, "ObjectName"); if (result != NULL) { @@ -692,7 +692,7 @@ static WERROR fill_svc_config(TALLOC_CTX *ctx, result = svcctl_get_string_value(mem_ctx, msg_ctx, - server_info, + session_info, name, "ImagePath"); if (result != NULL) { @@ -749,7 +749,7 @@ WERROR _svcctl_QueryServiceConfigW(struct pipes_struct *p, wresult = fill_svc_config(p->mem_ctx, p->msg_ctx, - p->server_info, + p->session_info, info->name, r->out.query); if ( !W_ERROR_IS_OK(wresult) ) @@ -798,7 +798,7 @@ WERROR _svcctl_QueryServiceConfig2W(struct pipes_struct *p, description = svcctl_lookup_description(p->mem_ctx, p->msg_ctx, - p->server_info, + p->session_info, info->name); desc_buf.description = description; @@ -921,7 +921,7 @@ WERROR _svcctl_QueryServiceObjectSecurity(struct pipes_struct *p, /* Lookup the security descriptor and marshall it up for a reply */ sec_desc = svcctl_get_secdesc(p->mem_ctx, p->msg_ctx, - get_server_info_system(), + get_session_info_system(), info->name); if (sec_desc == NULL) { return WERR_NOMEM; @@ -997,7 +997,7 @@ WERROR _svcctl_SetServiceObjectSecurity(struct pipes_struct *p, /* store the new SD */ - if (!svcctl_set_secdesc(p->msg_ctx, p->server_info, info->name, sec_desc)) + if (!svcctl_set_secdesc(p->msg_ctx, p->session_info, info->name, sec_desc)) return WERR_ACCESS_DENIED; return WERR_OK; diff --git a/source3/rpc_server/svcctl/srv_svcctl_reg.c b/source3/rpc_server/svcctl/srv_svcctl_reg.c index 84c5f434ee..f4876222fb 100644 --- a/source3/rpc_server/svcctl/srv_svcctl_reg.c +++ b/source3/rpc_server/svcctl/srv_svcctl_reg.c @@ -574,7 +574,7 @@ bool svcctl_init_winreg(struct messaging_context *msg_ctx) } status = dcerpc_winreg_int_hklm_openkey(tmp_ctx, - get_server_info_system(), + get_session_info_system(), msg_ctx, &h, key, diff --git a/source3/rpc_server/winreg/srv_winreg_nt.c b/source3/rpc_server/winreg/srv_winreg_nt.c index 379fe57c38..1b54d37f69 100644 --- a/source3/rpc_server/winreg/srv_winreg_nt.c +++ b/source3/rpc_server/winreg/srv_winreg_nt.c @@ -68,7 +68,7 @@ static WERROR open_registry_key(struct pipes_struct *p, if (parent == NULL) { result = reg_openhive(p->mem_ctx, subkeyname, access_desired, - p->server_info->security_token, &key); + p->session_info->security_token, &key); } else { result = reg_openkey(p->mem_ctx, parent, subkeyname, @@ -577,7 +577,7 @@ WERROR _winreg_InitiateSystemShutdownEx(struct pipes_struct *p, return WERR_NOMEM; } - can_shutdown = security_token_has_privilege(p->server_info->security_token, SEC_PRIV_REMOTE_SHUTDOWN); + can_shutdown = security_token_has_privilege(p->session_info->security_token, SEC_PRIV_REMOTE_SHUTDOWN); /* IF someone has privs, run the shutdown script as root. OTHERWISE run it as not root Take the error return from the script and provide it as the Windows return code. */ @@ -614,7 +614,7 @@ WERROR _winreg_AbortSystemShutdown(struct pipes_struct *p, if (!*abort_shutdown_script) return WERR_ACCESS_DENIED; - can_shutdown = security_token_has_privilege(p->server_info->security_token, SEC_PRIV_REMOTE_SHUTDOWN); + can_shutdown = security_token_has_privilege(p->session_info->security_token, SEC_PRIV_REMOTE_SHUTDOWN); /********** BEGIN SeRemoteShutdownPrivilege BLOCK **********/ @@ -704,7 +704,7 @@ WERROR _winreg_RestoreKey(struct pipes_struct *p, /* user must posses SeRestorePrivilege for this this proceed */ - if ( !security_token_has_privilege(p->server_info->security_token, SEC_PRIV_RESTORE)) { + if ( !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_RESTORE)) { return WERR_ACCESS_DENIED; } diff --git a/source3/rpc_server/wkssvc/srv_wkssvc_nt.c b/source3/rpc_server/wkssvc/srv_wkssvc_nt.c index 4cbf70c80f..205f7601e1 100644 --- a/source3/rpc_server/wkssvc/srv_wkssvc_nt.c +++ b/source3/rpc_server/wkssvc/srv_wkssvc_nt.c @@ -352,7 +352,7 @@ WERROR _wkssvc_NetWkstaGetInfo(struct pipes_struct *p, case 101: /* Level 101 can be allowed from any logged in user */ if (!nt_token_check_sid(&global_sid_Authenticated_Users, - p->server_info->security_token)) { + p->session_info->security_token)) { DEBUG(1,("User not allowed for NetWkstaGetInfo level " "101\n")); DEBUGADD(3,(" - does not have sid for Authenticated " @@ -360,7 +360,7 @@ WERROR _wkssvc_NetWkstaGetInfo(struct pipes_struct *p, sid_string_dbg( &global_sid_Authenticated_Users))); security_token_debug(DBGC_CLASS, 3, - p->server_info->security_token); + p->session_info->security_token); return WERR_ACCESS_DENIED; } r->out.info->info101 = create_wks_info_101(p->mem_ctx); @@ -371,14 +371,14 @@ WERROR _wkssvc_NetWkstaGetInfo(struct pipes_struct *p, case 102: /* Level 102 Should only be allowed from a domain administrator */ if (!nt_token_check_sid(&global_sid_Builtin_Administrators, - p->server_info->security_token)) { + p->session_info->security_token)) { DEBUG(1,("User not allowed for NetWkstaGetInfo level " "102\n")); DEBUGADD(3,(" - does not have sid for Administrators " "group %s, sids are:\n", sid_string_dbg(&global_sid_Builtin_Administrators))); security_token_debug(DBGC_CLASS, 3, - p->server_info->security_token); + p->session_info->security_token); return WERR_ACCESS_DENIED; } r->out.info->info102 = create_wks_info_102(p->mem_ctx); @@ -557,12 +557,12 @@ WERROR _wkssvc_NetWkstaEnumUsers(struct pipes_struct *p, { /* This with any level should only be allowed from a domain administrator */ if (!nt_token_check_sid(&global_sid_Builtin_Administrators, - p->server_info->security_token)) { + p->session_info->security_token)) { DEBUG(1,("User not allowed for NetWkstaEnumUsers\n")); DEBUGADD(3,(" - does not have sid for Administrators group " "%s\n", sid_string_dbg( &global_sid_Builtin_Administrators))); - security_token_debug(DBGC_CLASS, 3, p->server_info->security_token); + security_token_debug(DBGC_CLASS, 3, p->session_info->security_token); return WERR_ACCESS_DENIED; } @@ -813,7 +813,7 @@ WERROR _wkssvc_NetrJoinDomain2(struct pipes_struct *p, char *admin_domain = NULL; char *admin_account = NULL; WERROR werr; - struct security_token *token = p->server_info->security_token; + struct security_token *token = p->session_info->security_token; if (!r->in.domain_name) { return WERR_INVALID_PARAM; @@ -838,7 +838,7 @@ WERROR _wkssvc_NetrJoinDomain2(struct pipes_struct *p, werr = decode_wkssvc_join_password_buffer( p->mem_ctx, r->in.encrypted_password, - &p->server_info->user_session_key, &cleartext_pwd); + &p->session_info->user_session_key, &cleartext_pwd); if (!W_ERROR_IS_OK(werr)) { return werr; } @@ -888,7 +888,7 @@ WERROR _wkssvc_NetrUnjoinDomain2(struct pipes_struct *p, char *admin_domain = NULL; char *admin_account = NULL; WERROR werr; - struct security_token *token = p->server_info->security_token; + struct security_token *token = p->session_info->security_token; if (!r->in.account || !r->in.encrypted_password) { return WERR_INVALID_PARAM; @@ -904,7 +904,7 @@ WERROR _wkssvc_NetrUnjoinDomain2(struct pipes_struct *p, werr = decode_wkssvc_join_password_buffer( p->mem_ctx, r->in.encrypted_password, - &p->server_info->user_session_key, &cleartext_pwd); + &p->session_info->user_session_key, &cleartext_pwd); if (!W_ERROR_IS_OK(werr)) { return werr; } diff --git a/source3/services/svc_winreg_glue.c b/source3/services/svc_winreg_glue.c index 2b35556caf..65f0388167 100644 --- a/source3/services/svc_winreg_glue.c +++ b/source3/services/svc_winreg_glue.c @@ -77,7 +77,7 @@ struct security_descriptor* svcctl_gen_service_sd(TALLOC_CTX *mem_ctx) struct security_descriptor *svcctl_get_secdesc(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *name) { struct dcerpc_binding_handle *h = NULL; @@ -96,7 +96,7 @@ struct security_descriptor *svcctl_get_secdesc(TALLOC_CTX *mem_ctx, } status = dcerpc_winreg_int_hklm_openkey(mem_ctx, - server_info, + session_info, msg_ctx, &h, key, @@ -147,7 +147,7 @@ done: } bool svcctl_set_secdesc(struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *name, struct security_descriptor *sd) { @@ -171,7 +171,7 @@ bool svcctl_set_secdesc(struct messaging_context *msg_ctx, } status = dcerpc_winreg_int_hklm_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &h, key, @@ -258,7 +258,7 @@ done: const char *svcctl_get_string_value(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *key_name, const char *value_name) { @@ -283,7 +283,7 @@ const char *svcctl_get_string_value(TALLOC_CTX *mem_ctx, } status = dcerpc_winreg_int_hklm_openkey(tmp_ctx, - server_info, + session_info, msg_ctx, &h, path, @@ -320,14 +320,14 @@ done: const char *svcctl_lookup_dispname(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *name) { const char *display_name = NULL; display_name = svcctl_get_string_value(mem_ctx, msg_ctx, - server_info, + session_info, name, "DisplayName"); @@ -343,14 +343,14 @@ const char *svcctl_lookup_dispname(TALLOC_CTX *mem_ctx, const char *svcctl_lookup_description(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *name) { const char *description = NULL; description = svcctl_get_string_value(mem_ctx, msg_ctx, - server_info, + session_info, name, "Description"); diff --git a/source3/services/svc_winreg_glue.h b/source3/services/svc_winreg_glue.h index f2f036e725..a4a1628cd3 100644 --- a/source3/services/svc_winreg_glue.h +++ b/source3/services/svc_winreg_glue.h @@ -28,28 +28,28 @@ struct security_descriptor* svcctl_gen_service_sd(TALLOC_CTX *mem_ctx); struct security_descriptor *svcctl_get_secdesc(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *name); bool svcctl_set_secdesc(struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *name, struct security_descriptor *sd); const char *svcctl_get_string_value(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *key_name, const char *value_name); const char *svcctl_lookup_dispname(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *name); const char *svcctl_lookup_description(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, const char *name); #endif /* SVC_WINREG_GLUE_H */ diff --git a/source3/smbd/close.c b/source3/smbd/close.c index d5a824f868..0efa36f9a9 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -674,7 +674,7 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp, status = ntstatus_keeperror(status, tmp); DEBUG(2,("%s closed file %s (numopen=%d) %s\n", - conn->server_info->unix_name, fsp_str_dbg(fsp), + conn->session_info->unix_name, fsp_str_dbg(fsp), conn->num_files_open - 1, nt_errstr(status) )); diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c index 9653723e13..cfbc80ef9f 100644 --- a/source3/smbd/connection.c +++ b/source3/smbd/connection.c @@ -141,8 +141,8 @@ bool claim_connection(connection_struct *conn, const char *name) crec.magic = 0x280267; crec.pid = sconn_server_id(conn->sconn); crec.cnum = conn->cnum; - crec.uid = conn->server_info->utok.uid; - crec.gid = conn->server_info->utok.gid; + crec.uid = conn->session_info->utok.uid; + crec.gid = conn->session_info->utok.gid; strlcpy(crec.servicename, lp_servicename(SNUM(conn)), sizeof(crec.servicename)); crec.start = time(NULL); diff --git a/source3/smbd/fake_file.c b/source3/smbd/fake_file.c index d844261efb..0c796faf45 100644 --- a/source3/smbd/fake_file.c +++ b/source3/smbd/fake_file.c @@ -132,7 +132,7 @@ NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn, "service[%s] file[%s] user[%s]\n", lp_servicename(SNUM(conn)), smb_fname_str_dbg(smb_fname), - conn->server_info->unix_name)); + conn->session_info->unix_name)); return NT_STATUS_ACCESS_DENIED; } diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 7771049bde..c326846825 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -417,7 +417,7 @@ struct smbd_smb2_session { NTSTATUS status; uint64_t vuid; struct auth_ntlmssp_state *auth_ntlmssp_state; - struct auth_serversupplied_info *server_info; + struct auth_serversupplied_info *session_info; DATA_BLOB session_key; bool do_signing; diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index 491808ad57..259da3dc46 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -114,11 +114,11 @@ static int CopyExpanded(connection_struct *conn, } buf = talloc_sub_advanced(ctx, lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, buf); if (!buf) { *p_space_remaining = 0; @@ -165,11 +165,11 @@ static int StrlenExpanded(connection_struct *conn, int snum, char *s) } buf = talloc_sub_advanced(ctx, lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, buf); if (!buf) { return 0; @@ -830,7 +830,7 @@ static bool api_DosPrintQGetInfo(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -1027,7 +1027,7 @@ static bool api_DosPrintQEnum(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -1184,7 +1184,7 @@ static bool api_DosPrintQEnum(struct smbd_server_connection *sconn, Get info level for a server list query. ****************************************************************************/ -static bool check_server_info(int uLevel, char* id) +static bool check_session_info(int uLevel, char* id) { switch( uLevel ) { case 0: @@ -1216,7 +1216,7 @@ struct srv_info_struct { number of entries. ******************************************************************/ -static int get_server_info(uint32 servertype, +static int get_session_info(uint32 servertype, struct srv_info_struct **servers, const char *domain) { @@ -1257,7 +1257,7 @@ static int get_server_info(uint32 servertype, alloced += 10; *servers = SMB_REALLOC_ARRAY(*servers,struct srv_info_struct, alloced); if (!*servers) { - DEBUG(0,("get_server_info: failed to enlarge servers info struct!\n")); + DEBUG(0,("get_session_info: failed to enlarge servers info struct!\n")); TALLOC_FREE(lines); return 0; } @@ -1487,7 +1487,7 @@ static bool api_RNetServerEnum2(struct smbd_server_connection *sconn, if (!prefix_ok(str1,"WrLehD")) { return False; } - if (!check_server_info(uLevel,str2)) { + if (!check_session_info(uLevel,str2)) { return False; } @@ -1507,7 +1507,7 @@ static bool api_RNetServerEnum2(struct smbd_server_connection *sconn, DEBUG(4, ("domain [%s]\n", domain)); if (lp_browse_list()) { - total = get_server_info(servertype,&servers,domain); + total = get_session_info(servertype,&servers,domain); } data_len = fixed_len = string_len = 0; @@ -1658,7 +1658,7 @@ static bool api_RNetServerEnum3(struct smbd_server_connection *sconn, if (strcmp(str1, "WrLehDzz") != 0) { return false; } - if (!check_server_info(uLevel,str2)) { + if (!check_session_info(uLevel,str2)) { return False; } @@ -1683,7 +1683,7 @@ static bool api_RNetServerEnum3(struct smbd_server_connection *sconn, domain, first_name)); if (lp_browse_list()) { - total = get_server_info(servertype,&servers,domain); + total = get_session_info(servertype,&servers,domain); } data_len = fixed_len = string_len = 0; @@ -2254,7 +2254,7 @@ static bool api_RNetShareAdd(struct smbd_server_connection *sconn, } status = rpc_pipe_open_internal(mem_ctx, &ndr_table_srvsvc.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -2366,7 +2366,7 @@ static bool api_RNetGroupEnum(struct smbd_server_connection *sconn, status = rpc_pipe_open_internal( talloc_tos(), &ndr_table_samr.syntax_id, - conn->server_info, &conn->sconn->client_id, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &samr_pipe); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("api_RNetUserEnum: Could not connect to samr: %s\n", @@ -2572,7 +2572,7 @@ static bool api_NetUserGetGroups(struct smbd_server_connection *sconn, status = rpc_pipe_open_internal( talloc_tos(), &ndr_table_samr.syntax_id, - conn->server_info, &conn->sconn->client_id, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &samr_pipe); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("api_RNetUserEnum: Could not connect to samr: %s\n", @@ -2764,7 +2764,7 @@ static bool api_RNetUserEnum(struct smbd_server_connection *sconn, status = rpc_pipe_open_internal( talloc_tos(), &ndr_table_samr.syntax_id, - conn->server_info, &conn->sconn->client_id, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &samr_pipe); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("api_RNetUserEnum: Could not connect to samr: %s\n", @@ -3029,7 +3029,7 @@ static bool api_SetUserPassword(struct smbd_server_connection *sconn, ZERO_STRUCT(user_handle); status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -3280,7 +3280,7 @@ static bool api_SamOEMChangePassword(struct smbd_server_connection *sconn, memcpy(hash.hash, data+516, 16); status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -3377,7 +3377,7 @@ static bool api_RDosPrintJobDel(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -3505,7 +3505,7 @@ static bool api_WPrintQueueCtrl(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -3687,7 +3687,7 @@ static bool api_PrintJobInfo(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -3864,7 +3864,7 @@ static bool api_RNetServerGetInfo(struct smbd_server_connection *sconn, p2 = p + struct_len; status = rpc_pipe_open_internal(mem_ctx, &ndr_table_srvsvc.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -4010,7 +4010,7 @@ static bool api_NetWkstaGetInfo(struct smbd_server_connection *sconn, p += 4; SIVAL(p,0,PTR_DIFF(p2,*rdata)); - strlcpy(p2,conn->server_info->sanitized_username,PTR_DIFF(endp,p2)); + strlcpy(p2,conn->session_info->sanitized_username,PTR_DIFF(endp,p2)); p2 = skip_string(*rdata,*rdata_len,p2); if (!p2) { return False; @@ -4291,7 +4291,7 @@ static bool api_RNetUserGetInfo(struct smbd_server_connection *sconn, ZERO_STRUCT(user_handle); status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -4634,8 +4634,8 @@ static bool api_WWkstaUserLogon(struct smbd_server_connection *sconn, if(vuser != NULL) { DEBUG(3,(" Username of UID %d is %s\n", - (int)vuser->server_info->utok.uid, - vuser->server_info->unix_name)); + (int)vuser->session_info->utok.uid, + vuser->session_info->unix_name)); } uLevel = get_safe_SVAL(param,tpscnt,p,0,-1); @@ -4695,7 +4695,7 @@ static bool api_WWkstaUserLogon(struct smbd_server_connection *sconn, PACKS(&desc,"z",lp_workgroup());/* domain */ PACKS(&desc,"z", vuser ? - vuser->server_info->info3->base.logon_script.string + vuser->session_info->info3->base.logon_script.string : ""); /* script path */ PACKI(&desc,"D",0x00000000); /* reserved */ } @@ -4818,7 +4818,7 @@ static bool api_WPrintJobGetInfo(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -4960,7 +4960,7 @@ static bool api_WPrintJobEnumerate(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -5160,7 +5160,7 @@ static bool api_WPrintDestGetInfo(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -5292,7 +5292,7 @@ static bool api_WPrintDestEnum(struct smbd_server_connection *sconn, status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -5803,7 +5803,7 @@ void api_reply(connection_struct *conn, uint16 vuid, if (api_commands[i].auth_user && lp_restrict_anonymous()) { user_struct *user = get_valid_user_struct(req->sconn, vuid); - if (!user || user->server_info->guest) { + if (!user || user->session_info->guest) { reply_nterror(req, NT_STATUS_ACCESS_DENIED); return; } diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 165e802a82..07b0933031 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -219,7 +219,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx, connection_struct **pconn, int snum, const char *path, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, char **poldcwd) { connection_struct *conn; @@ -258,9 +258,9 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx, conn->sconn = smbd_server_conn; conn->sconn->num_tcons_open++; - if (server_info != NULL) { - conn->server_info = copy_serverinfo(conn, server_info); - if (conn->server_info == NULL) { + if (session_info != NULL) { + conn->session_info = copy_serverinfo(conn, session_info); + if (conn->session_info == NULL) { DEBUG(0, ("copy_serverinfo failed\n")); TALLOC_FREE(conn); return NT_STATUS_NO_MEMORY; @@ -726,7 +726,7 @@ static NTSTATUS dfs_redirect(TALLOC_CTX *ctx, if (!( strequal(pdp->servicename, lp_servicename(SNUM(conn))) || (strequal(pdp->servicename, HOMES_NAME) && strequal(lp_servicename(SNUM(conn)), - conn->server_info->sanitized_username) )) ) { + conn->session_info->sanitized_username) )) ) { /* The given sharename doesn't match this connection. */ TALLOC_FREE(pdp); diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index b63f37f0fd..afc4f54cf2 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -2507,10 +2507,10 @@ static void call_nt_transact_get_user_quota(connection_struct *conn, ZERO_STRUCT(qt); /* access check */ - if (conn->server_info->utok.uid != 0) { + if (conn->session_info->utok.uid != 0) { DEBUG(1,("get_user_quota: access_denied service [%s] user " "[%s]\n", lp_servicename(SNUM(conn)), - conn->server_info->unix_name)); + conn->session_info->unix_name)); reply_nterror(req, NT_STATUS_ACCESS_DENIED); return; } @@ -2777,10 +2777,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn, ZERO_STRUCT(qt); /* access check */ - if (conn->server_info->utok.uid != 0) { + if (conn->session_info->utok.uid != 0) { DEBUG(1,("set_user_quota: access_denied service [%s] user " "[%s]\n", lp_servicename(SNUM(conn)), - conn->server_info->unix_name)); + conn->session_info->unix_name)); reply_nterror(req, NT_STATUS_ACCESS_DENIED); return; } diff --git a/source3/smbd/open.c b/source3/smbd/open.c index b6a75bb16f..2c7764ab14 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -619,7 +619,7 @@ static NTSTATUS open_file(files_struct *fsp, fsp->wcp = NULL; /* Write cache pointer. */ DEBUG(2,("%s opened file %s read=%s write=%s (numopen=%d)\n", - conn->server_info->unix_name, + conn->session_info->unix_name, smb_fname_str_dbg(smb_fname), BOOLSTR(fsp->can_read), BOOLSTR(fsp->can_write), conn->num_files_open)); diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 9c343badd2..15277d04b4 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -53,12 +53,12 @@ static user_struct *get_valid_user_struct_internal( if (vuid == usp->vuid) { switch (server_allocated) { case SERVER_ALLOCATED_REQUIRED_YES: - if (usp->server_info == NULL) { + if (usp->session_info == NULL) { continue; } break; case SERVER_ALLOCATED_REQUIRED_NO: - if (usp->server_info != NULL) { + if (usp->session_info != NULL) { continue; } case SERVER_ALLOCATED_REQUIRED_ANY: @@ -242,7 +242,7 @@ int register_homes_share(const char *username) /** * register that a valid login has been performed, establish 'session'. - * @param server_info The token returned from the authentication process. + * @param session_info The token returned from the authentication process. * (now 'owned' by register_existing_vuid) * * @param session_key The User session key for the login session (now also @@ -260,7 +260,7 @@ int register_homes_share(const char *username) int register_existing_vuid(struct smbd_server_connection *sconn, uint16 vuid, - struct auth_serversupplied_info *server_info, + struct auth_serversupplied_info *session_info, DATA_BLOB response_blob, const char *smb_name) { @@ -273,35 +273,35 @@ int register_existing_vuid(struct smbd_server_connection *sconn, } /* Use this to keep tabs on all our info from the authentication */ - vuser->server_info = talloc_move(vuser, &server_info); + vuser->session_info = talloc_move(vuser, &session_info); /* This is a potentially untrusted username */ alpha_strcpy(tmp, smb_name, ". _-$", sizeof(tmp)); - vuser->server_info->sanitized_username = talloc_strdup( - vuser->server_info, tmp); + vuser->session_info->sanitized_username = talloc_strdup( + vuser->session_info, tmp); DEBUG(10,("register_existing_vuid: (%u,%u) %s %s %s guest=%d\n", - (unsigned int)vuser->server_info->utok.uid, - (unsigned int)vuser->server_info->utok.gid, - vuser->server_info->unix_name, - vuser->server_info->sanitized_username, - vuser->server_info->info3->base.domain.string, - vuser->server_info->guest )); + (unsigned int)vuser->session_info->utok.uid, + (unsigned int)vuser->session_info->utok.gid, + vuser->session_info->unix_name, + vuser->session_info->sanitized_username, + vuser->session_info->info3->base.domain.string, + vuser->session_info->guest )); DEBUG(3, ("register_existing_vuid: User name: %s\t" - "Real name: %s\n", vuser->server_info->unix_name, - vuser->server_info->info3->base.full_name.string)); + "Real name: %s\n", vuser->session_info->unix_name, + vuser->session_info->info3->base.full_name.string)); - if (!vuser->server_info->security_token) { - DEBUG(1, ("register_existing_vuid: server_info does not " + if (!vuser->session_info->security_token) { + DEBUG(1, ("register_existing_vuid: session_info does not " "contain a user_token - cannot continue\n")); goto fail; } DEBUG(3,("register_existing_vuid: UNIX uid %d is UNIX user %s, " - "and will be vuid %u\n", (int)vuser->server_info->utok.uid, - vuser->server_info->unix_name, vuser->vuid)); + "and will be vuid %u\n", (int)vuser->session_info->utok.uid, + vuser->session_info->unix_name, vuser->vuid)); if (!session_claim(sconn, vuser)) { DEBUG(1, ("register_existing_vuid: Failed to claim session " @@ -318,25 +318,25 @@ int register_existing_vuid(struct smbd_server_connection *sconn, vuser->homes_snum = -1; - if (!vuser->server_info->guest) { + if (!vuser->session_info->guest) { vuser->homes_snum = register_homes_share( - vuser->server_info->unix_name); + vuser->session_info->unix_name); } if (srv_is_signing_negotiated(sconn) && - !vuser->server_info->guest) { + !vuser->session_info->guest) { /* Try and turn on server signing on the first non-guest * sessionsetup. */ srv_set_signing(sconn, - vuser->server_info->user_session_key, + vuser->session_info->user_session_key, response_blob); } /* fill in the current_user_info struct */ set_current_user_info( - vuser->server_info->sanitized_username, - vuser->server_info->unix_name, - vuser->server_info->info3->base.domain.string); + vuser->session_info->sanitized_username, + vuser->session_info->unix_name, + vuser->session_info->info3->base.domain.string); return vuser->vuid; diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c index 9f31abe569..73398abcd8 100644 --- a/source3/smbd/pipes.c +++ b/source3/smbd/pipes.c @@ -71,7 +71,7 @@ NTSTATUS open_np_file(struct smb_request *smb_req, const char *name, conn->sconn->local_address, conn->sconn->remote_address, &conn->sconn->client_id, - conn->server_info, + conn->session_info, conn->sconn->msg_ctx, &fsp->fake_file_handle); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 20569d858c..6ba41a3b8d 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1477,9 +1477,9 @@ static connection_struct *switch_message(uint8 type, struct smb_request *req, in vuser = get_valid_user_struct(sconn, session_tag); if (vuser) { set_current_user_info( - vuser->server_info->sanitized_username, - vuser->server_info->unix_name, - vuser->server_info->info3->base.domain.string); + vuser->session_info->sanitized_username, + vuser->session_info->unix_name, + vuser->session_info->info3->base.domain.string); } } } diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index dea265f679..561281f9ed 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2531,7 +2531,7 @@ static NTSTATUS do_unlink(connection_struct *conn, } /* The set is across all open files on this dev/inode pair. */ - if (!set_delete_on_close(fsp, True, &conn->server_info->utok)) { + if (!set_delete_on_close(fsp, True, &conn->session_info->utok)) { close_file(req, fsp, NORMAL_CLOSE); return NT_STATUS_ACCESS_DENIED; } @@ -5333,7 +5333,7 @@ void reply_printqueue(struct smb_request *req) status = rpc_pipe_open_interface(conn, &ndr_table_spoolss.syntax_id, - conn->server_info, + conn->session_info, &conn->sconn->client_id, conn->sconn->msg_ctx, &cli); @@ -5649,7 +5649,7 @@ void reply_rmdir(struct smb_request *req) goto out; } - if (!set_delete_on_close(fsp, true, &conn->server_info->utok)) { + if (!set_delete_on_close(fsp, true, &conn->session_info->utok)) { close_file(req, fsp, ERROR_CLOSE); reply_nterror(req, NT_STATUS_ACCESS_DENIED); goto out; diff --git a/source3/smbd/server_reload.c b/source3/smbd/server_reload.c index bdca29d0bf..f60130bd11 100644 --- a/source3/smbd/server_reload.c +++ b/source3/smbd/server_reload.c @@ -33,7 +33,7 @@ void reload_printers(struct tevent_context *ev, struct messaging_context *msg_ctx) { - struct auth_serversupplied_info *server_info = NULL; + struct auth_serversupplied_info *session_info = NULL; struct spoolss_PrinterInfo2 *pinfo2 = NULL; int snum; int n_services = lp_numservices(); @@ -45,10 +45,10 @@ void reload_printers(struct tevent_context *ev, SMB_ASSERT(pcap_cache_loaded()); DEBUG(10, ("reloading printer services from pcap cache\n")); - status = make_server_info_system(talloc_tos(), &server_info); + status = make_session_info_system(talloc_tos(), &session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(3, ("reload_printers: " - "Could not create system server_info\n")); + "Could not create system session_info\n")); /* can't remove stale printers before we * are fully initilized */ skip = true; @@ -65,18 +65,18 @@ void reload_printers(struct tevent_context *ev, if (!pcap_printername_ok(pname)) { DEBUG(3, ("removing stale printer %s\n", pname)); - if (is_printer_published(server_info, server_info, + if (is_printer_published(session_info, session_info, msg_ctx, NULL, lp_servicename(snum), NULL, &pinfo2)) { - nt_printer_publish(server_info, - server_info, + nt_printer_publish(session_info, + session_info, msg_ctx, pinfo2, DSPRINT_UNPUBLISH); TALLOC_FREE(pinfo2); } - nt_printer_remove(server_info, server_info, msg_ctx, + nt_printer_remove(session_info, session_info, msg_ctx, pname); lp_killservice(snum); } @@ -84,7 +84,7 @@ void reload_printers(struct tevent_context *ev, load_printers(ev, msg_ctx); - TALLOC_FREE(server_info); + TALLOC_FREE(session_info); } /**************************************************************************** diff --git a/source3/smbd/service.c b/source3/smbd/service.c index dfe2c2141f..41e31dc0d1 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -585,7 +585,7 @@ static NTSTATUS find_forced_group(bool force_user, Create an auth_serversupplied_info structure for a connection_struct ****************************************************************************/ -static NTSTATUS create_connection_server_info(struct smbd_server_connection *sconn, +static NTSTATUS create_connection_session_info(struct smbd_server_connection *sconn, TALLOC_CTX *mem_ctx, int snum, struct auth_serversupplied_info *vuid_serverinfo, DATA_BLOB password, @@ -696,12 +696,12 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, conn->params->service = snum; - status = create_connection_server_info(sconn, - conn, snum, vuser ? vuser->server_info : NULL, password, - &conn->server_info); + status = create_connection_session_info(sconn, + conn, snum, vuser ? vuser->session_info : NULL, password, + &conn->session_info); if (!NT_STATUS_IS_OK(status)) { - DEBUG(1, ("create_connection_server_info failed: %s\n", + DEBUG(1, ("create_connection_session_info failed: %s\n", nt_errstr(status))); *pstatus = status; goto err_root_exit; @@ -711,7 +711,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, conn->force_user = true; } - add_session_user(sconn, conn->server_info->unix_name); + add_session_user(sconn, conn->session_info->unix_name); conn->num_files_open = 0; conn->lastused = conn->lastused_count = time(NULL); @@ -744,7 +744,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, if (*lp_force_user(snum)) { /* - * Replace conn->server_info with a completely faked up one + * Replace conn->session_info with a completely faked up one * from the username we are forced into :-) */ @@ -759,15 +759,15 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, } status = make_serverinfo_from_username( - conn, fuser, conn->server_info->guest, + conn, fuser, conn->session_info->guest, &forced_serverinfo); if (!NT_STATUS_IS_OK(status)) { *pstatus = status; goto err_root_exit; } - TALLOC_FREE(conn->server_info); - conn->server_info = forced_serverinfo; + TALLOC_FREE(conn->session_info); + conn->session_info = forced_serverinfo; conn->force_user = True; DEBUG(3,("Forced user %s\n", fuser)); @@ -781,9 +781,9 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, if (*lp_force_group(snum)) { status = find_forced_group( - conn->force_user, snum, conn->server_info->unix_name, - &conn->server_info->security_token->sids[1], - &conn->server_info->utok.gid); + conn->force_user, snum, conn->session_info->unix_name, + &conn->session_info->security_token->sids[1], + &conn->session_info->utok.gid); if (!NT_STATUS_IS_OK(status)) { *pstatus = status; @@ -792,11 +792,11 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, /* * We need to cache this gid, to use within - * change_to_user() separately from the conn->server_info - * struct. We only use conn->server_info directly if + * change_to_user() separately from the conn->session_info + * struct. We only use conn->session_info directly if * "force_user" was set. */ - conn->force_group_gid = conn->server_info->utok.gid; + conn->force_group_gid = conn->session_info->utok.gid; } conn->vuid = (vuser != NULL) ? vuser->vuid : UID_FIELD_INVALID; @@ -804,11 +804,11 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, { char *s = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, lp_pathname(snum)); if (!s) { *pstatus = NT_STATUS_NO_MEMORY; @@ -835,12 +835,12 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, { bool can_write = False; - can_write = share_access_check(conn->server_info->security_token, + can_write = share_access_check(conn->session_info->security_token, lp_servicename(snum), FILE_WRITE_DATA); if (!can_write) { - if (!share_access_check(conn->server_info->security_token, + if (!share_access_check(conn->session_info->security_token, lp_servicename(snum), FILE_READ_DATA)) { /* No access, read or write. */ @@ -897,7 +897,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, filesystem operation that we do. */ if (SMB_VFS_CONNECT(conn, lp_servicename(snum), - conn->server_info->unix_name) < 0) { + conn->session_info->unix_name) < 0) { DEBUG(0,("make_connection: VFS make connection failed!\n")); *pstatus = NT_STATUS_UNSUCCESSFUL; goto err_root_exit; @@ -932,11 +932,11 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, if (*lp_rootpreexec(snum)) { char *cmd = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, lp_rootpreexec(snum)); DEBUG(5,("cmd=%s\n",cmd)); ret = smbrun(cmd,NULL); @@ -970,11 +970,11 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, if (*lp_preexec(snum)) { char *cmd = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, lp_preexec(snum)); ret = smbrun(cmd,NULL); TALLOC_FREE(cmd); @@ -1077,7 +1077,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, dbgtext( "%s", srv_is_signing_active(sconn) ? "signed " : ""); dbgtext( "connect to service %s ", lp_servicename(snum) ); dbgtext( "initially as user %s ", - conn->server_info->unix_name ); + conn->session_info->unix_name ); dbgtext( "(uid=%d, gid=%d) ", (int)effuid, (int)effgid ); dbgtext( "(pid %d)\n", (int)sys_getpid() ); } @@ -1288,11 +1288,11 @@ void close_cnum(connection_struct *conn, uint16 vuid) change_to_user(conn, vuid)) { char *cmd = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, lp_postexec(SNUM(conn))); smbrun(cmd,NULL); TALLOC_FREE(cmd); @@ -1304,11 +1304,11 @@ void close_cnum(connection_struct *conn, uint16 vuid) if (*lp_rootpostexec(SNUM(conn))) { char *cmd = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), - conn->server_info->unix_name, + conn->session_info->unix_name, conn->connectpath, - conn->server_info->utok.gid, - conn->server_info->sanitized_username, - conn->server_info->info3->base.domain.string, + conn->session_info->utok.gid, + conn->session_info->sanitized_username, + conn->session_info->info3->base.domain.string, lp_rootpostexec(SNUM(conn))); smbrun(cmd,NULL); TALLOC_FREE(cmd); diff --git a/source3/smbd/session.c b/source3/smbd/session.c index 185ba800be..93cfba3b05 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -48,7 +48,7 @@ bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser) /* don't register sessions for the guest user - its just too expensive to go through pam session code for browsing etc */ - if (vuser->server_info->guest) { + if (vuser->session_info->guest) { return True; } @@ -131,12 +131,12 @@ bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser) client_name() handles this case internally. */ - fstrcpy(sessionid.username, vuser->server_info->unix_name); + fstrcpy(sessionid.username, vuser->session_info->unix_name); fstrcpy(sessionid.hostname, sconn->client_id.name); sessionid.id_num = i; /* Only valid for utmp sessions */ sessionid.pid = pid; - sessionid.uid = vuser->server_info->utok.uid; - sessionid.gid = vuser->server_info->utok.gid; + sessionid.uid = vuser->session_info->utok.uid; + sessionid.gid = vuser->session_info->utok.gid; fstrcpy(sessionid.remote_machine, get_remote_machine_name()); fstrcpy(sessionid.ip_addr_str, sconn->client_id.addr); sessionid.connect_start = time(NULL); diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 5a1776e698..d9333502b8 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -474,19 +474,19 @@ static void reply_spnego_ntlmssp(struct smb_request *req, { bool do_invalidate = true; DATA_BLOB response; - struct auth_serversupplied_info *server_info = NULL; + struct auth_serversupplied_info *session_info = NULL; struct smbd_server_connection *sconn = req->sconn; if (NT_STATUS_IS_OK(nt_status)) { - nt_status = auth_ntlmssp_steal_server_info(talloc_tos(), - (*auth_ntlmssp_state), &server_info); + nt_status = auth_ntlmssp_steal_session_info(talloc_tos(), + (*auth_ntlmssp_state), &session_info); } else { - /* Note that this server_info won't have a session + /* Note that this session_info won't have a session * key. But for map to guest, that's exactly the right * thing - we can't reasonably guess the key the * client wants, as the password was wrong */ nt_status = do_map_to_guest(nt_status, - &server_info, + &session_info, auth_ntlmssp_get_username(*auth_ntlmssp_state), auth_ntlmssp_get_domain(*auth_ntlmssp_state)); } @@ -505,7 +505,7 @@ static void reply_spnego_ntlmssp(struct smb_request *req, /* register_existing_vuid keeps the server info */ if (register_existing_vuid(sconn, vuid, - server_info, nullblob, + session_info, nullblob, auth_ntlmssp_get_username(*auth_ntlmssp_state)) != vuid) { /* The problem is, *auth_ntlmssp_state points @@ -522,7 +522,7 @@ static void reply_spnego_ntlmssp(struct smb_request *req, SSVAL(req->outbuf, smb_vwv3, 0); - if (server_info->guest) { + if (session_info->guest) { SSVAL(req->outbuf,smb_vwv2,1); } } diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 7d029151bc..d1ebe9b673 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -146,20 +146,20 @@ static int smbd_smb2_session_destructor(struct smbd_smb2_session *session) return 0; } -static NTSTATUS setup_ntlmssp_server_info(struct smbd_smb2_session *session, +static NTSTATUS setup_ntlmssp_session_info(struct smbd_smb2_session *session, NTSTATUS status) { if (NT_STATUS_IS_OK(status)) { - status = auth_ntlmssp_steal_server_info(session, + status = auth_ntlmssp_steal_session_info(session, session->auth_ntlmssp_state, - &session->server_info); + &session->session_info); } else { - /* Note that this server_info won't have a session + /* Note that this session_info won't have a session * key. But for map to guest, that's exactly the right * thing - we can't reasonably guess the key the * client wants, as the password was wrong */ status = do_map_to_guest(status, - &session->server_info, + &session->session_info, auth_ntlmssp_get_username(session->auth_ntlmssp_state), auth_ntlmssp_get_domain(session->auth_ntlmssp_state)); } @@ -236,20 +236,20 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session, status = make_server_info_krb5(session, user, domain, real_username, pw, logon_info, map_domainuser_to_guest, - &session->server_info); + &session->session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("smb2: make_server_info_krb5 failed\n")); goto fail; } - session->server_info->nss_token |= username_was_mapped; + session->session_info->nss_token |= username_was_mapped; - /* we need to build the token for the user. make_server_info_guest() + /* we need to build the token for the user. make_session_info_guest() already does this */ - if (!session->server_info->security_token ) { - status = create_local_token(session->server_info); + if (!session->session_info->security_token ) { + status = create_local_token(session->session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(10,("smb2: failed to create local token: %s\n", nt_errstr(status))); @@ -262,7 +262,7 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session, session->do_signing = true; } - if (session->server_info->guest) { + if (session->session_info->guest) { /* we map anonymous to guest internally */ *out_session_flags |= SMB2_SESSION_FLAG_IS_GUEST; *out_session_flags |= SMB2_SESSION_FLAG_IS_NULL; @@ -270,19 +270,19 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session, session->do_signing = false; } - data_blob_free(&session->server_info->user_session_key); - session->server_info->user_session_key = + data_blob_free(&session->session_info->user_session_key); + session->session_info->user_session_key = data_blob_talloc( - session->server_info, + session->session_info, session_key.data, session_key.length); if (session_key.length > 0) { - if (session->server_info->user_session_key.data == NULL) { + if (session->session_info->user_session_key.data == NULL) { status = NT_STATUS_NO_MEMORY; goto fail; } } - session->session_key = session->server_info->user_session_key; + session->session_key = session->session_info->user_session_key; session->compat_vuser = talloc_zero(session, user_struct); if (session->compat_vuser == NULL) { @@ -291,19 +291,19 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session, } session->compat_vuser->auth_ntlmssp_state = NULL; session->compat_vuser->homes_snum = -1; - session->compat_vuser->server_info = session->server_info; + session->compat_vuser->session_info = session->session_info; session->compat_vuser->session_keystr = NULL; session->compat_vuser->vuid = session->vuid; DLIST_ADD(session->sconn->smb1.sessions.validated_users, session->compat_vuser); /* This is a potentially untrusted username */ alpha_strcpy(tmp, user, ". _-$", sizeof(tmp)); - session->server_info->sanitized_username = - talloc_strdup(session->server_info, tmp); + session->session_info->sanitized_username = + talloc_strdup(session->session_info, tmp); - if (!session->server_info->guest) { + if (!session->session_info->guest) { session->compat_vuser->homes_snum = - register_homes_share(session->server_info->unix_name); + register_homes_share(session->session_info->unix_name); } if (!session_claim(session->sconn, session->compat_vuser)) { @@ -480,7 +480,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s session->do_signing = true; } - if (session->server_info->guest) { + if (session->session_info->guest) { /* we map anonymous to guest internally */ *out_session_flags |= SMB2_SESSION_FLAG_IS_GUEST; *out_session_flags |= SMB2_SESSION_FLAG_IS_NULL; @@ -488,7 +488,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s session->do_signing = false; } - session->session_key = session->server_info->user_session_key; + session->session_key = session->session_info->user_session_key; session->compat_vuser = talloc_zero(session, user_struct); if (session->compat_vuser == NULL) { @@ -498,7 +498,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s } session->compat_vuser->auth_ntlmssp_state = session->auth_ntlmssp_state; session->compat_vuser->homes_snum = -1; - session->compat_vuser->server_info = session->server_info; + session->compat_vuser->session_info = session->session_info; session->compat_vuser->session_keystr = NULL; session->compat_vuser->vuid = session->vuid; DLIST_ADD(session->sconn->smb1.sessions.validated_users, session->compat_vuser); @@ -508,12 +508,12 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s auth_ntlmssp_get_username(session->auth_ntlmssp_state), ". _-$", sizeof(tmp)); - session->server_info->sanitized_username = talloc_strdup( - session->server_info, tmp); + session->session_info->sanitized_username = talloc_strdup( + session->session_info, tmp); - if (!session->compat_vuser->server_info->guest) { + if (!session->compat_vuser->session_info->guest) { session->compat_vuser->homes_snum = - register_homes_share(session->server_info->unix_name); + register_homes_share(session->session_info->unix_name); } if (!session_claim(session->sconn, session->compat_vuser)) { @@ -624,11 +624,11 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session, status = auth_ntlmssp_update(session->auth_ntlmssp_state, auth, &auth_out); - /* We need to call setup_ntlmssp_server_info() if status==NT_STATUS_OK, + /* We need to call setup_ntlmssp_session_info() if status==NT_STATUS_OK, or if status is anything except NT_STATUS_MORE_PROCESSING_REQUIRED, as this can trigger map to guest. */ if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { - status = setup_ntlmssp_server_info(session, status); + status = setup_ntlmssp_session_info(session, status); } if (!NT_STATUS_IS_OK(status) && @@ -706,7 +706,7 @@ static NTSTATUS smbd_smb2_raw_ntlmssp_auth(struct smbd_smb2_session *session, return status; } - status = setup_ntlmssp_server_info(session, status); + status = setup_ntlmssp_session_info(session, status); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(session->auth_ntlmssp_state); @@ -857,9 +857,9 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req) return NT_STATUS_ACCESS_DENIED; } - set_current_user_info(session->server_info->sanitized_username, - session->server_info->unix_name, - session->server_info->info3->base.domain.string); + set_current_user_info(session->session_info->sanitized_username, + session->session_info->unix_name, + session->session_info->info3->base.domain.string); req->session = session; diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c index 82d9a28084..01c7e01c65 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -183,7 +183,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req, "user %s because it was not found " "or created at session setup " "time\n", - compat_vuser->server_info->unix_name)); + compat_vuser->session_info->unix_name)); return NT_STATUS_BAD_NETWORK_NAME; } snum = compat_vuser->homes_snum; diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 32c557826e..12cbc3b9e9 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -3199,11 +3199,11 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned fsp.fnum = -1; /* access check */ - if (conn->server_info->utok.uid != sec_initial_uid()) { + if (conn->session_info->utok.uid != sec_initial_uid()) { DEBUG(0,("set_user_quota: access_denied " "service [%s] user [%s]\n", lp_servicename(SNUM(conn)), - conn->server_info->unix_name)); + conn->session_info->unix_name)); return NT_STATUS_ACCESS_DENIED; } @@ -3356,7 +3356,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned * in our list of SIDs. */ if (nt_token_check_sid(&global_sid_Builtin_Guests, - conn->server_info->security_token)) { + conn->session_info->security_token)) { flags |= SMB_WHOAMI_GUEST; } @@ -3364,7 +3364,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned * is in our list of SIDs. */ if (nt_token_check_sid(&global_sid_Authenticated_Users, - conn->server_info->security_token)) { + conn->session_info->security_token)) { flags &= ~SMB_WHOAMI_GUEST; } @@ -3380,18 +3380,18 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned + 4 /* num_sids */ + 4 /* SID bytes */ + 4 /* pad/reserved */ - + (conn->server_info->utok.ngroups * 8) + + (conn->session_info->utok.ngroups * 8) /* groups list */ - + (conn->server_info->security_token->num_sids * + + (conn->session_info->security_token->num_sids * SID_MAX_SIZE) /* SID list */; SIVAL(pdata, 0, flags); SIVAL(pdata, 4, SMB_WHOAMI_MASK); SBIG_UINT(pdata, 8, - (uint64_t)conn->server_info->utok.uid); + (uint64_t)conn->session_info->utok.uid); SBIG_UINT(pdata, 16, - (uint64_t)conn->server_info->utok.gid); + (uint64_t)conn->session_info->utok.gid); if (data_len >= max_data_bytes) { @@ -3406,17 +3406,17 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned break; } - SIVAL(pdata, 24, conn->server_info->utok.ngroups); - SIVAL(pdata, 28, conn->server_info->security_token->num_sids); + SIVAL(pdata, 24, conn->session_info->utok.ngroups); + SIVAL(pdata, 28, conn->session_info->security_token->num_sids); /* We walk the SID list twice, but this call is fairly * infrequent, and I don't expect that it's performance * sensitive -- jpeach */ for (i = 0, sid_bytes = 0; - i < conn->server_info->security_token->num_sids; ++i) { + i < conn->session_info->security_token->num_sids; ++i) { sid_bytes += ndr_size_dom_sid( - &conn->server_info->security_token->sids[i], + &conn->session_info->security_token->sids[i], 0); } @@ -3428,21 +3428,21 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned data_len = 40; /* GID list */ - for (i = 0; i < conn->server_info->utok.ngroups; ++i) { + for (i = 0; i < conn->session_info->utok.ngroups; ++i) { SBIG_UINT(pdata, data_len, - (uint64_t)conn->server_info->utok.groups[i]); + (uint64_t)conn->session_info->utok.groups[i]); data_len += 8; } /* SID list */ for (i = 0; - i < conn->server_info->security_token->num_sids; ++i) { + i < conn->session_info->security_token->num_sids; ++i) { int sid_len = ndr_size_dom_sid( - &conn->server_info->security_token->sids[i], + &conn->session_info->security_token->sids[i], 0); sid_linearize(pdata + data_len, sid_len, - &conn->server_info->security_token->sids[i]); + &conn->session_info->security_token->sids[i]); data_len += sid_len; } @@ -3694,11 +3694,11 @@ cap_low = 0x%x, cap_high = 0x%x\n", ZERO_STRUCT(quotas); /* access check */ - if ((conn->server_info->utok.uid != sec_initial_uid()) + if ((conn->session_info->utok.uid != sec_initial_uid()) ||!CAN_WRITE(conn)) { DEBUG(0,("set_user_quota: access_denied service [%s] user [%s]\n", lp_servicename(SNUM(conn)), - conn->server_info->unix_name)); + conn->session_info->unix_name)); reply_nterror(req, NT_STATUS_ACCESS_DENIED); return; } @@ -5838,7 +5838,7 @@ static NTSTATUS smb_set_file_disposition_info(connection_struct *conn, /* The set is across all open files on this dev/inode pair. */ if (!set_delete_on_close(fsp, delete_on_close, - &conn->server_info->utok)) { + &conn->session_info->utok)) { return NT_STATUS_ACCESS_DENIED; } return NT_STATUS_OK; diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 87d85eff83..0890ae698c 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -55,10 +55,10 @@ bool change_to_guest(void) } /**************************************************************************** - talloc free the conn->server_info if not used in the vuid cache. + talloc free the conn->session_info if not used in the vuid cache. ****************************************************************************/ -static void free_conn_server_info_if_unused(connection_struct *conn) +static void free_conn_session_info_if_unused(connection_struct *conn) { unsigned int i; @@ -66,24 +66,24 @@ static void free_conn_server_info_if_unused(connection_struct *conn) struct vuid_cache_entry *ent; ent = &conn->vuid_cache.array[i]; if (ent->vuid != UID_FIELD_INVALID && - conn->server_info == ent->server_info) { + conn->session_info == ent->session_info) { return; } } /* Not used, safe to free. */ - TALLOC_FREE(conn->server_info); + TALLOC_FREE(conn->session_info); } /******************************************************************* Check if a username is OK. - This sets up conn->server_info with a copy related to this vuser that + This sets up conn->session_info with a copy related to this vuser that later code can then mess with. ********************************************************************/ static bool check_user_ok(connection_struct *conn, uint16_t vuid, - const struct auth_serversupplied_info *server_info, + const struct auth_serversupplied_info *session_info, int snum) { bool valid_vuid = (vuid != UID_FIELD_INVALID); @@ -97,27 +97,27 @@ static bool check_user_ok(connection_struct *conn, for (i=0; i<VUID_CACHE_SIZE; i++) { ent = &conn->vuid_cache.array[i]; if (ent->vuid == vuid) { - free_conn_server_info_if_unused(conn); - conn->server_info = ent->server_info; + free_conn_session_info_if_unused(conn); + conn->session_info = ent->session_info; conn->read_only = ent->read_only; return(True); } } } - if (!user_ok_token(server_info->unix_name, - server_info->info3->base.domain.string, - server_info->security_token, snum)) + if (!user_ok_token(session_info->unix_name, + session_info->info3->base.domain.string, + session_info->security_token, snum)) return(False); readonly_share = is_share_read_only_for_token( - server_info->unix_name, - server_info->info3->base.domain.string, - server_info->security_token, + session_info->unix_name, + session_info->info3->base.domain.string, + session_info->security_token, conn); if (!readonly_share && - !share_access_check(server_info->security_token, lp_servicename(snum), + !share_access_check(session_info->security_token, lp_servicename(snum), FILE_WRITE_DATA)) { /* smb.conf allows r/w, but the security descriptor denies * write. Fall back to looking at readonly. */ @@ -126,16 +126,16 @@ static bool check_user_ok(connection_struct *conn, "security descriptor\n")); } - if (!share_access_check(server_info->security_token, lp_servicename(snum), + if (!share_access_check(session_info->security_token, lp_servicename(snum), readonly_share ? FILE_READ_DATA : FILE_WRITE_DATA)) { return False; } admin_user = token_contains_name_in_list( - server_info->unix_name, - server_info->info3->base.domain.string, - NULL, server_info->security_token, lp_admin_users(snum)); + session_info->unix_name, + session_info->info3->base.domain.string, + NULL, session_info->security_token, lp_admin_users(snum)); if (valid_vuid) { struct vuid_cache_entry *ent = @@ -144,34 +144,34 @@ static bool check_user_ok(connection_struct *conn, conn->vuid_cache.next_entry = (conn->vuid_cache.next_entry + 1) % VUID_CACHE_SIZE; - TALLOC_FREE(ent->server_info); + TALLOC_FREE(ent->session_info); /* - * If force_user was set, all server_info's are based on the same + * If force_user was set, all session_info's are based on the same * username-based faked one. */ - ent->server_info = copy_serverinfo( - conn, conn->force_user ? conn->server_info : server_info); + ent->session_info = copy_serverinfo( + conn, conn->force_user ? conn->session_info : session_info); - if (ent->server_info == NULL) { + if (ent->session_info == NULL) { ent->vuid = UID_FIELD_INVALID; return false; } ent->vuid = vuid; ent->read_only = readonly_share; - free_conn_server_info_if_unused(conn); - conn->server_info = ent->server_info; + free_conn_session_info_if_unused(conn); + conn->session_info = ent->session_info; } conn->read_only = readonly_share; if (admin_user) { DEBUG(2,("check_user_ok: user %s is an admin user. " "Setting uid as %d\n", - conn->server_info->unix_name, + conn->session_info->unix_name, sec_initial_uid() )); - conn->server_info->utok.uid = sec_initial_uid(); + conn->session_info->utok.uid = sec_initial_uid(); } return(True); @@ -194,27 +194,27 @@ void conn_clear_vuid_cache(connection_struct *conn, uint16_t vuid) if (ent->vuid == vuid) { ent->vuid = UID_FIELD_INVALID; /* - * We need to keep conn->server_info around - * if it's equal to ent->server_info as a SMBulogoff + * We need to keep conn->session_info around + * if it's equal to ent->session_info as a SMBulogoff * is often followed by a SMBtdis (with an invalid * vuid). The debug code (or regular code in * vfs_full_audit) wants to refer to the - * conn->server_info pointer to print debug + * conn->session_info pointer to print debug * statements. Theoretically this is a bug, - * as once the vuid is gone the server_info + * as once the vuid is gone the session_info * on the conn struct isn't valid any more, * but there's enough code that assumes - * conn->server_info is never null that + * conn->session_info is never null that * it's easier to hold onto the old pointer * until we get a new sessionsetupX. * As everything is hung off the * conn pointer as a talloc context we're not * leaking memory here. See bug #6315. JRA. */ - if (conn->server_info == ent->server_info) { - ent->server_info = NULL; + if (conn->session_info == ent->session_info) { + ent->session_info = NULL; } else { - TALLOC_FREE(ent->server_info); + TALLOC_FREE(ent->session_info); } ent->read_only = False; } @@ -228,7 +228,7 @@ void conn_clear_vuid_cache(connection_struct *conn, uint16_t vuid) bool change_to_user(connection_struct *conn, uint16 vuid) { - const struct auth_serversupplied_info *server_info = NULL; + const struct auth_serversupplied_info *session_info = NULL; user_struct *vuser; int snum; gid_t gid; @@ -252,13 +252,13 @@ bool change_to_user(connection_struct *conn, uint16 vuid) */ if((lp_security() == SEC_SHARE) && (current_user.conn == conn) && - (current_user.ut.uid == conn->server_info->utok.uid)) { + (current_user.ut.uid == conn->session_info->utok.uid)) { DEBUG(4,("change_to_user: Skipping user change - already " "user\n")); return(True); } else if ((current_user.conn == conn) && (vuser != NULL) && (current_user.vuid == vuid) && - (current_user.ut.uid == vuser->server_info->utok.uid)) { + (current_user.ut.uid == vuser->session_info->utok.uid)) { DEBUG(4,("change_to_user: Skipping user change - already " "user\n")); return(True); @@ -266,20 +266,20 @@ bool change_to_user(connection_struct *conn, uint16 vuid) snum = SNUM(conn); - server_info = vuser ? vuser->server_info : conn->server_info; + session_info = vuser ? vuser->session_info : conn->session_info; - if (!server_info) { + if (!session_info) { /* Invalid vuid sent - even with security = share. */ DEBUG(2,("change_to_user: Invalid vuid %d used on " "share %s.\n",vuid, lp_servicename(snum) )); return false; } - if (!check_user_ok(conn, vuid, server_info, snum)) { + if (!check_user_ok(conn, vuid, session_info, snum)) { DEBUG(2,("change_to_user: SMB user %s (unix user %s, vuid %d) " "not permitted access to share %s.\n", - server_info->sanitized_username, - server_info->unix_name, vuid, + session_info->sanitized_username, + session_info->unix_name, vuid, lp_servicename(snum))); return false; } @@ -292,14 +292,14 @@ bool change_to_user(connection_struct *conn, uint16 vuid) } /* - * conn->server_info is now correctly set up with a copy we can mess + * conn->session_info is now correctly set up with a copy we can mess * with for force_group etc. */ - uid = conn->server_info->utok.uid; - gid = conn->server_info->utok.gid; - num_groups = conn->server_info->utok.ngroups; - group_list = conn->server_info->utok.groups; + uid = conn->session_info->utok.uid; + gid = conn->session_info->utok.gid; + num_groups = conn->session_info->utok.ngroups; + group_list = conn->session_info->utok.groups; /* * See if we should force group for this service. @@ -324,18 +324,18 @@ bool change_to_user(connection_struct *conn, uint16 vuid) for (i = 0; i < num_groups; i++) { if (group_list[i] == conn->force_group_gid) { - conn->server_info->utok.gid = + conn->session_info->utok.gid = conn->force_group_gid; gid = conn->force_group_gid; - gid_to_sid(&conn->server_info->security_token + gid_to_sid(&conn->session_info->security_token ->sids[1], gid); break; } } } else { - conn->server_info->utok.gid = conn->force_group_gid; + conn->session_info->utok.gid = conn->force_group_gid; gid = conn->force_group_gid; - gid_to_sid(&conn->server_info->security_token->sids[1], + gid_to_sid(&conn->session_info->security_token->sids[1], gid); } } @@ -347,7 +347,7 @@ bool change_to_user(connection_struct *conn, uint16 vuid) current_user.ut.groups = group_list; set_sec_ctx(uid, gid, current_user.ut.ngroups, current_user.ut.groups, - conn->server_info->security_token); + conn->session_info->security_token); current_user.conn = conn; current_user.vuid = vuid; @@ -387,9 +387,9 @@ bool become_authenticated_pipe_user(struct pipes_struct *p) if (!push_sec_ctx()) return False; - set_sec_ctx(p->server_info->utok.uid, p->server_info->utok.gid, - p->server_info->utok.ngroups, p->server_info->utok.groups, - p->server_info->security_token); + set_sec_ctx(p->session_info->utok.uid, p->session_info->utok.gid, + p->session_info->utok.ngroups, p->session_info->utok.groups, + p->session_info->security_token); return True; } @@ -510,7 +510,7 @@ bool unbecome_user(void) /**************************************************************************** Return the current user we are running effectively as on this connection. - I'd like to make this return conn->server_info->utok.uid, but become_root() + I'd like to make this return conn->session_info->utok.uid, but become_root() doesn't alter this value. ****************************************************************************/ @@ -521,7 +521,7 @@ uid_t get_current_uid(connection_struct *conn) /**************************************************************************** Return the current group we are running effectively as on this connection. - I'd like to make this return conn->server_info->utok.gid, but become_root() + I'd like to make this return conn->session_info->utok.gid, but become_root() doesn't alter this value. ****************************************************************************/ @@ -532,7 +532,7 @@ gid_t get_current_gid(connection_struct *conn) /**************************************************************************** Return the UNIX token we are running effectively as on this connection. - I'd like to make this return &conn->server_info->utok, but become_root() + I'd like to make this return &conn->session_info->utok, but become_root() doesn't alter this value. ****************************************************************************/ diff --git a/source3/winbindd/winbindd_samr.c b/source3/winbindd/winbindd_samr.c index d33a3097d6..783d9f9f31 100644 --- a/source3/winbindd/winbindd_samr.c +++ b/source3/winbindd/winbindd_samr.c @@ -43,15 +43,15 @@ static NTSTATUS open_internal_samr_pipe(TALLOC_CTX *mem_ctx, struct rpc_pipe_client **samr_pipe) { struct rpc_pipe_client *cli = NULL; - struct auth_serversupplied_info *server_info = NULL; + struct auth_serversupplied_info *session_info = NULL; NTSTATUS status; if (cli != NULL) { goto done; } - if (server_info == NULL) { - status = make_server_info_system(mem_ctx, &server_info); + if (session_info == NULL) { + status = make_session_info_system(mem_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("open_samr_pipe: Could not create auth_serversupplied_info: %s\n", nt_errstr(status))); @@ -62,7 +62,7 @@ static NTSTATUS open_internal_samr_pipe(TALLOC_CTX *mem_ctx, /* create a samr connection */ status = rpc_pipe_open_interface(mem_ctx, &ndr_table_samr.syntax_id, - server_info, + session_info, NULL, winbind_messaging_context(), &cli); @@ -125,15 +125,15 @@ static NTSTATUS open_internal_lsa_pipe(TALLOC_CTX *mem_ctx, struct rpc_pipe_client **lsa_pipe) { struct rpc_pipe_client *cli = NULL; - struct auth_serversupplied_info *server_info = NULL; + struct auth_serversupplied_info *session_info = NULL; NTSTATUS status; if (cli != NULL) { goto done; } - if (server_info == NULL) { - status = make_server_info_system(mem_ctx, &server_info); + if (session_info == NULL) { + status = make_session_info_system(mem_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("open_lsa_pipe: Could not create auth_serversupplied_info: %s\n", nt_errstr(status))); @@ -144,7 +144,7 @@ static NTSTATUS open_internal_lsa_pipe(TALLOC_CTX *mem_ctx, /* create a lsa connection */ status = rpc_pipe_open_interface(mem_ctx, &ndr_table_lsarpc.syntax_id, - server_info, + session_info, NULL, winbind_messaging_context(), &cli); |