mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
s3:smbd: use 'struct user_struct' instead of typedef'ed 'user_struct'
metze
This commit is contained in:
parent
9e2e3708aa
commit
f52e5738a2
@ -449,7 +449,7 @@ struct smbd_smb2_session {
|
||||
DATA_BLOB session_key;
|
||||
bool do_signing;
|
||||
|
||||
user_struct *compat_vuser;
|
||||
struct user_struct *compat_vuser;
|
||||
|
||||
struct {
|
||||
/* an id tree used to allocate tids */
|
||||
|
@ -4627,7 +4627,7 @@ static bool api_WWkstaUserLogon(struct smbd_server_connection *sconn,
|
||||
char* name;
|
||||
/* With share level security vuid will always be zero.
|
||||
Don't depend on vuser being non-null !!. JRA */
|
||||
user_struct *vuser = get_valid_user_struct(sconn, vuid);
|
||||
struct user_struct *vuser = get_valid_user_struct(sconn, vuid);
|
||||
|
||||
if (!str1 || !str2 || !p) {
|
||||
return False;
|
||||
@ -5855,7 +5855,7 @@ void api_reply(connection_struct *conn, uint16 vuid,
|
||||
/* Check whether this api call can be done anonymously */
|
||||
|
||||
if (api_commands[i].auth_user && lp_restrict_anonymous()) {
|
||||
user_struct *user = get_valid_user_struct(req->sconn, vuid);
|
||||
struct user_struct *user = get_valid_user_struct(req->sconn, vuid);
|
||||
|
||||
if (!user || security_session_user_level(user->session_info, NULL) < SECURITY_USER) {
|
||||
reply_nterror(req, NT_STATUS_ACCESS_DENIED);
|
||||
|
@ -41,12 +41,12 @@ enum server_allocated_state { SERVER_ALLOCATED_REQUIRED_YES,
|
||||
SERVER_ALLOCATED_REQUIRED_NO,
|
||||
SERVER_ALLOCATED_REQUIRED_ANY};
|
||||
|
||||
static user_struct *get_valid_user_struct_internal(
|
||||
static struct user_struct *get_valid_user_struct_internal(
|
||||
struct smbd_server_connection *sconn,
|
||||
uint16 vuid,
|
||||
enum server_allocated_state server_allocated)
|
||||
{
|
||||
user_struct *usp;
|
||||
struct user_struct *usp;
|
||||
int count=0;
|
||||
|
||||
if (vuid == UID_FIELD_INVALID)
|
||||
@ -84,7 +84,7 @@ static user_struct *get_valid_user_struct_internal(
|
||||
tell random client vuid's (normally zero) from valid vuids.
|
||||
****************************************************************************/
|
||||
|
||||
user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
|
||||
struct user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
|
||||
uint16 vuid)
|
||||
{
|
||||
return get_valid_user_struct_internal(sconn, vuid,
|
||||
@ -100,7 +100,7 @@ bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint16 vuid)
|
||||
Get the user struct of a partial NTLMSSP login
|
||||
****************************************************************************/
|
||||
|
||||
user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn,
|
||||
struct user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn,
|
||||
uint16 vuid)
|
||||
{
|
||||
return get_valid_user_struct_internal(sconn, vuid,
|
||||
@ -113,7 +113,7 @@ user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn,
|
||||
|
||||
void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid)
|
||||
{
|
||||
user_struct *vuser = NULL;
|
||||
struct user_struct *vuser = NULL;
|
||||
|
||||
vuser = get_valid_user_struct_internal(sconn, vuid,
|
||||
SERVER_ALLOCATED_REQUIRED_ANY);
|
||||
@ -169,14 +169,14 @@ static void increment_next_vuid(uint16_t *vuid)
|
||||
|
||||
int register_initial_vuid(struct smbd_server_connection *sconn)
|
||||
{
|
||||
user_struct *vuser;
|
||||
struct user_struct *vuser;
|
||||
|
||||
/* Limit allowed vuids to 16bits - VUID_OFFSET. */
|
||||
if (sconn->num_users >= 0xFFFF-VUID_OFFSET) {
|
||||
return UID_FIELD_INVALID;
|
||||
}
|
||||
|
||||
if((vuser = talloc_zero(NULL, user_struct)) == NULL) {
|
||||
if((vuser = talloc_zero(NULL, struct user_struct)) == NULL) {
|
||||
DEBUG(0,("register_initial_vuid: "
|
||||
"Failed to talloc users struct!\n"));
|
||||
return UID_FIELD_INVALID;
|
||||
@ -261,7 +261,7 @@ int register_existing_vuid(struct smbd_server_connection *sconn,
|
||||
struct auth_session_info *session_info,
|
||||
DATA_BLOB response_blob)
|
||||
{
|
||||
user_struct *vuser;
|
||||
struct user_struct *vuser;
|
||||
bool guest = security_session_user_level(session_info, NULL) < SECURITY_USER;
|
||||
|
||||
vuser = get_partial_auth_user_struct(sconn, vuid);
|
||||
|
@ -1391,7 +1391,7 @@ static connection_struct *switch_message(uint8 type, struct smb_request *req)
|
||||
*/
|
||||
|
||||
if (session_tag != sconn->smb1.sessions.last_session_tag) {
|
||||
user_struct *vuser = NULL;
|
||||
struct user_struct *vuser = NULL;
|
||||
|
||||
sconn->smb1.sessions.last_session_tag = session_tag;
|
||||
if(session_tag != UID_FIELD_INVALID) {
|
||||
|
@ -687,10 +687,10 @@ struct kernel_oplocks *linux_init_kernel_oplocks(struct smbd_server_connection *
|
||||
|
||||
/* The following definitions come from smbd/password.c */
|
||||
|
||||
user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
|
||||
struct user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
|
||||
uint16 vuid);
|
||||
bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint16 vuid);
|
||||
user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn,
|
||||
struct user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn,
|
||||
uint16 vuid);
|
||||
void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid);
|
||||
void invalidate_all_vuids(struct smbd_server_connection *sconn);
|
||||
@ -984,7 +984,7 @@ int find_service(TALLOC_CTX *ctx, const char *service, char **p_service_out);
|
||||
struct smbd_smb2_tcon;
|
||||
connection_struct *make_connection_smb2(struct smbd_server_connection *sconn,
|
||||
struct smbd_smb2_tcon *tcon,
|
||||
user_struct *vuser,
|
||||
struct user_struct *vuser,
|
||||
const char *pdev,
|
||||
NTSTATUS *pstatus);
|
||||
connection_struct *make_connection(struct smbd_server_connection *sconn,
|
||||
@ -996,8 +996,8 @@ void close_cnum(connection_struct *conn, uint16 vuid);
|
||||
/* The following definitions come from smbd/session.c */
|
||||
struct sessionid;
|
||||
bool session_init(void);
|
||||
bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser);
|
||||
void session_yield(user_struct *vuser);
|
||||
bool session_claim(struct smbd_server_connection *sconn, struct user_struct *vuser);
|
||||
void session_yield(struct user_struct *vuser);
|
||||
int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list);
|
||||
|
||||
/* The following definitions come from smbd/sesssetup.c */
|
||||
|
@ -2073,7 +2073,7 @@ void reply_open_and_X(struct smb_request *req)
|
||||
void reply_ulogoffX(struct smb_request *req)
|
||||
{
|
||||
struct smbd_server_connection *sconn = req->sconn;
|
||||
user_struct *vuser;
|
||||
struct user_struct *vuser;
|
||||
|
||||
START_PROFILE(SMBulogoffX);
|
||||
|
||||
|
@ -536,7 +536,7 @@ static void create_share_access_mask(connection_struct *conn, int snum)
|
||||
|
||||
static NTSTATUS make_connection_snum(struct smbd_server_connection *sconn,
|
||||
connection_struct *conn,
|
||||
int snum, user_struct *vuser,
|
||||
int snum, struct user_struct *vuser,
|
||||
const char *pdev)
|
||||
{
|
||||
struct smb_filename *smb_fname_cpath = NULL;
|
||||
@ -913,7 +913,7 @@ static NTSTATUS make_connection_snum(struct smbd_server_connection *sconn,
|
||||
****************************************************************************/
|
||||
|
||||
static connection_struct *make_connection_smb1(struct smbd_server_connection *sconn,
|
||||
int snum, user_struct *vuser,
|
||||
int snum, struct user_struct *vuser,
|
||||
const char *pdev,
|
||||
NTSTATUS *pstatus)
|
||||
{
|
||||
@ -942,7 +942,7 @@ static connection_struct *make_connection_smb1(struct smbd_server_connection *sc
|
||||
|
||||
connection_struct *make_connection_smb2(struct smbd_server_connection *sconn,
|
||||
struct smbd_smb2_tcon *tcon,
|
||||
user_struct *vuser,
|
||||
struct user_struct *vuser,
|
||||
const char *pdev,
|
||||
NTSTATUS *pstatus)
|
||||
{
|
||||
@ -977,7 +977,7 @@ connection_struct *make_connection(struct smbd_server_connection *sconn,
|
||||
NTSTATUS *status)
|
||||
{
|
||||
uid_t euid;
|
||||
user_struct *vuser = NULL;
|
||||
struct user_struct *vuser = NULL;
|
||||
char *service = NULL;
|
||||
fstring dev;
|
||||
int snum = -1;
|
||||
|
@ -40,7 +40,7 @@
|
||||
called when a session is created
|
||||
********************************************************************/
|
||||
|
||||
bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser)
|
||||
bool session_claim(struct smbd_server_connection *sconn, struct user_struct *vuser)
|
||||
{
|
||||
struct server_id pid = messaging_server_id(sconn->msg_ctx);
|
||||
TDB_DATA data;
|
||||
@ -194,7 +194,7 @@ bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser)
|
||||
called when a session is destroyed
|
||||
********************************************************************/
|
||||
|
||||
void session_yield(user_struct *vuser)
|
||||
void session_yield(struct user_struct *vuser)
|
||||
{
|
||||
struct sessionid sessionid;
|
||||
struct db_record *rec;
|
||||
|
@ -127,7 +127,7 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req)
|
||||
uint16 data_blob_len = SVAL(req->vwv+7, 0);
|
||||
enum remote_arch_types ra_type = get_remote_arch();
|
||||
int vuid = req->vuid;
|
||||
user_struct *vuser = NULL;
|
||||
struct user_struct *vuser = NULL;
|
||||
NTSTATUS status = NT_STATUS_OK;
|
||||
struct smbd_server_connection *sconn = req->sconn;
|
||||
uint16_t action = 0;
|
||||
|
@ -224,7 +224,7 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbd_smb2_session *session,
|
||||
|
||||
session->session_key = session->session_info->session_key;
|
||||
|
||||
session->compat_vuser = talloc_zero(session, user_struct);
|
||||
session->compat_vuser = talloc_zero(session, struct user_struct);
|
||||
if (session->compat_vuser == NULL) {
|
||||
TALLOC_FREE(session);
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
@ -203,7 +203,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
|
||||
int snum = -1;
|
||||
struct smbd_smb2_tcon *tcon;
|
||||
connection_struct *compat_conn = NULL;
|
||||
user_struct *compat_vuser = req->session->compat_vuser;
|
||||
struct user_struct *compat_vuser = req->session->compat_vuser;
|
||||
int id;
|
||||
NTSTATUS status;
|
||||
|
||||
|
@ -278,7 +278,7 @@ static bool change_to_user_internal(connection_struct *conn,
|
||||
bool change_to_user(connection_struct *conn, uint16_t vuid)
|
||||
{
|
||||
const struct auth_session_info *session_info = NULL;
|
||||
user_struct *vuser;
|
||||
struct user_struct *vuser;
|
||||
int snum = SNUM(conn);
|
||||
|
||||
if (!conn) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user