diff options
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_netlog.c | 28 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe.c | 10 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 13 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_srvsvc.c | 20 | ||||
-rw-r--r-- | source3/rpc_server/srv_util.c | 12 |
6 files changed, 37 insertions, 48 deletions
diff --git a/source3/rpc_server/srv_netlog.c b/source3/rpc_server/srv_netlog.c index 7fe89f90b6..f634b8e15f 100644 --- a/source3/rpc_server/srv_netlog.c +++ b/source3/rpc_server/srv_netlog.c @@ -354,7 +354,7 @@ static BOOL api_net_req_chal(pipes_struct *p) (char *)vuser->dc.md4pw, vuser->dc.sess_key); } else { /* lkclXXXX take a guess at a good error message to return :-) */ - status = 0xC0000000 | NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT; + status = NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT; } /* construct reply. */ @@ -370,7 +370,7 @@ static BOOL api_net_req_chal(pipes_struct *p) static BOOL api_net_auth_2(pipes_struct *p) { - uint16 vuid = p->vuid; + uint16 vuid = p->vuid; NET_Q_AUTH_2 q_a; uint32 status = 0x0; prs_struct *data = &p->in_data.data; @@ -403,7 +403,7 @@ static BOOL api_net_auth_2(pipes_struct *p) memcpy(vuser->dc.clnt_cred.challenge.data, q_a.clnt_chal.data, sizeof(q_a.clnt_chal.data)); memcpy(vuser->dc.srv_cred .challenge.data, q_a.clnt_chal.data, sizeof(q_a.clnt_chal.data)); } else { - status = NT_STATUS_ACCESS_DENIED | 0xC0000000; + status = NT_STATUS_ACCESS_DENIED; } /* construct reply. */ @@ -420,9 +420,9 @@ static BOOL api_net_auth_2(pipes_struct *p) static BOOL api_net_srv_pwset(pipes_struct *p) { - uint16 vuid = p->vuid; + uint16 vuid = p->vuid; NET_Q_SRV_PWSET q_a; - uint32 status = NT_STATUS_WRONG_PASSWORD|0xC0000000; + uint32 status = NT_STATUS_WRONG_PASSWORD; DOM_CRED srv_cred; pstring mach_acct; struct smb_passwd *smb_pass; @@ -487,7 +487,7 @@ static BOOL api_net_srv_pwset(pipes_struct *p) } else { /* lkclXXXX take a guess at a sensible error code to return... */ - status = 0xC0000000 | NT_STATUS_NETWORK_CREDENTIAL_CONFLICT; + status = NT_STATUS_NETWORK_CREDENTIAL_CONFLICT; } /* Construct reply. */ @@ -582,7 +582,7 @@ static uint32 net_login_interactive(NET_ID_INFO_1 *id1, struct smb_passwd *smb_p if (memcmp(smb_pass->smb_passwd , lm_pwd, 16) != 0 || memcmp(smb_pass->smb_nt_passwd, nt_pwd, 16) != 0) { - status = 0xC0000000 | NT_STATUS_WRONG_PASSWORD; + status = NT_STATUS_WRONG_PASSWORD; } return status; @@ -609,7 +609,7 @@ static uint32 net_login_network(NET_ID_INFO_2 *id2, struct smb_passwd *smb_pass) id2->lm_chal)) return 0x0; else - return 0xC0000000 | NT_STATUS_WRONG_PASSWORD; + return NT_STATUS_WRONG_PASSWORD; } /* lkclXXXX this is not a good place to put disabling of LM hashes in. @@ -631,7 +631,7 @@ static uint32 net_login_network(NET_ID_INFO_2 *id2, struct smb_passwd *smb_pass) /* oops! neither password check succeeded */ - return 0xC0000000 | NT_STATUS_WRONG_PASSWORD; + return NT_STATUS_WRONG_PASSWORD; } /************************************************************************* @@ -673,7 +673,7 @@ static BOOL api_net_sam_logon(pipes_struct *p) /* checks and updates credentials. creates reply credentials */ if (!deal_with_creds(vuser->dc.sess_key, &(vuser->dc.clnt_cred), &(q_l.sam_id.client.cred), &srv_cred)) - status = 0xC0000000 | NT_STATUS_INVALID_HANDLE; + status = NT_STATUS_INVALID_HANDLE; else memcpy(&(vuser->dc.srv_cred), &(vuser->dc.clnt_cred), sizeof(vuser->dc.clnt_cred)); @@ -695,7 +695,7 @@ static BOOL api_net_sam_logon(pipes_struct *p) break; default: DEBUG(2,("SAM Logon: unsupported switch value\n")); - status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + status = NT_STATUS_INVALID_INFO_CLASS; break; } /* end switch */ } /* end if status == 0 */ @@ -723,11 +723,11 @@ static BOOL api_net_sam_logon(pipes_struct *p) unbecome_root(); if (smb_pass == NULL) - status = 0xC0000000 | NT_STATUS_NO_SUCH_USER; + status = NT_STATUS_NO_SUCH_USER; else if (smb_pass->acct_ctrl & ACB_PWNOTREQ) status = 0; else if (smb_pass->acct_ctrl & ACB_DISABLED) - status = 0xC0000000 | NT_STATUS_ACCOUNT_DISABLED; + status = NT_STATUS_ACCOUNT_DISABLED; } /* Validate password - if required. */ @@ -851,7 +851,7 @@ static BOOL api_net_sam_logon(pipes_struct *p) &global_sam_sid, /* DOM_SID *dom_sid */ NULL); /* char *other_sids */ else - status = 0xC0000000 | NT_STATUS_NO_SUCH_USER; + status = NT_STATUS_NO_SUCH_USER; /* Free any allocated groups array. */ if(gids) diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 6f650c7e5e..049db69ca7 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -78,8 +78,8 @@ static void NTLMSSPcalc_p( pipes_struct *p, unsigned char *data, int len) BOOL create_next_pdu(pipes_struct *p) { RPC_HDR_RESP hdr_resp; - BOOL auth_verify = IS_BITS_SET_ALL(p->ntlmssp_chal_flags, NTLMSSP_NEGOTIATE_SIGN); - BOOL auth_seal = IS_BITS_SET_ALL(p->ntlmssp_chal_flags, NTLMSSP_NEGOTIATE_SEAL); + BOOL auth_verify = ((p->ntlmssp_chal_flags & NTLMSSP_NEGOTIATE_SIGN) != 0); + BOOL auth_seal = ((p->ntlmssp_chal_flags & NTLMSSP_NEGOTIATE_SEAL) != 0); uint32 data_len; uint32 data_space_available; uint32 data_len_left; @@ -292,7 +292,7 @@ static BOOL api_pipe_ntlmssp_verify(pipes_struct *p, RPC_AUTH_NTLMSSP_RESP *ntlm * We always negotiate UNICODE. */ - if (IS_BITS_SET_ALL(p->ntlmssp_chal_flags, NTLMSSP_NEGOTIATE_UNICODE)) { + if (p->ntlmssp_chal_flags & NTLMSSP_NEGOTIATE_UNICODE) { fstrcpy(user_name, dos_unistrn2((uint16*)ntlmssp_resp->user, ntlmssp_resp->hdr_usr.str_str_len/2)); fstrcpy(domain, dos_unistrn2((uint16*)ntlmssp_resp->domain, ntlmssp_resp->hdr_domain.str_str_len/2)); fstrcpy(wks, dos_unistrn2((uint16*)ntlmssp_resp->wks, ntlmssp_resp->hdr_wks.str_str_len/2)); @@ -1014,8 +1014,8 @@ BOOL api_pipe_auth_process(pipes_struct *p, prs_struct *rpc_in) /* * We always negotiate the following two bits.... */ - BOOL auth_verify = IS_BITS_SET_ALL(p->ntlmssp_chal_flags, NTLMSSP_NEGOTIATE_SIGN); - BOOL auth_seal = IS_BITS_SET_ALL(p->ntlmssp_chal_flags, NTLMSSP_NEGOTIATE_SEAL); + BOOL auth_verify = ((p->ntlmssp_chal_flags & NTLMSSP_NEGOTIATE_SIGN) != 0); + BOOL auth_seal = ((p->ntlmssp_chal_flags & NTLMSSP_NEGOTIATE_SEAL) != 0); int data_len; int auth_len; uint32 old_offset; diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index e51bc5ae4d..e6aeb26d63 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -213,17 +213,6 @@ pipes_struct *open_rpc_pipe_p(char *pipe_name, fstrcpy(p->name, pipe_name); -#if 0 - - Comment out until memory leak fixed. JRA. - - /* - * For Luke - attempt to connect to RPC redirect process. - */ - - attempt_remote_rpc_connect(p); -#endif - DEBUG(4,("Opened pipe %s with handle %x (pipes_open=%d)\n", pipe_name, i, pipes_open)); @@ -364,7 +353,7 @@ static ssize_t unmarshall_rpc_header(pipes_struct *p) static BOOL process_request_pdu(pipes_struct *p, prs_struct *rpc_in_p) { - BOOL auth_verify = IS_BITS_SET_ALL(p->ntlmssp_chal_flags, NTLMSSP_NEGOTIATE_SIGN); + BOOL auth_verify = ((p->ntlmssp_chal_flags & NTLMSSP_NEGOTIATE_SIGN) != 0); size_t data_len = p->hdr.frag_len - RPC_HEADER_LEN - RPC_HDR_REQ_LEN - (auth_verify ? RPC_HDR_AUTH_LEN : 0) - p->hdr.auth_len; diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 12b0d95abf..5a0f049ba7 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -88,7 +88,7 @@ static BOOL get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, (*num_entries), pwd->smb_name, pwd->user_rid, pwd->acct_ctrl)); - if (acb_mask == 0 || IS_BITS_SET_SOME(pwd->acct_ctrl, acb_mask)) { + if (acb_mask == 0 || (pwd->acct_ctrl & acb_mask)) { DEBUG(5,(" acb_mask %x accepts\n", acb_mask)); (*num_entries)++; } else { diff --git a/source3/rpc_server/srv_srvsvc.c b/source3/rpc_server/srv_srvsvc.c index 34f369bc8b..715a681a29 100644 --- a/source3/rpc_server/srv_srvsvc.c +++ b/source3/rpc_server/srv_srvsvc.c @@ -192,7 +192,7 @@ static void init_srv_r_net_share_enum(SRV_R_NET_SHARE_ENUM *r_n, &resume_hnd, &r_n->total_entries)) { r_n->status = 0x0; } else { - r_n->status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + r_n->status = NT_STATUS_INVALID_INFO_CLASS; } init_enum_hnd(&r_n->enum_hnd, resume_hnd); @@ -255,11 +255,11 @@ static void init_srv_r_net_share_get_info(SRV_R_NET_SHARE_GET_INFO *r_n, break; default: DEBUG(5,("init_srv_net_share_get_info: unsupported switch value %d\n", info_level)); - status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + status = NT_STATUS_INVALID_INFO_CLASS; break; } } else { - status = 0xC0000000 | NT_STATUS_BAD_NETWORK_NAME; + status = NT_STATUS_BAD_NETWORK_NAME; } r_n->ptr_share_ctr = (status == 0x0) ? 1 : 0; @@ -462,7 +462,7 @@ static uint32 init_srv_sess_info_ctr(SRV_SESS_INFO_CTR *ctr, (*resume_hnd) = 0; (*total_entries) = 0; ctr->ptr_sess_ctr = 0; - status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + status = NT_STATUS_INVALID_INFO_CLASS; break; } } @@ -481,7 +481,7 @@ static void init_srv_r_net_sess_enum(SRV_R_NET_SESS_ENUM *r_n, r_n->sess_level = sess_level; if (sess_level == -1) { - r_n->status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + r_n->status = NT_STATUS_INVALID_INFO_CLASS; } else { @@ -675,7 +675,7 @@ static uint32 init_srv_conn_info_ctr(SRV_CONN_INFO_CTR *ctr, (*resume_hnd = 0); (*total_entries) = 0; ctr->ptr_conn_ctr = 0; - status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + status = NT_STATUS_INVALID_INFO_CLASS; break; } } @@ -694,7 +694,7 @@ static void init_srv_r_net_conn_enum(SRV_R_NET_CONN_ENUM *r_n, r_n->conn_level = conn_level; if (conn_level == -1) { - r_n->status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + r_n->status = NT_STATUS_INVALID_INFO_CLASS; } else { @@ -810,7 +810,7 @@ static uint32 init_srv_file_info_ctr(SRV_FILE_INFO_CTR *ctr, (*resume_hnd = 0); (*total_entries) = 0; ctr->ptr_file_ctr = 0; - status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + status = NT_STATUS_INVALID_INFO_CLASS; break; } } @@ -829,7 +829,7 @@ static void init_srv_r_net_file_enum(SRV_R_NET_FILE_ENUM *r_n, r_n->file_level = file_level; if (file_level == 0) { - r_n->status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + r_n->status = NT_STATUS_INVALID_INFO_CLASS; } else { @@ -910,7 +910,7 @@ static void srv_reply_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *q_n, } default: { - status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS; + status = NT_STATUS_INVALID_INFO_CLASS; break; } } diff --git a/source3/rpc_server/srv_util.c b/source3/rpc_server/srv_util.c index a1f2a7c085..ba13f0ed7a 100644 --- a/source3/rpc_server/srv_util.c +++ b/source3/rpc_server/srv_util.c @@ -216,7 +216,7 @@ uint32 lookup_group_name(uint32 rid, char *group_name, uint32 *type) } DEBUG(5,(" none mapped\n")); - return 0xC0000000 | NT_STATUS_NONE_MAPPED; + return NT_STATUS_NONE_MAPPED; } /******************************************************************* @@ -242,7 +242,7 @@ uint32 lookup_alias_name(uint32 rid, char *alias_name, uint32 *type) } DEBUG(5,(" none mapped\n")); - return 0xC0000000 | NT_STATUS_NONE_MAPPED; + return NT_STATUS_NONE_MAPPED; } /******************************************************************* @@ -282,7 +282,7 @@ uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type) } DEBUG(5,(" none mapped\n")); - return 0xC0000000 | NT_STATUS_NONE_MAPPED; + return NT_STATUS_NONE_MAPPED; } /******************************************************************* @@ -301,7 +301,7 @@ uint32 lookup_group_rid(char *group_name, uint32 *rid) } while (grp_name != NULL && !strequal(grp_name, group_name)); - return (grp_name != NULL) ? 0 : 0xC0000000 | NT_STATUS_NONE_MAPPED; + return (grp_name != NULL) ? 0 : NT_STATUS_NONE_MAPPED; } /******************************************************************* @@ -320,7 +320,7 @@ uint32 lookup_alias_rid(char *alias_name, uint32 *rid) } while (als_name != NULL && !strequal(als_name, alias_name)); - return (als_name != NULL) ? 0 : 0xC0000000 | NT_STATUS_NONE_MAPPED; + return (als_name != NULL) ? 0 : NT_STATUS_NONE_MAPPED; } /******************************************************************* @@ -342,7 +342,7 @@ uint32 lookup_user_rid(char *user_name, uint32 *rid) return 0x0; } - return 0xC0000000 | NT_STATUS_NONE_MAPPED; + return NT_STATUS_NONE_MAPPED; } #undef OLD_NTDOMAIN |