diff --git a/source3/auth/auth.c b/source3/auth/auth.c index ec493b7c065..d6bc8aeadcc 100644 --- a/source3/auth/auth.c +++ b/source3/auth/auth.c @@ -68,15 +68,15 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info, return NT_STATUS_LOGON_FAILURE; } - if (nt_status != NT_STATUS_NOPROBLEMO) { + if (nt_status != NT_STATUS_OK) { nt_status = check_rhosts_security(user_info, server_info); } - if ((lp_security() == SEC_DOMAIN) && (nt_status != NT_STATUS_NOPROBLEMO)) { + if ((lp_security() == SEC_DOMAIN) && (nt_status != NT_STATUS_OK)) { nt_status = check_domain_security(user_info, server_info); } - if ((lp_security() == SEC_SERVER) && (nt_status != NT_STATUS_NOPROBLEMO)) { + if ((lp_security() == SEC_SERVER) && (nt_status != NT_STATUS_OK)) { nt_status = check_server_security(user_info, server_info); } @@ -84,7 +84,7 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info, smb_user_control(user_info->smb_username.str, nt_status); } - if (nt_status != NT_STATUS_NOPROBLEMO) { + if (nt_status != NT_STATUS_OK) { if ((user_info->plaintext_password.len > 0) && (!lp_plaintext_to_smbpasswd())) { nt_status = check_unix_security(user_info, server_info); @@ -94,14 +94,14 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info, } } - if ((nt_status == NT_STATUS_NOPROBLEMO) && !done_pam) { + if ((nt_status == NT_STATUS_OK) && !done_pam) { /* We might not be root if we are an RPC call */ become_root(); nt_status = smb_pam_accountcheck(user_info->smb_username.str); unbecome_root(); } - if (nt_status == NT_STATUS_NOPROBLEMO) { + if (nt_status == NT_STATUS_OK) { DEBUG(5, ("check_password: Password for user %s suceeded\n", user_info->smb_username.str)); } else { DEBUG(3, ("check_password: Password for user %s FAILED with error %s\n", user_info->smb_username.str, get_nt_error_msg(nt_status))); @@ -233,11 +233,11 @@ BOOL password_ok(char *user, char *password, int pwlen) /* The password could be either NTLM or plain LM. Try NTLM first, but fall-through as required. */ - if (pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen) == NT_STATUS_NOPROBLEMO) { + if (pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen) == NT_STATUS_OK) { return True; } - if (pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0) == NT_STATUS_NOPROBLEMO) { + if (pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0) == NT_STATUS_OK) { return True; } diff --git a/source3/auth/auth_rhosts.c b/source3/auth/auth_rhosts.c index f11f9cf777c..a4914f2ef16 100644 --- a/source3/auth/auth_rhosts.c +++ b/source3/auth/auth_rhosts.c @@ -175,7 +175,7 @@ uint32 check_rhosts_security(const auth_usersupplied_info *user_info, become_root(); if (check_hosts_equiv(user_info->smb_username.str)) { - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; } unbecome_root(); diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index 1a5d02e4a44..54847581679 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -127,7 +127,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_ if (lp_null_passwords()) { DEBUG(3,("Account for user '%s' has no password and null passwords are allowed.\n", user_info->smb_username.str)); - return(NT_STATUS_NOPROBLEMO); + return(NT_STATUS_OK); } else { @@ -156,7 +156,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_ user_info->requested_domain.str, (char *)server_info->session_key)) { - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } DEBUG(4,("smb_password_ok: NTLMv2 password check failed\n")); @@ -169,7 +169,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_ nt_pw, user_info->chal, server_info->session_key)) { DEBUG(4,("smb_password_ok: NT MD4 password check succeeded\n")); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } else { DEBUG(4,("smb_password_ok: NT MD4 password check failed\n")); return NT_STATUS_WRONG_PASSWORD; @@ -185,7 +185,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_ lm_pw, user_info->chal, server_info->session_key)) { DEBUG(4,("smb_password_ok: LM password check succeeded\n")); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } else { DEBUG(4,("smb_password_ok: LM password check failed\n")); return NT_STATUS_WRONG_PASSWORD; diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index ad66f0c4ac9..9636094fa36 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -214,7 +214,7 @@ use this machine as the password server.\n")); /* Make this cli_nt_error() when the conversion is in */ nt_status = NT_STATUS_LOGON_FAILURE; } else { - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; } /* if logged in as guest then reject */ diff --git a/source3/auth/auth_unix.c b/source3/auth/auth_unix.c index 89e670747f2..fda44fd91ce 100644 --- a/source3/auth/auth_unix.c +++ b/source3/auth/auth_unix.c @@ -76,7 +76,7 @@ uint32 check_unix_security(const auth_usersupplied_info *user_info, auth_servers nt_status = (pass_check(user_info->smb_username.str, user_info->plaintext_password.str, user_info->plaintext_password.len, lp_update_encrypted() ? update_smbpassword_file : NULL) - ? NT_STATUS_NOPROBLEMO : NT_STATUS_LOGON_FAILURE); + ? NT_STATUS_OK : NT_STATUS_LOGON_FAILURE); unbecome_root(); return nt_status; diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 4a0f45f8436..5ccf9638894 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -105,7 +105,7 @@ void smb_user_control(char *unix_user, uint32 nt_status) { struct passwd *pwd=NULL; - if(nt_status == NT_STATUS_NOPROBLEMO) { + if(nt_status == NT_STATUS_OK) { /* * User validated ok against Domain controller. * If the admin wants us to try and create a UNIX diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c index 418c618af2b..359ed02b293 100644 --- a/source3/auth/pampass.c +++ b/source3/auth/pampass.c @@ -88,7 +88,7 @@ static BOOL smb_pam_nt_status_error_handler(pam_handle_t *pamh, int pam_error, if (smb_pam_error_handler(pamh, pam_error, msg, dbglvl)) return True; - if (*nt_status == NT_STATUS_NOPROBLEMO) { + if (*nt_status == NT_STATUS_OK) { /* Complain LOUDLY */ DEBUG(0, ("smb_pam_nt_status_error_handler: PAM: BUG: PAM and NT_STATUS \ error MISMATCH, forcing to NT_STATUS_LOGON_FAILURE")); @@ -533,7 +533,7 @@ static uint32 smb_pam_auth(pam_handle_t *pamh, char *user) break; case PAM_SUCCESS: DEBUG(4, ("smb_pam_auth: PAM: User %s Authenticated OK\n", user)); - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; break; default: DEBUG(0, ("smb_pam_auth: PAM: UNKNOWN ERROR while authenticating user %s\n", user)); @@ -578,7 +578,7 @@ static uint32 smb_pam_account(pam_handle_t *pamh, char * user) break; case PAM_SUCCESS: DEBUG(4, ("smb_pam_account: PAM: Account OK for User: %s\n", user)); - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; break; default: nt_status = NT_STATUS_ACCOUNT_DISABLED; @@ -625,7 +625,7 @@ static uint32 smb_pam_setcred(pam_handle_t *pamh, char * user) break; case PAM_SUCCESS: DEBUG(4, ("smb_pam_setcred: PAM: SetCredentials OK for User: %s\n", user)); - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; break; default: DEBUG(0, ("smb_pam_setcred: PAM: UNKNOWN PAM ERROR (%d) during SetCredentials for User: %s\n", pam_error, user)); @@ -787,7 +787,7 @@ uint32 smb_pam_accountcheck(char * user) /* Ignore PAM if told to. */ if (!lp_obey_pam_restrictions()) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; if ((pconv = smb_setup_pam_conv(smb_pam_conv, user, NULL, NULL)) == NULL) return False; @@ -795,7 +795,7 @@ uint32 smb_pam_accountcheck(char * user) if (!smb_pam_start(&pamh, user, NULL, pconv)) return NT_STATUS_ACCOUNT_DISABLED; - if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_NOPROBLEMO) + if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_OK) DEBUG(0, ("smb_pam_accountcheck: PAM: Account Validation Failed - Rejecting User %s!\n", user)); smb_pam_end(pamh, pconv); @@ -824,19 +824,19 @@ uint32 smb_pam_passcheck(char * user, char * password) if (!smb_pam_start(&pamh, user, NULL, pconv)) return NT_STATUS_LOGON_FAILURE; - if ((nt_status = smb_pam_auth(pamh, user)) != NT_STATUS_NOPROBLEMO) { + if ((nt_status = smb_pam_auth(pamh, user)) != NT_STATUS_OK) { DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_auth failed - Rejecting User %s !\n", user)); smb_pam_end(pamh, pconv); return nt_status; } - if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_NOPROBLEMO) { + if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_OK) { DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_account failed - Rejecting User %s !\n", user)); smb_pam_end(pamh, pconv); return nt_status; } - if ((nt_status = smb_pam_setcred(pamh, user)) != NT_STATUS_NOPROBLEMO) { + if ((nt_status = smb_pam_setcred(pamh, user)) != NT_STATUS_OK) { DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_setcred failed - Rejecting User %s !\n", user)); smb_pam_end(pamh, pconv); return nt_status; @@ -876,7 +876,7 @@ BOOL smb_pam_passchange(char * user, char * oldpassword, char * newpassword) /* If PAM not used, no PAM restrictions on accounts. */ uint32 smb_pam_accountcheck(char * user) { - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /* If PAM not used, also no PAM restrictions on sessions. */ diff --git a/source3/auth/pass_check.c b/source3/auth/pass_check.c index 677d298449f..b6cc403b869 100644 --- a/source3/auth/pass_check.c +++ b/source3/auth/pass_check.c @@ -599,7 +599,7 @@ static BOOL password_check(char *password) { #ifdef WITH_PAM - return (smb_pam_passcheck(this_user, password) == NT_STATUS_NOPROBLEMO); + return (smb_pam_passcheck(this_user, password) == NT_STATUS_OK); #endif /* WITH_PAM */ #ifdef WITH_AFS diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h index 4c9265f09fa..de215371166 100644 --- a/source3/include/nt_printing.h +++ b/source3/include/nt_printing.h @@ -231,7 +231,7 @@ typedef struct nt_printer_info_level_2 uint32 default_priority; uint32 starttime; uint32 untiltime; - uint32 status; + NTSTATUS status; uint32 cjobs; uint32 averageppm; fstring servername; diff --git a/source3/include/nterr.h b/source3/include/nterr.h index 0ab08479c8c..da7b50b04a8 100644 --- a/source3/include/nterr.h +++ b/source3/include/nterr.h @@ -12,7 +12,6 @@ we start supporting NT error codes in Samba. They were extracted using a loop in smbclient then printing a netmon sniff to a file */ -#define NT_STATUS_NOPROBLEMO NT_STATUS(0x0) #define NT_STATUS_OK NT_STATUS(0x0) #define NT_STATUS_UNSUCCESSFUL NT_STATUS(0xC0000000 | 1) #define NT_STATUS_NOT_IMPLEMENTED NT_STATUS(0xC0000000 | 2) diff --git a/source3/include/rpc_brs.h b/source3/include/rpc_brs.h index 36d89ec151c..99ba8f2dd07 100644 --- a/source3/include/rpc_brs.h +++ b/source3/include/rpc_brs.h @@ -73,7 +73,7 @@ typedef struct r_brs_query_info_info } info; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } BRS_R_QUERY_INFO; diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 96704b33610..f9ebaae0b81 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -161,7 +161,7 @@ typedef struct rpc_hdr_resp_info /* RPC_HDR_FAULT - fault rpc header */ typedef struct rpc_hdr_fault_info { - uint32 status; + NTSTATUS status; uint32 reserved; /* 0x0000 0000 */ } RPC_HDR_FAULT; diff --git a/source3/include/rpc_dfs.h b/source3/include/rpc_dfs.h index 40e73c5afb4..57a633b8e67 100644 --- a/source3/include/rpc_dfs.h +++ b/source3/include/rpc_dfs.h @@ -55,7 +55,7 @@ DFS_Q_DFS_EXIST; /* status == 1 if dfs exists. */ typedef struct dfs_r_dfs_exist { - uint32 status; + NTSTATUS status; } DFS_R_DFS_EXIST; @@ -75,7 +75,7 @@ DFS_Q_DFS_ADD; typedef struct dfs_r_dfs_add { - uint32 status; + NTSTATUS status; } DFS_R_DFS_ADD; @@ -92,7 +92,7 @@ DFS_Q_DFS_REMOVE; typedef struct dfs_r_dfs_remove { - uint32 status; + NTSTATUS status; } DFS_R_DFS_REMOVE; @@ -173,7 +173,7 @@ typedef struct dfs_r_dfs_get_info uint32 level; uint32 ptr_ctr; DFS_INFO_CTR ctr; - uint32 status; + NTSTATUS status; } DFS_R_DFS_GET_INFO; @@ -202,7 +202,7 @@ typedef struct dfs_r_dfs_enum uint32 ptr_num_entries2; uint32 num_entries2; ENUM_HND reshnd; - uint32 status; + NTSTATUS status; } DFS_R_DFS_ENUM; diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index f15cec3ca9a..ce5a8b85a1e 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -226,7 +226,7 @@ typedef struct net_r_logon_ctrl_info NETLOGON_INFO_1 info1; } logon; - uint32 status; + NTSTATUS status; } NET_R_LOGON_CTRL; /******************************************************** @@ -269,7 +269,7 @@ typedef struct net_r_logon_ctrl2_info } logon; - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } NET_R_LOGON_CTRL2; @@ -288,7 +288,7 @@ typedef struct net_r_trust_dom_info { UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS]; - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } NET_R_TRUST_DOM_LIST; @@ -315,10 +315,8 @@ typedef struct net_q_req_chal_info /* NET_R_REQ_CHAL */ typedef struct net_r_req_chal_info { - DOM_CHAL srv_chal; /* server challenge */ - - uint32 status; /* return code */ - + DOM_CHAL srv_chal; /* server challenge */ + NTSTATUS status; /* return code */ } NET_R_REQ_CHAL; /* NET_Q_AUTH */ @@ -332,7 +330,7 @@ typedef struct net_q_auth_info typedef struct net_r_auth_info { DOM_CHAL srv_chal; /* server-calculated credentials */ - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } NET_R_AUTH; /* NET_Q_AUTH_2 */ @@ -352,7 +350,7 @@ typedef struct net_r_auth2_info DOM_CHAL srv_chal; /* server-calculated credentials */ NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */ - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } NET_R_AUTH_2; @@ -370,7 +368,7 @@ typedef struct net_r_srv_pwset_info { DOM_CRED srv_cred; /* server-calculated credentials */ - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } NET_R_SRV_PWSET; @@ -459,7 +457,7 @@ typedef struct net_r_sam_logon_info uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } NET_R_SAM_LOGON; @@ -477,7 +475,7 @@ typedef struct net_r_sam_logoff_info uint32 buffer_creds; /* undocumented buffer pointer */ DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } NET_R_SAM_LOGOFF; diff --git a/source3/include/rpc_reg.h b/source3/include/rpc_reg.h index f65d8d7cc31..1906eb1aad0 100644 --- a/source3/include/rpc_reg.h +++ b/source3/include/rpc_reg.h @@ -73,7 +73,7 @@ typedef struct q_reg_open_hkcr_info typedef struct r_reg_open_hkcr_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_OPEN_HKCR; @@ -93,7 +93,7 @@ REG_Q_OPEN_HKLM; typedef struct r_reg_open_hklm_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_OPEN_HKLM; @@ -113,7 +113,7 @@ typedef struct q_reg_open_hku_info typedef struct r_reg_open_hku_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_OPEN_HKU; @@ -128,7 +128,7 @@ typedef struct q_reg_open_flush_key_info /* REG_R_FLUSH_KEY */ typedef struct r_reg_open_flush_key_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_FLUSH_KEY; @@ -149,7 +149,7 @@ typedef struct q_reg_set_key_sec_info /* REG_R_SET_KEY_SEC */ typedef struct r_reg_set_key_sec_info { - uint32 status; + NTSTATUS status; } REG_R_SET_KEY_SEC; @@ -176,7 +176,7 @@ typedef struct r_reg_get_key_sec_info BUFHDR hdr_sec; /* header for security data */ SEC_DESC_BUF *data; /* security data */ - uint32 status; + NTSTATUS status; } REG_R_GET_KEY_SEC; @@ -197,7 +197,7 @@ typedef struct q_reg_create_value_info /* REG_R_CREATE_VALUE */ typedef struct r_reg_create_value_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_CREATE_VALUE; @@ -243,7 +243,7 @@ typedef struct r_reg_enum_value_info uint32 ptr2; /* pointer */ uint32 len_value2; /* */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_ENUM_VALUE; @@ -279,7 +279,7 @@ typedef struct r_reg_create_key_info POLICY_HND key_pol; /* policy handle */ uint32 unknown; /* 0x0000 0000 */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_CREATE_KEY; @@ -297,7 +297,7 @@ typedef struct r_reg_delete_key_info { POLICY_HND key_pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_DELETE_KEY; @@ -316,7 +316,7 @@ typedef struct r_reg_delete_val_info { POLICY_HND key_pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_DELETE_VALUE; @@ -344,7 +344,7 @@ typedef struct r_reg_query_key_info uint32 sec_desc; /* 0x0000 0078 */ NTTIME mod_time; /* modified time */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_QUERY_KEY; @@ -360,7 +360,7 @@ typedef struct q_reg_unk_1a_info typedef struct r_reg_unk_1a_info { uint32 unknown; /* 0x0500 0000 */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_UNK_1A; @@ -377,7 +377,7 @@ typedef struct reg_r_close_info { POLICY_HND pol; /* policy handle. should be all zeros. */ - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } REG_R_CLOSE; @@ -422,7 +422,7 @@ typedef struct r_reg_enum_key_info uint32 ptr3; /* pointer */ NTTIME time; /* current time? */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_ENUM_KEY; @@ -466,7 +466,7 @@ typedef struct r_reg_info_info uint32 ptr_len; uint32 buf_len; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_INFO; @@ -490,7 +490,7 @@ typedef struct q_reg_open_entry_info typedef struct r_reg_open_entry_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_OPEN_ENTRY; @@ -510,7 +510,7 @@ typedef struct q_reg_shutdown_info /* REG_R_SHUTDOWN */ typedef struct r_reg_shutdown_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_SHUTDOWN; @@ -525,7 +525,7 @@ typedef struct q_reg_abort_shutdown_info /* REG_R_ABORT_SHUTDOWN */ typedef struct r_reg_abort_shutdown_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } REG_R_ABORT_SHUTDOWN; diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index 1cf3248b810..a29f96c107a 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -411,7 +411,7 @@ typedef struct q_samr_close_hnd_info typedef struct r_samr_close_hnd_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_CLOSE_HND; @@ -438,7 +438,7 @@ typedef struct r_samr_usrdom_pwinfo_info uint16 unknown_0; /* 0000 */ uint16 unknown_1; /* 0x0016 or 0x0015 */ uint32 unknown_2; /* 0x0000 0000 */ - uint32 status; + NTSTATUS status; } SAMR_R_GET_USRDOM_PWINFO; @@ -461,7 +461,7 @@ typedef struct r_samr_query_sec_obj_info uint32 ptr; SEC_DESC_BUF *buf; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_QUERY_SEC_OBJ; @@ -583,7 +583,7 @@ typedef struct r_samr_query_domain_info SAM_UNK_CTR *ctr; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_QUERY_DOMAIN_INFO; @@ -605,7 +605,7 @@ typedef struct r_samr_lookup_domain_info uint32 ptr_sid; DOM_SID2 dom_sid; - uint32 status; + NTSTATUS status; } SAMR_R_LOOKUP_DOMAIN; @@ -631,7 +631,7 @@ typedef struct q_samr_open_domain_info typedef struct r_samr_open_domain_info { POLICY_HND domain_pol; /* policy handle associated with the SID */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_OPEN_DOMAIN; @@ -671,7 +671,7 @@ typedef struct r_samr_enum_domains_info uint32 num_entries4; - uint32 status; + NTSTATUS status; } SAMR_R_ENUM_DOMAINS; @@ -705,7 +705,7 @@ typedef struct r_samr_enum_dom_users_info uint32 num_entries4; - uint32 status; + NTSTATUS status; } SAMR_R_ENUM_DOM_USERS; @@ -739,7 +739,7 @@ typedef struct r_samr_enum_dom_groups_info uint32 num_entries4; - uint32 status; + NTSTATUS status; } SAMR_R_ENUM_DOM_GROUPS; @@ -773,7 +773,7 @@ typedef struct r_samr_enum_dom_aliases_info uint32 num_entries4; - uint32 status; + NTSTATUS status; } SAMR_R_ENUM_DOM_ALIASES; @@ -964,7 +964,7 @@ typedef struct r_samr_query_dispinfo_info SAM_DISPINFO_CTR *ctr; - uint32 status; + NTSTATUS status; } SAMR_R_QUERY_DISPINFO; @@ -981,7 +981,7 @@ typedef struct q_samr_delete_dom_group_info typedef struct r_samr_delete_dom_group_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_DELETE_DOM_GROUP; @@ -1004,7 +1004,7 @@ typedef struct r_samr_create_dom_group_info POLICY_HND pol; /* policy handle */ uint32 rid; - uint32 status; + NTSTATUS status; } SAMR_R_CREATE_DOM_GROUP; @@ -1059,7 +1059,7 @@ typedef struct r_samr_query_groupinfo_info uint32 ptr; GROUP_INFO_CTR *ctr; - uint32 status; + NTSTATUS status; } SAMR_R_QUERY_GROUPINFO; @@ -1075,7 +1075,7 @@ typedef struct q_samr_set_group_info /* SAMR_R_SET_GROUPINFO - SAM Group Info */ typedef struct r_samr_set_group_info { - uint32 status; + NTSTATUS status; } SAMR_R_SET_GROUPINFO; @@ -1092,7 +1092,7 @@ typedef struct q_samr_delete_dom_alias_info typedef struct r_samr_delete_dom_alias_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_DELETE_DOM_ALIAS; @@ -1115,7 +1115,7 @@ typedef struct r_samr_create_dom_alias_info POLICY_HND alias_pol; /* policy handle */ uint32 rid; - uint32 status; + NTSTATUS status; } SAMR_R_CREATE_DOM_ALIAS; @@ -1155,7 +1155,7 @@ typedef struct r_samr_query_aliasinfo_info uint32 ptr; ALIAS_INFO_CTR ctr; - uint32 status; + NTSTATUS status; } SAMR_R_QUERY_ALIASINFO; @@ -1171,7 +1171,7 @@ typedef struct q_samr_set_alias_info /* SAMR_R_SET_ALIASINFO - SAM alias info */ typedef struct r_samr_set_aliasinfo_info { - uint32 status; + NTSTATUS status; } SAMR_R_SET_ALIASINFO; @@ -1193,7 +1193,7 @@ typedef struct r_samr_query_usergroup_info DOM_GID *gid; /* group info */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_QUERY_USERGROUPS; @@ -1232,7 +1232,7 @@ typedef struct q_samr_set_user_info2 /* SAMR_R_SET_USERINFO2 - set sam info */ typedef struct r_samr_set_user_info2 { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_SET_USERINFO2; @@ -1248,7 +1248,7 @@ typedef struct q_samr_set_user_info /* SAMR_R_SET_USERINFO - set sam info */ typedef struct r_samr_set_user_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_SET_USERINFO; @@ -1267,7 +1267,7 @@ typedef struct r_samr_query_user_info uint32 ptr; /* pointer */ SAM_USERINFO_CTR *ctr; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_QUERY_USERINFO; @@ -1303,7 +1303,7 @@ typedef struct r_samr_query_useraliases_info uint32 num_entries2; uint32 *rid; /* domain RIDs being looked up */ - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } SAMR_R_QUERY_USERALIASES; @@ -1342,7 +1342,7 @@ typedef struct r_samr_lookup_names_info uint32 *types; /* SID_ENUM type */ - uint32 status; /* return code */ + NTSTATUS status; /* return code */ } SAMR_R_LOOKUP_NAMES; @@ -1387,7 +1387,7 @@ typedef struct r_samr_lookup_rids_info uint32 *type; /* SID_ENUM type */ - uint32 status; + NTSTATUS status; } SAMR_R_LOOKUP_RIDS; @@ -1406,7 +1406,7 @@ typedef struct q_samr_open_user_info typedef struct r_samr_open_user_info { POLICY_HND user_pol; /* policy handle associated with unknown id */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_OPEN_USER; @@ -1432,7 +1432,7 @@ typedef struct r_samr_create_user_info uint32 unknown_0; /* 0x0007 03ff */ uint32 user_rid; /* user RID */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_CREATE_USER; @@ -1449,7 +1449,7 @@ typedef struct q_samr_delete_dom_user_info typedef struct r_samr_delete_dom_user_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_DELETE_DOM_USER; @@ -1477,7 +1477,7 @@ typedef struct r_samr_query_groupmem_info uint32 num_attrs; uint32 *attr; - uint32 status; + NTSTATUS status; } SAMR_R_QUERY_GROUPMEM; @@ -1495,7 +1495,7 @@ typedef struct q_samr_del_group_mem_info /* SAMR_R_DEL_GROUPMEM - probably an del group member */ typedef struct r_samr_del_group_mem_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_DEL_GROUPMEM; @@ -1514,7 +1514,7 @@ typedef struct q_samr_add_group_mem_info /* SAMR_R_ADD_GROUPMEM - probably an add group member */ typedef struct r_samr_add_group_mem_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_ADD_GROUPMEM; @@ -1533,7 +1533,7 @@ typedef struct q_samr_open_group_info typedef struct r_samr_open_group_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_OPEN_GROUP; @@ -1555,7 +1555,7 @@ typedef struct r_samr_query_aliasmem_info DOM_SID2 *sid; - uint32 status; + NTSTATUS status; } SAMR_R_QUERY_ALIASMEM; @@ -1573,7 +1573,7 @@ typedef struct q_samr_add_alias_mem_info /* SAMR_R_ADD_ALIASMEM - add alias member */ typedef struct r_samr_add_alias_mem_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_ADD_ALIASMEM; @@ -1591,7 +1591,7 @@ typedef struct q_samr_del_alias_mem_info /* SAMR_R_DEL_ALIASMEM - delete alias member */ typedef struct r_samr_del_alias_mem_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_DEL_ALIASMEM; @@ -1612,7 +1612,7 @@ typedef struct q_samr_open_alias_info typedef struct r_samr_open_alias_info { POLICY_HND pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_OPEN_ALIAS; @@ -1631,7 +1631,7 @@ typedef struct q_samr_connect_anon_info typedef struct r_samr_connect_anon_info { POLICY_HND connect_pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_CONNECT_ANON; @@ -1650,7 +1650,7 @@ typedef struct q_samr_connect_info typedef struct r_samr_connect_info { POLICY_HND connect_pol; /* policy handle */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_CONNECT; @@ -1669,7 +1669,7 @@ typedef struct r_samr_get_dom_pwinfo uint16 unk_0; uint16 unk_1; uint16 unk_2; - uint32 status; + NTSTATUS status; } SAMR_R_GET_DOM_PWINFO; @@ -1713,7 +1713,7 @@ typedef struct q_samr_chgpasswd_user_info /* SAMR_R_CHGPASSWD_USER */ typedef struct r_samr_chgpasswd_user_info { - uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */ + NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */ } SAMR_R_CHGPASSWD_USER; @@ -1730,7 +1730,7 @@ typedef struct q_samr_unknown_2d_info /* SAMR_R_UNKNOWN_2D - probably an open */ typedef struct r_samr_unknown_2d_info { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SAMR_R_UNKNOWN_2D; diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index dd66982cd5c..c57fc1bc421 100755 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -460,7 +460,7 @@ SPOOL_Q_OPEN_PRINTER_EX; typedef struct spool_r_open_printer_ex { POLICY_HND handle; /* handle used along all transactions (20*uint8) */ - uint32 status; + NTSTATUS status; } SPOOL_R_OPEN_PRINTER_EX; @@ -523,7 +523,7 @@ typedef struct spool_r_getprinterdata uint32 size; uint8 *data; uint32 needed; - uint32 status; + NTSTATUS status; } SPOOL_R_GETPRINTERDATA; @@ -536,7 +536,7 @@ SPOOL_Q_DELETEPRINTERDATA; typedef struct spool_r_deleteprinterdata { - uint32 status; + NTSTATUS status; } SPOOL_R_DELETEPRINTERDATA; @@ -549,7 +549,7 @@ SPOOL_Q_CLOSEPRINTER; typedef struct spool_r_closeprinter { POLICY_HND handle; - uint32 status; + NTSTATUS status; } SPOOL_R_CLOSEPRINTER; @@ -561,7 +561,7 @@ SPOOL_Q_STARTPAGEPRINTER; typedef struct spool_r_startpageprinter { - uint32 status; + NTSTATUS status; } SPOOL_R_STARTPAGEPRINTER; @@ -573,7 +573,7 @@ SPOOL_Q_ENDPAGEPRINTER; typedef struct spool_r_endpageprinter { - uint32 status; + NTSTATUS status; } SPOOL_R_ENDPAGEPRINTER; @@ -589,7 +589,7 @@ SPOOL_Q_DELETEPRINTERDRIVER; typedef struct spool_r_deleteprinterdriver { - uint32 status; + NTSTATUS status; } SPOOL_R_DELETEPRINTERDRIVER; @@ -629,7 +629,7 @@ SPOOL_Q_STARTDOCPRINTER; typedef struct spool_r_startdocprinter { uint32 jobid; - uint32 status; + NTSTATUS status; } SPOOL_R_STARTDOCPRINTER; @@ -641,7 +641,7 @@ SPOOL_Q_ENDDOCPRINTER; typedef struct spool_r_enddocprinter { - uint32 status; + NTSTATUS status; } SPOOL_R_ENDDOCPRINTER; @@ -657,7 +657,7 @@ SPOOL_Q_WRITEPRINTER; typedef struct spool_r_writeprinter { uint32 buffer_written; - uint32 status; + NTSTATUS status; } SPOOL_R_WRITEPRINTER; @@ -718,7 +718,7 @@ SPOOL_Q_RFFPCNEX; typedef struct spool_r_rffpcnex { - uint32 status; + NTSTATUS status; } SPOOL_R_RFFPCNEX; @@ -736,7 +736,7 @@ typedef struct spool_r_rfnpcnex { uint32 info_ptr; SPOOL_NOTIFY_INFO info; - uint32 status; + NTSTATUS status; } SPOOL_R_RFNPCNEX; @@ -749,7 +749,7 @@ SPOOL_Q_FCPN; typedef struct spool_r_fcpn { - uint32 status; + NTSTATUS status; } SPOOL_R_FCPN; @@ -789,7 +789,7 @@ typedef struct printer_info_0 uint32 unknown16; uint32 change_id; uint32 unknown18; - uint32 status; + NTSTATUS status; uint32 unknown20; uint32 c_setprinter; @@ -832,7 +832,7 @@ typedef struct printer_info_2 uint32 defaultpriority; uint32 starttime; uint32 untiltime; - uint32 status; + NTSTATUS status; uint32 cjobs; uint32 averageppm; } @@ -870,7 +870,7 @@ typedef struct spool_r_enumprinters NEW_BUFFER *buffer; uint32 needed; /* bytes needed */ uint32 returned; /* number of printers */ - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMPRINTERS; @@ -899,7 +899,7 @@ typedef struct spool_r_getprinter { NEW_BUFFER *buffer; uint32 needed; - uint32 status; + NTSTATUS status; } SPOOL_R_GETPRINTER; typedef struct driver_info_1 @@ -984,7 +984,7 @@ typedef struct spool_r_getprinterdriver2 uint32 needed; uint32 servermajorversion; uint32 serverminorversion; - uint32 status; + NTSTATUS status; } SPOOL_R_GETPRINTERDRIVER2; @@ -1010,7 +1010,7 @@ typedef struct spool_r_addjob { NEW_BUFFER *buffer; uint32 needed; - uint32 status; + NTSTATUS status; } SPOOL_R_ADDJOB; @@ -1042,7 +1042,7 @@ typedef struct s_job_info_1 UNISTR document; UNISTR datatype; UNISTR text_status; - uint32 status; + NTSTATUS status; uint32 priority; uint32 position; uint32 totalpages; @@ -1066,7 +1066,7 @@ typedef struct s_job_info_2 DEVICEMODE *devmode; UNISTR text_status; /* SEC_DESC sec_desc;*/ - uint32 status; + NTSTATUS status; uint32 priority; uint32 position; uint32 starttime; @@ -1106,7 +1106,7 @@ typedef struct spool_r_enumjobs NEW_BUFFER *buffer; uint32 needed; uint32 returned; - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMJOBS; @@ -1119,7 +1119,7 @@ SPOOL_Q_SCHEDULEJOB; typedef struct spool_r_schedulejob { - uint32 status; + NTSTATUS status; } SPOOL_R_SCHEDULEJOB; @@ -1166,7 +1166,7 @@ typedef struct spool_r_enumports NEW_BUFFER *buffer; uint32 needed; /* bytes needed */ uint32 returned; /* number of printers */ - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMPORTS; @@ -1201,7 +1201,7 @@ SPOOL_Q_SETJOB; typedef struct spool_r_setjob { - uint32 status; + NTSTATUS status; } SPOOL_R_SETJOB; @@ -1223,7 +1223,7 @@ typedef struct spool_r_enumprinterdrivers NEW_BUFFER *buffer; uint32 needed; uint32 returned; - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMPRINTERDRIVERS; @@ -1254,7 +1254,7 @@ typedef struct spool_r_enumforms NEW_BUFFER *buffer; uint32 needed; uint32 numofforms; - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMFORMS; @@ -1272,7 +1272,7 @@ typedef struct spool_r_getform { NEW_BUFFER *buffer; uint32 needed; - uint32 status; + NTSTATUS status; } SPOOL_R_GETFORM; @@ -1307,7 +1307,7 @@ typedef struct spool_printer_info_level_2 uint32 default_priority; uint32 starttime; uint32 untiltime; - uint32 status; + NTSTATUS status; uint32 cjobs; uint32 averageppm; UNISTR2 servername; @@ -1454,7 +1454,7 @@ SPOOL_Q_SETPRINTER; typedef struct spool_r_setprinter { - uint32 status; + NTSTATUS status; } SPOOL_R_SETPRINTER; @@ -1474,7 +1474,7 @@ SPOOL_Q_ADDPRINTER; typedef struct spool_r_addprinter { - uint32 status; + NTSTATUS status; } SPOOL_R_ADDPRINTER; @@ -1487,7 +1487,7 @@ SPOOL_Q_DELETEPRINTER; typedef struct spool_r_deleteprinter { POLICY_HND handle; - uint32 status; + NTSTATUS status; } SPOOL_R_DELETEPRINTER; @@ -1499,7 +1499,7 @@ SPOOL_Q_ABORTPRINTER; typedef struct spool_r_abortprinter { - uint32 status; + NTSTATUS status; } SPOOL_R_ABORTPRINTER; @@ -1522,7 +1522,7 @@ SPOOL_Q_ADDPRINTEREX; typedef struct spool_r_addprinterex { POLICY_HND handle; - uint32 status; + NTSTATUS status; } SPOOL_R_ADDPRINTEREX; @@ -1538,7 +1538,7 @@ SPOOL_Q_ADDPRINTERDRIVER; typedef struct spool_r_addprinterdriver { - uint32 status; + NTSTATUS status; } SPOOL_R_ADDPRINTERDRIVER; @@ -1571,7 +1571,7 @@ typedef struct spool_r_getprinterdriverdirectory { NEW_BUFFER *buffer; uint32 needed; - uint32 status; + NTSTATUS status; } SPOOL_R_GETPRINTERDRIVERDIR; @@ -1587,7 +1587,7 @@ SPOOL_Q_ADDPRINTPROCESSOR; typedef struct spool_r_addprintprocessor { - uint32 status; + NTSTATUS status; } SPOOL_R_ADDPRINTPROCESSOR; @@ -1615,7 +1615,7 @@ typedef struct spool_r_enumprintprocessors NEW_BUFFER *buffer; uint32 needed; uint32 returned; - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMPRINTPROCESSORS; @@ -1642,7 +1642,7 @@ typedef struct spool_r_enumprintprocdatatypes NEW_BUFFER *buffer; uint32 needed; uint32 returned; - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMPRINTPROCDATATYPES; @@ -1675,7 +1675,7 @@ typedef struct spool_r_enumprintmonitors NEW_BUFFER *buffer; uint32 needed; uint32 returned; - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMPRINTMONITORS; @@ -1698,7 +1698,7 @@ typedef struct spool_r_enumprinterdata uint32 datasize; uint8 *data; uint32 realdatasize; - uint32 status; + NTSTATUS status; } SPOOL_R_ENUMPRINTERDATA; @@ -1716,7 +1716,7 @@ SPOOL_Q_SETPRINTERDATA; typedef struct spool_r_setprinterdata { - uint32 status; + NTSTATUS status; } SPOOL_R_SETPRINTERDATA; @@ -1745,7 +1745,7 @@ SPOOL_Q_ADDFORM; typedef struct spool_r_addform { - uint32 status; + NTSTATUS status; } SPOOL_R_ADDFORM; @@ -1761,7 +1761,7 @@ SPOOL_Q_SETFORM; typedef struct spool_r_setform { - uint32 status; + NTSTATUS status; } SPOOL_R_SETFORM; @@ -1774,7 +1774,7 @@ SPOOL_Q_DELETEFORM; typedef struct spool_r_deleteform { - uint32 status; + NTSTATUS status; } SPOOL_R_DELETEFORM; @@ -1805,7 +1805,7 @@ typedef struct spool_r_getjob { NEW_BUFFER *buffer; uint32 needed; - uint32 status; + NTSTATUS status; } SPOOL_R_GETJOB; @@ -1822,7 +1822,7 @@ SPOOL_Q_REPLYOPENPRINTER; typedef struct spool_r_replyopenprinter { POLICY_HND handle; - uint32 status; + NTSTATUS status; } SPOOL_R_REPLYOPENPRINTER; @@ -1835,7 +1835,7 @@ SPOOL_Q_REPLYCLOSEPRINTER; typedef struct spool_r_replycloseprinter { POLICY_HND handle; - uint32 status; + NTSTATUS status; } SPOOL_R_REPLYCLOSEPRINTER; @@ -1854,7 +1854,7 @@ SPOOL_Q_REPLY_RRPCN; typedef struct spool_r_rrpcn { uint32 unknown0; - uint32 status; + NTSTATUS status; } SPOOL_R_REPLY_RRPCN; diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h index d6fe7617b25..651c0b97673 100644 --- a/source3/include/rpc_srvsvc.h +++ b/source3/include/rpc_srvsvc.h @@ -67,7 +67,7 @@ typedef struct net_srv_disk_enum { uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ uint32 total_entries; /* total number of entries */ ENUM_HND enum_hnd; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_Q_NET_DISK_ENUM, SRV_R_NET_DISK_ENUM; typedef struct net_name_validate { @@ -76,7 +76,7 @@ typedef struct net_name_validate { UNISTR2 uni_name; /*name to validate*/ uint32 type; uint32 flags; - uint32 status; + NTSTATUS status; } SRV_Q_NET_NAME_VALIDATE, SRV_R_NET_NAME_VALIDATE; /* SESS_INFO_0 (pointers to level 0 session info strings) */ @@ -185,7 +185,7 @@ typedef struct r_net_sess_enum_info uint32 total_entries; /* total number of entries */ ENUM_HND enum_hnd; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_SESS_ENUM; @@ -288,7 +288,7 @@ typedef struct r_net_conn_enum_info uint32 total_entries; /* total number of entries */ ENUM_HND enum_hnd; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_CONN_ENUM; @@ -444,7 +444,7 @@ typedef struct r_net_share_enum_info uint32 total_entries; /* total number of entries */ ENUM_HND enum_hnd; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_SHARE_ENUM; @@ -480,7 +480,7 @@ typedef struct srv_share_info { typedef struct r_net_share_get_info_info { SRV_SHARE_INFO info; - uint32 status; + NTSTATUS status; } SRV_R_NET_SHARE_GET_INFO; @@ -502,7 +502,7 @@ typedef struct r_net_share_set_info { uint32 switch_value; /* switch value */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_SHARE_SET_INFO; @@ -523,7 +523,7 @@ typedef struct r_net_share_add { uint32 switch_value; /* switch value */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_SHARE_ADD; @@ -539,7 +539,7 @@ typedef struct q_net_share_del /* SRV_R_NET_SHARE_DEL */ typedef struct r_net_share_del { - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_SHARE_DEL; @@ -622,7 +622,7 @@ typedef struct r_net_file_enum_info uint32 total_entries; /* total number of files */ ENUM_HND enum_hnd; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_FILE_ENUM; @@ -704,7 +704,7 @@ typedef struct r_net_srv_get_info { SRV_INFO_CTR *ctr; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_SRV_GET_INFO; @@ -725,7 +725,7 @@ typedef struct r_net_srv_set_info { uint32 switch_value; /* switch value */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_SRV_SET_INFO; @@ -761,7 +761,7 @@ typedef struct r_net_remote_tod uint32 ptr_srv_tod; /* pointer to TOD */ TIME_OF_DAY_INFO *tod; - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } SRV_R_NET_REMOTE_TOD; @@ -786,7 +786,7 @@ typedef struct r_net_file_query_secdesc uint32 ptr_secdesc; uint32 size_secdesc; SEC_DESC *sec_desc; - uint32 status; + NTSTATUS status; } SRV_R_NET_FILE_QUERY_SECDESC; /* SRV_Q_NET_FILE_SET_SECDESC */ @@ -807,6 +807,6 @@ typedef struct q_net_file_set_secdesc /* SRV_R_NET_FILE_SET_SECDESC */ typedef struct r_net_file_set_secdesc { - uint32 status; + NTSTATUS status; } SRV_R_NET_FILE_SET_SECDESC; #endif /* _RPC_SRVSVC_H */ diff --git a/source3/include/rpc_wkssvc.h b/source3/include/rpc_wkssvc.h index 1483997acb3..57a70b4798e 100644 --- a/source3/include/rpc_wkssvc.h +++ b/source3/include/rpc_wkssvc.h @@ -64,7 +64,7 @@ typedef struct r_wks_query_info_info uint32 ptr_1; /* pointer 1 */ WKS_INFO_100 *wks100; /* workstation info level 100 */ - uint32 status; /* return status */ + NTSTATUS status; /* return status */ } WKS_R_QUERY_INFO; diff --git a/source3/include/smb.h b/source3/include/smb.h index cef75d3713d..ce6f0c794a0 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -207,7 +207,7 @@ typedef struct nttime_info uint32 high; } NTTIME; -#ifdef __GNUC__XX +#ifdef __GNUC__XX_NOT_YET typedef struct {uint32 v;} NTSTATUS; #define NT_STATUS(x) ((NTSTATUS) { x }) #define NT_STATUS_V(x) ((x).v) @@ -218,7 +218,7 @@ typedef uint32 NTSTATUS; #endif #define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0) -#define NT_STATUS_IS_ERR(x) (NT_STATUS_V(x) & 0xc0000000) +#define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000) /* Allowable account control bits */ #define ACB_DISABLED 0x0001 /* 1 = User account disabled */ diff --git a/source3/lib/cmd_interp.c b/source3/lib/cmd_interp.c index 0ae6f5fb830..1d31d78b947 100644 --- a/source3/lib/cmd_interp.c +++ b/source3/lib/cmd_interp.c @@ -314,7 +314,7 @@ static uint32 cmd_set_options = 0xffffffff; ****************************************************************************/ static uint32 do_command(struct client_info *info, char *line) { - uint32 status = 0x0; + NTSTATUS status = 0x0; int i; if (!get_cmd_args(line)) @@ -355,7 +355,7 @@ static uint32 do_command(struct client_info *info, char *line) ****************************************************************************/ static uint32 process(struct client_info *info, char *cmd_str) { - uint32 status = 0; + NTSTATUS status = 0; pstring line; char *cmd = cmd_str; @@ -1286,7 +1286,7 @@ static void readline_init(void) ****************************************************************************/ int command_main(int argc, char *argv[]) { - uint32 status; + NTSTATUS status; mode_t myumask = 0755; char progname[255], path[255], *s; pstring msg; diff --git a/source3/lib/util_seaccess.c b/source3/lib/util_seaccess.c index 1716226272e..f10c84c276d 100644 --- a/source3/lib/util_seaccess.c +++ b/source3/lib/util_seaccess.c @@ -157,7 +157,7 @@ static BOOL get_max_access( SEC_ACL *the_acl, NT_USER_TOKEN *token, uint32 *gran */ *granted = acc_granted; - *status = NT_STATUS_NOPROBLEMO; + *status = NT_STATUS_OK; return True; } @@ -218,7 +218,7 @@ BOOL se_access_check(SEC_DESC *sd, struct current_user *user, if (!status || !acc_granted) return False; - *status = NT_STATUS_NOPROBLEMO; + *status = NT_STATUS_OK; *acc_granted = 0; DEBUG(10,("se_access_check: requested access %x, for uid %u\n", @@ -232,7 +232,7 @@ BOOL se_access_check(SEC_DESC *sd, struct current_user *user, /* ACL must have something in it */ if (!sd || (sd && (!(sd->type & SEC_DESC_DACL_PRESENT) || sd->dacl == NULL))) { - *status = NT_STATUS_NOPROBLEMO; + *status = NT_STATUS_OK; *acc_granted = acc_desired; DEBUG(5, ("se_access_check: no sd or blank DACL, access allowed\n")); return True; @@ -295,7 +295,7 @@ BOOL se_access_check(SEC_DESC *sd, struct current_user *user, if (tmp_acc_desired == 0) { *acc_granted = acc_desired; - *status = NT_STATUS_NOPROBLEMO; + *status = NT_STATUS_OK; DEBUG(5,("se_access_check: access (%x) granted.\n", (unsigned int)acc_desired )); return True; } diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 144f7cbd686..16b457c4130 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -807,7 +807,7 @@ int open_socket_in( int type, int port, int dlevel, uint32 socket_addr, BOOL reb if( setsockopt(res,SOL_SOCKET,SO_REUSEADDR,(char *)&val,sizeof(val)) == -1 ) { if( DEBUGLVL( dlevel ) ) { dbgtext( "open_socket_in(): setsockopt: " ); - dbgtext( "SO_REUSEADDR = %d ", val?"True":"False" ); + dbgtext( "SO_REUSEADDR = %s ", val?"True":"False" ); dbgtext( "on port %d failed ", port ); dbgtext( "with error = %s\n", strerror(errno) ); } diff --git a/source3/libsmb/cli_dfs.c b/source3/libsmb/cli_dfs.c index a16c76658fd..ad36438ed8a 100644 --- a/source3/libsmb/cli_dfs.c +++ b/source3/libsmb/cli_dfs.c @@ -66,7 +66,7 @@ uint32 cli_dfs_exist(struct cli_state *cli, TALLOC_CTX *mem_ctx, *dfs_exists = (r.status == 1); - result = NT_STATUS_NOPROBLEMO; + result = NT_STATUS_OK; done: prs_mem_free(&qbuf); diff --git a/source3/libsmb/cli_lsarpc.c b/source3/libsmb/cli_lsarpc.c index 8cf08174200..023f7f8dae4 100644 --- a/source3/libsmb/cli_lsarpc.c +++ b/source3/libsmb/cli_lsarpc.c @@ -78,7 +78,7 @@ uint32 cli_lsa_open_policy(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *pol = r.pol; } @@ -136,7 +136,7 @@ uint32 cli_lsa_open_policy2(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *pol = r.pol; } @@ -184,7 +184,7 @@ uint32 cli_lsa_close(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *pol = r.pol; } @@ -242,7 +242,7 @@ uint32 cli_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx, result = r.status; - if (result != NT_STATUS_NOPROBLEMO && result != 0x00000107 && + if (result != NT_STATUS_OK && result != 0x00000107 && result != (0xC0000000 | NT_STATUS_NONE_MAPPED)) { /* An actual error occured */ @@ -250,7 +250,7 @@ uint32 cli_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx, goto done; } - result = NT_STATUS_NOPROBLEMO; + result = NT_STATUS_OK; /* Return output parameters */ @@ -347,7 +347,7 @@ uint32 cli_lsa_lookup_names(struct cli_state *cli, TALLOC_CTX *mem_ctx, result = r.status; - if (result != NT_STATUS_NOPROBLEMO && + if (result != NT_STATUS_OK && result != (0xC0000000 | NT_STATUS_NONE_MAPPED)) { /* An actual error occured */ @@ -355,7 +355,7 @@ uint32 cli_lsa_lookup_names(struct cli_state *cli, TALLOC_CTX *mem_ctx, goto done; } - result = NT_STATUS_NOPROBLEMO; + result = NT_STATUS_OK; /* Return output parameters */ @@ -441,7 +441,7 @@ uint32 cli_lsa_query_info_policy(struct cli_state *cli, TALLOC_CTX *mem_ctx, goto done; } - if ((result = r.status) != NT_STATUS_NOPROBLEMO) { + if ((result = r.status) != NT_STATUS_OK) { goto done; } @@ -536,7 +536,7 @@ uint32 cli_lsa_enum_trust_dom(struct cli_state *cli, TALLOC_CTX *mem_ctx, 0x8000001a (NT_STATUS_UNABLE_TO_FREE_VM) so we ignore it and pretend everything is OK. */ - if (result != NT_STATUS_NOPROBLEMO && + if (result != NT_STATUS_OK && result != NT_STATUS_UNABLE_TO_FREE_VM) { /* An actual error ocured */ @@ -544,7 +544,7 @@ uint32 cli_lsa_enum_trust_dom(struct cli_state *cli, TALLOC_CTX *mem_ctx, goto done; } - result = NT_STATUS_NOPROBLEMO; + result = NT_STATUS_OK; /* Return output parameters */ diff --git a/source3/libsmb/cli_samr.c b/source3/libsmb/cli_samr.c index dee1baff02a..123f5c116bb 100644 --- a/source3/libsmb/cli_samr.c +++ b/source3/libsmb/cli_samr.c @@ -68,7 +68,7 @@ uint32 cli_samr_connect(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *connect_pol = r.connect_pol; } @@ -114,7 +114,7 @@ uint32 cli_samr_close(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *connect_pol = r.pol; } @@ -161,7 +161,7 @@ uint32 cli_samr_open_domain(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *domain_pol = r.domain_pol; } @@ -208,7 +208,7 @@ uint32 cli_samr_open_user(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *user_pol = r.user_pol; } @@ -255,7 +255,7 @@ uint32 cli_samr_open_group(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *group_pol = r.pol; } @@ -395,7 +395,7 @@ uint32 cli_samr_query_usergroups(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *num_groups = r.num_entries; *gid = r.gid; } @@ -443,7 +443,7 @@ uint32 cli_samr_query_groupmem(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *num_mem = r.num_entries; *rid = r.rid; *attr = r.attr; @@ -495,7 +495,7 @@ uint32 cli_samr_enum_dom_groups(struct cli_state *cli, TALLOC_CTX *mem_ctx, result = r.status; - if (result != NT_STATUS_NOPROBLEMO && + if (result != NT_STATUS_OK && result != STATUS_MORE_ENTRIES) { goto done; } @@ -569,7 +569,7 @@ uint32 cli_samr_query_aliasmem(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) != NT_STATUS_NOPROBLEMO) { + if ((result = r.status) != NT_STATUS_OK) { goto done; } @@ -629,7 +629,7 @@ uint32 cli_samr_open_alias(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *alias_pol = r.pol; } @@ -678,7 +678,7 @@ uint32 cli_samr_query_dom_info(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) != NT_STATUS_NOPROBLEMO) { + if ((result = r.status) != NT_STATUS_OK) { goto done; } @@ -731,7 +731,7 @@ uint32 cli_samr_query_dispinfo(struct cli_state *cli, TALLOC_CTX *mem_ctx, result = r.status; - if (result != NT_STATUS_NOPROBLEMO && + if (result != NT_STATUS_OK && result != STATUS_MORE_ENTRIES) { goto done; } @@ -791,7 +791,7 @@ uint32 cli_samr_lookup_rids(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) != NT_STATUS_NOPROBLEMO) { + if ((result = r.status) != NT_STATUS_OK) { goto done; } @@ -859,7 +859,7 @@ uint32 cli_samr_lookup_names(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) != NT_STATUS_NOPROBLEMO) { + if ((result = r.status) != NT_STATUS_OK) { goto done; } @@ -921,7 +921,7 @@ uint32 cli_samr_create_dom_user(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) != NT_STATUS_NOPROBLEMO) { + if ((result = r.status) != NT_STATUS_OK) { goto done; } @@ -977,7 +977,7 @@ uint32 cli_samr_set_userinfo(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) != NT_STATUS_NOPROBLEMO) { + if ((result = r.status) != NT_STATUS_OK) { goto done; } @@ -1024,7 +1024,7 @@ uint32 cli_samr_set_userinfo2(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if ((result = r.status) != NT_STATUS_NOPROBLEMO) { + if ((result = r.status) != NT_STATUS_OK) { goto done; } diff --git a/source3/libsmb/cli_spoolss.c b/source3/libsmb/cli_spoolss.c index 9c53912dff2..b301de6448a 100644 --- a/source3/libsmb/cli_spoolss.c +++ b/source3/libsmb/cli_spoolss.c @@ -84,7 +84,7 @@ uint32 cli_spoolss_open_printer_ex( /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *pol = r.handle; } @@ -137,7 +137,7 @@ uint32 cli_spoolss_close_printer( /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { *pol = r.handle; } @@ -429,7 +429,7 @@ uint32 cli_spoolss_enum_printers( /* Return output parameters */ - if (((result=r.status) == NT_STATUS_NOPROBLEMO) && (*returned = r.returned)) + if (((result=r.status) == NT_STATUS_OK) && (*returned = r.returned)) { switch (level) { @@ -505,7 +505,7 @@ uint32 cli_spoolss_enum_ports( /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO && + if ((result = r.status) == NT_STATUS_OK && r.returned > 0) { *returned = r.returned; @@ -574,7 +574,7 @@ uint32 cli_spoolss_getprinter( } /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) { + if ((result = r.status) == NT_STATUS_OK) { switch (level) { case 0: @@ -705,7 +705,7 @@ uint32 cli_spoolss_getprinterdriver ( } /* Return output parameters */ - if ((result = r.status) == NT_STATUS_NOPROBLEMO) + if ((result = r.status) == NT_STATUS_OK) { switch (level) @@ -784,7 +784,7 @@ uint32 cli_spoolss_enumprinterdrivers ( } /* Return output parameters */ - if (((result=r.status) == NT_STATUS_NOPROBLEMO) && + if (((result=r.status) == NT_STATUS_OK) && (r.returned != 0)) { *returned = r.returned; @@ -865,7 +865,7 @@ uint32 cli_spoolss_getprinterdriverdir ( } /* Return output parameters */ - if ((result=r.status) == NT_STATUS_NOPROBLEMO) + if ((result=r.status) == NT_STATUS_OK) { switch (level) { diff --git a/source3/libsmb/domain_client_validate.c b/source3/libsmb/domain_client_validate.c index 5c56a815efa..69b5739b634 100644 --- a/source3/libsmb/domain_client_validate.c +++ b/source3/libsmb/domain_client_validate.c @@ -269,7 +269,7 @@ static BOOL find_connect_pdc(struct cli_state *pcli, use it, otherwise figure out a server from the 'password server' param. ************************************************************************/ -uint32 domain_client_validate(const auth_usersupplied_info *user_info, +NTSTATUS domain_client_validate(const auth_usersupplied_info *user_info, auth_serversupplied_info *server_info, char *server, unsigned char *trust_passwd, time_t last_change_time) @@ -280,7 +280,7 @@ uint32 domain_client_validate(const auth_usersupplied_info *user_info, struct cli_state cli; uint32 smb_uid_low; BOOL connected_ok = False; - uint32 status; + NTSTATUS status; /* * Check that the requested domain is not our own machine name. @@ -325,14 +325,14 @@ uint32 domain_client_validate(const auth_usersupplied_info *user_info, if ((status = cli_nt_login_network(&cli, user_info, smb_uid_low, &ctr, &info3)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { DEBUG(0,("domain_client_validate: unable to validate password " "for user %s in domain %s to Domain controller %s. " "Error was %s.\n", user_info->smb_username.str, user_info->domain.str, remote_machine, get_nt_error_msg(status))); } else { - status = NT_STATUS_NOPROBLEMO; + status = NT_STATUS_OK; } /* @@ -346,7 +346,7 @@ uint32 domain_client_validate(const auth_usersupplied_info *user_info, * send here. JRA. */ - if (status == NT_STATUS_NOPROBLMO) { + if (NT_STATUS_IS_OK(status)) { if(cli_nt_logoff(&cli, &ctr) == False) { DEBUG(0,("domain_client_validate: unable to log off user %s in domain \ %s to Domain controller %s. Error was %s.\n", user, domain, remote_machine, cli_errstr(&cli))); diff --git a/source3/libsmb/errormap.c b/source3/libsmb/errormap.c index 92a4b19847f..a8baf025af2 100644 --- a/source3/libsmb/errormap.c +++ b/source3/libsmb/errormap.c @@ -574,7 +574,7 @@ static struct { {ERRDOS, ERRbadfile, NT_STATUS_NO_SUCH_FILE}, {ERRDOS, ERRbadpath, NT_STATUS_OBJECT_PATH_NOT_FOUND}, {ERRDOS, ERRnofids, NT_STATUS_TOO_MANY_OPENED_FILES}, - {ERRDOS, ERRnoaccess, NT_STATUS_INVALID_LOCK_SEQUENCE}, + {ERRDOS, ERRnoaccess, NT_STATUS_ACCESS_DENIED}, {ERRDOS, ERRbadfid, NT_STATUS_INVALID_HANDLE}, {ERRDOS, ERRnomem, NT_STATUS_INSUFFICIENT_RESOURCES}, {ERRDOS, ERRbadaccess, NT_STATUS_INVALID_LOCK_SEQUENCE}, diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index c0c586eceb2..c3456bc4e7e 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -207,7 +207,7 @@ int smbc_errno(struct cli_state *c) DEBUG(3,("smbc_error %d %d (0x%x) -> %d\n", (int)eclass, (int)ecode, (int)ecode, ret)); } else { - uint32 status; + NTSTATUS status; status = cli_nt_error(c); ret = cli_errno_from_nt(status); diff --git a/source3/locking/locking.c b/source3/locking/locking.c index e905bd56e9d..4928d6d1606 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -143,7 +143,7 @@ NTSTATUS do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_pid, if (!ok) return NT_STATUS_FILE_LOCK_CONFLICT; - return NT_STATUS_NOPROBLEMO; /* Got lock */ + return NT_STATUS_OK; /* Got lock */ } /**************************************************************************** diff --git a/source3/nsswitch/winbindd_glue.c b/source3/nsswitch/winbindd_glue.c index 28ccfb2f03a..e9792c6d47c 100644 --- a/source3/nsswitch/winbindd_glue.c +++ b/source3/nsswitch/winbindd_glue.c @@ -79,13 +79,13 @@ BOOL wb_lsa_open_policy(char *server, BOOL sec_qos, uint32 des_access, des_access, &pol->handle); done: - if (result != NT_STATUS_NOPROBLEMO && pol->cli) { + if (result != NT_STATUS_OK && pol->cli) { if (pol->cli->initialised) cli_shutdown(pol->cli); free(pol->cli); } - return (result == NT_STATUS_NOPROBLEMO); + return (result == NT_STATUS_OK); } /**************************************************************************** @@ -99,7 +99,7 @@ BOOL wb_lsa_enum_trust_dom(CLI_POLICY_HND *hnd, uint32 *enum_ctx, ret = cli_lsa_enum_trust_dom(hnd->cli, hnd->mem_ctx, &hnd->handle, enum_ctx, num_doms, names, sids); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } /**************************************************************************** @@ -113,7 +113,7 @@ BOOL wb_lsa_query_info_pol(CLI_POLICY_HND *hnd, uint16 info_class, ret = cli_lsa_query_info_policy(hnd->cli, hnd->mem_ctx, &hnd->handle, info_class, domain_name, domain_sid); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } /**************************************************************************** @@ -127,7 +127,7 @@ BOOL wb_lsa_lookup_names(CLI_POLICY_HND *hnd, int num_names, char **names, ret = cli_lsa_lookup_names(hnd->cli, hnd->mem_ctx, &hnd->handle, num_names, names, sids, types, num_sids); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } /**************************************************************************** @@ -141,7 +141,7 @@ BOOL wb_lsa_lookup_sids(CLI_POLICY_HND *hnd, int num_sids, DOM_SID *sids, ret = cli_lsa_lookup_sids(hnd->cli, hnd->mem_ctx, &hnd->handle, num_sids, sids, names, types, num_names); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } /**************************************************************************** @@ -153,7 +153,7 @@ BOOL wb_lsa_close(CLI_POLICY_HND *hnd) ret = cli_lsa_close(hnd->cli, hnd->mem_ctx, &hnd->handle); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } @@ -166,7 +166,7 @@ BOOL wb_samr_close(CLI_POLICY_HND *hnd) ret = cli_samr_close(hnd->cli, hnd->mem_ctx, &hnd->handle); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } @@ -225,13 +225,13 @@ BOOL wb_samr_connect(char *server, uint32 access_mask, CLI_POLICY_HND *pol) access_mask, &pol->handle); done: - if (result != NT_STATUS_NOPROBLEMO && pol->cli) { + if (result != NT_STATUS_OK && pol->cli) { if (pol->cli->initialised) cli_shutdown(pol->cli); free(pol->cli); } - return (result == NT_STATUS_NOPROBLEMO); + return (result == NT_STATUS_OK); } @@ -250,7 +250,7 @@ BOOL wb_samr_open_domain(CLI_POLICY_HND *connect_pol, uint32 ace_perms, sid, &domain_pol->handle); - if (ret == NT_STATUS_NOPROBLEMO) { + if (ret == NT_STATUS_OK) { domain_pol->cli = connect_pol->cli; domain_pol->mem_ctx = connect_pol->mem_ctx; return True; @@ -271,7 +271,7 @@ uint32 wb_samr_enum_dom_groups(CLI_POLICY_HND *pol, uint32 *start_idx, ret = cli_samr_enum_dom_groups(pol->cli, pol->mem_ctx, &pol->handle, start_idx, size, sam, num_sam_groups); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } /**************************************************************************** @@ -287,20 +287,20 @@ BOOL wb_get_samr_query_userinfo(CLI_POLICY_HND *pol, uint32 info_level, if ((result = cli_samr_open_user(pol->cli, pol->mem_ctx, &pol->handle, MAXIMUM_ALLOWED_ACCESS, user_rid, &user_pol)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) goto done; got_user_pol = True; if ((result = cli_samr_query_userinfo(pol->cli, pol->mem_ctx, &user_pol, info_level, ctr)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) goto done; done: if (got_user_pol) cli_samr_close(pol->cli, pol->mem_ctx, &user_pol); - return (result == NT_STATUS_NOPROBLEMO); + return (result == NT_STATUS_OK); } /**************************************************************************** @@ -314,7 +314,7 @@ BOOL wb_samr_open_user(CLI_POLICY_HND *pol, uint32 access_mask, uint32 rid, ret = cli_samr_open_user(pol->cli, pol->mem_ctx, &pol->handle, access_mask, rid, user_pol); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } BOOL wb_samr_query_usergroups(CLI_POLICY_HND *pol, uint32 *num_groups, @@ -325,7 +325,7 @@ BOOL wb_samr_query_usergroups(CLI_POLICY_HND *pol, uint32 *num_groups, ret = cli_samr_query_usergroups(pol->cli, pol->mem_ctx, &pol->handle, num_groups, gid); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } BOOL wb_get_samr_query_groupinfo(CLI_POLICY_HND *pol, uint32 info_level, @@ -338,20 +338,20 @@ BOOL wb_get_samr_query_groupinfo(CLI_POLICY_HND *pol, uint32 info_level, if ((result = cli_samr_open_group(pol->cli, pol->mem_ctx, &pol->handle, MAXIMUM_ALLOWED_ACCESS, group_rid, &group_pol)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) goto done; got_group_pol = True; if ((result = cli_samr_query_groupinfo(pol->cli, pol->mem_ctx, &group_pol, info_level, - ctr)) != NT_STATUS_NOPROBLEMO) + ctr)) != NT_STATUS_OK) goto done; done: if (got_group_pol) cli_samr_close(pol->cli, pol->mem_ctx, &group_pol); - return (result == NT_STATUS_NOPROBLEMO); + return (result == NT_STATUS_OK); } BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid, @@ -365,7 +365,7 @@ BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid, if ((result = cli_samr_open_group(pol->cli, pol->mem_ctx, &pol->handle, MAXIMUM_ALLOWED_ACCESS, group_rid, &group_pol)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) goto done; got_group_pol = True; @@ -373,7 +373,7 @@ BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid, if ((result = cli_samr_query_groupmem(pol->cli, pol->mem_ctx, &group_pol, num_names, rid_mem, name_types)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) goto done; /* Call cli_samr_lookup_rids() in bunches of ~1000 rids to avoid @@ -399,7 +399,7 @@ BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid, &tmp_num_names, &tmp_names, &tmp_types); - if (result != NT_STATUS_NOPROBLEMO) + if (result != NT_STATUS_OK) goto done; /* Copy result into array. The talloc system will take @@ -420,7 +420,7 @@ BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid, if (got_group_pol) cli_samr_close(pol->cli, pol->mem_ctx, &group_pol); - return (result == NT_STATUS_NOPROBLEMO); + return (result == NT_STATUS_OK); } BOOL wb_samr_query_dom_info(CLI_POLICY_HND *pol, uint16 switch_value, @@ -431,7 +431,7 @@ BOOL wb_samr_query_dom_info(CLI_POLICY_HND *pol, uint16 switch_value, ret = cli_samr_query_dom_info(pol->cli, pol->mem_ctx, &pol->handle, switch_value, ctr); - return (ret == NT_STATUS_NOPROBLEMO); + return (ret == NT_STATUS_OK); } /* Unlike all the others, the status code of this function is actually used diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c index 9fc2ee79a03..30b874a820f 100644 --- a/source3/nsswitch/winbindd_group.c +++ b/source3/nsswitch/winbindd_group.c @@ -465,7 +465,7 @@ enum winbindd_result winbindd_endgrent(struct winbindd_cli_state *state) static BOOL get_sam_group_entries(struct getent_state *ent) { - uint32 status, num_entries, start_ndx = 0; + NTSTATUS status, num_entries, start_ndx = 0; struct acct_info *name_list = NULL; if (ent->got_all_sam_entries) { diff --git a/source3/nsswitch/winbindd_misc.c b/source3/nsswitch/winbindd_misc.c index 21f1afa6a70..b98e89888b3 100644 --- a/source3/nsswitch/winbindd_misc.c +++ b/source3/nsswitch/winbindd_misc.c @@ -123,7 +123,7 @@ enum winbindd_result winbindd_check_machine_acct( /* Pass back result code - zero for success, other values for specific failures. */ - DEBUG(3, ("secret is %s\n", (result == NT_STATUS_NOPROBLEMO) ? + DEBUG(3, ("secret is %s\n", (result == NT_STATUS_OK) ? "good" : "bad")); done: diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c index 6f1872e0a42..40762b1f0b9 100644 --- a/source3/nsswitch/winbindd_pam.c +++ b/source3/nsswitch/winbindd_pam.c @@ -135,7 +135,7 @@ enum winbindd_result winbindd_pam_auth(struct winbindd_cli_state *state) server_state.controller, trust_passwd, last_change_time); - return (result == NT_STATUS_NOPROBLEMO) ? WINBINDD_OK : WINBINDD_ERROR; + return (result == NT_STATUS_OK) ? WINBINDD_OK : WINBINDD_ERROR; } /* Challenge Response Authentication Protocol */ @@ -206,7 +206,7 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state) server_state.controller, trust_passwd, last_change_time); - return (result == NT_STATUS_NOPROBLEMO) ? WINBINDD_OK : WINBINDD_ERROR; + return (result == NT_STATUS_OK) ? WINBINDD_OK : WINBINDD_ERROR; } /* Change a user password */ diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c index 8bc9ef5a850..6f887e87353 100644 --- a/source3/nsswitch/winbindd_user.c +++ b/source3/nsswitch/winbindd_user.c @@ -356,7 +356,7 @@ enum winbindd_result winbindd_endpwent(struct winbindd_cli_state *state) static BOOL get_sam_user_entries(struct getent_state *ent) { - uint32 status, num_entries; + NTSTATUS status, num_entries; SAM_DISPINFO_1 info1; SAM_DISPINFO_CTR ctr; struct getpwent_user *name_list = NULL; @@ -614,7 +614,7 @@ enum winbindd_result winbindd_list_users(struct winbindd_cli_state *state) ctr.sam.info1 = &info1; for (domain = domain_list; domain; domain = domain->next) { - uint32 status, start_ndx = 0; + NTSTATUS status, start_ndx = 0; /* Skip domains other than WINBINDD_DOMAIN environment variable */ diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 75ddb6bc09c..e24e15429f3 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -594,7 +594,7 @@ BOOL winbindd_lookup_usergroups(struct winbindd_domain *domain, if (cli_samr_query_usergroups(domain->sam_dom_handle.cli, domain->sam_dom_handle.mem_ctx, &user_pol, num_groups, user_groups) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { result = False; goto done; } @@ -871,7 +871,7 @@ uint32 winbindd_query_dispinfo(struct winbindd_domain *domain, uint32 *start_ndx, uint16 info_level, uint32 *num_entries, SAM_DISPINFO_CTR *ctr) { - uint32 status; + NTSTATUS status; status = wb_samr_query_dispinfo(&domain->sam_dom_handle, start_ndx, info_level, num_entries, ctr); diff --git a/source3/passdb/pampass.c b/source3/passdb/pampass.c index 418c618af2b..359ed02b293 100644 --- a/source3/passdb/pampass.c +++ b/source3/passdb/pampass.c @@ -88,7 +88,7 @@ static BOOL smb_pam_nt_status_error_handler(pam_handle_t *pamh, int pam_error, if (smb_pam_error_handler(pamh, pam_error, msg, dbglvl)) return True; - if (*nt_status == NT_STATUS_NOPROBLEMO) { + if (*nt_status == NT_STATUS_OK) { /* Complain LOUDLY */ DEBUG(0, ("smb_pam_nt_status_error_handler: PAM: BUG: PAM and NT_STATUS \ error MISMATCH, forcing to NT_STATUS_LOGON_FAILURE")); @@ -533,7 +533,7 @@ static uint32 smb_pam_auth(pam_handle_t *pamh, char *user) break; case PAM_SUCCESS: DEBUG(4, ("smb_pam_auth: PAM: User %s Authenticated OK\n", user)); - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; break; default: DEBUG(0, ("smb_pam_auth: PAM: UNKNOWN ERROR while authenticating user %s\n", user)); @@ -578,7 +578,7 @@ static uint32 smb_pam_account(pam_handle_t *pamh, char * user) break; case PAM_SUCCESS: DEBUG(4, ("smb_pam_account: PAM: Account OK for User: %s\n", user)); - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; break; default: nt_status = NT_STATUS_ACCOUNT_DISABLED; @@ -625,7 +625,7 @@ static uint32 smb_pam_setcred(pam_handle_t *pamh, char * user) break; case PAM_SUCCESS: DEBUG(4, ("smb_pam_setcred: PAM: SetCredentials OK for User: %s\n", user)); - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; break; default: DEBUG(0, ("smb_pam_setcred: PAM: UNKNOWN PAM ERROR (%d) during SetCredentials for User: %s\n", pam_error, user)); @@ -787,7 +787,7 @@ uint32 smb_pam_accountcheck(char * user) /* Ignore PAM if told to. */ if (!lp_obey_pam_restrictions()) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; if ((pconv = smb_setup_pam_conv(smb_pam_conv, user, NULL, NULL)) == NULL) return False; @@ -795,7 +795,7 @@ uint32 smb_pam_accountcheck(char * user) if (!smb_pam_start(&pamh, user, NULL, pconv)) return NT_STATUS_ACCOUNT_DISABLED; - if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_NOPROBLEMO) + if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_OK) DEBUG(0, ("smb_pam_accountcheck: PAM: Account Validation Failed - Rejecting User %s!\n", user)); smb_pam_end(pamh, pconv); @@ -824,19 +824,19 @@ uint32 smb_pam_passcheck(char * user, char * password) if (!smb_pam_start(&pamh, user, NULL, pconv)) return NT_STATUS_LOGON_FAILURE; - if ((nt_status = smb_pam_auth(pamh, user)) != NT_STATUS_NOPROBLEMO) { + if ((nt_status = smb_pam_auth(pamh, user)) != NT_STATUS_OK) { DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_auth failed - Rejecting User %s !\n", user)); smb_pam_end(pamh, pconv); return nt_status; } - if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_NOPROBLEMO) { + if ((nt_status = smb_pam_account(pamh, user)) != NT_STATUS_OK) { DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_account failed - Rejecting User %s !\n", user)); smb_pam_end(pamh, pconv); return nt_status; } - if ((nt_status = smb_pam_setcred(pamh, user)) != NT_STATUS_NOPROBLEMO) { + if ((nt_status = smb_pam_setcred(pamh, user)) != NT_STATUS_OK) { DEBUG(0, ("smb_pam_passcheck: PAM: smb_pam_setcred failed - Rejecting User %s !\n", user)); smb_pam_end(pamh, pconv); return nt_status; @@ -876,7 +876,7 @@ BOOL smb_pam_passchange(char * user, char * oldpassword, char * newpassword) /* If PAM not used, no PAM restrictions on accounts. */ uint32 smb_pam_accountcheck(char * user) { - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /* If PAM not used, also no PAM restrictions on sessions. */ diff --git a/source3/passdb/pass_check.c b/source3/passdb/pass_check.c index 677d298449f..b6cc403b869 100644 --- a/source3/passdb/pass_check.c +++ b/source3/passdb/pass_check.c @@ -599,7 +599,7 @@ static BOOL password_check(char *password) { #ifdef WITH_PAM - return (smb_pam_passcheck(this_user, password) == NT_STATUS_NOPROBLEMO); + return (smb_pam_passcheck(this_user, password) == NT_STATUS_OK); #endif /* WITH_PAM */ #ifdef WITH_AFS diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 63cfe614e37..edb45ab36a5 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1110,7 +1110,7 @@ static uint32 clean_up_driver_struct_level_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 *dri driver->driverpath, user, &err)) == -1) return err; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /**************************************************************************** @@ -1175,7 +1175,7 @@ static uint32 clean_up_driver_struct_level_6(NT_PRINTER_DRIVER_INFO_LEVEL_6 *dri driver->driverpath, user, &err)) == -1) return err; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /**************************************************************************** @@ -3003,7 +3003,7 @@ static uint32 save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARA uint32 save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, NT_PRINTER_PARAM *param) { - uint32 status = ERRsuccess; + NTSTATUS status = ERRsuccess; switch (level) { @@ -3285,7 +3285,7 @@ BOOL printer_driver_in_use (char *arch, char *driver) Remove a printer driver from the TDB. This assumes that the the driver was previously looked up. ***************************************************************************/ -uint32 delete_printer_driver (NT_PRINTER_DRIVER_INFO_LEVEL_3 *i) +NTSTATUS delete_printer_driver (NT_PRINTER_DRIVER_INFO_LEVEL_3 *i) { pstring key; fstring arch; @@ -3308,7 +3308,7 @@ uint32 delete_printer_driver (NT_PRINTER_DRIVER_INFO_LEVEL_3 *i) DEBUG(5,("delete_printer_driver: [%s] driver delete successful.\n", i->name)); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ @@ -3396,7 +3396,7 @@ uint32 nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr) prs_struct ps; TALLOC_CTX *mem_ctx = NULL; fstring key; - uint32 status; + NTSTATUS status; mem_ctx = talloc_init(); if (mem_ctx == NULL) diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 96d77ab3cf6..8b4a4bcc3d9 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -471,7 +471,7 @@ uint32 lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids, return r_l.status; } - result = NT_STATUS_NOPROBLEMO; + result = NT_STATUS_OK; if (p) { if (t_names.ptr_trans_names != 0 diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 2dd9eb0141f..2c30e5ba475 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -57,7 +57,7 @@ static void gen_next_creds( struct cli_state *cli, DOM_CRED *new_clnt_cred) /**************************************************************************** do a LSA Logon Control2 ****************************************************************************/ -BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level) +BOOL cli_net_logon_ctrl2(struct cli_state *cli, NTSTATUS status_level) { prs_struct rbuf; prs_struct buf; @@ -446,7 +446,7 @@ uint32 cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, result = cli_net_sam_logon_internal(cli, ctr, user_info3, validation_level); - if(result == NT_STATUS_NOPROBLEMO) { + if(result == NT_STATUS_OK) { DEBUG(10,("cli_net_sam_logon: Success \n")); } else if (result == NT_STATUS_INVALID_INFO_CLASS) { DEBUG(10,("cli_net_sam_logon: STATUS INVALID INFO CLASS \n")); diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index a06f3afb6a4..9c93ec02d50 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -70,7 +70,7 @@ uint32 spoolss_enum_printerdrivers(const char *srv_name, const char *environment if(spoolss_io_r_enumprinterdrivers("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { DEBUG(3,("SPOOLSS_ENUMPRINTERDRIVERS: %s\n", get_nt_error_msg(r_o.status))); } @@ -126,7 +126,7 @@ uint32 spoolss_enum_printers(uint32 flags, fstring srv_name, uint32 level, if(new_spoolss_io_r_enumprinters("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { /* report error code */ DEBUG(3,("SPOOLSS_ENUMPRINTERS: %s\n", get_nt_error_msg(r_o.status))); @@ -186,7 +186,7 @@ uint32 spoolss_enum_ports(fstring srv_name, uint32 level, if(new_spoolss_io_r_enumports("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { DEBUG(3,("SPOOLSS_ENUMPORTS: %s\n", get_nt_error_msg(r_o.status))); } @@ -240,7 +240,7 @@ uint32 spoolss_enum_jobs(const POLICY_HND *hnd, uint32 firstjob, uint32 numofjob if(spoolss_io_r_enumjobs("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { DEBUG(3,("SPOOLSS_ENUMJOBS: %s\n", get_nt_error_msg(r_o.status))); } @@ -298,7 +298,7 @@ uint32 spoolss_enum_printerdata(const POLICY_HND *hnd, uint32 idx, if(spoolss_io_r_enumprinterdata("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { DEBUG(3,("SPOOLSS_ENUMPRINTERDATA: %s\n", get_nt_error_msg(r_o.status))); } @@ -358,7 +358,7 @@ uint32 spoolss_getprinter(const POLICY_HND *hnd, uint32 level, if(!spoolss_io_r_getprinter("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { DEBUG(3,("SPOOLSS_GETPRINTER: %s\n", get_nt_error_msg(r_o.status))); } @@ -411,7 +411,7 @@ uint32 spoolss_getprinterdriver(const POLICY_HND *hnd, if(spoolss_io_r_getprinterdriver2("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { DEBUG(3,("SPOOLSS_GETPRINTERDRIVER2: %s\n", get_nt_error_msg(r_o.status))); } @@ -561,7 +561,7 @@ BOOL spoolss_addprinterex(POLICY_HND *hnd, const char* srv_name, PRINTER_INFO_2 if(spoolss_io_r_addprinterex("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { /* report error code */ DEBUG(3,("SPOOLSS_ADDPRINTEREX: %s\n", get_nt_error_msg(r_o.status))); @@ -690,7 +690,7 @@ uint32 spoolss_getprinterdata(const POLICY_HND *hnd, const UNISTR2 *valuename, if(spoolss_io_r_getprinterdata("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { DEBUG(3,("SPOOLSS_GETPRINTERDATA: %s\n", get_nt_error_msg(r_o.status))); } @@ -749,7 +749,7 @@ uint32 spoolss_getprinterdriverdir(fstring srv_name, fstring env_name, uint32 le if(spoolss_io_r_getprinterdriverdir("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { DEBUG(3,("SPOOLSS_GETPRINTERDRIVERDIRECTORY: %s\n", get_nt_error_msg(r_o.status))); } @@ -800,7 +800,7 @@ uint32 spoolss_addprinterdriver(const char *srv_name, uint32 level, PRINTER_DRIV if(spoolss_io_r_addprinterdriver("", &r_o, &rbuf, 0)) { - if (r_o.status != NT_STATUS_NOPROBLEMO) + if (r_o.status != NT_STATUS_OK) { /* report error code */ DEBUG(3,("SPOOLSS_ADDPRINTERDRIVER: %s\n", get_nt_error_msg(r_o.status))); diff --git a/source3/rpc_client/cli_spoolss_notify.c b/source3/rpc_client/cli_spoolss_notify.c index 8aba2a32426..ca2e4f7ec0f 100644 --- a/source3/rpc_client/cli_spoolss_notify.c +++ b/source3/rpc_client/cli_spoolss_notify.c @@ -132,7 +132,7 @@ BOOL spoolss_connect_to_client( struct cli_state *cli, char *remote_machine) do a reply open printer ****************************************************************************/ -BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 localprinter, uint32 type, uint32 *status, POLICY_HND *handle) +BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 localprinter, uint32 type, NTSTATUS *status, POLICY_HND *handle) { prs_struct rbuf; prs_struct buf; @@ -188,7 +188,7 @@ BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 ****************************************************************************/ BOOL cli_spoolss_reply_rrpcn(struct cli_state *cli, POLICY_HND *handle, - uint32 change_low, uint32 change_high, uint32 *status) + uint32 change_low, uint32 change_high, NTSTATUS *status) { prs_struct rbuf; prs_struct buf; @@ -242,7 +242,7 @@ BOOL cli_spoolss_reply_rrpcn(struct cli_state *cli, POLICY_HND *handle, do a reply open printer ****************************************************************************/ -BOOL cli_spoolss_reply_close_printer(struct cli_state *cli, POLICY_HND *handle, uint32 *status) +BOOL cli_spoolss_reply_close_printer(struct cli_state *cli, POLICY_HND *handle, NTSTATUS *status) { prs_struct rbuf; prs_struct buf; diff --git a/source3/rpc_client/msrpc_spoolss.c b/source3/rpc_client/msrpc_spoolss.c index 4c0d3f49993..288c7f63cba 100644 --- a/source3/rpc_client/msrpc_spoolss.c +++ b/source3/rpc_client/msrpc_spoolss.c @@ -227,7 +227,7 @@ nt spoolss query BOOL msrpc_spoolss_enum_printers(char* srv_name, uint32 flags, uint32 level, PRINTER_INFO_CTR ctr) { - uint32 status; + NTSTATUS status; NEW_BUFFER buffer; uint32 needed; uint32 returned; @@ -250,7 +250,7 @@ BOOL msrpc_spoolss_enum_printers(char* srv_name, uint32 flags, needed, &needed, &returned); } - if (status!=NT_STATUS_NOPROBLEMO) + if (status!=NT_STATUS_OK) { DEBUG(0,("spoolss_enum_printers: %s\n", get_nt_error_msg(status))); if (mem_ctx) @@ -290,7 +290,7 @@ nt spoolss query BOOL msrpc_spoolss_enum_ports(char* srv_name, uint32 level, PORT_INFO_CTR *ctr) { - uint32 status; + NTSTATUS status; NEW_BUFFER buffer; uint32 needed; uint32 returned; @@ -316,7 +316,7 @@ BOOL msrpc_spoolss_enum_ports(char* srv_name, report(out_hnd, "\tstatus:[%d (%x)]\n", status, status); - if (status!=NT_STATUS_NOPROBLEMO) + if (status!=NT_STATUS_OK) { if (mem_ctx) talloc_destroy(mem_ctx); @@ -362,7 +362,7 @@ uint32 msrpc_spoolss_getprinterdata( const char* printer_name, void *fn) { POLICY_HND hnd; - uint32 status; + NTSTATUS status; uint32 needed; uint32 size; char *data; @@ -405,7 +405,7 @@ uint32 msrpc_spoolss_getprinterdata( const char* printer_name, if (mem_ctx) talloc_destroy(mem_ctx); - if (status != NT_STATUS_NOPROBLEMO) + if (status != NT_STATUS_OK) { if (!spoolss_closeprinter(&hnd)) return NT_STATUS_ACCESS_DENIED; @@ -429,7 +429,7 @@ BOOL msrpc_spoolss_enum_jobs( const char* printer_name, void ***ctr, JOB_INFO_FN(fn)) { POLICY_HND hnd; - uint32 status; + NTSTATUS status; NEW_BUFFER buffer; uint32 needed; uint32 returned; @@ -462,7 +462,7 @@ BOOL msrpc_spoolss_enum_jobs( const char* printer_name, if (mem_ctx) talloc_destroy(mem_ctx); - if (status!=NT_STATUS_NOPROBLEMO) { + if (status!=NT_STATUS_OK) { if (!spoolss_closeprinter(&hnd)) return False; return False; @@ -482,7 +482,7 @@ BOOL msrpc_spoolss_enum_printerdata( const char* printer_name, const char* station, const char* user_name ) { POLICY_HND hnd; - uint32 status; + NTSTATUS status; uint32 idx; uint32 valuelen; uint16 *value; @@ -540,7 +540,7 @@ BOOL msrpc_spoolss_enum_printerdata( const char* printer_name, value, rvaluelen, type, datalen, data, rdatalen); - if (status!=NT_STATUS_NOPROBLEMO) { + if (status!=NT_STATUS_OK) { /* * the check on this if statement is redundant * since is the status is bad we're going to @@ -563,7 +563,7 @@ BOOL msrpc_spoolss_getprinter( const char* printer_name, const uint32 level, PRINTER_INFO_CTR ctr) { POLICY_HND hnd; - uint32 status=0; + NTSTATUS status=0; NEW_BUFFER buffer; uint32 needed=1000; TALLOC_CTX *mem_ctx = NULL; @@ -589,7 +589,7 @@ BOOL msrpc_spoolss_getprinter( const char* printer_name, const uint32 level, report(out_hnd, "\tstatus:[%d (%x)]\n", status, status); - if (status!=NT_STATUS_NOPROBLEMO) + if (status!=NT_STATUS_OK) { if (mem_ctx) talloc_destroy(mem_ctx); @@ -618,7 +618,7 @@ BOOL msrpc_spoolss_getprinter( const char* printer_name, const uint32 level, if (mem_ctx) talloc_destroy(mem_ctx); - if (status!=NT_STATUS_NOPROBLEMO) { + if (status!=NT_STATUS_OK) { if (!spoolss_closeprinter(&hnd)) return False; return False; @@ -636,7 +636,7 @@ BOOL msrpc_spoolss_getprinterdriver( const char* printer_name, PRINTER_DRIVER_CTR ctr) { POLICY_HND hnd; - uint32 status=0; + NTSTATUS status=0; NEW_BUFFER buffer; uint32 needed; TALLOC_CTX *mem_ctx = NULL; @@ -662,7 +662,7 @@ BOOL msrpc_spoolss_getprinterdriver( const char* printer_name, /* report(out_hnd, "\tstatus:[%d (%x)]\n", status, status); */ - if (status!=NT_STATUS_NOPROBLEMO) + if (status!=NT_STATUS_OK) { if (mem_ctx) talloc_destroy(mem_ctx); @@ -688,7 +688,7 @@ BOOL msrpc_spoolss_getprinterdriver( const char* printer_name, if (mem_ctx) talloc_destroy(mem_ctx); - if (status!=NT_STATUS_NOPROBLEMO) { + if (status!=NT_STATUS_OK) { if (!spoolss_closeprinter(&hnd)) return False; return False; @@ -704,7 +704,7 @@ BOOL msrpc_spoolss_enumprinterdrivers( const char* srv_name, const char *environment, const uint32 level, PRINTER_DRIVER_CTR ctr) { - uint32 status=0; + NTSTATUS status=0; NEW_BUFFER buffer; uint32 needed; uint32 returned; @@ -731,7 +731,7 @@ BOOL msrpc_spoolss_enumprinterdrivers( const char* srv_name, report(out_hnd, "\tstatus:[%d (%x)]\n", status, status); - if (status!=NT_STATUS_NOPROBLEMO) + if (status!=NT_STATUS_OK) { if (mem_ctx) talloc_destroy(mem_ctx); @@ -766,7 +766,7 @@ nt spoolss query ****************************************************************************/ BOOL msrpc_spoolss_getprinterdriverdir(char* srv_name, char* env_name, uint32 level, DRIVER_DIRECTORY_CTR ctr) { - uint32 status; + NTSTATUS status; NEW_BUFFER buffer; uint32 needed; TALLOC_CTX *mem_ctx = NULL; @@ -788,7 +788,7 @@ BOOL msrpc_spoolss_getprinterdriverdir(char* srv_name, char* env_name, uint32 le report(out_hnd, "\tstatus:[%d (%x)]\n", status, status); - if (status!=NT_STATUS_NOPROBLEMO) + if (status!=NT_STATUS_OK) { if (mem_ctx) talloc_destroy(mem_ctx); diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index 2c588912fe6..9bfb6746bb9 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -532,7 +532,7 @@ BOOL lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, void init_r_enum_trust_dom(TALLOC_CTX *ctx, LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context, char *domain_name, DOM_SID *domain_sid, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_r_enum_trust_dom\n")); diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index 23d47cf9b59..3a6f7ba8194 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -891,7 +891,7 @@ makes a structure. ********************************************************************/ void init_reg_r_get_key_sec(REG_R_GET_KEY_SEC *r_i, POLICY_HND *pol, uint32 buf_len, uint8 *buf, - uint32 status) + NTSTATUS status) { r_i->ptr = 1; init_buf_hdr(&r_i->hdr_sec, buf_len, buf_len); @@ -1028,7 +1028,7 @@ BOOL reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth) ********************************************************************/ BOOL init_reg_r_info(uint32 include_keyval, REG_R_INFO *r_r, - BUFFER2* buf, uint32 type, uint32 status) + BUFFER2* buf, uint32 type, NTSTATUS status) { if(r_r == NULL) return False; @@ -1519,7 +1519,7 @@ BOOL reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int ********************************************************************/ void init_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, - POLICY_HND *pol, uint32 status) + POLICY_HND *pol, NTSTATUS status) { memcpy(&r_r->pol, pol, sizeof(r_r->pol)); r_r->status = status; diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 6964c58a971..f39104fed0e 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -133,7 +133,7 @@ inits a SAMR_R_LOOKUP_DOMAIN structure. ********************************************************************/ void init_samr_r_lookup_domain(SAMR_R_LOOKUP_DOMAIN * r_u, - DOM_SID *dom_sid, uint32 status) + DOM_SID *dom_sid, NTSTATUS status) { DEBUG(5, ("init_samr_r_lookup_domain\n")); @@ -342,7 +342,7 @@ BOOL samr_io_q_get_usrdom_pwinfo(char *desc, SAMR_Q_GET_USRDOM_PWINFO * q_u, Init. ********************************************************************/ -void init_samr_r_get_usrdom_pwinfo(SAMR_R_GET_USRDOM_PWINFO *r_u, uint32 status) +void init_samr_r_get_usrdom_pwinfo(SAMR_R_GET_USRDOM_PWINFO *r_u, NTSTATUS status) { DEBUG(5, ("init_samr_r_get_usrdom_pwinfo\n")); @@ -762,7 +762,7 @@ inits a SAMR_R_QUERY_DOMAIN_INFO structure. void init_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO * r_u, uint16 switch_value, SAM_UNK_CTR * ctr, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_query_dom_info\n")); @@ -1424,7 +1424,7 @@ BOOL samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO * q_e, inits a SAM_DISPINFO_1 structure. ********************************************************************/ -uint32 init_sam_dispinfo_1(TALLOC_CTX *ctx, SAM_DISPINFO_1 *sam, uint32 *num_entries, +NTSTATUS init_sam_dispinfo_1(TALLOC_CTX *ctx, SAM_DISPINFO_1 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]) { @@ -1442,7 +1442,7 @@ uint32 init_sam_dispinfo_1(TALLOC_CTX *ctx, SAM_DISPINFO_1 *sam, uint32 *num_ent max_entries, max_data_size)); if (max_entries==0) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; sam->sam=(SAM_ENTRY1 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY1)); if (!sam->sam) @@ -1480,7 +1480,7 @@ uint32 init_sam_dispinfo_1(TALLOC_CTX *ctx, SAM_DISPINFO_1 *sam, uint32 *num_ent *num_entries = i; *data_size = dsize; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -1536,7 +1536,7 @@ static BOOL sam_io_sam_dispinfo_1(char *desc, SAM_DISPINFO_1 * sam, inits a SAM_DISPINFO_2 structure. ********************************************************************/ -uint32 init_sam_dispinfo_2(TALLOC_CTX *ctx, SAM_DISPINFO_2 *sam, uint32 *num_entries, +NTSTATUS init_sam_dispinfo_2(TALLOC_CTX *ctx, SAM_DISPINFO_2 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]) { @@ -1553,7 +1553,7 @@ uint32 init_sam_dispinfo_2(TALLOC_CTX *ctx, SAM_DISPINFO_2 *sam, uint32 *num_ent max_data_size = *data_size; if (max_entries==0) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; if (!(sam->sam=(SAM_ENTRY2 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY2)))) return NT_STATUS_NO_MEMORY; @@ -1585,7 +1585,7 @@ uint32 init_sam_dispinfo_2(TALLOC_CTX *ctx, SAM_DISPINFO_2 *sam, uint32 *num_ent *num_entries = i; *data_size = dsize; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -1643,7 +1643,7 @@ static BOOL sam_io_sam_dispinfo_2(char *desc, SAM_DISPINFO_2 * sam, inits a SAM_DISPINFO_3 structure. ********************************************************************/ -uint32 init_sam_dispinfo_3(TALLOC_CTX *ctx, SAM_DISPINFO_3 *sam, uint32 *num_entries, +NTSTATUS init_sam_dispinfo_3(TALLOC_CTX *ctx, SAM_DISPINFO_3 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, DOMAIN_GRP * grp) { @@ -1660,7 +1660,7 @@ uint32 init_sam_dispinfo_3(TALLOC_CTX *ctx, SAM_DISPINFO_3 *sam, uint32 *num_ent max_data_size = *data_size; if (max_entries==0) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; if (!(sam->sam=(SAM_ENTRY3 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY3)))) return NT_STATUS_NO_MEMORY; @@ -1688,7 +1688,7 @@ uint32 init_sam_dispinfo_3(TALLOC_CTX *ctx, SAM_DISPINFO_3 *sam, uint32 *num_ent *num_entries = i; *data_size = dsize; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -1746,7 +1746,7 @@ static BOOL sam_io_sam_dispinfo_3(char *desc, SAM_DISPINFO_3 * sam, inits a SAM_DISPINFO_4 structure. ********************************************************************/ -uint32 init_sam_dispinfo_4(TALLOC_CTX *ctx, SAM_DISPINFO_4 *sam, uint32 *num_entries, +NTSTATUS init_sam_dispinfo_4(TALLOC_CTX *ctx, SAM_DISPINFO_4 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]) { @@ -1764,7 +1764,7 @@ uint32 init_sam_dispinfo_4(TALLOC_CTX *ctx, SAM_DISPINFO_4 *sam, uint32 *num_ent max_data_size = *data_size; if (max_entries==0) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; if (!(sam->sam=(SAM_ENTRY4 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY4)))) return NT_STATUS_NO_MEMORY; @@ -1790,7 +1790,7 @@ uint32 init_sam_dispinfo_4(TALLOC_CTX *ctx, SAM_DISPINFO_4 *sam, uint32 *num_ent *num_entries = i; *data_size = dsize; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -1849,7 +1849,7 @@ static BOOL sam_io_sam_dispinfo_4(char *desc, SAM_DISPINFO_4 * sam, inits a SAM_DISPINFO_5 structure. ********************************************************************/ -uint32 init_sam_dispinfo_5(TALLOC_CTX *ctx, SAM_DISPINFO_5 *sam, uint32 *num_entries, +NTSTATUS init_sam_dispinfo_5(TALLOC_CTX *ctx, SAM_DISPINFO_5 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, DOMAIN_GRP * grp) { @@ -1866,7 +1866,7 @@ uint32 init_sam_dispinfo_5(TALLOC_CTX *ctx, SAM_DISPINFO_5 *sam, uint32 *num_ent max_data_size = *data_size; if (max_entries==0) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; if (!(sam->sam=(SAM_ENTRY5 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY5)))) return NT_STATUS_NO_MEMORY; @@ -1890,7 +1890,7 @@ uint32 init_sam_dispinfo_5(TALLOC_CTX *ctx, SAM_DISPINFO_5 *sam, uint32 *num_ent *num_entries = i; *data_size = dsize; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -1952,7 +1952,7 @@ inits a SAMR_R_QUERY_DISPINFO structure. void init_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO * r_u, uint32 num_entries, uint32 data_size, uint16 switch_level, SAM_DISPINFO_CTR * ctr, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_query_dispinfo: level %d\n", switch_level)); @@ -2443,7 +2443,7 @@ inits a SAMR_R_DEL_GROUPMEM structure. ********************************************************************/ void init_samr_r_del_groupmem(SAMR_R_DEL_GROUPMEM * r_u, POLICY_HND *pol, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_del_groupmem\n")); @@ -2518,7 +2518,7 @@ inits a SAMR_R_ADD_GROUPMEM structure. ********************************************************************/ void init_samr_r_add_groupmem(SAMR_R_ADD_GROUPMEM * r_u, POLICY_HND *pol, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_add_groupmem\n")); @@ -2589,7 +2589,7 @@ BOOL samr_io_q_set_groupinfo(char *desc, SAMR_Q_SET_GROUPINFO * q_e, inits a SAMR_R_SET_GROUPINFO structure. ********************************************************************/ -void init_samr_r_set_groupinfo(SAMR_R_SET_GROUPINFO * r_u, uint32 status) +void init_samr_r_set_groupinfo(SAMR_R_SET_GROUPINFO * r_u, NTSTATUS status) { DEBUG(5, ("init_samr_r_set_groupinfo\n")); @@ -2662,7 +2662,7 @@ inits a SAMR_R_QUERY_GROUPINFO structure. ********************************************************************/ void init_samr_r_query_groupinfo(SAMR_R_QUERY_GROUPINFO * r_u, - GROUP_INFO_CTR * ctr, uint32 status) + GROUP_INFO_CTR * ctr, NTSTATUS status) { DEBUG(5, ("init_samr_r_query_groupinfo\n")); @@ -2742,7 +2742,7 @@ inits a SAMR_R_QUERY_GROUPMEM structure. void init_samr_r_query_groupmem(SAMR_R_QUERY_GROUPMEM * r_u, uint32 num_entries, uint32 *rid, - uint32 *attr, uint32 status) + uint32 *attr, NTSTATUS status) { DEBUG(5, ("init_samr_r_query_groupmem\n")); @@ -2876,7 +2876,7 @@ inits a SAMR_R_QUERY_USERGROUPS structure. void init_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS * r_u, uint32 num_gids, DOM_GID * gid, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_query_usergroups\n")); @@ -3495,7 +3495,7 @@ inits a SAMR_R_QUERY_ALIASINFO structure. ********************************************************************/ void init_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO * r_u, - ALIAS_INFO_CTR * ctr, uint32 status) + ALIAS_INFO_CTR * ctr, NTSTATUS status) { DEBUG(5, ("init_samr_r_query_aliasinfo\n")); @@ -3681,7 +3681,7 @@ inits a SAMR_R_QUERY_USERALIASES structure. void init_samr_r_query_useraliases(SAMR_R_QUERY_USERALIASES * r_u, uint32 num_rids, uint32 *rid, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_query_useraliases\n")); @@ -4327,7 +4327,7 @@ inits a SAMR_R_DELETE_DOM_ALIAS structure. ********************************************************************/ void init_samr_r_delete_dom_alias(SAMR_R_DELETE_DOM_ALIAS * r_u, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_delete_dom_alias\n")); @@ -4396,7 +4396,7 @@ inits a SAMR_R_QUERY_ALIASMEM structure. void init_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM * r_u, uint32 num_sids, DOM_SID2 * sid, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_query_aliasmem\n")); @@ -4472,7 +4472,7 @@ BOOL samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM * r_u, inits a SAMR_Q_LOOKUP_NAMES structure. ********************************************************************/ -uint32 init_samr_q_lookup_names(TALLOC_CTX *ctx, SAMR_Q_LOOKUP_NAMES * q_u, +NTSTATUS init_samr_q_lookup_names(TALLOC_CTX *ctx, SAMR_Q_LOOKUP_NAMES * q_u, POLICY_HND *pol, uint32 flags, uint32 num_names, char **name) { @@ -4499,7 +4499,7 @@ uint32 init_samr_q_lookup_names(TALLOC_CTX *ctx, SAMR_Q_LOOKUP_NAMES * q_u, init_unistr2(&q_u->uni_name[i], name[i], len_name); /* unicode string for machine account */ } - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -4561,10 +4561,10 @@ BOOL samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES * q_u, inits a SAMR_R_LOOKUP_NAMES structure. ********************************************************************/ -uint32 init_samr_r_lookup_names(TALLOC_CTX *ctx, SAMR_R_LOOKUP_NAMES * r_u, +NTSTATUS init_samr_r_lookup_names(TALLOC_CTX *ctx, SAMR_R_LOOKUP_NAMES * r_u, uint32 num_rids, uint32 *rid, uint32 *type, - uint32 status) + NTSTATUS status) { DEBUG(5, ("init_samr_r_lookup_names\n")); @@ -4608,7 +4608,7 @@ uint32 init_samr_r_lookup_names(TALLOC_CTX *ctx, SAMR_R_LOOKUP_NAMES * r_u, r_u->status = status; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -6013,7 +6013,7 @@ static BOOL sam_io_user_info20(char *desc, SAM_USER_INFO_20 *usr, inits a SAM_USERINFO_CTR structure. ********************************************************************/ -uint32 make_samr_userinfo_ctr_usr21(TALLOC_CTX *ctx, SAM_USERINFO_CTR * ctr, +NTSTATUS make_samr_userinfo_ctr_usr21(TALLOC_CTX *ctx, SAM_USERINFO_CTR * ctr, uint16 switch_value, SAM_USER_INFO_21 * usr) { @@ -6074,7 +6074,7 @@ uint32 make_samr_userinfo_ctr_usr21(TALLOC_CTX *ctx, SAM_USERINFO_CTR * ctr, return NT_STATUS_INVALID_INFO_CLASS; } - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -6230,7 +6230,7 @@ inits a SAMR_R_QUERY_USERINFO structure. ********************************************************************/ void init_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO * r_u, - SAM_USERINFO_CTR * ctr, uint32 status) + SAM_USERINFO_CTR * ctr, NTSTATUS status) { DEBUG(5, ("init_samr_r_query_userinfo\n")); @@ -6322,7 +6322,7 @@ BOOL samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO * q_u, inits a SAMR_R_SET_USERINFO structure. ********************************************************************/ -void init_samr_r_set_userinfo(SAMR_R_SET_USERINFO * r_u, uint32 status) +void init_samr_r_set_userinfo(SAMR_R_SET_USERINFO * r_u, NTSTATUS status) { DEBUG(5, ("init_samr_r_set_userinfo\n")); @@ -6410,7 +6410,7 @@ BOOL samr_io_q_set_userinfo2(char *desc, SAMR_Q_SET_USERINFO2 * q_u, inits a SAMR_R_SET_USERINFO2 structure. ********************************************************************/ -void init_samr_r_set_userinfo2(SAMR_R_SET_USERINFO2 * r_u, uint32 status) +void init_samr_r_set_userinfo2(SAMR_R_SET_USERINFO2 * r_u, NTSTATUS status) { DEBUG(5, ("init_samr_r_set_userinfo2\n")); @@ -6825,7 +6825,7 @@ BOOL samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER * q_u, inits a SAMR_R_CHGPASSWD_USER structure. ********************************************************************/ -void init_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER * r_u, uint32 status) +void init_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER * r_u, NTSTATUS status) { DEBUG(5, ("init_r_chgpasswd_user\n")); diff --git a/source3/rpc_parse/parse_srv.c b/source3/rpc_parse/parse_srv.c index 637b8342660..d695eb136cb 100644 --- a/source3/rpc_parse/parse_srv.c +++ b/source3/rpc_parse/parse_srv.c @@ -2240,7 +2240,7 @@ BOOL srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_stru ********************************************************************/ void init_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status) + uint32 switch_value, SRV_INFO_CTR *ctr, NTSTATUS status) { DEBUG(5,("init_srv_r_net_srv_get_info\n")); @@ -2262,7 +2262,7 @@ void init_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, ********************************************************************/ void init_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, - uint32 switch_value, uint32 status) + uint32 switch_value, NTSTATUS status) { DEBUG(5,("init_srv_r_net_srv_set_info\n")); diff --git a/source3/rpc_parse/parse_wks.c b/source3/rpc_parse/parse_wks.c index 7357e3d2f3a..f35bef83bd4 100644 --- a/source3/rpc_parse/parse_wks.c +++ b/source3/rpc_parse/parse_wks.c @@ -135,8 +135,8 @@ static BOOL wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, i ********************************************************************/ void init_wks_r_query_info(WKS_R_QUERY_INFO *r_u, - uint32 switch_value, WKS_INFO_100 *wks100, - int status) + uint32 switch_value, WKS_INFO_100 *wks100, + NTSTATUS status) { DEBUG(5,("init_wks_r_unknown_0: %d\n", __LINE__)); diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c index a84f2ceb48e..034b1bbe774 100644 --- a/source3/rpc_server/srv_dfs_nt.c +++ b/source3/rpc_server/srv_dfs_nt.c @@ -106,7 +106,7 @@ uint32 _dfs_add(pipes_struct *p, DFS_Q_DFS_ADD* q_u, DFS_R_DFS_ADD *r_u) if(!create_msdfs_link(&jn, exists)) return NERR_DfsCantCreateJunctionPoint; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } uint32 _dfs_remove(pipes_struct *p, DFS_Q_DFS_REMOVE *q_u, DFS_R_DFS_REMOVE *r_u) @@ -185,7 +185,7 @@ uint32 _dfs_remove(pipes_struct *p, DFS_Q_DFS_REMOVE *q_u, DFS_R_DFS_REMOVE *r_u } } - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } static BOOL init_reply_dfs_info_1(struct junction_map* j, DFS_INFO_1* dfs1, int num_j) @@ -309,7 +309,7 @@ static uint32 init_reply_dfs_ctr(TALLOC_CTX *ctx, uint32 level, DFS_INFO_CTR* ct default: return NT_STATUS_INVALID_LEVEL; } - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } uint32 _dfs_enum(pipes_struct *p, DFS_Q_DFS_ENUM *q_u, DFS_R_DFS_ENUM *r_u) diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index fd4e3b6ec22..b84293b2f48 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -193,7 +193,7 @@ static void init_reply_lookup_names(LSA_R_LOOKUP_NAMES *r_l, if (mapped_count == 0) r_l->status = NT_STATUS_NONE_MAPPED; else - r_l->status = NT_STATUS_NOPROBLEMO; + r_l->status = NT_STATUS_OK; } /*************************************************************************** @@ -288,7 +288,7 @@ static void init_reply_lookup_sids(LSA_R_LOOKUP_SIDS *r_l, if (mapped_count == 0) r_l->status = NT_STATUS_NONE_MAPPED; else - r_l->status = NT_STATUS_NOPROBLEMO; + r_l->status = NT_STATUS_OK; } /*************************************************************************** @@ -303,14 +303,14 @@ NTSTATUS _lsa_open_policy2(pipes_struct *p, LSA_Q_OPEN_POL2 *q_u, LSA_R_OPEN_POL if (!create_policy_hnd(p, &r_u->pol, NULL, NULL)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /*************************************************************************** _lsa_open_policy ***************************************************************************/ -uint32 _lsa_open_policy(pipes_struct *p, LSA_Q_OPEN_POL *q_u, LSA_R_OPEN_POL *r_u) +NTSTATUS _lsa_open_policy(pipes_struct *p, LSA_Q_OPEN_POL *q_u, LSA_R_OPEN_POL *r_u) { /* lkclXXXX having decoded it, ignore all fields in the open policy! */ @@ -318,14 +318,14 @@ uint32 _lsa_open_policy(pipes_struct *p, LSA_Q_OPEN_POL *q_u, LSA_R_OPEN_POL *r_ if (!create_policy_hnd(p, &r_u->pol, NULL, NULL)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /*************************************************************************** _lsa_enum_trust_dom - this needs fixing to do more than return NULL ! JRA. ***************************************************************************/ -uint32 _lsa_enum_trust_dom(pipes_struct *p, LSA_Q_ENUM_TRUST_DOM *q_u, LSA_R_ENUM_TRUST_DOM *r_u) +NTSTATUS _lsa_enum_trust_dom(pipes_struct *p, LSA_Q_ENUM_TRUST_DOM *q_u, LSA_R_ENUM_TRUST_DOM *r_u) { uint32 enum_context = 0; char *dom_name = NULL; @@ -336,7 +336,7 @@ uint32 _lsa_enum_trust_dom(pipes_struct *p, LSA_Q_ENUM_TRUST_DOM *q_u, LSA_R_ENU /* set up the LSA QUERY INFO response */ init_r_enum_trust_dom(p->mem_ctx, r_u, enum_context, dom_name, dom_sid, - dom_name != NULL ? NT_STATUS_NOPROBLEMO : NT_STATUS_UNABLE_TO_FREE_VM); + dom_name != NULL ? NT_STATUS_OK : NT_STATUS_UNABLE_TO_FREE_VM); return r_u->status; } @@ -345,14 +345,14 @@ uint32 _lsa_enum_trust_dom(pipes_struct *p, LSA_Q_ENUM_TRUST_DOM *q_u, LSA_R_ENU _lsa_query_info. See the POLICY_INFOMATION_CLASS docs at msdn. ***************************************************************************/ -uint32 _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INFO *r_u) +NTSTATUS _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INFO *r_u) { LSA_INFO_UNION *info = &r_u->dom; DOM_SID domain_sid; char *name = NULL; DOM_SID *sid = NULL; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; if (!find_policy_by_hnd(p, &q_u->pol, NULL)) return NT_STATUS_INVALID_HANDLE; @@ -366,7 +366,7 @@ uint32 _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INFO info->id2.count1 = 7; info->id2.count2 = 7; if ((info->id2.auditsettings = (uint32 *)talloc(p->mem_ctx,7*sizeof(uint32))) == NULL) - return False; + return NT_STATUS_NO_MEMORY; for (i = 0; i < 7; i++) info->id2.auditsettings[i] = 3; break; @@ -442,7 +442,7 @@ uint32 _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INFO break; } - if(r_u->status == NT_STATUS_NOPROBLEMO) { + if (NT_STATUS_IS_OK(r_u->status)) { r_u->undoc_buffer = 0x22000000; /* bizarre */ r_u->info_class = q_u->info_class; } @@ -454,7 +454,7 @@ uint32 _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INFO _lsa_lookup_sids ***************************************************************************/ -uint32 _lsa_lookup_sids(pipes_struct *p, LSA_Q_LOOKUP_SIDS *q_u, LSA_R_LOOKUP_SIDS *r_u) +NTSTATUS _lsa_lookup_sids(pipes_struct *p, LSA_Q_LOOKUP_SIDS *q_u, LSA_R_LOOKUP_SIDS *r_u) { DOM_SID2 *sid = q_u->sids.sid; int num_entries = q_u->sids.num_entries; @@ -482,7 +482,7 @@ uint32 _lsa_lookup_sids(pipes_struct *p, LSA_Q_LOOKUP_SIDS *q_u, LSA_R_LOOKUP_SI lsa_reply_lookup_names ***************************************************************************/ -uint32 _lsa_lookup_names(pipes_struct *p,LSA_Q_LOOKUP_NAMES *q_u, LSA_R_LOOKUP_NAMES *r_u) +NTSTATUS _lsa_lookup_names(pipes_struct *p,LSA_Q_LOOKUP_NAMES *q_u, LSA_R_LOOKUP_NAMES *r_u) { UNISTR2 *names = q_u->uni_name; int num_entries = q_u->num_entries; @@ -510,20 +510,20 @@ uint32 _lsa_lookup_names(pipes_struct *p,LSA_Q_LOOKUP_NAMES *q_u, LSA_R_LOOKUP_N _lsa_close. Also weird - needs to check if lsa handle is correct. JRA. ***************************************************************************/ -uint32 _lsa_close(pipes_struct *p, LSA_Q_CLOSE *q_u, LSA_R_CLOSE *r_u) +NTSTATUS _lsa_close(pipes_struct *p, LSA_Q_CLOSE *q_u, LSA_R_CLOSE *r_u) { if (!find_policy_by_hnd(p, &q_u->pol, NULL)) return NT_STATUS_INVALID_HANDLE; close_policy_hnd(p, &q_u->pol); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /*************************************************************************** "No more secrets Marty...." :-). ***************************************************************************/ -uint32 _lsa_open_secret(pipes_struct *p, LSA_Q_OPEN_SECRET *q_u, LSA_R_OPEN_SECRET *r_u) +NTSTATUS _lsa_open_secret(pipes_struct *p, LSA_Q_OPEN_SECRET *q_u, LSA_R_OPEN_SECRET *r_u) { return NT_STATUS_OBJECT_NAME_NOT_FOUND; } @@ -532,7 +532,7 @@ uint32 _lsa_open_secret(pipes_struct *p, LSA_Q_OPEN_SECRET *q_u, LSA_R_OPEN_SECR _lsa_enum_privs. ***************************************************************************/ -uint32 _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIVS *r_u) +NTSTATUS _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIVS *r_u) { uint32 i; @@ -544,7 +544,7 @@ uint32 _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIVS return NT_STATUS_INVALID_HANDLE; if (enum_context >= PRIV_ALL_INDEX) - return 0x8000001A; + return NT_STATUS_UNABLE_TO_FREE_VM; entries = (LSA_PRIV_ENTRY *)talloc_zero(p->mem_ctx, sizeof(LSA_PRIV_ENTRY) * (PRIV_ALL_INDEX-enum_context)); if (entries==NULL) @@ -560,14 +560,14 @@ uint32 _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIVS init_lsa_r_enum_privs(r_u, i+enum_context, PRIV_ALL_INDEX-enum_context, entries); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /*************************************************************************** _lsa_priv_get_dispname. ***************************************************************************/ -uint32 _lsa_priv_get_dispname(pipes_struct *p, LSA_Q_PRIV_GET_DISPNAME *q_u, LSA_R_PRIV_GET_DISPNAME *r_u) +NTSTATUS _lsa_priv_get_dispname(pipes_struct *p, LSA_Q_PRIV_GET_DISPNAME *q_u, LSA_R_PRIV_GET_DISPNAME *r_u) { fstring name_asc; fstring desc_asc; @@ -595,14 +595,14 @@ uint32 _lsa_priv_get_dispname(pipes_struct *p, LSA_Q_PRIV_GET_DISPNAME *q_u, LSA r_u->ptr_info=0xdeadbeef; r_u->lang_id=q_u->lang_id; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /*************************************************************************** _lsa_enum_accounts. ***************************************************************************/ -uint32 _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENUM_ACCOUNTS *r_u) +NTSTATUS _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENUM_ACCOUNTS *r_u) { GROUP_MAP *map=NULL; int num_entries=0; @@ -614,7 +614,7 @@ uint32 _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENUM_ /* get the list of mapped groups (domain, local, builtin) */ if(!enum_group_mapping(SID_NAME_UNKNOWN, &map, &num_entries, ENUM_ONLY_MAPPED)) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; sids->ptr_sid = (uint32 *)talloc_zero(p->mem_ctx, (num_entries-q_u->enum_context)*sizeof(uint32)); sids->sid = (DOM_SID2 *)talloc_zero(p->mem_ctx, (num_entries-q_u->enum_context)*sizeof(DOM_SID2)); @@ -634,11 +634,11 @@ uint32 _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENUM_ init_lsa_r_enum_accounts(r_u, j); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } -uint32 _lsa_unk_get_connuser(pipes_struct *p, LSA_Q_UNK_GET_CONNUSER *q_u, LSA_R_UNK_GET_CONNUSER *r_u) +NTSTATUS _lsa_unk_get_connuser(pipes_struct *p, LSA_Q_UNK_GET_CONNUSER *q_u, LSA_R_UNK_GET_CONNUSER *r_u) { fstring username, domname; int ulen, dlen; @@ -663,7 +663,7 @@ uint32 _lsa_unk_get_connuser(pipes_struct *p, LSA_Q_UNK_GET_CONNUSER *q_u, LSA_R r_u->ptr_dom_name = 1; init_unistr2(&r_u->uni2_dom_name, domname, dlen); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; return r_u->status; } @@ -672,11 +672,11 @@ uint32 _lsa_unk_get_connuser(pipes_struct *p, LSA_Q_UNK_GET_CONNUSER *q_u, LSA_R ***************************************************************************/ -uint32 _lsa_open_account(pipes_struct *p, LSA_Q_OPENACCOUNT *q_u, LSA_R_OPENACCOUNT *r_u) +NTSTATUS _lsa_open_account(pipes_struct *p, LSA_Q_OPENACCOUNT *q_u, LSA_R_OPENACCOUNT *r_u) { struct lsa_info *info; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* find the connection policy handle. */ if (!find_policy_by_hnd(p, &q_u->pol, NULL)) @@ -701,7 +701,7 @@ uint32 _lsa_open_account(pipes_struct *p, LSA_Q_OPENACCOUNT *q_u, LSA_R_OPENACCO ***************************************************************************/ -uint32 _lsa_enum_privsaccount(pipes_struct *p, LSA_Q_ENUMPRIVSACCOUNT *q_u, LSA_R_ENUMPRIVSACCOUNT *r_u) +NTSTATUS _lsa_enum_privsaccount(pipes_struct *p, LSA_Q_ENUMPRIVSACCOUNT *q_u, LSA_R_ENUMPRIVSACCOUNT *r_u) { struct lsa_info *info=NULL; GROUP_MAP map; @@ -710,7 +710,7 @@ uint32 _lsa_enum_privsaccount(pipes_struct *p, LSA_Q_ENUMPRIVSACCOUNT *q_u, LSA_ LUID_ATTR *set=NULL; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* find the connection policy handle. */ if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) @@ -742,9 +742,9 @@ uint32 _lsa_enum_privsaccount(pipes_struct *p, LSA_Q_ENUMPRIVSACCOUNT *q_u, LSA_ ***************************************************************************/ -uint32 _lsa_getsystemaccount(pipes_struct *p, LSA_Q_GETSYSTEMACCOUNT *q_u, LSA_R_GETSYSTEMACCOUNT *r_u) +NTSTATUS _lsa_getsystemaccount(pipes_struct *p, LSA_Q_GETSYSTEMACCOUNT *q_u, LSA_R_GETSYSTEMACCOUNT *r_u) { - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* find the connection policy handle. */ if (!find_policy_by_hnd(p, &q_u->pol, NULL)) diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c index 886e5fefca0..e29d9393a66 100644 --- a/source3/rpc_server/srv_netlog_nt.c +++ b/source3/rpc_server/srv_netlog_nt.c @@ -38,7 +38,7 @@ extern DOM_SID global_sam_sid; *************************************************************************/ static void init_net_r_req_chal(NET_R_REQ_CHAL *r_c, - DOM_CHAL *srv_chal, int status) + DOM_CHAL *srv_chal, NTSTATUS status) { DEBUG(6,("init_net_r_req_chal: %d\n", __LINE__)); memcpy(r_c->srv_chal.data, srv_chal->data, sizeof(srv_chal->data)); @@ -62,7 +62,7 @@ static void init_net_r_req_chal(NET_R_REQ_CHAL *r_c, #define LOGON_CTRL_REPL_NEEDED 0x01 #define LOGON_CTRL_REPL_IN_PROGRESS 0x02 -uint32 _net_logon_ctrl(pipes_struct *p, NET_Q_LOGON_CTRL *q_u, +NTSTATUS _net_logon_ctrl(pipes_struct *p, NET_Q_LOGON_CTRL *q_u, NET_R_LOGON_CTRL *r_u) { uint32 flags = 0x0; @@ -80,7 +80,7 @@ uint32 _net_logon_ctrl(pipes_struct *p, NET_Q_LOGON_CTRL *q_u, net_reply_logon_ctrl2: *************************************************************************/ -uint32 _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_CTRL2 *r_u) +NTSTATUS _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_CTRL2 *r_u) { /* lkclXXXX - guess what - absolutely no idea what these are! */ uint32 flags = 0x0; @@ -105,7 +105,7 @@ uint32 _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_CTR net_reply_trust_dom_list: *************************************************************************/ -uint32 _net_trust_dom_list(pipes_struct *p, NET_Q_TRUST_DOM_LIST *q_u, NET_R_TRUST_DOM_LIST *r_u) +NTSTATUS _net_trust_dom_list(pipes_struct *p, NET_Q_TRUST_DOM_LIST *q_u, NET_R_TRUST_DOM_LIST *r_u) { char *trusted_domain = "test_domain"; uint32 num_trust_domains = 1; @@ -125,7 +125,7 @@ uint32 _net_trust_dom_list(pipes_struct *p, NET_Q_TRUST_DOM_LIST *q_u, NET_R_TRU ***********************************************************************************/ static void init_net_r_srv_pwset(NET_R_SRV_PWSET *r_s, - DOM_CRED *srv_cred, int status) + DOM_CRED *srv_cred, NTSTATUS status) { DEBUG(5,("init_net_r_srv_pwset: %d\n", __LINE__)); @@ -194,9 +194,9 @@ static BOOL get_md4pw(char *md4pw, char *mach_acct) _net_req_chal *************************************************************************/ -uint32 _net_req_chal(pipes_struct *p, NET_Q_REQ_CHAL *q_u, NET_R_REQ_CHAL *r_u) +NTSTATUS _net_req_chal(pipes_struct *p, NET_Q_REQ_CHAL *q_u, NET_R_REQ_CHAL *r_u) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; fstring mach_acct; if (!get_valid_user_struct(p->vuid)) @@ -242,7 +242,7 @@ uint32 _net_req_chal(pipes_struct *p, NET_Q_REQ_CHAL *q_u, NET_R_REQ_CHAL *r_u) init_net_r_auth: *************************************************************************/ -static void init_net_r_auth(NET_R_AUTH *r_a, DOM_CHAL *resp_cred, int status) +static void init_net_r_auth(NET_R_AUTH *r_a, DOM_CHAL *resp_cred, NTSTATUS status) { memcpy(r_a->srv_chal.data, resp_cred->data, sizeof(resp_cred->data)); r_a->status = status; @@ -252,9 +252,9 @@ static void init_net_r_auth(NET_R_AUTH *r_a, DOM_CHAL *resp_cred, int status) _net_auth *************************************************************************/ -uint32 _net_auth(pipes_struct *p, NET_Q_AUTH *q_u, NET_R_AUTH *r_u) +NTSTATUS _net_auth(pipes_struct *p, NET_Q_AUTH *q_u, NET_R_AUTH *r_u) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; DOM_CHAL srv_cred; UTIME srv_time; @@ -287,7 +287,7 @@ uint32 _net_auth(pipes_struct *p, NET_Q_AUTH *q_u, NET_R_AUTH *r_u) *************************************************************************/ static void init_net_r_auth_2(NET_R_AUTH_2 *r_a, - DOM_CHAL *resp_cred, NEG_FLAGS *flgs, int status) + DOM_CHAL *resp_cred, NEG_FLAGS *flgs, NTSTATUS status) { memcpy(r_a->srv_chal.data, resp_cred->data, sizeof(resp_cred->data)); memcpy(&r_a->srv_flgs, flgs, sizeof(r_a->srv_flgs)); @@ -298,9 +298,9 @@ static void init_net_r_auth_2(NET_R_AUTH_2 *r_a, _net_auth_2 *************************************************************************/ -uint32 _net_auth_2(pipes_struct *p, NET_Q_AUTH_2 *q_u, NET_R_AUTH_2 *r_u) +NTSTATUS _net_auth_2(pipes_struct *p, NET_Q_AUTH_2 *q_u, NET_R_AUTH_2 *r_u) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; DOM_CHAL srv_cred; UTIME srv_time; NEG_FLAGS srv_flgs; @@ -335,9 +335,9 @@ uint32 _net_auth_2(pipes_struct *p, NET_Q_AUTH_2 *q_u, NET_R_AUTH_2 *r_u) _net_srv_pwset *************************************************************************/ -uint32 _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *r_u) +NTSTATUS _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *r_u) { - uint32 status = NT_STATUS_WRONG_PASSWORD; + NTSTATUS status = NT_STATUS_WRONG_PASSWORD; DOM_CRED srv_cred; pstring mach_acct; SAM_ACCOUNT *sampass=NULL; @@ -403,7 +403,7 @@ uint32 _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *r_ unbecome_root(); if (ret) - status = NT_STATUS_NOPROBLEMO; + status = NT_STATUS_OK; /* set up the LSA Server Password Set response */ init_net_r_srv_pwset(r_u, &srv_cred, status); @@ -417,7 +417,7 @@ uint32 _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *r_ _net_sam_logoff: *************************************************************************/ -uint32 _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOFF *r_u) +NTSTATUS _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOFF *r_u) { DOM_CRED srv_cred; @@ -435,7 +435,7 @@ uint32 _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOFF r_u->buffer_creds = 1; /* yes, we have valid server credentials */ memcpy(&r_u->srv_creds, &srv_cred, sizeof(r_u->srv_creds)); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; return r_u->status; } @@ -444,9 +444,9 @@ uint32 _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOFF _net_logon_any: Use the new authentications subsystem to log in. *************************************************************************/ -static uint32 _net_logon_any(NET_ID_INFO_CTR *ctr, char *user, char *domain, char *sess_key) +static NTSTATUS _net_logon_any(NET_ID_INFO_CTR *ctr, char *user, char *domain, char *sess_key) { - uint32 nt_status = NT_STATUS_LOGON_FAILURE; + NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE; unsigned char local_lm_response[24]; unsigned char local_nt_response[24]; @@ -550,10 +550,10 @@ static uint32 _net_logon_any(NET_ID_INFO_CTR *ctr, char *user, char *domain, cha nt_status = check_password(&user_info, &server_info); - DEBUG(5, ("_net_logon_any: exited with status %d\n", nt_status)); + DEBUG(5, ("_net_logon_any: exited with status %s\n", + get_nt_error_msg(nt_status))); return nt_status; - } @@ -562,9 +562,9 @@ static uint32 _net_logon_any(NET_ID_INFO_CTR *ctr, char *user, char *domain, cha _net_sam_logon *************************************************************************/ -uint32 _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *r_u) +NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *r_u) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; NET_USER_INFO_3 *usr_info = NULL; DOM_CRED srv_cred; SAM_ACCOUNT *sampass = NULL; @@ -637,7 +637,7 @@ uint32 _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *r_ /* Check account and password */ - if (status != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_V(status)) return status; pdb_init_sam(&sampass); diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 4d4d058fba5..60250c903f9 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -93,7 +93,7 @@ BOOL create_next_pdu(pipes_struct *p) */ if(p->fault_state) { - setup_fault_pdu(p, 0x1c010002); + setup_fault_pdu(p, NT_STATUS(0x1c010002)); return True; } @@ -367,11 +367,12 @@ static BOOL api_pipe_ntlmssp_verify(pipes_struct *p, RPC_AUTH_NTLMSSP_RESP *ntlm become_root(); - if(!(p->ntlmssp_auth_validated = - pass_check_smb_with_chal(pipe_user_name, domain, - (uchar*)p->challenge, - lm_owf, lm_pw_len, - nt_owf, nt_pw_len) == NT_STATUS_NOPROBLEMO)) { + p->ntlmssp_auth_validated = + NT_STATUS_IS_OK(pass_check_smb_with_chal(pipe_user_name, domain, + (uchar*)p->challenge, + lm_owf, lm_pw_len, + nt_owf, nt_pw_len)); + if (!p->ntlmssp_auth_validated) { DEBUG(1,("api_pipe_ntlmssp_verify: User %s\\%s from machine %s \ failed authentication on named pipe %s.\n", domain, pipe_user_name, wks, p->name )); unbecome_root(); @@ -625,7 +626,7 @@ static BOOL setup_bind_nak(pipes_struct *p) Marshall a fault pdu. *******************************************************************/ -BOOL setup_fault_pdu(pipes_struct *p, uint32 status) +BOOL setup_fault_pdu(pipes_struct *p, NTSTATUS status) { prs_struct outgoing_pdu; RPC_HDR fault_hdr; @@ -1203,7 +1204,7 @@ BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, * and not put the pipe into fault state. JRA. */ DEBUG(4, ("unknown\n")); - setup_fault_pdu(p, 0x1c010002); + setup_fault_pdu(p, NT_STATUS(0x1c010002)); return True; } diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 3c8e44d84e6..0111733bb01 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -570,7 +570,7 @@ static ssize_t process_complete_pdu(pipes_struct *p) DEBUG(10,("process_complete_pdu: pipe %s in fault state.\n", p->name )); set_incoming_fault(p); - setup_fault_pdu(p, 0x1c010002); + setup_fault_pdu(p, NT_STATUS(0x1c010002)); return (ssize_t)data_len; } @@ -619,7 +619,7 @@ static ssize_t process_complete_pdu(pipes_struct *p) if (!reply) { DEBUG(3,("process_complete_pdu: DCE/RPC fault sent on pipe %s\n", p->pipe_srv_name)); set_incoming_fault(p); - setup_fault_pdu(p, 0x1c010002); + setup_fault_pdu(p, NT_STATUS(0x1c010002)); prs_mem_free(&rpc_in); } else { /* diff --git a/source3/rpc_server/srv_reg_nt.c b/source3/rpc_server/srv_reg_nt.c index f7263ff266b..71abdd517f0 100644 --- a/source3/rpc_server/srv_reg_nt.c +++ b/source3/rpc_server/srv_reg_nt.c @@ -46,7 +46,7 @@ static void free_reg_info(void *ptr) reg_reply_unknown_1 ********************************************************************/ -uint32 _reg_close(pipes_struct *p, REG_Q_CLOSE *q_u, REG_R_CLOSE *r_u) +NTSTATUS _reg_close(pipes_struct *p, REG_Q_CLOSE *q_u, REG_R_CLOSE *r_u) { /* set up the REG unknown_1 response */ ZERO_STRUCT(r_u->pol); @@ -55,26 +55,26 @@ uint32 _reg_close(pipes_struct *p, REG_Q_CLOSE *q_u, REG_R_CLOSE *r_u) if (!close_policy_hnd(p, &q_u->pol)) return NT_STATUS_OBJECT_NAME_INVALID; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* reg_reply_open ********************************************************************/ -uint32 _reg_open(pipes_struct *p, REG_Q_OPEN_HKLM *q_u, REG_R_OPEN_HKLM *r_u) +NTSTATUS _reg_open(pipes_struct *p, REG_Q_OPEN_HKLM *q_u, REG_R_OPEN_HKLM *r_u) { if (!create_policy_hnd(p, &r_u->pol, free_reg_info, NULL)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* reg_reply_open_entry ********************************************************************/ -uint32 _reg_open_entry(pipes_struct *p, REG_Q_OPEN_ENTRY *q_u, REG_R_OPEN_ENTRY *r_u) +NTSTATUS _reg_open_entry(pipes_struct *p, REG_Q_OPEN_ENTRY *q_u, REG_R_OPEN_ENTRY *r_u) { POLICY_HND pol; fstring name; @@ -103,7 +103,7 @@ uint32 _reg_open_entry(pipes_struct *p, REG_Q_OPEN_ENTRY *q_u, REG_R_OPEN_ENTRY if (!create_policy_hnd(p, &pol, free_reg_info, (void *)info)) return NT_STATUS_TOO_MANY_SECRETS; /* ha ha very droll */ - init_reg_r_open_entry(r_u, &pol, NT_STATUS_NOPROBLEMO); + init_reg_r_open_entry(r_u, &pol, NT_STATUS_OK); DEBUG(5,("reg_open_entry: %d\n", __LINE__)); @@ -114,9 +114,9 @@ uint32 _reg_open_entry(pipes_struct *p, REG_Q_OPEN_ENTRY *q_u, REG_R_OPEN_ENTRY reg_reply_info ********************************************************************/ -uint32 _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u) +NTSTATUS _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; char *key = NULL; uint32 type=0x1; /* key type: REG_SZ */ @@ -141,7 +141,7 @@ uint32 _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u) if ( strequal(name, "RefusePasswordChange") ) { type=0xF770; - status = ERRbadfile; + status = NT_STATUS_NO_SUCH_FILE; init_unistr2(uni_key, "", 0); init_buffer2(buf, (uint8*) uni_key->buffer, uni_key->uni_str_len*2); @@ -186,9 +186,9 @@ uint32 _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u) #define SHUTDOWN_F_STRING "-f" -uint32 _reg_shutdown(pipes_struct *p, REG_Q_SHUTDOWN *q_u, REG_R_SHUTDOWN *r_u) +NTSTATUS _reg_shutdown(pipes_struct *p, REG_Q_SHUTDOWN *q_u, REG_R_SHUTDOWN *r_u) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; pstring shutdown_script; UNISTR2 unimsg = q_u->uni_msg; pstring message; @@ -223,9 +223,9 @@ uint32 _reg_shutdown(pipes_struct *p, REG_Q_SHUTDOWN *q_u, REG_R_SHUTDOWN *r_u) return status; } -uint32 _reg_abort_shutdown(pipes_struct *p, REG_Q_ABORT_SHUTDOWN *q_u, REG_R_ABORT_SHUTDOWN *r_u) +NTSTATUS _reg_abort_shutdown(pipes_struct *p, REG_Q_ABORT_SHUTDOWN *q_u, REG_R_ABORT_SHUTDOWN *r_u) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; pstring abort_shutdown_script; pstrcpy(abort_shutdown_script, lp_abort_shutdown_script()); diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 6cd0f3b854a..f00ecae3ce6 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -727,7 +727,7 @@ static BOOL api_samr_set_userinfo(pipes_struct *p) DEBUG(0,("api_samr_set_userinfo: Unable to unmarshall SAMR_Q_SET_USERINFO.\n")); /* Fix for W2K SP2 */ if (q_u.switch_value == 0x1a) { - setup_fault_pdu(p, 0x1c000006); + setup_fault_pdu(p, NT_STATUS(0x1c000006)); return True; } return False; diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index ba59aa548c9..dce082d31d5 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -88,7 +88,7 @@ static void samr_clear_sam_passwd(SAM_ACCOUNT *sam_pass) dynamically returns the correct user info..... JRA. ********************************************************************/ -static uint32 get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, int start_idx, +static NTSTATUS get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, int start_idx, int *total_entries, int *num_entries, int max_num_entries, uint16 acb_mask) { @@ -152,10 +152,10 @@ static uint32 get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, int start_idx, if (not_finished) return STATUS_MORE_ENTRIES; else - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } -static uint32 jf_get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, int start_idx, +static NTSTATUS jf_get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, int start_idx, int *total_entries, uint32 *num_entries, int max_num_entries, uint16 acb_mask) { @@ -232,7 +232,7 @@ static uint32 jf_get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, int start_idx, if (not_finished) return STATUS_MORE_ENTRIES; else - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } #if 0 /* This function appears to be unused! */ @@ -494,9 +494,9 @@ done: _samr_close_hnd ********************************************************************/ -uint32 _samr_close_hnd(pipes_struct *p, SAMR_Q_CLOSE_HND *q_u, SAMR_R_CLOSE_HND *r_u) +NTSTATUS _samr_close_hnd(pipes_struct *p, SAMR_Q_CLOSE_HND *q_u, SAMR_R_CLOSE_HND *r_u) { - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* close the policy handle */ if (!close_policy_hnd(p, &q_u->pol)) @@ -511,11 +511,11 @@ uint32 _samr_close_hnd(pipes_struct *p, SAMR_Q_CLOSE_HND *q_u, SAMR_R_CLOSE_HND samr_reply_open_domain ********************************************************************/ -uint32 _samr_open_domain(pipes_struct *p, SAMR_Q_OPEN_DOMAIN *q_u, SAMR_R_OPEN_DOMAIN *r_u) +NTSTATUS _samr_open_domain(pipes_struct *p, SAMR_Q_OPEN_DOMAIN *q_u, SAMR_R_OPEN_DOMAIN *r_u) { struct samr_info *info; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* find the connection policy handle. */ if (!find_policy_by_hnd(p, &q_u->pol, NULL)) @@ -540,8 +540,8 @@ uint32 _samr_open_domain(pipes_struct *p, SAMR_Q_OPEN_DOMAIN *q_u, SAMR_R_OPEN_D static uint32 get_lsa_policy_samr_rid(struct samr_info *info) { if (!info) { - DEBUG(3,("Error getting policy\n")); - return 0xffffffff; + DEBUG(3,("Error getting policy\n")); + return 0xffffffff; } return info->sid.sub_auths[info->sid.num_auths-1]; @@ -551,11 +551,11 @@ static uint32 get_lsa_policy_samr_rid(struct samr_info *info) _samr_get_usrdom_pwinfo ********************************************************************/ -uint32 _samr_get_usrdom_pwinfo(pipes_struct *p, SAMR_Q_GET_USRDOM_PWINFO *q_u, SAMR_R_GET_USRDOM_PWINFO *r_u) +NTSTATUS _samr_get_usrdom_pwinfo(pipes_struct *p, SAMR_Q_GET_USRDOM_PWINFO *q_u, SAMR_R_GET_USRDOM_PWINFO *r_u) { struct samr_info *info = NULL; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* find the policy handle. open a policy on it. */ if (!find_policy_by_hnd(p, &q_u->user_pol, (void **)&info)) { @@ -567,7 +567,7 @@ uint32 _samr_get_usrdom_pwinfo(pipes_struct *p, SAMR_Q_GET_USRDOM_PWINFO *q_u, S return NT_STATUS_OBJECT_TYPE_MISMATCH; } - init_samr_r_get_usrdom_pwinfo(r_u, NT_STATUS_NOPROBLEMO); + init_samr_r_get_usrdom_pwinfo(r_u, NT_STATUS_OK); DEBUG(5,("_samr_get_usrdom_pwinfo: %d\n", __LINE__)); @@ -578,7 +578,7 @@ uint32 _samr_get_usrdom_pwinfo(pipes_struct *p, SAMR_Q_GET_USRDOM_PWINFO *q_u, S samr_make_usr_obj_sd ********************************************************************/ -static uint32 samr_make_usr_obj_sd(TALLOC_CTX *ctx, SEC_DESC_BUF **buf, DOM_SID *usr_sid) +static NTSTATUS samr_make_usr_obj_sd(TALLOC_CTX *ctx, SEC_DESC_BUF **buf, DOM_SID *usr_sid) { extern DOM_SID global_sid_World; DOM_SID adm_sid; @@ -616,7 +616,7 @@ static uint32 samr_make_usr_obj_sd(TALLOC_CTX *ctx, SEC_DESC_BUF **buf, DOM_SID if((*buf = make_sec_desc_buf(ctx, sd_size, psd)) == NULL) return NT_STATUS_NO_MEMORY; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } static BOOL get_lsa_policy_samr_sid(pipes_struct *p, POLICY_HND *pol, DOM_SID *sid) @@ -638,11 +638,11 @@ static BOOL get_lsa_policy_samr_sid(pipes_struct *p, POLICY_HND *pol, DOM_SID *s _samr_query_sec_obj ********************************************************************/ -uint32 _samr_query_sec_obj(pipes_struct *p, SAMR_Q_QUERY_SEC_OBJ *q_u, SAMR_R_QUERY_SEC_OBJ *r_u) +NTSTATUS _samr_query_sec_obj(pipes_struct *p, SAMR_Q_QUERY_SEC_OBJ *q_u, SAMR_R_QUERY_SEC_OBJ *r_u) { DOM_SID pol_sid; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* Get the SID. */ @@ -651,7 +651,7 @@ uint32 _samr_query_sec_obj(pipes_struct *p, SAMR_Q_QUERY_SEC_OBJ *q_u, SAMR_R_QU r_u->status = samr_make_usr_obj_sd(p->mem_ctx, &r_u->buf, &pol_sid); - if (r_u->status == NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_OK(r_u->status)) r_u->ptr = 1; return r_u->status; @@ -701,13 +701,13 @@ static void make_user_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UNISTR samr_reply_enum_dom_users ********************************************************************/ -uint32 _samr_enum_dom_users(pipes_struct *p, SAMR_Q_ENUM_DOM_USERS *q_u, SAMR_R_ENUM_DOM_USERS *r_u) +NTSTATUS _samr_enum_dom_users(pipes_struct *p, SAMR_Q_ENUM_DOM_USERS *q_u, SAMR_R_ENUM_DOM_USERS *r_u) { SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]; int num_entries = 0; int total_entries = 0; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* find the policy handle. open a policy on it. */ if (!find_policy_by_hnd(p, &q_u->pol, NULL)) @@ -720,7 +720,7 @@ uint32 _samr_enum_dom_users(pipes_struct *p, SAMR_Q_ENUM_DOM_USERS *q_u, SAMR_R_ MAX_SAM_ENTRIES, q_u->acb_mask); unbecome_root(); - if (r_u->status != NT_STATUS_NOPROBLEMO && r_u->status != STATUS_MORE_ENTRIES) + if (NT_STATUS_IS_ERR(r_u->status)) return r_u->status; samr_clear_passwd_fields(pass, num_entries); @@ -791,7 +791,7 @@ static void make_group_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UNIST Get the group entries - similar to get_sampwd_entries(). ********************************************************************/ -static BOOL get_group_alias_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_SID *sid, uint32 start_idx, +static NTSTATUS get_group_alias_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_SID *sid, uint32 start_idx, uint32 *p_num_entries, uint32 max_entries) { fstring sid_str; @@ -902,14 +902,14 @@ static BOOL get_group_alias_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_SID DEBUG(10,("get_group_alias_entries: returning %d entries\n", *p_num_entries)); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* Get the group entries - similar to get_sampwd_entries(). ********************************************************************/ -static uint32 get_group_domain_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_SID *sid, uint32 start_idx, +static NTSTATUS get_group_domain_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_SID *sid, uint32 start_idx, uint32 *p_num_entries, uint32 max_entries) { GROUP_MAP *map=NULL; @@ -946,7 +946,7 @@ static uint32 get_group_domain_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_ *p_num_entries = num_entries; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -955,13 +955,13 @@ static uint32 get_group_domain_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_ a real PDC. JRA. ********************************************************************/ -uint32 _samr_enum_dom_groups(pipes_struct *p, SAMR_Q_ENUM_DOM_GROUPS *q_u, SAMR_R_ENUM_DOM_GROUPS *r_u) +NTSTATUS _samr_enum_dom_groups(pipes_struct *p, SAMR_Q_ENUM_DOM_GROUPS *q_u, SAMR_R_ENUM_DOM_GROUPS *r_u) { DOMAIN_GRP *grp=NULL; uint32 num_entries; DOM_SID sid; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; if (!get_lsa_policy_samr_sid(p, &q_u->pol, &sid)) return NT_STATUS_INVALID_HANDLE; @@ -985,14 +985,15 @@ uint32 _samr_enum_dom_groups(pipes_struct *p, SAMR_Q_ENUM_DOM_GROUPS *q_u, SAMR_ samr_reply_enum_dom_aliases ********************************************************************/ -uint32 _samr_enum_dom_aliases(pipes_struct *p, SAMR_Q_ENUM_DOM_ALIASES *q_u, SAMR_R_ENUM_DOM_ALIASES *r_u) +NTSTATUS _samr_enum_dom_aliases(pipes_struct *p, SAMR_Q_ENUM_DOM_ALIASES *q_u, SAMR_R_ENUM_DOM_ALIASES *r_u) { DOMAIN_GRP *grp=NULL; uint32 num_entries = 0; fstring sid_str; DOM_SID sid; + NTSTATUS status; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; if (!get_lsa_policy_samr_sid(p, &q_u->pol, &sid)) return NT_STATUS_INVALID_HANDLE; @@ -1000,8 +1001,9 @@ uint32 _samr_enum_dom_aliases(pipes_struct *p, SAMR_Q_ENUM_DOM_ALIASES *q_u, SAM sid_to_string(sid_str, &sid); DEBUG(5,("samr_reply_enum_dom_aliases: sid %s\n", sid_str)); - if (get_group_alias_entries(p->mem_ctx, &grp, &sid, q_u->start_idx, &num_entries, MAX_SAM_ENTRIES)!=NT_STATUS_NOPROBLEMO) - return NT_STATUS_ACCESS_DENIED; + status = get_group_alias_entries(p->mem_ctx, &grp, &sid, q_u->start_idx, + &num_entries, MAX_SAM_ENTRIES); + if (NT_STATUS_IS_ERR(status)) return status; make_group_sam_entry_list(p->mem_ctx, &r_u->sam, &r_u->uni_grp_name, num_entries, grp); @@ -1018,7 +1020,7 @@ uint32 _samr_enum_dom_aliases(pipes_struct *p, SAMR_Q_ENUM_DOM_ALIASES *q_u, SAM samr_reply_query_dispinfo ********************************************************************/ -uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_QUERY_DISPINFO *r_u) +NTSTATUS _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_QUERY_DISPINFO *r_u) { SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]; DOMAIN_GRP *grps=NULL; @@ -1028,12 +1030,12 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ int total_entries = 0; uint32 data_size = 0; DOM_SID sid; - uint32 disp_ret; + NTSTATUS disp_ret; SAM_DISPINFO_CTR *ctr; DEBUG(5, ("samr_reply_query_dispinfo: %d\n", __LINE__)); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; if (!get_lsa_policy_samr_sid(p, &q_u->domain_pol, &sid)) return NT_STATUS_INVALID_HANDLE; @@ -1072,7 +1074,7 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ MAX_SAM_ENTRIES, acb_mask); #endif unbecome_root(); - if (r_u->status!=STATUS_MORE_ENTRIES && r_u->status!=NT_STATUS_NOPROBLEMO) { + if (NT_STATUS_IS_ERR(r_u->status)) { DEBUG(5, ("get_sampwd_entries: failed\n")); return r_u->status; } @@ -1080,8 +1082,8 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ case 0x3: case 0x5: r_u->status = get_group_domain_entries(p->mem_ctx, &grps, &sid, q_u->start_idx, &num_entries, MAX_SAM_ENTRIES); - if (r_u->status != NT_STATUS_NOPROBLEMO) - return NT_STATUS_ACCESS_DENIED; + if (NT_STATUS_IS_ERR(r_u->status)) + return r_u->status; break; default: DEBUG(0,("_samr_query_dispinfo: Unknown info level (%u)\n", (unsigned int)q_u->switch_level )); @@ -1116,7 +1118,7 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ return NT_STATUS_NO_MEMORY; } disp_ret = init_sam_dispinfo_1(p->mem_ctx, ctr->sam.info1, &num_entries, &data_size, q_u->start_idx, pass); - if (disp_ret != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(disp_ret)) return disp_ret; break; case 0x2: @@ -1125,7 +1127,7 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ return NT_STATUS_NO_MEMORY; } disp_ret = init_sam_dispinfo_2(p->mem_ctx, ctr->sam.info2, &num_entries, &data_size, q_u->start_idx, pass); - if (disp_ret != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(disp_ret)) return disp_ret; break; case 0x3: @@ -1134,7 +1136,7 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ return NT_STATUS_NO_MEMORY; } disp_ret = init_sam_dispinfo_3(p->mem_ctx, ctr->sam.info3, &num_entries, &data_size, q_u->start_idx, grps); - if (disp_ret != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(disp_ret)) return disp_ret; break; case 0x4: @@ -1143,7 +1145,7 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ return NT_STATUS_NO_MEMORY; } disp_ret = init_sam_dispinfo_4(p->mem_ctx, ctr->sam.info4, &num_entries, &data_size, q_u->start_idx, pass); - if (disp_ret != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(disp_ret)) return disp_ret; break; case 0x5: @@ -1152,7 +1154,7 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ return NT_STATUS_NO_MEMORY; } disp_ret = init_sam_dispinfo_5(p->mem_ctx, ctr->sam.info5, &num_entries, &data_size, q_u->start_idx, grps); - if (disp_ret != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(disp_ret)) return disp_ret; break; default: @@ -1174,7 +1176,7 @@ uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_ samr_reply_query_aliasinfo ********************************************************************/ -uint32 _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_R_QUERY_ALIASINFO *r_u) +NTSTATUS _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_R_QUERY_ALIASINFO *r_u) { fstring alias_desc = "Local Unix group"; fstring alias=""; @@ -1182,7 +1184,7 @@ uint32 _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_ uint32 alias_rid; struct samr_info *info = NULL; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; DEBUG(5,("_samr_query_aliasinfo: %d\n", __LINE__)); @@ -1222,7 +1224,7 @@ uint32 _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_ uint32 rid[MAX_SAM_ENTRIES]; int num_rids = q_u->num_sids1; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; DEBUG(5,("_samr_lookup_ids: %d\n", __LINE__)); @@ -1264,7 +1266,7 @@ uint32 _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_ num_rids = 1; rid[0] = BUILTIN_ALIAS_RID_USERS; - init_samr_r_lookup_ids(&r_u, num_rids, rid, NT_STATUS_NOPROBLEMO); + init_samr_r_lookup_ids(&r_u, num_rids, rid, NT_STATUS_OK); DEBUG(5,("_samr_lookup_ids: %d\n", __LINE__)); @@ -1276,7 +1278,7 @@ uint32 _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_ _samr_lookup_names ********************************************************************/ -uint32 _samr_lookup_names(pipes_struct *p, SAMR_Q_LOOKUP_NAMES *q_u, SAMR_R_LOOKUP_NAMES *r_u) +NTSTATUS _samr_lookup_names(pipes_struct *p, SAMR_Q_LOOKUP_NAMES *q_u, SAMR_R_LOOKUP_NAMES *r_u) { uint32 rid[MAX_SAM_ENTRIES]; enum SID_NAME_USE type[MAX_SAM_ENTRIES]; @@ -1284,7 +1286,7 @@ uint32 _samr_lookup_names(pipes_struct *p, SAMR_Q_LOOKUP_NAMES *q_u, SAMR_R_LOOK int num_rids = q_u->num_names2; DOM_SID pol_sid; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; DEBUG(5,("_samr_lookup_names: %d\n", __LINE__)); @@ -1315,7 +1317,7 @@ uint32 _samr_lookup_names(pipes_struct *p, SAMR_Q_LOOKUP_NAMES *q_u, SAMR_R_LOOK DOM_SID sid; if(local_lookup_name(global_myname, name, &sid, &type[i])) { sid_split_rid( &sid, &rid[i]); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; } } } @@ -1331,14 +1333,14 @@ uint32 _samr_lookup_names(pipes_struct *p, SAMR_Q_LOOKUP_NAMES *q_u, SAMR_R_LOOK _samr_chgpasswd_user ********************************************************************/ -uint32 _samr_chgpasswd_user(pipes_struct *p, SAMR_Q_CHGPASSWD_USER *q_u, SAMR_R_CHGPASSWD_USER *r_u) +NTSTATUS _samr_chgpasswd_user(pipes_struct *p, SAMR_Q_CHGPASSWD_USER *q_u, SAMR_R_CHGPASSWD_USER *r_u) { fstring user_name; fstring wks; DEBUG(5,("_samr_chgpasswd_user: %d\n", __LINE__)); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; rpcstr_pull(user_name, q_u->uni_user_name.buffer, sizeof(user_name), q_u->uni_user_name.uni_str_len*2, 0); rpcstr_pull(wks, q_u->uni_dest_host.buffer, sizeof(wks), q_u->uni_dest_host.uni_str_len,0); @@ -1409,7 +1411,7 @@ static BOOL make_samr_lookup_rids(TALLOC_CTX *ctx, uint32 num_names, fstring nam _samr_lookup_rids ********************************************************************/ -uint32 _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOKUP_RIDS *r_u) +NTSTATUS _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOKUP_RIDS *r_u) { fstring group_names[MAX_SAM_ENTRIES]; uint32 *group_attrs = NULL; @@ -1419,7 +1421,7 @@ uint32 _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOKUP int num_rids = q_u->num_rids1; int i; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; DEBUG(5,("_samr_lookup_rids: %d\n", __LINE__)); @@ -1453,7 +1455,7 @@ uint32 _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOKUP sid_append_rid(&sid, q_u->rid[i]); if (lookup_sid(&sid, domname, tmpname, &type)) { - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; group_attrs[i] = (uint32)type; fstrcpy(group_names[i],tmpname); DEBUG(5,("_samr_lookup_rids: %s:%d\n", group_names[i], group_attrs[i])); @@ -1475,7 +1477,7 @@ uint32 _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOKUP _api_samr_open_user. Safe - gives out no passwd info. ********************************************************************/ -uint32 _api_samr_open_user(pipes_struct *p, SAMR_Q_OPEN_USER *q_u, SAMR_R_OPEN_USER *r_u) +NTSTATUS _api_samr_open_user(pipes_struct *p, SAMR_Q_OPEN_USER *q_u, SAMR_R_OPEN_USER *r_u) { SAM_ACCOUNT *sampass=NULL; DOM_SID sid; @@ -1485,7 +1487,7 @@ uint32 _api_samr_open_user(pipes_struct *p, SAMR_Q_OPEN_USER *q_u, SAMR_R_OPEN_U struct samr_info *info = NULL; BOOL ret; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* find the domain policy handle. */ if (!find_policy_by_hnd(p, &domain_pol, NULL)) @@ -1571,7 +1573,7 @@ static BOOL get_user_info_10(SAM_USER_INFO_10 *id10, uint32 user_rid) user. JRA. *************************************************************************/ -static uint32 get_user_info_12(pipes_struct *p, SAM_USER_INFO_12 * id12, uint32 user_rid) +static NTSTATUS get_user_info_12(pipes_struct *p, SAM_USER_INFO_12 * id12, uint32 user_rid) { SAM_ACCOUNT *smbpass=NULL; BOOL ret; @@ -1607,7 +1609,7 @@ static uint32 get_user_info_12(pipes_struct *p, SAM_USER_INFO_12 * id12, uint32 pdb_free_sam(smbpass); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /************************************************************************* @@ -1690,13 +1692,13 @@ static BOOL get_user_info_21(SAM_USER_INFO_21 *id21, uint32 user_rid) _samr_query_userinfo ********************************************************************/ -uint32 _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_R_QUERY_USERINFO *r_u) +NTSTATUS _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_R_QUERY_USERINFO *r_u) { SAM_USERINFO_CTR *ctr; uint32 rid = 0; struct samr_info *info = NULL; - r_u->status=NT_STATUS_NOPROBLEMO; + r_u->status=NT_STATUS_OK; /* search for the handle */ if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) @@ -1758,7 +1760,7 @@ uint32 _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_R_ if (ctr->info.id12 == NULL) return NT_STATUS_NO_MEMORY; - if ((r_u->status = get_user_info_12(p, ctr->info.id12, rid)) != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(r_u->status = get_user_info_12(p, ctr->info.id12, rid))) return r_u->status; break; @@ -1793,7 +1795,7 @@ uint32 _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_R_ samr_reply_query_usergroups ********************************************************************/ -uint32 _samr_query_usergroups(pipes_struct *p, SAMR_Q_QUERY_USERGROUPS *q_u, SAMR_R_QUERY_USERGROUPS *r_u) +NTSTATUS _samr_query_usergroups(pipes_struct *p, SAMR_Q_QUERY_USERGROUPS *q_u, SAMR_R_QUERY_USERGROUPS *r_u) { SAM_ACCOUNT *sam_pass=NULL; DOM_GID *gids = NULL; @@ -1803,7 +1805,7 @@ uint32 _samr_query_usergroups(pipes_struct *p, SAMR_Q_QUERY_USERGROUPS *q_u, SAM struct samr_info *info = NULL; BOOL ret; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; DEBUG(5,("_samr_query_usergroups: %d\n", __LINE__)); @@ -1844,7 +1846,7 @@ uint32 _samr_query_usergroups(pipes_struct *p, SAMR_Q_QUERY_USERGROUPS *q_u, SAM _samr_query_dom_info ********************************************************************/ -uint32 _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SAMR_R_QUERY_DOMAIN_INFO *r_u) +NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SAMR_R_QUERY_DOMAIN_INFO *r_u) { SAM_UNK_CTR *ctr; @@ -1853,7 +1855,7 @@ uint32 _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SAMR ZERO_STRUCTP(ctr); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; DEBUG(5,("_samr_query_dom_info: %d\n", __LINE__)); @@ -1888,7 +1890,7 @@ uint32 _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SAMR return NT_STATUS_INVALID_INFO_CLASS; } - init_samr_r_query_dom_info(r_u, q_u->switch_value, ctr, NT_STATUS_NOPROBLEMO); + init_samr_r_query_dom_info(r_u, q_u->switch_value, ctr, NT_STATUS_OK); DEBUG(5,("_samr_query_dom_info: %d\n", __LINE__)); @@ -1899,7 +1901,7 @@ uint32 _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SAMR _api_samr_create_user ********************************************************************/ -uint32 _api_samr_create_user(pipes_struct *p, SAMR_Q_CREATE_USER *q_u, SAMR_R_CREATE_USER *r_u) +NTSTATUS _api_samr_create_user(pipes_struct *p, SAMR_Q_CREATE_USER *q_u, SAMR_R_CREATE_USER *r_u) { SAM_ACCOUNT *sam_pass=NULL; fstring mach_acct; @@ -2018,20 +2020,20 @@ uint32 _api_samr_create_user(pipes_struct *p, SAMR_Q_CREATE_USER *q_u, SAMR_R_CR pdb_free_sam(sam_pass); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* samr_reply_connect_anon ********************************************************************/ -uint32 _samr_connect_anon(pipes_struct *p, SAMR_Q_CONNECT_ANON *q_u, SAMR_R_CONNECT_ANON *r_u) +NTSTATUS _samr_connect_anon(pipes_struct *p, SAMR_Q_CONNECT_ANON *q_u, SAMR_R_CONNECT_ANON *r_u) { struct samr_info *info = NULL; /* set up the SAMR connect_anon response */ - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* associate the user's SID with the new handle. */ if ((info = (struct samr_info *)malloc(sizeof(struct samr_info))) == NULL) @@ -2051,13 +2053,13 @@ uint32 _samr_connect_anon(pipes_struct *p, SAMR_Q_CONNECT_ANON *q_u, SAMR_R_CONN samr_reply_connect ********************************************************************/ -uint32 _samr_connect(pipes_struct *p, SAMR_Q_CONNECT *q_u, SAMR_R_CONNECT *r_u) +NTSTATUS _samr_connect(pipes_struct *p, SAMR_Q_CONNECT *q_u, SAMR_R_CONNECT *r_u) { struct samr_info *info = NULL; DEBUG(5,("_samr_connect: %d\n", __LINE__)); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* associate the user's SID with the new handle. */ if ((info = (struct samr_info *)malloc(sizeof(struct samr_info))) == NULL) @@ -2079,9 +2081,9 @@ uint32 _samr_connect(pipes_struct *p, SAMR_Q_CONNECT *q_u, SAMR_R_CONNECT *r_u) api_samr_lookup_domain **********************************************************************/ -uint32 _samr_lookup_domain(pipes_struct *p, SAMR_Q_LOOKUP_DOMAIN *q_u, SAMR_R_LOOKUP_DOMAIN *r_u) +NTSTATUS _samr_lookup_domain(pipes_struct *p, SAMR_Q_LOOKUP_DOMAIN *q_u, SAMR_R_LOOKUP_DOMAIN *r_u) { - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; if (!find_policy_by_hnd(p, &q_u->connect_pol, NULL)) return NT_STATUS_INVALID_HANDLE; @@ -2135,12 +2137,12 @@ static BOOL make_enum_domains(TALLOC_CTX *ctx, SAM_ENTRY **pp_sam, api_samr_enum_domains **********************************************************************/ -uint32 _samr_enum_domains(pipes_struct *p, SAMR_Q_ENUM_DOMAINS *q_u, SAMR_R_ENUM_DOMAINS *r_u) +NTSTATUS _samr_enum_domains(pipes_struct *p, SAMR_Q_ENUM_DOMAINS *q_u, SAMR_R_ENUM_DOMAINS *r_u) { uint32 num_entries = 2; fstring dom[2]; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; fstrcpy(dom[0],global_myworkgroup); fstrcpy(dom[1],"Builtin"); @@ -2157,7 +2159,7 @@ uint32 _samr_enum_domains(pipes_struct *p, SAMR_Q_ENUM_DOMAINS *q_u, SAMR_R_ENUM api_samr_open_alias ********************************************************************/ -uint32 _api_samr_open_alias(pipes_struct *p, SAMR_Q_OPEN_ALIAS *q_u, SAMR_R_OPEN_ALIAS *r_u) +NTSTATUS _api_samr_open_alias(pipes_struct *p, SAMR_Q_OPEN_ALIAS *q_u, SAMR_R_OPEN_ALIAS *r_u) { DOM_SID sid; POLICY_HND domain_pol = q_u->dom_pol; @@ -2165,7 +2167,7 @@ uint32 _api_samr_open_alias(pipes_struct *p, SAMR_Q_OPEN_ALIAS *q_u, SAMR_R_OPEN POLICY_HND *alias_pol = &r_u->pol; struct samr_info *info = NULL; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* get the domain policy. */ if (!find_policy_by_hnd(p, &domain_pol, NULL)) @@ -2448,7 +2450,7 @@ static BOOL set_user_info_pw(char *pass, uint32 rid) samr_reply_set_userinfo ********************************************************************/ -uint32 _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SET_USERINFO *r_u) +NTSTATUS _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SET_USERINFO *r_u) { uint32 rid = 0x0; DOM_SID sid; @@ -2462,7 +2464,7 @@ uint32 _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SET_ DEBUG(5, ("_samr_set_userinfo: %d\n", __LINE__)); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; if (p->ntlmssp_auth_validated) { memcpy(&user, &p->pipe_user, sizeof(user)); @@ -2563,7 +2565,7 @@ uint32 _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SET_ samr_reply_set_userinfo2 ********************************************************************/ -uint32 _samr_set_userinfo2(pipes_struct *p, SAMR_Q_SET_USERINFO2 *q_u, SAMR_R_SET_USERINFO2 *r_u) +NTSTATUS _samr_set_userinfo2(pipes_struct *p, SAMR_Q_SET_USERINFO2 *q_u, SAMR_R_SET_USERINFO2 *r_u) { DOM_SID sid; uint32 rid = 0x0; @@ -2573,7 +2575,7 @@ uint32 _samr_set_userinfo2(pipes_struct *p, SAMR_Q_SET_USERINFO2 *q_u, SAMR_R_SE DEBUG(5, ("samr_reply_set_userinfo2: %d\n", __LINE__)); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; /* find the policy handle. open a policy on it. */ if (!get_lsa_policy_samr_sid(p, pol, &sid)) @@ -2616,7 +2618,7 @@ uint32 _samr_set_userinfo2(pipes_struct *p, SAMR_Q_SET_USERINFO2 *q_u, SAMR_R_SE _samr_query_aliasmem *********************************************************************/ -uint32 _samr_query_useraliases(pipes_struct *p, SAMR_Q_QUERY_USERALIASES *q_u, SAMR_R_QUERY_USERALIASES *r_u) +NTSTATUS _samr_query_useraliases(pipes_struct *p, SAMR_Q_QUERY_USERALIASES *q_u, SAMR_R_QUERY_USERALIASES *r_u) { uint32 *rid=NULL; int num_rids; @@ -2630,9 +2632,9 @@ uint32 _samr_query_useraliases(pipes_struct *p, SAMR_Q_QUERY_USERALIASES *q_u, S rid[0] = BUILTIN_ALIAS_RID_USERS; - init_samr_r_query_useraliases(r_u, num_rids, rid, NT_STATUS_NOPROBLEMO); + init_samr_r_query_useraliases(r_u, num_rids, rid, NT_STATUS_OK); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } @@ -2640,7 +2642,7 @@ uint32 _samr_query_useraliases(pipes_struct *p, SAMR_Q_QUERY_USERALIASES *q_u, S _samr_query_aliasmem *********************************************************************/ -uint32 _samr_query_aliasmem(pipes_struct *p, SAMR_Q_QUERY_ALIASMEM *q_u, SAMR_R_QUERY_ALIASMEM *r_u) +NTSTATUS _samr_query_aliasmem(pipes_struct *p, SAMR_Q_QUERY_ALIASMEM *q_u, SAMR_R_QUERY_ALIASMEM *r_u) { int i; @@ -2694,16 +2696,16 @@ uint32 _samr_query_aliasmem(pipes_struct *p, SAMR_Q_QUERY_ALIASMEM *q_u, SAMR_R_ } DEBUG(10, ("sid is %s\n", alias_sid_str)); - init_samr_r_query_aliasmem(r_u, num_uids, sid, NT_STATUS_NOPROBLEMO); + init_samr_r_query_aliasmem(r_u, num_uids, sid, NT_STATUS_OK); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_query_groupmem *********************************************************************/ -uint32 _samr_query_groupmem(pipes_struct *p, SAMR_Q_QUERY_GROUPMEM *q_u, SAMR_R_QUERY_GROUPMEM *r_u) +NTSTATUS _samr_query_groupmem(pipes_struct *p, SAMR_Q_QUERY_GROUPMEM *q_u, SAMR_R_QUERY_GROUPMEM *r_u) { int num_uids = 0; int i; @@ -2752,16 +2754,16 @@ uint32 _samr_query_groupmem(pipes_struct *p, SAMR_Q_QUERY_GROUPMEM *q_u, SAMR_R_ attr[i] = SID_NAME_USER; } - init_samr_r_query_groupmem(r_u, num_uids, rid, attr, NT_STATUS_NOPROBLEMO); + init_samr_r_query_groupmem(r_u, num_uids, rid, attr, NT_STATUS_OK); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_add_aliasmem *********************************************************************/ -uint32 _samr_add_aliasmem(pipes_struct *p, SAMR_Q_ADD_ALIASMEM *q_u, SAMR_R_ADD_ALIASMEM *r_u) +NTSTATUS _samr_add_aliasmem(pipes_struct *p, SAMR_Q_ADD_ALIASMEM *q_u, SAMR_R_ADD_ALIASMEM *r_u) { DOM_SID alias_sid; fstring alias_sid_str; @@ -2820,24 +2822,24 @@ uint32 _samr_add_aliasmem(pipes_struct *p, SAMR_Q_ADD_ALIASMEM *q_u, SAMR_R_ADD_ if(!user_in_group_list(pwd->pw_name, grp_name)) return NT_STATUS_MEMBER_NOT_IN_ALIAS; /* don't know what to reply else */ - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_del_aliasmem *********************************************************************/ -uint32 _samr_del_aliasmem(pipes_struct *p, SAMR_Q_DEL_ALIASMEM *q_u, SAMR_R_DEL_ALIASMEM *r_u) +NTSTATUS _samr_del_aliasmem(pipes_struct *p, SAMR_Q_DEL_ALIASMEM *q_u, SAMR_R_DEL_ALIASMEM *r_u) { - DEBUG(0,("_samr_del_aliasmem: Not yet implemented.\n")); - return False; + DEBUG(0,("_samr_del_aliasmem: Not yet implemented.\n")); + return NT_STATUS_NOT_IMPLEMENTED; } /********************************************************************* _samr_add_groupmem *********************************************************************/ -uint32 _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_ADD_GROUPMEM *r_u) +NTSTATUS _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_ADD_GROUPMEM *r_u) { DOM_SID group_sid; fstring group_sid_str; @@ -2886,34 +2888,34 @@ uint32 _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_ADD_ if(!user_in_group_list(pwd->pw_name, grp_name)) return NT_STATUS_MEMBER_NOT_IN_GROUP; /* don't know what to reply else */ - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_del_groupmem *********************************************************************/ -uint32 _samr_del_groupmem(pipes_struct *p, SAMR_Q_DEL_GROUPMEM *q_u, SAMR_R_DEL_GROUPMEM *r_u) +NTSTATUS _samr_del_groupmem(pipes_struct *p, SAMR_Q_DEL_GROUPMEM *q_u, SAMR_R_DEL_GROUPMEM *r_u) { - DEBUG(0,("_samr_del_groupmem: Not yet implemented.\n")); - return False; + DEBUG(0,("_samr_del_groupmem: Not yet implemented.\n")); + return NT_STATUS_NOT_IMPLEMENTED; } /********************************************************************* _samr_delete_dom_user *********************************************************************/ -uint32 _samr_delete_dom_user(pipes_struct *p, SAMR_Q_DELETE_DOM_USER *q_u, SAMR_R_DELETE_DOM_USER *r_u ) +NTSTATUS _samr_delete_dom_user(pipes_struct *p, SAMR_Q_DELETE_DOM_USER *q_u, SAMR_R_DELETE_DOM_USER *r_u ) { - DEBUG(0,("_samr_delete_dom_user: Not yet implemented.\n")); - return False; + DEBUG(0,("_samr_delete_dom_user: Not yet implemented.\n")); + return NT_STATUS_NOT_IMPLEMENTED; } /********************************************************************* _samr_delete_dom_group *********************************************************************/ -uint32 _samr_delete_dom_group(pipes_struct *p, SAMR_Q_DELETE_DOM_GROUP *q_u, SAMR_R_DELETE_DOM_GROUP *r_u) +NTSTATUS _samr_delete_dom_group(pipes_struct *p, SAMR_Q_DELETE_DOM_GROUP *q_u, SAMR_R_DELETE_DOM_GROUP *r_u) { DOM_SID group_sid; DOM_SID dom_sid; @@ -2963,14 +2965,14 @@ uint32 _samr_delete_dom_group(pipes_struct *p, SAMR_Q_DELETE_DOM_GROUP *q_u, SAM if (!close_policy_hnd(p, &q_u->group_pol)) return NT_STATUS_OBJECT_NAME_INVALID; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_delete_dom_alias *********************************************************************/ -uint32 _samr_delete_dom_alias(pipes_struct *p, SAMR_Q_DELETE_DOM_ALIAS *q_u, SAMR_R_DELETE_DOM_ALIAS *r_u) +NTSTATUS _samr_delete_dom_alias(pipes_struct *p, SAMR_Q_DELETE_DOM_ALIAS *q_u, SAMR_R_DELETE_DOM_ALIAS *r_u) { DOM_SID alias_sid; DOM_SID dom_sid; @@ -3020,14 +3022,14 @@ uint32 _samr_delete_dom_alias(pipes_struct *p, SAMR_Q_DELETE_DOM_ALIAS *q_u, SAM if (!close_policy_hnd(p, &q_u->alias_pol)) return NT_STATUS_OBJECT_NAME_INVALID; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_create_dom_group *********************************************************************/ -uint32 _samr_create_dom_group(pipes_struct *p, SAMR_Q_CREATE_DOM_GROUP *q_u, SAMR_R_CREATE_DOM_GROUP *r_u) +NTSTATUS _samr_create_dom_group(pipes_struct *p, SAMR_Q_CREATE_DOM_GROUP *q_u, SAMR_R_CREATE_DOM_GROUP *r_u) { DOM_SID dom_sid; DOM_SID info_sid; @@ -3077,14 +3079,14 @@ uint32 _samr_create_dom_group(pipes_struct *p, SAMR_Q_CREATE_DOM_GROUP *q_u, SAM if (!create_policy_hnd(p, &r_u->pol, free_samr_info, (void *)info)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_create_dom_alias *********************************************************************/ -uint32 _samr_create_dom_alias(pipes_struct *p, SAMR_Q_CREATE_DOM_ALIAS *q_u, SAMR_R_CREATE_DOM_ALIAS *r_u) +NTSTATUS _samr_create_dom_alias(pipes_struct *p, SAMR_Q_CREATE_DOM_ALIAS *q_u, SAMR_R_CREATE_DOM_ALIAS *r_u) { DOM_SID dom_sid; fstring name; @@ -3133,7 +3135,7 @@ uint32 _samr_create_dom_alias(pipes_struct *p, SAMR_Q_CREATE_DOM_ALIAS *q_u, SAM if (!create_policy_hnd(p, &r_u->alias_pol, free_samr_info, (void *)info)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* @@ -3143,7 +3145,7 @@ sends the name/comment pair of a domain group level 1 send also the number of users of that group *********************************************************************/ -uint32 _samr_query_groupinfo(pipes_struct *p, SAMR_Q_QUERY_GROUPINFO *q_u, SAMR_R_QUERY_GROUPINFO *r_u) +NTSTATUS _samr_query_groupinfo(pipes_struct *p, SAMR_Q_QUERY_GROUPINFO *q_u, SAMR_R_QUERY_GROUPINFO *r_u) { DOM_SID group_sid; GROUP_MAP map; @@ -3177,9 +3179,9 @@ uint32 _samr_query_groupinfo(pipes_struct *p, SAMR_Q_QUERY_GROUPINFO *q_u, SAMR_ return NT_STATUS_INVALID_INFO_CLASS; } - init_samr_r_query_groupinfo(r_u, ctr, NT_STATUS_NOPROBLEMO); + init_samr_r_query_groupinfo(r_u, ctr, NT_STATUS_OK); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* @@ -3188,7 +3190,7 @@ uint32 _samr_query_groupinfo(pipes_struct *p, SAMR_Q_QUERY_GROUPINFO *q_u, SAMR_ update a domain group's comment. *********************************************************************/ -uint32 _samr_set_groupinfo(pipes_struct *p, SAMR_Q_SET_GROUPINFO *q_u, SAMR_R_SET_GROUPINFO *r_u) +NTSTATUS _samr_set_groupinfo(pipes_struct *p, SAMR_Q_SET_GROUPINFO *q_u, SAMR_R_SET_GROUPINFO *r_u) { DOM_SID group_sid; GROUP_MAP map; @@ -3216,7 +3218,7 @@ uint32 _samr_set_groupinfo(pipes_struct *p, SAMR_Q_SET_GROUPINFO *q_u, SAMR_R_SE if(!add_mapping_entry(&map, TDB_REPLACE)) return NT_STATUS_NO_SUCH_GROUP; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* @@ -3225,7 +3227,7 @@ uint32 _samr_set_groupinfo(pipes_struct *p, SAMR_Q_SET_GROUPINFO *q_u, SAMR_R_SE update a domain group's comment. *********************************************************************/ -uint32 _samr_set_aliasinfo(pipes_struct *p, SAMR_Q_SET_ALIASINFO *q_u, SAMR_R_SET_ALIASINFO *r_u) +NTSTATUS _samr_set_aliasinfo(pipes_struct *p, SAMR_Q_SET_ALIASINFO *q_u, SAMR_R_SET_ALIASINFO *r_u) { DOM_SID group_sid; GROUP_MAP map; @@ -3250,24 +3252,24 @@ uint32 _samr_set_aliasinfo(pipes_struct *p, SAMR_Q_SET_ALIASINFO *q_u, SAMR_R_SE if(!add_mapping_entry(&map, TDB_REPLACE)) return NT_STATUS_NO_SUCH_GROUP; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_get_dom_pwinfo *********************************************************************/ -uint32 _samr_get_dom_pwinfo(pipes_struct *p, SAMR_Q_GET_DOM_PWINFO *q_u, SAMR_R_GET_DOM_PWINFO *r_u) +NTSTATUS _samr_get_dom_pwinfo(pipes_struct *p, SAMR_Q_GET_DOM_PWINFO *q_u, SAMR_R_GET_DOM_PWINFO *r_u) { /* Actually, returning zeros here works quite well :-). */ - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_open_group *********************************************************************/ -uint32 _samr_open_group(pipes_struct *p, SAMR_Q_OPEN_GROUP *q_u, SAMR_R_OPEN_GROUP *r_u) +NTSTATUS _samr_open_group(pipes_struct *p, SAMR_Q_OPEN_GROUP *q_u, SAMR_R_OPEN_GROUP *r_u) { DOM_SID sid; GROUP_MAP map; @@ -3300,15 +3302,15 @@ uint32 _samr_open_group(pipes_struct *p, SAMR_Q_OPEN_GROUP *q_u, SAMR_R_OPEN_GRO if (!create_policy_hnd(p, &r_u->pol, free_samr_info, (void *)info)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /********************************************************************* _samr_unknown_2d *********************************************************************/ -uint32 _samr_unknown_2d(pipes_struct *p, SAMR_Q_UNKNOWN_2D *q_u, SAMR_R_UNKNOWN_2D *r_u) +NTSTATUS _samr_unknown_2d(pipes_struct *p, SAMR_Q_UNKNOWN_2D *q_u, SAMR_R_UNKNOWN_2D *r_u) { - DEBUG(0,("_samr_unknown_2d: Not yet implemented.\n")); - return False; + DEBUG(0,("_samr_unknown_2d: Not yet implemented.\n")); + return NT_STATUS_NOT_IMPLEMENTED; } diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c index 3500a4f3e1d..011efb1bace 100755 --- a/source3/rpc_server/srv_spoolss.c +++ b/source3/rpc_server/srv_spoolss.c @@ -1110,7 +1110,7 @@ static BOOL api_spoolss_addprintprocessor(pipes_struct *p) automatically set the winprint processor for printer entries later. Used to debug the LexMark Optra S 1855 PCL driver --jerry */ - r_u.status = NT_STATUS_NOPROBLEMO; + r_u.status = NT_STATUS_OK; if(!spoolss_io_r_addprintprocessor("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_addprintprocessor: unable to marshall SPOOL_R_ADDPRINTPROCESSOR.\n")); diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 0710f058700..0ebbc2aadac 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -160,7 +160,7 @@ static void free_spool_notify_option(SPOOL_NOTIFY_OPTION **pp) static void srv_spoolss_replycloseprinter(POLICY_HND *handle) { - uint32 status; + NTSTATUS status; /* weird if the test succeds !!! */ if (smb_connections==0) { @@ -270,18 +270,18 @@ static BOOL close_printer_handle(pipes_struct *p, POLICY_HND *hnd) /**************************************************************************** delete a printer given a handle ****************************************************************************/ -static uint32 delete_printer_handle(pipes_struct *p, POLICY_HND *hnd) +static NTSTATUS delete_printer_handle(pipes_struct *p, POLICY_HND *hnd) { Printer_entry *Printer = find_printer_index_by_hnd(p, hnd); if (!Printer) { DEBUG(0,("delete_printer_handle: Invalid handle (%s)\n", OUR_HANDLE(hnd))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } if (del_a_printer(Printer->dev.handlename) != 0) { DEBUG(3,("Error deleting printer %s\n", Printer->dev.handlename)); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } /* Check calling user has permission to delete printer. Note that @@ -291,7 +291,7 @@ static uint32 delete_printer_handle(pipes_struct *p, POLICY_HND *hnd) if (!print_access_check(NULL, -1, PRINTER_ACCESS_ADMINISTER)) { DEBUG(3, ("printer delete denied by security descriptor\n")); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } if (*lp_deleteprinter_cmd()) { @@ -308,7 +308,7 @@ static uint32 delete_printer_handle(pipes_struct *p, POLICY_HND *hnd) DEBUG(10,("Running [%s]\n", command)); ret = smbrun(command, NULL); if (ret != 0) { - return ERRbadfid; /* What to return here? */ + return NT_STATUS_INVALID_HANDLE; /* What to return here? */ } DEBUGADD(10,("returned [%d]\n", ret)); @@ -317,12 +317,12 @@ static uint32 delete_printer_handle(pipes_struct *p, POLICY_HND *hnd) if ( ( i = lp_servicenumber( Printer->dev.handlename ) ) >= 0 ) { lp_killservice( i ); - return ERRsuccess; + return NT_STATUS_OK; } else - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** @@ -618,7 +618,7 @@ static BOOL alloc_buffer_size(NEW_BUFFER *buffer, uint32 buffer_size) static void srv_spoolss_receive_message(int msg_type, pid_t src, void *buf, size_t len) { fstring printer; - uint32 status; + NTSTATUS status; struct pipes_struct *p; struct policy *pol; struct handle_list *hl; @@ -706,10 +706,10 @@ static BOOL srv_spoolss_sendnotify(pipes_struct *p, POLICY_HND *handle) * called from the spoolss dispatcher ********************************************************************/ -uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, SPOOL_R_OPEN_PRINTER_EX *r_u) +NTSTATUS _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, SPOOL_R_OPEN_PRINTER_EX *r_u) { #if 0 - uint32 result = ERRsuccess; + uint32 result = NT_STATUS_OK; #endif UNISTR2 *printername = NULL; @@ -726,7 +726,7 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, printername = &q_u->printername; if (printername == NULL) - return ERRinvalidprintername; + return NT_STATUS_OBJECT_NAME_INVALID; /* some sanity check because you can open a printer or a print server */ /* aka: \\server\printer or \\server */ @@ -735,7 +735,7 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, DEBUGADD(3,("checking name: %s\n",name)); if (!open_printer_hnd(p, handle, name)) - return ERRinvalidprintername; + return NT_STATUS_OBJECT_NAME_INVALID; /* if (printer_default->datatype_ptr != NULL) @@ -749,7 +749,7 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, if (!set_printer_hnd_accesstype(p, handle, printer_default->access_required)) { close_printer_handle(p, handle); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } /* @@ -779,7 +779,7 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, if (handle_is_printserver(p, handle)) { if (printer_default->access_required == 0) { - return ERRsuccess; + return NT_STATUS_OK; } else if ((printer_default->access_required & SERVER_ACCESS_ADMINISTER ) == SERVER_ACCESS_ADMINISTER) { @@ -788,14 +788,14 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, if (!lp_ms_add_printer_wizard()) { close_printer_handle(p, handle); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } else if (user.uid == 0 || user_in_list(uidtoname(user.uid), lp_printer_admin(snum))) { - return ERRsuccess; + return NT_STATUS_OK; } else { close_printer_handle(p, handle); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } } } @@ -805,7 +805,7 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, doesn't have print permission. */ if (!get_printer_snum(p, handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; /* map an empty access mask to the minimum access mask */ if (printer_default->access_required == 0x0) @@ -826,7 +826,7 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, if (!print_access_check(&user, snum, printer_default->access_required)) { DEBUG(3, ("access DENIED for printer open\n")); close_printer_handle(p, handle); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } /* @@ -905,7 +905,7 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, #endif } - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** @@ -1021,27 +1021,27 @@ BOOL convert_devicemode(char *printername, const DEVICEMODE *devmode, * _spoolss_enddocprinter_internal. ********************************************************************/ -static uint32 _spoolss_enddocprinter_internal(pipes_struct *p, POLICY_HND *handle) +static NTSTATUS _spoolss_enddocprinter_internal(pipes_struct *p, POLICY_HND *handle) { Printer_entry *Printer=find_printer_index_by_hnd(p, handle); if (!Printer) { DEBUG(0,("_spoolss_enddocprinter_internal: Invalid handle (%s)\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } Printer->document_started=False; print_job_end(Printer->jobid,True); /* error codes unhandled so far ... */ - return 0x0; + return NT_STATUS_OK; } /******************************************************************** * api_spoolss_closeprinter ********************************************************************/ -uint32 _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R_CLOSEPRINTER *r_u) +NTSTATUS _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R_CLOSEPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; @@ -1053,9 +1053,9 @@ uint32 _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R memcpy(&r_u->handle, &q_u->handle, sizeof(r_u->handle)); if (!close_printer_handle(p, handle)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** @@ -1063,12 +1063,11 @@ uint32 _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R ********************************************************************/ -uint32 _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPOOL_R_DELETEPRINTER *r_u) +NTSTATUS _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPOOL_R_DELETEPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; - Printer_entry *Printer=find_printer_index_by_hnd(p, handle); - uint32 result; + NTSTATUS result; if (Printer && Printer->document_started) _spoolss_enddocprinter_internal(p, handle); /* print job was not closed */ @@ -1077,7 +1076,7 @@ uint32 _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPOOL result = delete_printer_handle(p, handle); - if (result == ERRsuccess) { + if (NT_STATUS_IS_OK(result)) { srv_spoolss_sendnotify(p, handle); } @@ -1125,7 +1124,7 @@ static int get_version_id (char * arch) * --jerry ********************************************************************/ -uint32 _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER *q_u, +NTSTATUS _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER *q_u, SPOOL_R_DELETEPRINTERDRIVER *r_u) { fstring driver; @@ -1138,21 +1137,18 @@ uint32 _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER /* check that we have a valid driver name first */ if ((version=get_version_id(arch)) == -1) { - /* this is what NT returns */ - return ERRinvalidenvironment; + return NT_STATUS_REVISION_MISMATCH; } ZERO_STRUCT(info); if (get_a_printer_driver (&info, 3, driver, arch, version) != 0) { - /* this is what NT returns */ - return ERRunknownprinterdriver; + return NT_STATUS_DRIVER_ORDINAL_NOT_FOUND; } if (printer_driver_in_use(arch, driver)) { - /* this is what NT returns */ - return ERRprinterdriverinuse; + return NT_STATUS_NETWORK_BUSY; } return delete_printer_driver(info.info_3); @@ -1297,7 +1293,7 @@ static BOOL getprinterdata_printer(pipes_struct *p, TALLOC_CTX *ctx, POLICY_HND * spoolss_getprinterdata ********************************************************************/ -uint32 _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPOOL_R_GETPRINTERDATA *r_u) +NTSTATUS _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPOOL_R_GETPRINTERDATA *r_u) { POLICY_HND *handle = &q_u->handle; UNISTR2 *valuename = &q_u->valuename; @@ -1328,9 +1324,9 @@ uint32 _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPO if (!Printer) { if((*data=(uint8 *)malloc(4*sizeof(uint8))) == NULL) - return ERRnomem; + return NT_STATUS_NO_MEMORY; DEBUG(0,("_spoolss_getprinterdata: Invalid handle (%s).\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } unistr2_to_ascii(value, valuename, sizeof(value)-1); @@ -1345,18 +1341,18 @@ uint32 _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPO /* reply this param doesn't exist */ if (*out_size) { if((*data=(uint8 *)talloc_zero(p->mem_ctx, *out_size*sizeof(uint8))) == NULL) - return ERRnomem; + return NT_STATUS_NO_MEMORY; } else { *data = NULL; } - return ERRinvalidparam; + return NT_STATUS_INVALID_PARAMETER; } if (*needed > *out_size) - return ERRmoredata; + return STATUS_MORE_ENTRIES; else { - return ERRsuccess; + return NT_STATUS_OK; } } @@ -1365,7 +1361,7 @@ uint32 _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPO ****************************************************************************/ static BOOL srv_spoolss_replyopenprinter(char *printer, uint32 localprinter, uint32 type, POLICY_HND *handle) { - uint32 status; + NTSTATUS status; /* * If it's the first connection, contact the client @@ -1402,7 +1398,7 @@ static BOOL srv_spoolss_replyopenprinter(char *printer, uint32 localprinter, uin * called from api_spoolss_rffpcnex ********************************************************************/ -uint32 _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNEX *r_u) +NTSTATUS _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNEX *r_u) { POLICY_HND *handle = &q_u->handle; uint32 flags = q_u->flags; @@ -1417,7 +1413,7 @@ uint32 _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNE if (!Printer) { DEBUG(0,("_spoolss_rffpcnex: Invalid handle (%s).\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } Printer->notify.flags=flags; @@ -1437,7 +1433,7 @@ uint32 _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNE &Printer->notify.client_hnd)) Printer->notify.client_connected=True; - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************* @@ -2338,7 +2334,7 @@ static BOOL construct_notify_jobs_info(print_queue_struct *queue, * ********************************************************************/ -static uint32 printserver_notify_info(pipes_struct *p, POLICY_HND *hnd, +static NTSTATUS printserver_notify_info(pipes_struct *p, POLICY_HND *hnd, SPOOL_NOTIFY_INFO *info, TALLOC_CTX *mem_ctx) { @@ -2386,7 +2382,7 @@ static uint32 printserver_notify_info(pipes_struct *p, POLICY_HND *hnd, } */ - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************* @@ -2469,14 +2465,14 @@ static uint32 printer_notify_info(pipes_struct *p, POLICY_HND *hnd, SPOOL_NOTIFY info->data[i].id, info->data[i].size, info->data[i].enc_type)); } */ - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** * spoolss_rfnpcnex ********************************************************************/ -uint32 _spoolss_rfnpcnex( pipes_struct *p, SPOOL_Q_RFNPCNEX *q_u, SPOOL_R_RFNPCNEX *r_u) +NTSTATUS _spoolss_rfnpcnex( pipes_struct *p, SPOOL_Q_RFNPCNEX *q_u, SPOOL_R_RFNPCNEX *r_u) { POLICY_HND *handle = &q_u->handle; /* uint32 change = q_u->change; - notused. */ @@ -2484,7 +2480,7 @@ uint32 _spoolss_rfnpcnex( pipes_struct *p, SPOOL_Q_RFNPCNEX *q_u, SPOOL_R_RFNPCN SPOOL_NOTIFY_INFO *info = &r_u->info; Printer_entry *Printer=find_printer_index_by_hnd(p, handle); - uint32 result = ERRbadfid; + NTSTATUS result = NT_STATUS_INVALID_HANDLE; /* we always have a NOTIFY_INFO struct */ r_u->info_ptr=0x1; @@ -2941,7 +2937,7 @@ static BOOL enum_all_printers_info_1(uint32 flags, NEW_BUFFER *buffer, uint32 of return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** @@ -3023,7 +3019,7 @@ static BOOL enum_all_printers_info_1_remote(fstring name, NEW_BUFFER *buffer, ui return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** @@ -3097,13 +3093,13 @@ static BOOL enum_all_printers_info_2(NEW_BUFFER *buffer, uint32 offered, uint32 return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** * handle enumeration of printers at level 1 ********************************************************************/ -static uint32 enumprinters_level1( uint32 flags, fstring name, +static NTSTATUS enumprinters_level1( uint32 flags, fstring name, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { @@ -3121,13 +3117,13 @@ static uint32 enumprinters_level1( uint32 flags, fstring name, if (flags & PRINTER_ENUM_NETWORK) return enum_all_printers_info_1_network(buffer, offered, needed, returned); - return ERRsuccess; /* NT4sp5 does that */ + return NT_STATUS_OK; /* NT4sp5 does that */ } /******************************************************************** * handle enumeration of printers at level 2 ********************************************************************/ -static uint32 enumprinters_level2( uint32 flags, fstring servername, +static NTSTATUS enumprinters_level2( uint32 flags, fstring servername, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { @@ -3153,18 +3149,18 @@ static uint32 enumprinters_level2( uint32 flags, fstring servername, if (flags & PRINTER_ENUM_REMOTE) return ERRunknownlevel; - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** * handle enumeration of printers at level 5 ********************************************************************/ -static uint32 enumprinters_level5( uint32 flags, fstring servername, +static NTSTATUS enumprinters_level5( uint32 flags, fstring servername, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { /* return enum_all_printers_info_5(buffer, offered, needed, returned);*/ - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** @@ -3173,7 +3169,7 @@ static uint32 enumprinters_level5( uint32 flags, fstring servername, * called from api_spoolss_enumprinters (see this to understand) ********************************************************************/ -uint32 _spoolss_enumprinters( pipes_struct *p, SPOOL_Q_ENUMPRINTERS *q_u, SPOOL_R_ENUMPRINTERS *r_u) +NTSTATUS _spoolss_enumprinters( pipes_struct *p, SPOOL_Q_ENUMPRINTERS *q_u, SPOOL_R_ENUMPRINTERS *r_u) { uint32 flags = q_u->flags; UNISTR2 *servername = &q_u->servername; @@ -3226,7 +3222,7 @@ uint32 _spoolss_enumprinters( pipes_struct *p, SPOOL_Q_ENUMPRINTERS *q_u, SPOOL_ /**************************************************************************** ****************************************************************************/ -static uint32 getprinter_level_0(int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinter_level_0(int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { PRINTER_INFO_0 *printer=NULL; @@ -3253,12 +3249,12 @@ static uint32 getprinter_level_0(int snum, NEW_BUFFER *buffer, uint32 offered, u return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -static uint32 getprinter_level_1(int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinter_level_1(int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { PRINTER_INFO_1 *printer=NULL; @@ -3285,12 +3281,12 @@ static uint32 getprinter_level_1(int snum, NEW_BUFFER *buffer, uint32 offered, u return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -static uint32 getprinter_level_2(int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinter_level_2(int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { PRINTER_INFO_2 *printer=NULL; @@ -3320,12 +3316,12 @@ static uint32 getprinter_level_2(int snum, NEW_BUFFER *buffer, uint32 offered, u return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -static uint32 getprinter_level_3(int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinter_level_3(int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { PRINTER_INFO_3 *printer=NULL; @@ -3350,13 +3346,13 @@ static uint32 getprinter_level_3(int snum, NEW_BUFFER *buffer, uint32 offered, u return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_getprinter(pipes_struct *p, SPOOL_Q_GETPRINTER *q_u, SPOOL_R_GETPRINTER *r_u) +NTSTATUS _spoolss_getprinter(pipes_struct *p, SPOOL_Q_GETPRINTER *q_u, SPOOL_R_GETPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; uint32 level = q_u->level; @@ -3373,7 +3369,7 @@ uint32 _spoolss_getprinter(pipes_struct *p, SPOOL_Q_GETPRINTER *q_u, SPOOL_R_GET *needed=0; if (!get_printer_snum(p, handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; switch (level) { case 0: @@ -3400,7 +3396,7 @@ static void fill_printer_driver_info_1(DRIVER_INFO_1 *info, NT_PRINTER_DRIVER_IN /******************************************************************** * construct_printer_driver_info_1 ********************************************************************/ -static uint32 construct_printer_driver_info_1(DRIVER_INFO_1 *info, int snum, fstring servername, fstring architecture, uint32 version) +static NTSTATUS construct_printer_driver_info_1(DRIVER_INFO_1 *info, int snum, fstring servername, fstring architecture, uint32 version) { NT_PRINTER_INFO_LEVEL *printer = NULL; NT_PRINTER_DRIVER_INFO_LEVEL driver; @@ -3417,7 +3413,7 @@ static uint32 construct_printer_driver_info_1(DRIVER_INFO_1 *info, int snum, fst free_a_printer(&printer,2); - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** @@ -3457,7 +3453,7 @@ static void fill_printer_driver_info_2(DRIVER_INFO_2 *info, NT_PRINTER_DRIVER_IN * construct_printer_driver_info_2 * fill a printer_info_2 struct ********************************************************************/ -static uint32 construct_printer_driver_info_2(DRIVER_INFO_2 *info, int snum, fstring servername, fstring architecture, uint32 version) +static NTSTATUS construct_printer_driver_info_2(DRIVER_INFO_2 *info, int snum, fstring servername, fstring architecture, uint32 version) { NT_PRINTER_INFO_LEVEL *printer = NULL; NT_PRINTER_DRIVER_INFO_LEVEL driver; @@ -3475,7 +3471,7 @@ static uint32 construct_printer_driver_info_2(DRIVER_INFO_2 *info, int snum, fst free_a_printer(&printer,2); - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** @@ -3570,11 +3566,11 @@ static void fill_printer_driver_info_3(DRIVER_INFO_3 *info, NT_PRINTER_DRIVER_IN * construct_printer_info_3 * fill a printer_info_3 struct ********************************************************************/ -static uint32 construct_printer_driver_info_3(DRIVER_INFO_3 *info, int snum, fstring servername, fstring architecture, uint32 version) +static NTSTATUS construct_printer_driver_info_3(DRIVER_INFO_3 *info, int snum, fstring servername, fstring architecture, uint32 version) { NT_PRINTER_INFO_LEVEL *printer = NULL; NT_PRINTER_DRIVER_INFO_LEVEL driver; - uint32 status=0; + NTSTATUS status=0; ZERO_STRUCT(driver); status=get_a_printer(&printer, 2, lp_servicename(snum) ); @@ -3593,7 +3589,7 @@ static uint32 construct_printer_driver_info_3(DRIVER_INFO_3 *info, int snum, fst free_a_printer(&printer,2); - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** @@ -3664,11 +3660,11 @@ static void fill_printer_driver_info_6(DRIVER_INFO_6 *info, NT_PRINTER_DRIVER_IN * construct_printer_info_6 * fill a printer_info_6 struct ********************************************************************/ -static uint32 construct_printer_driver_info_6(DRIVER_INFO_6 *info, int snum, fstring servername, fstring architecture, uint32 version) +static NTSTATUS construct_printer_driver_info_6(DRIVER_INFO_6 *info, int snum, fstring servername, fstring architecture, uint32 version) { NT_PRINTER_INFO_LEVEL *printer = NULL; NT_PRINTER_DRIVER_INFO_LEVEL driver; - uint32 status=0; + NTSTATUS status=0; ZERO_STRUCT(driver); status=get_a_printer(&printer, 2, lp_servicename(snum) ); @@ -3702,7 +3698,7 @@ static uint32 construct_printer_driver_info_6(DRIVER_INFO_6 *info, int snum, fst free_a_printer(&printer,2); - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** @@ -3724,16 +3720,16 @@ static void free_printer_driver_info_6(DRIVER_INFO_6 *info) /**************************************************************************** ****************************************************************************/ -static uint32 getprinterdriver2_level1(fstring servername, fstring architecture, uint32 version, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinterdriver2_level1(fstring servername, fstring architecture, uint32 version, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { DRIVER_INFO_1 *info=NULL; - uint32 status; + NTSTATUS status; if((info=(DRIVER_INFO_1 *)malloc(sizeof(DRIVER_INFO_1))) == NULL) return ERRnomem; status=construct_printer_driver_info_1(info, snum, servername, architecture, version); - if (status != ERRsuccess) { + if (status != NT_STATUS_OK) { safe_free(info); return status; } @@ -3755,21 +3751,21 @@ static uint32 getprinterdriver2_level1(fstring servername, fstring architecture, if (*needed > offered) return ERRinsufficientbuffer; else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -static uint32 getprinterdriver2_level2(fstring servername, fstring architecture, uint32 version, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinterdriver2_level2(fstring servername, fstring architecture, uint32 version, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { DRIVER_INFO_2 *info=NULL; - uint32 status; + NTSTATUS status; if((info=(DRIVER_INFO_2 *)malloc(sizeof(DRIVER_INFO_2))) == NULL) return ERRnomem; status=construct_printer_driver_info_2(info, snum, servername, architecture, version); - if (status != ERRsuccess) { + if (status != NT_STATUS_OK) { safe_free(info); return status; } @@ -3791,20 +3787,20 @@ static uint32 getprinterdriver2_level2(fstring servername, fstring architecture, if (*needed > offered) return ERRinsufficientbuffer; else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -static uint32 getprinterdriver2_level3(fstring servername, fstring architecture, uint32 version, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinterdriver2_level3(fstring servername, fstring architecture, uint32 version, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { DRIVER_INFO_3 info; - uint32 status; + NTSTATUS status; ZERO_STRUCT(info); status=construct_printer_driver_info_3(&info, snum, servername, architecture, version); - if (status != ERRsuccess) { + if (status != NT_STATUS_OK) { return status; } @@ -3824,20 +3820,20 @@ static uint32 getprinterdriver2_level3(fstring servername, fstring architecture, if (*needed > offered) return ERRinsufficientbuffer; else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -static uint32 getprinterdriver2_level6(fstring servername, fstring architecture, uint32 version, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinterdriver2_level6(fstring servername, fstring architecture, uint32 version, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { DRIVER_INFO_6 info; - uint32 status; + NTSTATUS status; ZERO_STRUCT(info); status=construct_printer_driver_info_6(&info, snum, servername, architecture, version); - if (status != ERRsuccess) { + if (status != NT_STATUS_OK) { return status; } @@ -3857,13 +3853,13 @@ static uint32 getprinterdriver2_level6(fstring servername, fstring architecture, if (*needed > offered) return ERRinsufficientbuffer; else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_u, SPOOL_R_GETPRINTERDRIVER2 *r_u) +NTSTATUS _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_u, SPOOL_R_GETPRINTERDRIVER2 *r_u) { POLICY_HND *handle = &q_u->handle; UNISTR2 *uni_arch = &q_u->architecture; @@ -3894,7 +3890,7 @@ uint32 _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_ unistr2_to_ascii(architecture, uni_arch, sizeof(architecture)-1); if (!get_printer_snum(p, handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; switch (level) { case 1: @@ -3913,7 +3909,7 @@ uint32 _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_ /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u, SPOOL_R_STARTPAGEPRINTER *r_u) +NTSTATUS _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u, SPOOL_R_STARTPAGEPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; @@ -3925,13 +3921,13 @@ uint32 _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u, } DEBUG(3,("Error in startpageprinter printer handle\n")); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPOOL_R_ENDPAGEPRINTER *r_u) +NTSTATUS _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPOOL_R_ENDPAGEPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; @@ -3939,12 +3935,12 @@ uint32 _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPO if (!Printer) { DEBUG(0,("_spoolss_endpageprinter: Invalid handle (%s).\n",OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } Printer->page_started=False; - return ERRsuccess; + return NT_STATUS_OK; } /******************************************************************** @@ -3953,7 +3949,7 @@ uint32 _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPO * ********************************************************************/ -uint32 _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, SPOOL_R_STARTDOCPRINTER *r_u) +NTSTATUS _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, SPOOL_R_STARTDOCPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; /* uint32 level = q_u->doc_info_container.level; - notused. */ @@ -3969,7 +3965,7 @@ uint32 _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, S if (!Printer) { DEBUG(0,("_spoolss_startdocprinter: Invalid handle (%s)\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } get_current_user(&user, p); @@ -3996,7 +3992,7 @@ uint32 _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, S /* get the share number of the printer */ if (!get_printer_snum(p, handle, &snum)) { - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } unistr2_to_ascii(jobname, &info_1->docname, sizeof(jobname)); @@ -4022,7 +4018,7 @@ uint32 _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, S * ********************************************************************/ -uint32 _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPOOL_R_ENDDOCPRINTER *r_u) +NTSTATUS _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPOOL_R_ENDDOCPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; @@ -4032,7 +4028,7 @@ uint32 _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPOOL /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R_WRITEPRINTER *r_u) +NTSTATUS _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R_WRITEPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; uint32 buffer_size = q_u->buffer_size; @@ -4044,7 +4040,7 @@ uint32 _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R if (!Printer) { DEBUG(0,("_spoolss_writeprinter: Invalid handle (%s)\n",OUR_HANDLE(handle))); r_u->buffer_written = q_u->buffer_size2; - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } (*buffer_written) = print_job_write(Printer->jobid, (char *)buffer, buffer_size); @@ -4060,7 +4056,7 @@ uint32 _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R * called from the spoolss dispatcher * ********************************************************************/ -static uint32 control_printer(POLICY_HND *handle, uint32 command, +static NTSTATUS control_printer(POLICY_HND *handle, uint32 command, pipes_struct *p) { struct current_user user; @@ -4071,11 +4067,11 @@ static uint32 control_printer(POLICY_HND *handle, uint32 command, if (!Printer) { DEBUG(0,("control_printer: Invalid handle (%s)\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } if (!get_printer_snum(p, handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; switch (command) { case PRINTER_CONTROL_PAUSE: @@ -4105,7 +4101,7 @@ static uint32 control_printer(POLICY_HND *handle, uint32 command, * api_spoolss_abortprinter ********************************************************************/ -uint32 _spoolss_abortprinter(pipes_struct *p, SPOOL_Q_ABORTPRINTER *q_u, SPOOL_R_ABORTPRINTER *r_u) +NTSTATUS _spoolss_abortprinter(pipes_struct *p, SPOOL_Q_ABORTPRINTER *q_u, SPOOL_R_ABORTPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; @@ -4116,7 +4112,7 @@ uint32 _spoolss_abortprinter(pipes_struct *p, SPOOL_Q_ABORTPRINTER *q_u, SPOOL_R * called by spoolss_api_setprinter * when updating a printer description ********************************************************************/ -static uint32 update_printer_sec(POLICY_HND *handle, uint32 level, +static NTSTATUS update_printer_sec(POLICY_HND *handle, uint32 level, const SPOOL_PRINTER_INFO_LEVEL *info, pipes_struct *p, SEC_DESC_BUF *secdesc_ctr) { @@ -4131,7 +4127,7 @@ static uint32 update_printer_sec(POLICY_HND *handle, uint32 level, DEBUG(0,("update_printer_sec: Invalid handle (%s)\n", OUR_HANDLE(handle))); - result = ERRbadfid; + result = NT_STATUS_INVALID_HANDLE; goto done; } @@ -4181,7 +4177,7 @@ static uint32 update_printer_sec(POLICY_HND *handle, uint32 level, new_secdesc_ctr = sec_desc_merge(p->mem_ctx, secdesc_ctr, old_secdesc_ctr); if (sec_desc_equal(new_secdesc_ctr->sec, old_secdesc_ctr->sec)) { - result = ERRsuccess; + result = NT_STATUS_OK; goto done; } @@ -4195,7 +4191,7 @@ static uint32 update_printer_sec(POLICY_HND *handle, uint32 level, information. */ if (!print_access_check(&user, snum, PRINTER_ACCESS_ADMINISTER)) { - result = ERRnoaccess; + result = NT_STATUS_ACCESS_DENIED; goto done; } @@ -4528,7 +4524,7 @@ static BOOL nt_printer_info_level_equal(NT_PRINTER_INFO_LEVEL *p1, * when updating a printer description ********************************************************************/ -static uint32 update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, +static NTSTATUS update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, const SPOOL_PRINTER_INFO_LEVEL *info, DEVICEMODE *devmode) { @@ -4539,7 +4535,7 @@ static uint32 update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, DEBUG(8,("update_printer\n")); - result = ERRsuccess; + result = NT_STATUS_OK; if (level!=2) { DEBUG(0,("Send a mail to samba@samba.org\n")); @@ -4549,18 +4545,18 @@ static uint32 update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, } if (!Printer) { - result = ERRbadfid; + result = NT_STATUS_INVALID_HANDLE; goto done; } if (!get_printer_snum(p, handle, &snum)) { - result = ERRbadfid; + result = NT_STATUS_INVALID_HANDLE; goto done; } if((get_a_printer(&printer, 2, lp_servicename(snum)) != 0) || (get_a_printer(&old_printer, 2, lp_servicename(snum)) != 0)) { - result = ERRbadfid; + result = NT_STATUS_INVALID_HANDLE; goto done; } @@ -4599,7 +4595,7 @@ static uint32 update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, if (nt_printer_info_level_equal(printer, old_printer)) { DEBUG(3, ("printer info has not changed\n")); - result = ERRsuccess; + result = NT_STATUS_OK; goto done; } @@ -4608,7 +4604,7 @@ static uint32 update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, if (!print_access_check(NULL, snum, PRINTER_ACCESS_ADMINISTER)) { DEBUG(3, ("printer property change denied by security " "descriptor\n")); - result = ERRnoaccess; + result = NT_STATUS_ACCESS_DENIED; goto done; } @@ -4616,7 +4612,7 @@ static uint32 update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, if (*lp_addprinter_cmd() ) if ( !add_printer_hook(printer) ) { - result = ERRnoaccess; + result = NT_STATUS_ACCESS_DENIED; goto done; } @@ -4624,7 +4620,7 @@ static uint32 update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, if (add_a_printer(*printer, 2)!=0) { /* I don't really know what to return here !!! */ - result = ERRnoaccess; + result = NT_STATUS_ACCESS_DENIED; goto done; } @@ -4640,7 +4636,7 @@ static uint32 update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_setprinter(pipes_struct *p, SPOOL_Q_SETPRINTER *q_u, SPOOL_R_SETPRINTER *r_u) +NTSTATUS _spoolss_setprinter(pipes_struct *p, SPOOL_Q_SETPRINTER *q_u, SPOOL_R_SETPRINTER *r_u) { POLICY_HND *handle = &q_u->handle; uint32 level = q_u->level; @@ -4653,7 +4649,7 @@ uint32 _spoolss_setprinter(pipes_struct *p, SPOOL_Q_SETPRINTER *q_u, SPOOL_R_SET if (!Printer) { DEBUG(0,("_spoolss_setprinter: Invalid handle (%s)\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } /* check the level */ @@ -4673,7 +4669,7 @@ uint32 _spoolss_setprinter(pipes_struct *p, SPOOL_Q_SETPRINTER *q_u, SPOOL_R_SET /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u) +NTSTATUS _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u) { POLICY_HND *handle = &q_u->handle; @@ -4681,7 +4677,7 @@ uint32 _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u) if (!Printer) { DEBUG(0,("_spoolss_fcpn: Invalid handle (%s)\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } if (Printer->notify.client_connected==True) @@ -4695,13 +4691,13 @@ uint32 _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u) free_spool_notify_option(&Printer->notify.option); Printer->notify.client_connected=False; - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_addjob(pipes_struct *p, SPOOL_Q_ADDJOB *q_u, SPOOL_R_ADDJOB *r_u) +NTSTATUS _spoolss_addjob(pipes_struct *p, SPOOL_Q_ADDJOB *q_u, SPOOL_R_ADDJOB *r_u) { /* that's an [in out] buffer (despite appearences to the contrary) */ spoolss_move_buffer(q_u->buffer, &r_u->buffer); @@ -4793,7 +4789,7 @@ static BOOL fill_job_info_2(JOB_INFO_2 *job_info, print_queue_struct *queue, /**************************************************************************** Enumjobs at level 1. ****************************************************************************/ -static uint32 enumjobs_level1(print_queue_struct *queue, int snum, +static NTSTATUS enumjobs_level1(print_queue_struct *queue, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { @@ -4833,13 +4829,13 @@ static uint32 enumjobs_level1(print_queue_struct *queue, int snum, return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** Enumjobs at level 2. ****************************************************************************/ -static uint32 enumjobs_level2(print_queue_struct *queue, int snum, +static NTSTATUS enumjobs_level2(print_queue_struct *queue, int snum, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { @@ -4888,14 +4884,14 @@ static uint32 enumjobs_level2(print_queue_struct *queue, int snum, return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** Enumjobs. ****************************************************************************/ -uint32 _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJOBS *r_u) +NTSTATUS _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJOBS *r_u) { POLICY_HND *handle = &q_u->handle; /* uint32 firstjob = q_u->firstjob; - notused. */ @@ -4922,14 +4918,14 @@ uint32 _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJO *returned=0; if (!get_printer_snum(p, handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; *returned = print_queue_status(snum, &queue, &prt_status); DEBUGADD(4,("count:[%d], status:[%d], [%s]\n", *returned, prt_status.status, prt_status.message)); if (*returned == 0) { safe_free(queue); - return ERRsuccess; + return NT_STATUS_OK; } switch (level) { @@ -4947,7 +4943,7 @@ uint32 _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJO /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_schedulejob( pipes_struct *p, SPOOL_Q_SCHEDULEJOB *q_u, SPOOL_R_SCHEDULEJOB *r_u) +NTSTATUS _spoolss_schedulejob( pipes_struct *p, SPOOL_Q_SCHEDULEJOB *q_u, SPOOL_R_SCHEDULEJOB *r_u) { return 0x0; } @@ -4955,7 +4951,7 @@ uint32 _spoolss_schedulejob( pipes_struct *p, SPOOL_Q_SCHEDULEJOB *q_u, SPOOL_R_ /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_setjob(pipes_struct *p, SPOOL_Q_SETJOB *q_u, SPOOL_R_SETJOB *r_u) +NTSTATUS _spoolss_setjob(pipes_struct *p, SPOOL_Q_SETJOB *q_u, SPOOL_R_SETJOB *r_u) { POLICY_HND *handle = &q_u->handle; uint32 jobid = q_u->jobid; @@ -4970,7 +4966,7 @@ uint32 _spoolss_setjob(pipes_struct *p, SPOOL_Q_SETJOB *q_u, SPOOL_R_SETJOB *r_u memset(&prt_status, 0, sizeof(prt_status)); if (!get_printer_snum(p, handle, &snum)) { - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } if (!print_job_exists(jobid)) { @@ -5007,7 +5003,7 @@ uint32 _spoolss_setjob(pipes_struct *p, SPOOL_Q_SETJOB *q_u, SPOOL_R_SETJOB *r_u /**************************************************************************** Enumerates all printer drivers at level 1. ****************************************************************************/ -static uint32 enumprinterdrivers_level1(fstring servername, fstring architecture, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumprinterdrivers_level1(fstring servername, fstring architecture, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { int i; int ndrivers; @@ -5040,7 +5036,7 @@ static uint32 enumprinterdrivers_level1(fstring servername, fstring architecture } for (i=0; iname; - notused. */ UNISTR2 *environment = &q_u->environment; @@ -5304,7 +5300,7 @@ static void fill_form_1(FORM_1 *form, nt_forms_struct *list) /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMFORMS *r_u) +NTSTATUS _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMFORMS *r_u) { /* POLICY_HND *handle = &q_u->handle; - notused. */ uint32 level = q_u->level; @@ -5392,7 +5388,7 @@ uint32 _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMF return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; default: safe_free(list); @@ -5405,7 +5401,7 @@ uint32 _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMF /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *r_u) +NTSTATUS _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *r_u) { /* POLICY_HND *handle = &q_u->handle; - notused. */ uint32 level = q_u->level; @@ -5438,7 +5434,7 @@ uint32 _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM * DEBUGADD(5,("Number of forms [%d]\n", numofforms)); if (numofforms == 0) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } switch (level) { @@ -5461,7 +5457,7 @@ uint32 _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM * safe_free(list); if (i == numofforms) { - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } } /* check the required size. */ @@ -5480,7 +5476,7 @@ uint32 _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM * DEBUGADD(6,("adding form %s [%d] to buffer\n", form_name, i)); smb_io_form_1("", buffer, &form_1, 0); - return ERRsuccess; + return NT_STATUS_OK; default: safe_free(list); @@ -5510,7 +5506,7 @@ static void fill_port_2(PORT_INFO_2 *port, char *name) /**************************************************************************** enumports level 1. ****************************************************************************/ -static uint32 enumports_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumports_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { PORT_INFO_1 *ports=NULL; int i=0; @@ -5532,7 +5528,7 @@ static uint32 enumports_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *need if (fd != -1) close(fd); /* Is this the best error to return here? */ - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } numlines = 0; @@ -5592,14 +5588,14 @@ static uint32 enumports_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *need return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** enumports level 2. ****************************************************************************/ -static uint32 enumports_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumports_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { PORT_INFO_2 *ports=NULL; int i=0; @@ -5630,7 +5626,7 @@ static uint32 enumports_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *need if (fd != -1) close(fd); /* Is this the best error to return here? */ - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } numlines = 0; @@ -5691,14 +5687,14 @@ static uint32 enumports_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *need return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** enumports. ****************************************************************************/ -uint32 _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUMPORTS *r_u) +NTSTATUS _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUMPORTS *r_u) { /* UNISTR2 *name = &q_u->name; - notused. */ uint32 level = q_u->level; @@ -5728,7 +5724,7 @@ uint32 _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUM /**************************************************************************** ****************************************************************************/ -static uint32 spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_srv_name, +static NTSTATUS spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_srv_name, const SPOOL_PRINTER_INFO_LEVEL *info, uint32 unk0, uint32 unk1, uint32 unk2, uint32 unk3, uint32 user_switch, const SPOOL_USER_CTR *user, @@ -5751,7 +5747,7 @@ static uint32 spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_ if (*lp_addprinter_cmd() ) if ( !add_printer_hook(printer) ) { free_a_printer(&printer,2); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } slprintf(name, sizeof(name)-1, "\\\\%s\\%s", global_myname, @@ -5759,13 +5755,13 @@ static uint32 spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_ if ((snum = print_queue_snum(printer->info_2->sharename)) == -1) { free_a_printer(&printer,2); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } /* you must be a printer admin to add a new printer */ if (!print_access_check(NULL, snum, PRINTER_ACCESS_ADMINISTER)) { free_a_printer(&printer,2); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } /* @@ -5787,27 +5783,27 @@ static uint32 spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_ /* write the ASCII on disk */ if (add_a_printer(*printer, 2) != 0) { free_a_printer(&printer,2); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } if (!open_printer_hnd(p, handle, name)) { /* Handle open failed - remove addition. */ del_a_printer(printer->info_2->sharename); free_a_printer(&printer,2); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } free_a_printer(&printer,2); srv_spoolss_sendnotify(p, handle); - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_R_ADDPRINTEREX *r_u) +NTSTATUS _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_R_ADDPRINTEREX *r_u) { UNISTR2 *uni_srv_name = &q_u->server_name; uint32 level = q_u->level; @@ -5837,13 +5833,13 @@ uint32 _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_ /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_addprinterdriver(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVER *q_u, SPOOL_R_ADDPRINTERDRIVER *r_u) +NTSTATUS _spoolss_addprinterdriver(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVER *q_u, SPOOL_R_ADDPRINTERDRIVER *r_u) { /* UNISTR2 *server_name = &q_u->server_name; - notused. */ uint32 level = q_u->level; SPOOL_PRINTER_DRIVER_INFO_LEVEL *info = &q_u->info; - uint32 err = ERRsuccess; + uint32 err = NT_STATUS_OK; NT_PRINTER_DRIVER_INFO_LEVEL driver; struct current_user user; @@ -5857,18 +5853,18 @@ uint32 _spoolss_addprinterdriver(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVER *q_u, } DEBUG(5,("Cleaning driver's information\n")); - if ((err = clean_up_driver_struct(driver, level, &user)) != ERRsuccess ) + if ((err = clean_up_driver_struct(driver, level, &user)) != NT_STATUS_OK ) goto done; DEBUG(5,("Moving driver to final destination\n")); if(!move_driver_to_download_area(driver, level, &user, &err)) { if (err == 0) - err = ERRnoaccess; + err = NT_STATUS_ACCESS_DENIED; goto done; } if (add_a_printer_driver(driver, level)!=0) { - err = ERRnoaccess; + err = NT_STATUS_ACCESS_DENIED; goto done; } @@ -5886,7 +5882,7 @@ static void fill_driverdir_1(DRIVER_DIRECTORY_1 *info, char *name) /**************************************************************************** ****************************************************************************/ -static uint32 getprinterdriverdir_level_1(UNISTR2 *name, UNISTR2 *uni_environment, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getprinterdriverdir_level_1(UNISTR2 *name, UNISTR2 *uni_environment, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { pstring path; pstring long_archi; @@ -5921,13 +5917,13 @@ static uint32 getprinterdriverdir_level_1(UNISTR2 *name, UNISTR2 *uni_environmen if (*needed > offered) return ERRinsufficientbuffer; else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_getprinterdriverdirectory(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, SPOOL_R_GETPRINTERDRIVERDIR *r_u) +NTSTATUS _spoolss_getprinterdriverdirectory(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, SPOOL_R_GETPRINTERDRIVERDIR *r_u) { UNISTR2 *name = &q_u->name; UNISTR2 *uni_environment = &q_u->environment; @@ -5955,7 +5951,7 @@ uint32 _spoolss_getprinterdriverdirectory(pipes_struct *p, SPOOL_Q_GETPRINTERDRI /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, SPOOL_R_ENUMPRINTERDATA *r_u) +NTSTATUS _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, SPOOL_R_ENUMPRINTERDATA *r_u) { POLICY_HND *handle = &q_u->handle; uint32 idx = q_u->index; @@ -5998,14 +5994,14 @@ uint32 _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, S if (!Printer) { DEBUG(0,("_spoolss_enumprinterdata: Invalid handle (%s).\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } if (!get_printer_snum(p,handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; if (get_a_printer(&printer, 2, lp_servicename(snum)) != 0) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; /* * The NT machine wants to know the biggest size of value and data @@ -6069,7 +6065,7 @@ uint32 _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, S DEBUG(6,("final values: [%d], [%d]\n", *out_value_len, *out_data_len)); free_a_printer(&printer, 2); - return ERRsuccess; + return NT_STATUS_OK; } /* @@ -6116,13 +6112,13 @@ uint32 _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, S safe_free(data); - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SPOOL_R_SETPRINTERDATA *r_u) +NTSTATUS _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SPOOL_R_SETPRINTERDATA *r_u) { POLICY_HND *handle = &q_u->handle; UNISTR2 *value = &q_u->value; @@ -6135,18 +6131,18 @@ uint32 _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SP NT_PRINTER_INFO_LEVEL *printer = NULL; NT_PRINTER_PARAM *param = NULL, old_param; int snum=0; - uint32 status = 0x0; + NTSTATUS status = 0x0; Printer_entry *Printer=find_printer_index_by_hnd(p, handle); DEBUG(5,("spoolss_setprinterdata\n")); if (!Printer) { DEBUG(0,("_spoolss_setprinterdata: Invalid handle (%s).\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } if (!get_printer_snum(p,handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; status = get_a_printer(&printer, 2, lp_servicename(snum)); if (status != 0x0) @@ -6168,7 +6164,7 @@ uint32 _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SP old_param.data_len) == 0) { DEBUG(3, ("setprinterdata hasn't changed\n")); - status = ERRsuccess; + status = NT_STATUS_OK; goto done; } } @@ -6178,7 +6174,7 @@ uint32 _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SP if (!print_access_check(NULL, snum, PRINTER_ACCESS_ADMINISTER)) { DEBUG(3, ("security descriptor change denied by existing " "security descriptor\n")); - status = ERRnoaccess; + status = NT_STATUS_ACCESS_DENIED; goto done; } @@ -6212,7 +6208,7 @@ uint32 _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SP /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_u, SPOOL_R_DELETEPRINTERDATA *r_u) +NTSTATUS _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_u, SPOOL_R_DELETEPRINTERDATA *r_u) { POLICY_HND *handle = &q_u->handle; UNISTR2 *value = &q_u->valuename; @@ -6220,23 +6216,23 @@ uint32 _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_ NT_PRINTER_INFO_LEVEL *printer = NULL; NT_PRINTER_PARAM param; int snum=0; - uint32 status = 0x0; + NTSTATUS status = 0x0; Printer_entry *Printer=find_printer_index_by_hnd(p, handle); DEBUG(5,("spoolss_deleteprinterdata\n")); if (!Printer) { DEBUG(0,("_spoolss_deleteprinterdata: Invalid handle (%s).\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } if (!get_printer_snum(p, handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; if (!print_access_check(NULL, snum, PRINTER_ACCESS_ADMINISTER)) { DEBUG(3, ("_spoolss_deleteprinterdata: printer properties " "change denied by existing security descriptor\n")); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } status = get_a_printer(&printer, 2, lp_servicename(snum)); @@ -6258,7 +6254,7 @@ uint32 _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_ /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM *r_u) +NTSTATUS _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM *r_u) { POLICY_HND *handle = &q_u->handle; /* uint32 level = q_u->level; - notused. */ @@ -6273,7 +6269,7 @@ uint32 _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM if (!Printer) { DEBUG(0,("_spoolss_addform: Invalid handle (%s).\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } /* can't add if builtin */ @@ -6294,7 +6290,7 @@ uint32 _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DELETEFORM *r_u) +NTSTATUS _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DELETEFORM *r_u) { POLICY_HND *handle = &q_u->handle; UNISTR2 *form_name = &q_u->name; @@ -6308,7 +6304,7 @@ uint32 _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE if (!Printer) { DEBUG(0,("_spoolss_deleteform: Invalid handle (%s).\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } /* can't delete if builtin */ @@ -6328,7 +6324,7 @@ uint32 _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *r_u) +NTSTATUS _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *r_u) { POLICY_HND *handle = &q_u->handle; /* UNISTR2 *uni_name = &q_u->name; - notused. */ @@ -6344,7 +6340,7 @@ uint32 _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM * if (!Printer) { DEBUG(0,("_spoolss_setform: Invalid handle (%s).\n", OUR_HANDLE(handle))); - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; } /* can't set if builtin */ if (get_a_builtin_ntform(&form->name,&tmpForm)) { @@ -6363,7 +6359,7 @@ uint32 _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM * /**************************************************************************** enumprintprocessors level 1. ****************************************************************************/ -static uint32 enumprintprocessors_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumprintprocessors_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { PRINTPROCESSOR_1 *info_1=NULL; @@ -6388,13 +6384,13 @@ static uint32 enumprintprocessors_level_1(NEW_BUFFER *buffer, uint32 offered, ui return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumprintprocessors(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, SPOOL_R_ENUMPRINTPROCESSORS *r_u) +NTSTATUS _spoolss_enumprintprocessors(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, SPOOL_R_ENUMPRINTPROCESSORS *r_u) { /* UNISTR2 *name = &q_u->name; - notused. */ /* UNISTR2 *environment = &q_u->environment; - notused. */ @@ -6431,7 +6427,7 @@ uint32 _spoolss_enumprintprocessors(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCESSORS /**************************************************************************** enumprintprocdatatypes level 1. ****************************************************************************/ -static uint32 enumprintprocdatatypes_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumprintprocdatatypes_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { PRINTPROCDATATYPE_1 *info_1=NULL; @@ -6456,13 +6452,13 @@ static uint32 enumprintprocdatatypes_level_1(NEW_BUFFER *buffer, uint32 offered, return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumprintprocdatatypes(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCDATATYPES *q_u, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u) +NTSTATUS _spoolss_enumprintprocdatatypes(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCDATATYPES *q_u, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u) { /* UNISTR2 *name = &q_u->name; - notused. */ /* UNISTR2 *processor = &q_u->processor; - notused. */ @@ -6493,7 +6489,7 @@ uint32 _spoolss_enumprintprocdatatypes(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCDAT enumprintmonitors level 1. ****************************************************************************/ -static uint32 enumprintmonitors_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumprintmonitors_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { PRINTMONITOR_1 *info_1=NULL; @@ -6518,13 +6514,13 @@ static uint32 enumprintmonitors_level_1(NEW_BUFFER *buffer, uint32 offered, uint return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** enumprintmonitors level 2. ****************************************************************************/ -static uint32 enumprintmonitors_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumprintmonitors_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { PRINTMONITOR_2 *info_2=NULL; @@ -6551,13 +6547,13 @@ static uint32 enumprintmonitors_level_2(NEW_BUFFER *buffer, uint32 offered, uint return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumprintmonitors(pipes_struct *p, SPOOL_Q_ENUMPRINTMONITORS *q_u, SPOOL_R_ENUMPRINTMONITORS *r_u) +NTSTATUS _spoolss_enumprintmonitors(pipes_struct *p, SPOOL_Q_ENUMPRINTMONITORS *q_u, SPOOL_R_ENUMPRINTMONITORS *r_u) { /* UNISTR2 *name = &q_u->name; - notused. */ uint32 level = q_u->level; @@ -6594,7 +6590,7 @@ uint32 _spoolss_enumprintmonitors(pipes_struct *p, SPOOL_Q_ENUMPRINTMONITORS *q_ /**************************************************************************** ****************************************************************************/ -static uint32 getjob_level_1(print_queue_struct *queue, int count, int snum, uint32 jobid, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getjob_level_1(print_queue_struct *queue, int count, int snum, uint32 jobid, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { int i=0; BOOL found=False; @@ -6616,7 +6612,7 @@ static uint32 getjob_level_1(print_queue_struct *queue, int count, int snum, uin safe_free(queue); safe_free(info_1); /* I shoud reply something else ... I can't find the good one */ - return ERRsuccess; + return NT_STATUS_OK; } fill_job_info_1(info_1, &(queue[i-1]), i, snum); @@ -6637,13 +6633,13 @@ static uint32 getjob_level_1(print_queue_struct *queue, int count, int snum, uin if (*needed > offered) return ERRinsufficientbuffer; else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -static uint32 getjob_level_2(print_queue_struct *queue, int count, int snum, uint32 jobid, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) +static NTSTATUS getjob_level_2(print_queue_struct *queue, int count, int snum, uint32 jobid, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) { int i=0; BOOL found=False; @@ -6668,7 +6664,7 @@ static uint32 getjob_level_2(print_queue_struct *queue, int count, int snum, uin safe_free(queue); safe_free(info_2); /* I shoud reply something else ... I can't find the good one */ - return ERRsuccess; + return NT_STATUS_OK; } if (get_a_printer(&ntprinter, 2, lp_servicename(snum)) !=0) { @@ -6696,13 +6692,13 @@ static uint32 getjob_level_2(print_queue_struct *queue, int count, int snum, uin if (*needed > offered) return ERRinsufficientbuffer; else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_getjob( pipes_struct *p, SPOOL_Q_GETJOB *q_u, SPOOL_R_GETJOB *r_u) +NTSTATUS _spoolss_getjob( pipes_struct *p, SPOOL_Q_GETJOB *q_u, SPOOL_R_GETJOB *r_u) { POLICY_HND *handle = &q_u->handle; uint32 jobid = q_u->jobid; @@ -6727,7 +6723,7 @@ uint32 _spoolss_getjob( pipes_struct *p, SPOOL_Q_GETJOB *q_u, SPOOL_R_GETJOB *r_ *needed=0; if (!get_printer_snum(p, handle, &snum)) - return ERRbadfid; + return NT_STATUS_INVALID_HANDLE; count = print_queue_status(snum, &queue, &prt_status); diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index b5b38b1403c..5ba460b607e 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -303,7 +303,8 @@ void map_generic_share_sd_bits(SEC_DESC *psd) BOOL share_access_check(connection_struct *conn, int snum, uint16 vuid, uint32 desired_access) { - uint32 granted, status; + uint32 granted; + NTSTATUS status; TALLOC_CTX *mem_ctx = NULL; SEC_DESC *psd = NULL; size_t sd_size; @@ -530,7 +531,7 @@ static void init_srv_r_net_share_enum(pipes_struct *p, SRV_R_NET_SHARE_ENUM *r_n if (init_srv_share_info_ctr(p, &r_n->ctr, info_level, &resume_hnd, &r_n->total_entries, all)) { - r_n->status = NT_STATUS_NOPROBLEMO; + r_n->status = NT_STATUS_OK; } else { r_n->status = NT_STATUS_INVALID_INFO_CLASS; } @@ -545,7 +546,7 @@ static void init_srv_r_net_share_enum(pipes_struct *p, SRV_R_NET_SHARE_ENUM *r_n static void init_srv_r_net_share_get_info(pipes_struct *p, SRV_R_NET_SHARE_GET_INFO *r_n, char *share_name, uint32 info_level) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; int snum; DEBUG(5,("init_srv_r_net_share_get_info: %d\n", __LINE__)); @@ -577,7 +578,7 @@ static void init_srv_r_net_share_get_info(pipes_struct *p, SRV_R_NET_SHARE_GET_I status = NT_STATUS_BAD_NETWORK_NAME; } - r_n->info.ptr_share_ctr = (status == NT_STATUS_NOPROBLEMO) ? 1 : 0; + r_n->info.ptr_share_ctr = NT_STATUS_IS_OK(status) ? 1 : 0; r_n->status = status; } @@ -694,10 +695,10 @@ static void init_srv_sess_info_1(SRV_SESS_INFO_1 *ss1, uint32 *snum, uint32 *sto makes a SRV_R_NET_SESS_ENUM structure. ********************************************************************/ -static uint32 init_srv_sess_info_ctr(SRV_SESS_INFO_CTR *ctr, +static NTSTATUS init_srv_sess_info_ctr(SRV_SESS_INFO_CTR *ctr, int switch_value, uint32 *resume_hnd, uint32 *total_entries) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; DEBUG(5,("init_srv_sess_info_ctr: %d\n", __LINE__)); ctr->switch_value = switch_value; @@ -739,7 +740,7 @@ static void init_srv_r_net_sess_enum(SRV_R_NET_SESS_ENUM *r_n, else r_n->status = init_srv_sess_info_ctr(r_n->ctr, switch_value, &resume_hnd, &r_n->total_entries); - if (r_n->status != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(r_n->status)) resume_hnd = 0; init_enum_hnd(&r_n->enum_hnd, resume_hnd); @@ -850,10 +851,10 @@ static void init_srv_conn_info_1(SRV_CONN_INFO_1 *ss1, uint32 *snum, uint32 *sto makes a SRV_R_NET_CONN_ENUM structure. ********************************************************************/ -static uint32 init_srv_conn_info_ctr(SRV_CONN_INFO_CTR *ctr, +static NTSTATUS init_srv_conn_info_ctr(SRV_CONN_INFO_CTR *ctr, int switch_value, uint32 *resume_hnd, uint32 *total_entries) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; DEBUG(5,("init_srv_conn_info_ctr: %d\n", __LINE__)); ctr->switch_value = switch_value; @@ -894,7 +895,7 @@ static void init_srv_r_net_conn_enum(SRV_R_NET_CONN_ENUM *r_n, else r_n->status = init_srv_conn_info_ctr(r_n->ctr, switch_value, &resume_hnd, &r_n->total_entries); - if (r_n->status != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(r_n->status)) resume_hnd = 0; init_enum_hnd(&r_n->enum_hnd, resume_hnd); @@ -950,10 +951,10 @@ static void init_srv_file_info_3(SRV_FILE_INFO_3 *fl3, uint32 *fnum, uint32 *fto makes a SRV_R_NET_FILE_ENUM structure. ********************************************************************/ -static uint32 init_srv_file_info_ctr(SRV_FILE_INFO_CTR *ctr, +static NTSTATUS init_srv_file_info_ctr(SRV_FILE_INFO_CTR *ctr, int switch_value, uint32 *resume_hnd, uint32 *total_entries) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; DEBUG(5,("init_srv_file_info_ctr: %d\n", __LINE__)); ctr->switch_value = switch_value; @@ -990,7 +991,7 @@ static void init_srv_r_net_file_enum(SRV_R_NET_FILE_ENUM *r_n, else r_n->status = init_srv_file_info_ctr(r_n->ctr, switch_value, &resume_hnd, &(r_n->total_entries)); - if (r_n->status != NT_STATUS_NOPROBLEMO) + if (NT_STATUS_IS_ERR(r_n->status)) resume_hnd = 0; init_enum_hnd(&r_n->enum_hnd, resume_hnd); @@ -1000,9 +1001,9 @@ static void init_srv_r_net_file_enum(SRV_R_NET_FILE_ENUM *r_n, net server get info ********************************************************************/ -uint32 _srv_net_srv_get_info(pipes_struct *p, SRV_Q_NET_SRV_GET_INFO *q_u, SRV_R_NET_SRV_GET_INFO *r_u) +NTSTATUS _srv_net_srv_get_info(pipes_struct *p, SRV_Q_NET_SRV_GET_INFO *q_u, SRV_R_NET_SRV_GET_INFO *r_u) { - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; SRV_INFO_CTR *ctr = (SRV_INFO_CTR *)talloc(p->mem_ctx, sizeof(SRV_INFO_CTR)); if (!ctr) @@ -1054,12 +1055,12 @@ uint32 _srv_net_srv_get_info(pipes_struct *p, SRV_Q_NET_SRV_GET_INFO *q_u, SRV_R net server set info ********************************************************************/ -uint32 _srv_net_srv_set_info(pipes_struct *p, SRV_Q_NET_SRV_SET_INFO *q_u, SRV_R_NET_SRV_SET_INFO *r_u) +NTSTATUS _srv_net_srv_set_info(pipes_struct *p, SRV_Q_NET_SRV_SET_INFO *q_u, SRV_R_NET_SRV_SET_INFO *r_u) { /* NT gives "Windows NT error 0xc00000022" if we return NT_STATUS_ACCESS_DENIED here so just pretend everything is OK. */ - uint32 status = NT_STATUS_NOPROBLEMO; + NTSTATUS status = NT_STATUS_OK; DEBUG(5,("srv_net_srv_set_info: %d\n", __LINE__)); @@ -1076,7 +1077,7 @@ uint32 _srv_net_srv_set_info(pipes_struct *p, SRV_Q_NET_SRV_SET_INFO *q_u, SRV_R net file enum ********************************************************************/ -uint32 _srv_net_file_enum(pipes_struct *p, SRV_Q_NET_FILE_ENUM *q_u, SRV_R_NET_FILE_ENUM *r_u) +NTSTATUS _srv_net_file_enum(pipes_struct *p, SRV_Q_NET_FILE_ENUM *q_u, SRV_R_NET_FILE_ENUM *r_u) { r_u->ctr = (SRV_FILE_INFO_CTR *)talloc(p->mem_ctx, sizeof(SRV_FILE_INFO_CTR)); if (!r_u->ctr) @@ -1101,7 +1102,7 @@ uint32 _srv_net_file_enum(pipes_struct *p, SRV_Q_NET_FILE_ENUM *q_u, SRV_R_NET_F net conn enum ********************************************************************/ -uint32 _srv_net_conn_enum(pipes_struct *p, SRV_Q_NET_CONN_ENUM *q_u, SRV_R_NET_CONN_ENUM *r_u) +NTSTATUS _srv_net_conn_enum(pipes_struct *p, SRV_Q_NET_CONN_ENUM *q_u, SRV_R_NET_CONN_ENUM *r_u) { DEBUG(5,("srv_net_conn_enum: %d\n", __LINE__)); @@ -1126,7 +1127,7 @@ uint32 _srv_net_conn_enum(pipes_struct *p, SRV_Q_NET_CONN_ENUM *q_u, SRV_R_NET_C net sess enum ********************************************************************/ -uint32 _srv_net_sess_enum(pipes_struct *p, SRV_Q_NET_SESS_ENUM *q_u, SRV_R_NET_SESS_ENUM *r_u) +NTSTATUS _srv_net_sess_enum(pipes_struct *p, SRV_Q_NET_SESS_ENUM *q_u, SRV_R_NET_SESS_ENUM *r_u) { DEBUG(5,("_srv_net_sess_enum: %d\n", __LINE__)); @@ -1151,7 +1152,7 @@ uint32 _srv_net_sess_enum(pipes_struct *p, SRV_Q_NET_SESS_ENUM *q_u, SRV_R_NET_S Net share enum all. ********************************************************************/ -uint32 _srv_net_share_enum_all(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R_NET_SHARE_ENUM *r_u) +NTSTATUS _srv_net_share_enum_all(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R_NET_SHARE_ENUM *r_u) { DEBUG(5,("_srv_net_share_enum: %d\n", __LINE__)); @@ -1169,7 +1170,7 @@ uint32 _srv_net_share_enum_all(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R Net share enum. ********************************************************************/ -uint32 _srv_net_share_enum(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R_NET_SHARE_ENUM *r_u) +NTSTATUS _srv_net_share_enum(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R_NET_SHARE_ENUM *r_u) { DEBUG(5,("_srv_net_share_enum: %d\n", __LINE__)); @@ -1187,7 +1188,7 @@ uint32 _srv_net_share_enum(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R_NET Net share get info. ********************************************************************/ -uint32 _srv_net_share_get_info(pipes_struct *p, SRV_Q_NET_SHARE_GET_INFO *q_u, SRV_R_NET_SHARE_GET_INFO *r_u) +NTSTATUS _srv_net_share_get_info(pipes_struct *p, SRV_Q_NET_SHARE_GET_INFO *q_u, SRV_R_NET_SHARE_GET_INFO *r_u) { fstring share_name; @@ -1247,7 +1248,7 @@ static char *valid_share_pathname(char *dos_pathname) Net share set info. Modify share details. ********************************************************************/ -uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, SRV_R_NET_SHARE_SET_INFO *r_u) +NTSTATUS _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, SRV_R_NET_SHARE_SET_INFO *r_u) { struct current_user user; pstring command; @@ -1267,27 +1268,27 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S r_u->switch_value = 0; if (strequal(share_name,"IPC$") || strequal(share_name,"ADMIN$") || strequal(share_name,"global")) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; snum = find_service(share_name); /* Does this share exist ? */ if (snum < 0) - return ERRnosuchshare; + return NT_STATUS_BAD_NETWORK_NAME; /* No change to printer shares. */ if (lp_print_ok(snum)) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; get_current_user(&user,p); if (user.uid != 0) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; switch (q_u->info_level) { case 1: /* Not enough info in a level 1 to do anything. */ - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; case 2: unistr2_to_ascii(comment, &q_u->info.share.info2.info_2_str.uni_remark, sizeof(share_name)); unistr2_to_ascii(pathname, &q_u->info.share.info2.info_2_str.uni_path, sizeof(share_name)); @@ -1302,7 +1303,7 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S map_generic_share_sd_bits(psd); break; case 1005: - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; case 1501: fstrcpy(pathname, lp_pathname(snum)); fstrcpy(comment, lp_comment(snum)); @@ -1317,11 +1318,11 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S /* We can only modify disk shares. */ if (type != STYPE_DISKTREE) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; /* Check if the pathname is valid. */ if (!(ptr = valid_share_pathname( pathname ))) - return ERRbadpath; + return NT_STATUS_OBJECT_PATH_INVALID; /* Ensure share name, pathname and comment don't contain '"' characters. */ string_replace(share_name, '"', ' '); @@ -1335,7 +1336,7 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S if (strcmp(ptr, lp_pathname(snum)) || strcmp(comment, lp_comment(snum)) ) { if (!lp_change_share_cmd() || !*lp_change_share_cmd()) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; slprintf(command, sizeof(command)-1, "%s \"%s\" \"%s\" \"%s\" \"%s\"", lp_change_share_cmd(), CONFIGFILE, share_name, ptr, comment); @@ -1343,7 +1344,7 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S DEBUG(10,("_srv_net_share_set_info: Running [%s]\n", command )); if ((ret = smbrun(command, NULL)) != 0) { DEBUG(0,("_srv_net_share_set_info: Running [%s] returned (%d)\n", command, ret )); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } /* Tell everyone we updated smb.conf. */ @@ -1369,14 +1370,14 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S DEBUG(5,("_srv_net_share_set_info: %d\n", __LINE__)); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* Net share add. Call 'add_share_command "sharename" "pathname" "comment" "read only = xxx"' ********************************************************************/ -uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_SHARE_ADD *r_u) +NTSTATUS _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_SHARE_ADD *r_u) { struct current_user user; pstring command; @@ -1397,18 +1398,18 @@ uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S if (user.uid != 0) { DEBUG(10,("_srv_net_share_add: uid != 0. Access denied.\n")); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } if (!lp_add_share_cmd() || !*lp_add_share_cmd()) { DEBUG(10,("_srv_net_share_add: No add share command\n")); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } switch (q_u->info_level) { case 1: /* Not enough info in a level 1 to do anything. */ - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; case 2: unistr2_to_ascii(share_name, &q_u->info.share.info2.info_2_str.uni_netname, sizeof(share_name)); unistr2_to_ascii(comment, &q_u->info.share.info2.info_2_str.uni_remark, sizeof(share_name)); @@ -1425,28 +1426,28 @@ uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S break; case 1005: /* DFS only level. */ - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; default: DEBUG(5,("_srv_net_share_add: unsupported switch value %d\n", q_u->info_level)); return NT_STATUS_INVALID_INFO_CLASS; } if (strequal(share_name,"IPC$") || strequal(share_name,"ADMIN$") || strequal(share_name,"global")) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; snum = find_service(share_name); /* Share already exists. */ if (snum >= 0) - return ERRfilexists; + return NT_STATUS_OBJECT_NAME_COLLISION; /* We can only add disk shares. */ if (type != STYPE_DISKTREE) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; /* Check if the pathname is valid. */ if (!(ptr = valid_share_pathname( pathname ))) - return ERRbadpath; + return NT_STATUS_OBJECT_PATH_INVALID; /* Ensure share name, pathname and comment don't contain '"' characters. */ string_replace(share_name, '"', ' '); @@ -1459,7 +1460,7 @@ uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S DEBUG(10,("_srv_net_share_add: Running [%s]\n", command )); if ((ret = smbrun(command, NULL)) != 0) { DEBUG(0,("_srv_net_share_add: Running [%s] returned (%d)\n", command, ret )); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } if (psd) { @@ -1479,7 +1480,7 @@ uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S DEBUG(5,("_srv_net_share_add: %d\n", __LINE__)); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* @@ -1487,7 +1488,7 @@ uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S a parameter. ********************************************************************/ -uint32 _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_SHARE_DEL *r_u) +NTSTATUS _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_SHARE_DEL *r_u) { struct current_user user; pstring command; @@ -1500,24 +1501,24 @@ uint32 _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S unistr2_to_ascii(share_name, &q_u->uni_share_name, sizeof(share_name)); if (strequal(share_name,"IPC$") || strequal(share_name,"ADMIN$") || strequal(share_name,"global")) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; snum = find_service(share_name); if (snum < 0) - return ERRnosuchshare; + return NT_STATUS_BAD_NETWORK_NAME; /* No change to printer shares. */ if (lp_print_ok(snum)) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; get_current_user(&user,p); if (user.uid != 0) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; if (!lp_delete_share_cmd() || !*lp_delete_share_cmd()) - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; slprintf(command, sizeof(command)-1, "%s \"%s\" \"%s\"", lp_delete_share_cmd(), CONFIGFILE, lp_servicename(snum)); @@ -1525,7 +1526,7 @@ uint32 _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S DEBUG(10,("_srv_net_share_del: Running [%s]\n", command )); if ((ret = smbrun(command, NULL)) != 0) { DEBUG(0,("_srv_net_share_del: Running [%s] returned (%d)\n", command, ret )); - return ERRnoaccess; + return NT_STATUS_ACCESS_DENIED; } /* Delete the SD in the database. */ @@ -1536,14 +1537,14 @@ uint32 _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S lp_killservice(snum); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /******************************************************************* time of day ********************************************************************/ -uint32 _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET_REMOTE_TOD *r_u) +NTSTATUS _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET_REMOTE_TOD *r_u) { TIME_OF_DAY_INFO *tod; struct tm *t; @@ -1557,7 +1558,7 @@ uint32 _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET r_u->tod = tod; r_u->ptr_srv_tod = 0x1; - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; DEBUG(5,("_srv_net_remote_tod: %d\n", __LINE__)); @@ -1587,7 +1588,7 @@ uint32 _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET Win9x NT tools get security descriptor. ***********************************************************************************/ -uint32 _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC *q_u, +NTSTATUS _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC *q_u, SRV_R_NET_FILE_QUERY_SECDESC *r_u) { SEC_DESC *psd = NULL; @@ -1600,14 +1601,14 @@ uint32 _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC BOOL bad_path; int access_mode; int action; - int ecode; + NTSTATUS ecode; struct current_user user; fstring user_name; connection_struct *conn = NULL; ZERO_STRUCT(st); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; unistr2_to_ascii(qualname, &q_u->uni_qual_name, sizeof(qualname)); @@ -1621,7 +1622,7 @@ uint32 _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC if (conn == NULL) { DEBUG(3,("_srv_net_file_query_secdesc: Unable to connect to %s\n", qualname)); - r_u->status = (uint32)ecode; + r_u->status = ecode; goto error_exit; } @@ -1638,7 +1639,7 @@ uint32 _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC if (!fsp) { DEBUG(3,("_srv_net_file_query_secdesc: Unable to open file %s\n", filename)); - r_u->status = ERRnoaccess; + r_u->status = NT_STATUS_ACCESS_DENIED; goto error_exit; } } @@ -1647,7 +1648,7 @@ uint32 _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC if (sd_size == 0) { DEBUG(3,("_srv_net_file_query_secdesc: Unable to get NT ACL for file %s\n", filename)); - r_u->status = ERRnoaccess; + r_u->status = NT_STATUS_ACCESS_DENIED; goto error_exit; } @@ -1680,7 +1681,7 @@ uint32 _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC Win9x NT tools set security descriptor. ***********************************************************************************/ -uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_u, +NTSTATUS _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_u, SRV_R_NET_FILE_SET_SECDESC *r_u) { BOOL ret; @@ -1692,7 +1693,7 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ BOOL bad_path; int access_mode; int action; - int ecode; + NTSTATUS ecode; struct current_user user; fstring user_name; connection_struct *conn = NULL; @@ -1700,7 +1701,7 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ ZERO_STRUCT(st); - r_u->status = NT_STATUS_NOPROBLEMO; + r_u->status = NT_STATUS_OK; unistr2_to_ascii(qualname, &q_u->uni_qual_name, sizeof(qualname)); @@ -1714,13 +1715,13 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ if (conn == NULL) { DEBUG(3,("_srv_net_file_set_secdesc: Unable to connect to %s\n", qualname)); - r_u->status = (uint32)ecode; + r_u->status = ecode; goto error_exit; } if (!become_user(conn, conn->vuid)) { DEBUG(0,("_srv_net_file_set_secdesc: Can't become connected user!\n")); - r_u->status = ERRnoaccess; + r_u->status = NT_STATUS_ACCESS_DENIED; goto error_exit; } became_user = True; @@ -1739,7 +1740,7 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ if (!fsp) { DEBUG(3,("_srv_net_file_set_secdesc: Unable to open file %s\n", filename)); - r_u->status = ERRnoaccess; + r_u->status = NT_STATUS_ACCESS_DENIED; goto error_exit; } } @@ -1748,7 +1749,7 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ if (ret == False) { DEBUG(3,("_srv_net_file_set_secdesc: Unable to set NT ACL on file %s\n", filename)); - r_u->status = ERRnoaccess; + r_u->status = NT_STATUS_ACCESS_DENIED; goto error_exit; } @@ -1818,13 +1819,13 @@ static const char *next_server_disk_enum(uint32 *resume) return disk; } -uint32 _srv_net_disk_enum(pipes_struct *p, SRV_Q_NET_DISK_ENUM *q_u, SRV_R_NET_DISK_ENUM *r_u) +NTSTATUS _srv_net_disk_enum(pipes_struct *p, SRV_Q_NET_DISK_ENUM *q_u, SRV_R_NET_DISK_ENUM *r_u) { uint32 i; const char *disk_name; uint32 resume=get_enum_hnd(&q_u->enum_hnd); - r_u->status=NT_STATUS_NOPROBLEMO; + r_u->status=NT_STATUS_OK; r_u->total_entries = init_server_disk_enum(&resume); @@ -1854,12 +1855,12 @@ uint32 _srv_net_disk_enum(pipes_struct *p, SRV_Q_NET_DISK_ENUM *q_u, SRV_R_NET_D return r_u->status; } -uint32 _srv_net_name_validate(pipes_struct *p, SRV_Q_NET_NAME_VALIDATE *q_u, SRV_R_NET_NAME_VALIDATE *r_u) +NTSTATUS _srv_net_name_validate(pipes_struct *p, SRV_Q_NET_NAME_VALIDATE *q_u, SRV_R_NET_NAME_VALIDATE *r_u) { int snum; fstring share_name; - r_u->status=NT_STATUS_NOPROBLEMO; + r_u->status=NT_STATUS_OK; switch(q_u->type) { @@ -1878,7 +1879,7 @@ uint32 _srv_net_name_validate(pipes_struct *p, SRV_Q_NET_NAME_VALIDATE *q_u, SRV default: /*unsupported type*/ - r_u->status = ERRunknownlevel; + r_u->status = NT_STATUS_INVALID_LEVEL; break; } diff --git a/source3/rpc_server/srv_util.c b/source3/rpc_server/srv_util.c index f9e02b9bca0..5393523a789 100644 --- a/source3/rpc_server/srv_util.c +++ b/source3/rpc_server/srv_util.c @@ -190,7 +190,7 @@ void get_domain_user_groups(char *domain_groups, char *user) /******************************************************************* Look up a local (domain) rid and return a name and type. ********************************************************************/ -uint32 local_lookup_group_name(uint32 rid, char *group_name, uint32 *type) +NTSTATUS local_lookup_group_name(uint32 rid, char *group_name, uint32 *type) { int i = 0; (*type) = SID_NAME_DOM_GRP; @@ -206,7 +206,7 @@ uint32 local_lookup_group_name(uint32 rid, char *group_name, uint32 *type) { fstrcpy(group_name, domain_group_rids[i].name); DEBUG(5,(" = %s\n", group_name)); - return 0x0; + return NT_STATUS_OK; } DEBUG(5,(" none mapped\n")); @@ -216,7 +216,7 @@ uint32 local_lookup_group_name(uint32 rid, char *group_name, uint32 *type) /******************************************************************* Look up a local alias rid and return a name and type. ********************************************************************/ -uint32 local_lookup_alias_name(uint32 rid, char *alias_name, uint32 *type) +NTSTATUS local_lookup_alias_name(uint32 rid, char *alias_name, uint32 *type) { int i = 0; (*type) = SID_NAME_WKN_GRP; @@ -232,7 +232,7 @@ uint32 local_lookup_alias_name(uint32 rid, char *alias_name, uint32 *type) { fstrcpy(alias_name, builtin_alias_rids[i].name); DEBUG(5,(" = %s\n", alias_name)); - return 0x0; + return NT_STATUS_OK; } DEBUG(5,(" none mapped\n")); @@ -242,7 +242,7 @@ uint32 local_lookup_alias_name(uint32 rid, char *alias_name, uint32 *type) /******************************************************************* Look up a local user rid and return a name and type. ********************************************************************/ -uint32 local_lookup_user_name(uint32 rid, char *user_name, uint32 *type) +NTSTATUS local_lookup_user_name(uint32 rid, char *user_name, uint32 *type) { SAM_ACCOUNT *sampwd=NULL; int i = 0; @@ -261,7 +261,7 @@ uint32 local_lookup_user_name(uint32 rid, char *user_name, uint32 *type) if (domain_user_rids[i].rid != 0) { fstrcpy(user_name, domain_user_rids[i].name); DEBUG(5,(" = %s\n", user_name)); - return 0x0; + return NT_STATUS_OK; } pdb_init_sam(&sampwd); @@ -275,7 +275,7 @@ uint32 local_lookup_user_name(uint32 rid, char *user_name, uint32 *type) fstrcpy(user_name, pdb_get_username(sampwd) ); DEBUG(5,(" = %s\n", user_name)); pdb_free_sam(sampwd); - return 0x0; + return NT_STATUS_OK; } DEBUG(5,(" none mapped\n")); @@ -286,7 +286,7 @@ uint32 local_lookup_user_name(uint32 rid, char *user_name, uint32 *type) /******************************************************************* Look up a local (domain) group name and return a rid ********************************************************************/ -uint32 local_lookup_group_rid(char *group_name, uint32 *rid) +NTSTATUS local_lookup_group_rid(char *group_name, uint32 *rid) { char *grp_name; int i = -1; /* start do loop at -1 */ @@ -299,13 +299,13 @@ uint32 local_lookup_group_rid(char *group_name, uint32 *rid) } while (grp_name != NULL && !strequal(grp_name, group_name)); - return (grp_name != NULL) ? 0 : NT_STATUS_NONE_MAPPED; + return (grp_name != NULL) ? NT_STATUS_OK : NT_STATUS_NONE_MAPPED; } /******************************************************************* Look up a local (BUILTIN) alias name and return a rid ********************************************************************/ -uint32 local_lookup_alias_rid(char *alias_name, uint32 *rid) +NTSTATUS local_lookup_alias_rid(char *alias_name, uint32 *rid) { char *als_name; int i = -1; /* start do loop at -1 */ @@ -318,13 +318,13 @@ uint32 local_lookup_alias_rid(char *alias_name, uint32 *rid) } while (als_name != NULL && !strequal(als_name, alias_name)); - return (als_name != NULL) ? 0 : NT_STATUS_NONE_MAPPED; + return (als_name != NULL) ? NT_STATUS_OK : NT_STATUS_NONE_MAPPED; } /******************************************************************* Look up a local user name and return a rid ********************************************************************/ -uint32 local_lookup_user_rid(char *user_name, uint32 *rid) +NTSTATUS local_lookup_user_rid(char *user_name, uint32 *rid) { SAM_ACCOUNT *sampass=NULL; BOOL ret; @@ -341,7 +341,7 @@ uint32 local_lookup_user_rid(char *user_name, uint32 *rid) if (ret == True) { (*rid) = pdb_get_user_rid(sampass); pdb_free_sam(sampass); - return 0x0; + return NT_STATUS_OK; } pdb_free_sam(sampass); diff --git a/source3/rpc_server/srv_wkssvc_nt.c b/source3/rpc_server/srv_wkssvc_nt.c index 47566bbf3e2..4bbc0e237ff 100644 --- a/source3/rpc_server/srv_wkssvc_nt.c +++ b/source3/rpc_server/srv_wkssvc_nt.c @@ -60,7 +60,7 @@ static void create_wks_info_100(WKS_INFO_100 *inf) ********************************************************************/ -uint32 _wks_query_info(pipes_struct *p, WKS_Q_QUERY_INFO *q_u, WKS_R_QUERY_INFO *r_u) +NTSTATUS _wks_query_info(pipes_struct *p, WKS_Q_QUERY_INFO *q_u, WKS_R_QUERY_INFO *r_u) { WKS_INFO_100 *wks100 = NULL; @@ -72,7 +72,7 @@ uint32 _wks_query_info(pipes_struct *p, WKS_Q_QUERY_INFO *q_u, WKS_R_QUERY_INFO return NT_STATUS_NO_MEMORY; create_wks_info_100(wks100); - init_wks_r_query_info(r_u, q_u->switch_value, wks100, NT_STATUS_NOPROBLEMO); + init_wks_r_query_info(r_u, q_u->switch_value, wks100, NT_STATUS_OK); DEBUG(5,("_wks_query_info: %d\n", __LINE__)); diff --git a/source3/rpcclient/cmd_dfs.c b/source3/rpcclient/cmd_dfs.c index 8059f42f2ff..2b47028745f 100644 --- a/source3/rpcclient/cmd_dfs.c +++ b/source3/rpcclient/cmd_dfs.c @@ -53,7 +53,7 @@ static uint32 cmd_dfs_exist(struct cli_state *cli, int argc, char **argv) result = cli_dfs_exist(cli, mem_ctx, &dfs_exists); - if (result == NT_STATUS_NOPROBLEMO) + if (result == NT_STATUS_OK) printf("dfs is %spresent\n", dfs_exists ? "" : "not "); cli_nt_session_close(cli); @@ -252,7 +252,7 @@ static uint32 cmd_dfs_enum(struct cli_state *cli, int argc, char **argv) /* Call RPC function */ if ((result = cli_dfs_enum(cli, mem_ctx, info_level, &ctr)) - == NT_STATUS_NOPROBLEMO) { + == NT_STATUS_OK) { /* Print results */ display_dfs_info_ctr(&ctr); @@ -302,7 +302,7 @@ static uint32 cmd_dfs_getinfo(struct cli_state *cli, int argc, char **argv) if ((result = cli_dfs_get_info(cli, mem_ctx, entrypath, servername, sharename, info_level, &ctr)) - == NT_STATUS_NOPROBLEMO) { + == NT_STATUS_OK) { /* Print results */ diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index a34650b8079..3d14a66cfe8 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -59,7 +59,7 @@ static uint32 cmd_lsa_query_info_policy(struct cli_state *cli, int argc, char ** if ((result = cli_lsa_open_policy(cli, mem_ctx, True, SEC_RIGHTS_MAXIMUM_ALLOWED, - &pol)) != NT_STATUS_NOPROBLEMO) { + &pol)) != NT_STATUS_OK) { goto done; } @@ -69,7 +69,7 @@ static uint32 cmd_lsa_query_info_policy(struct cli_state *cli, int argc, char ** if ((result = cli_lsa_query_info_policy(cli, mem_ctx, &pol, info_class, domain_name, &dom_sid)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -125,7 +125,7 @@ static uint32 cmd_lsa_lookup_names(struct cli_state *cli, int argc, char **argv) if ((result = cli_lsa_open_policy(cli, mem_ctx, True, SEC_RIGHTS_MAXIMUM_ALLOWED, - &pol)) != NT_STATUS_NOPROBLEMO) { + &pol)) != NT_STATUS_OK) { goto done; } @@ -135,7 +135,7 @@ static uint32 cmd_lsa_lookup_names(struct cli_state *cli, int argc, char **argv) if ((result = cli_lsa_lookup_names(cli, mem_ctx, &pol, argc - 1, &argv[1], &sids, &types, &num_names) != - NT_STATUS_NOPROBLEMO)) { + NT_STATUS_OK)) { goto done; } @@ -193,7 +193,7 @@ static uint32 cmd_lsa_lookup_sids(struct cli_state *cli, int argc, char **argv) if ((result = cli_lsa_open_policy(cli, mem_ctx, True, SEC_RIGHTS_MAXIMUM_ALLOWED, - &pol)) != NT_STATUS_NOPROBLEMO) { + &pol)) != NT_STATUS_OK) { goto done; } @@ -216,7 +216,7 @@ static uint32 cmd_lsa_lookup_sids(struct cli_state *cli, int argc, char **argv) if ((result = cli_lsa_lookup_sids(cli, mem_ctx, &pol, argc - 1, sids, &names, &types, &num_names) != - NT_STATUS_NOPROBLEMO)) { + NT_STATUS_OK)) { goto done; } @@ -286,7 +286,7 @@ static uint32 cmd_lsa_enum_trust_dom(struct cli_state *cli, int argc, char **arg if ((result = cli_lsa_open_policy(cli, mem_ctx, True, SEC_RIGHTS_MAXIMUM_ALLOWED, - &pol)) != NT_STATUS_NOPROBLEMO) { + &pol)) != NT_STATUS_OK) { goto done; } @@ -297,7 +297,7 @@ static uint32 cmd_lsa_enum_trust_dom(struct cli_state *cli, int argc, char **arg if ((result = cli_lsa_enum_trust_dom(cli, mem_ctx, &pol, &enum_ctx, &num_domains, &domain_names, &domain_sids) - != NT_STATUS_NOPROBLEMO)) { + != NT_STATUS_OK)) { goto done; } diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index 549e21e25e1..410fd7fb0a3 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -49,7 +49,7 @@ static uint32 cmd_netlogon_logon_ctrl2(struct cli_state *cli, int argc, } if ((result = cli_netlogon_logon_ctrl2(cli, mem_ctx, query_level)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -87,7 +87,7 @@ static uint32 cmd_netlogon_logon_ctrl(struct cli_state *cli, int argc, #if 0 if ((result = cli_netlogon_logon_ctrl(cli, mem_ctx, query_level)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } #endif diff --git a/source3/rpcclient/cmd_reg.c b/source3/rpcclient/cmd_reg.c index 41814fd41e2..180e334fe95 100644 --- a/source3/rpcclient/cmd_reg.c +++ b/source3/rpcclient/cmd_reg.c @@ -973,7 +973,7 @@ static uint32 cmd_reg_shutdown(struct cli_state *cli, int argc, char **argv) /* create an entry */ result = cli_reg_shutdown(cli, mem_ctx, srv_name, msg, timeout, flgs); - if (result == NT_STATUS_NOPROBLEMO) + if (result == NT_STATUS_OK) DEBUG(5,("cmd_reg_shutdown: query succeeded\n")); else DEBUG(5,("cmd_reg_shutdown: query failed\n")); @@ -1017,7 +1017,7 @@ static uint32 cmd_reg_abort_shutdown(struct cli_state *cli, int argc, char **arg result = cli_reg_abort_shutdown(cli, mem_ctx, srv_name); - if (result == NT_STATUS_NOPROBLEMO) + if (result == NT_STATUS_OK) DEBUG(5,("cmd_reg_abort_shutdown: query succeeded\n")); else DEBUG(5,("cmd_reg_abort_shutdown: query failed\n")); diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index 6e8aa23a085..fb0916b4a5d 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -179,7 +179,7 @@ static uint32 cmd_samr_query_user(struct cli_state *cli, int argc, char **argv) if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) != - NT_STATUS_NOPROBLEMO) { + NT_STATUS_OK) { goto done; } @@ -188,7 +188,7 @@ static uint32 cmd_samr_query_user(struct cli_state *cli, int argc, char **argv) if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -197,7 +197,7 @@ static uint32 cmd_samr_query_user(struct cli_state *cli, int argc, char **argv) if ((result = cli_samr_open_user(cli, mem_ctx, &domain_pol, MAXIMUM_ALLOWED_ACCESS, user_rid, &user_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -207,7 +207,7 @@ static uint32 cmd_samr_query_user(struct cli_state *cli, int argc, char **argv) if ((result = cli_samr_query_userinfo(cli, mem_ctx, &user_pol, info_level, &user_ctr)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -307,7 +307,7 @@ static uint32 cmd_samr_query_group(struct cli_state *cli, int argc, char **argv) if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) != - NT_STATUS_NOPROBLEMO) { + NT_STATUS_OK) { goto done; } @@ -316,7 +316,7 @@ static uint32 cmd_samr_query_group(struct cli_state *cli, int argc, char **argv) if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -325,7 +325,7 @@ static uint32 cmd_samr_query_group(struct cli_state *cli, int argc, char **argv) if ((result = cli_samr_open_group(cli, mem_ctx, &domain_pol, MAXIMUM_ALLOWED_ACCESS, group_rid, &group_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -335,7 +335,7 @@ static uint32 cmd_samr_query_group(struct cli_state *cli, int argc, char **argv) if ((result = cli_samr_query_groupinfo(cli, mem_ctx, &group_pol, info_level, &group_ctr)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -397,7 +397,7 @@ static uint32 cmd_samr_query_usergroups(struct cli_state *cli, int argc, char ** if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) != - NT_STATUS_NOPROBLEMO) { + NT_STATUS_OK) { goto done; } @@ -406,7 +406,7 @@ static uint32 cmd_samr_query_usergroups(struct cli_state *cli, int argc, char ** if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -415,7 +415,7 @@ static uint32 cmd_samr_query_usergroups(struct cli_state *cli, int argc, char ** if ((result = cli_samr_open_user(cli, mem_ctx, &domain_pol, MAXIMUM_ALLOWED_ACCESS, user_rid, &user_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -423,7 +423,7 @@ static uint32 cmd_samr_query_usergroups(struct cli_state *cli, int argc, char ** if ((result = cli_samr_query_usergroups(cli, mem_ctx, &user_pol, &num_groups, &user_gids)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -484,7 +484,7 @@ static uint32 cmd_samr_query_groupmem(struct cli_state *cli, int argc, char **ar if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) != - NT_STATUS_NOPROBLEMO) { + NT_STATUS_OK) { goto done; } @@ -493,7 +493,7 @@ static uint32 cmd_samr_query_groupmem(struct cli_state *cli, int argc, char **ar if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -502,7 +502,7 @@ static uint32 cmd_samr_query_groupmem(struct cli_state *cli, int argc, char **ar if ((result = cli_samr_open_group(cli, mem_ctx, &domain_pol, MAXIMUM_ALLOWED_ACCESS, group_rid, &group_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -511,7 +511,7 @@ static uint32 cmd_samr_query_groupmem(struct cli_state *cli, int argc, char **ar if ((result = cli_samr_query_groupmem(cli, mem_ctx, &group_pol, &num_members, &group_rids, &group_attrs)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -568,7 +568,7 @@ static uint32 cmd_samr_enum_dom_groups(struct cli_state *cli, int argc, if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) != - NT_STATUS_NOPROBLEMO) { + NT_STATUS_OK) { goto done; } @@ -579,7 +579,7 @@ static uint32 cmd_samr_enum_dom_groups(struct cli_state *cli, int argc, if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -647,7 +647,7 @@ static uint32 cmd_samr_query_aliasmem(struct cli_state *cli, int argc, if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) != - NT_STATUS_NOPROBLEMO) { + NT_STATUS_OK) { goto done; } @@ -658,7 +658,7 @@ static uint32 cmd_samr_query_aliasmem(struct cli_state *cli, int argc, if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -669,7 +669,7 @@ static uint32 cmd_samr_query_aliasmem(struct cli_state *cli, int argc, if ((result = cli_samr_open_alias(cli, mem_ctx, &domain_pol, MAXIMUM_ALLOWED_ACCESS, alias_rid, &alias_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -677,7 +677,7 @@ static uint32 cmd_samr_query_aliasmem(struct cli_state *cli, int argc, if ((result = cli_samr_query_aliasmem(cli, mem_ctx, &alias_pol, &num_members, &alias_sids)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -738,7 +738,7 @@ static uint32 cmd_samr_query_dispinfo(struct cli_state *cli, int argc, if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -749,7 +749,7 @@ static uint32 cmd_samr_query_dispinfo(struct cli_state *cli, int argc, if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -824,7 +824,7 @@ static uint32 cmd_samr_query_dominfo(struct cli_state *cli, int argc, if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -835,7 +835,7 @@ static uint32 cmd_samr_query_dominfo(struct cli_state *cli, int argc, if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -845,7 +845,7 @@ static uint32 cmd_samr_query_dominfo(struct cli_state *cli, int argc, if ((result = cli_samr_query_dom_info(cli, mem_ctx, &domain_pol, switch_value, &ctr)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -912,7 +912,7 @@ static uint32 cmd_samr_create_dom_user(struct cli_state *cli, int argc, if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -923,7 +923,7 @@ static uint32 cmd_samr_create_dom_user(struct cli_state *cli, int argc, if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -937,7 +937,7 @@ static uint32 cmd_samr_create_dom_user(struct cli_state *cli, int argc, if ((result = cli_samr_create_dom_user(cli, mem_ctx, &domain_pol, acct_name, acb_info, unknown, &user_pol, &user_rid)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -992,7 +992,7 @@ static uint32 cmd_samr_lookup_names(struct cli_state *cli, int argc, if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -1001,7 +1001,7 @@ static uint32 cmd_samr_lookup_names(struct cli_state *cli, int argc, if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -1018,7 +1018,7 @@ static uint32 cmd_samr_lookup_names(struct cli_state *cli, int argc, if ((result = cli_samr_lookup_names(cli, mem_ctx, &domain_pol, flags, num_names, names, &num_rids, &rids, &name_types)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -1076,7 +1076,7 @@ static uint32 cmd_samr_lookup_rids(struct cli_state *cli, int argc, if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -1085,7 +1085,7 @@ static uint32 cmd_samr_lookup_rids(struct cli_state *cli, int argc, if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -1102,7 +1102,7 @@ static uint32 cmd_samr_lookup_rids(struct cli_state *cli, int argc, if ((result = cli_samr_lookup_rids(cli, mem_ctx, &domain_pol, flags, num_rids, rids, &num_names, &names, &name_types)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -1154,14 +1154,14 @@ static uint32 cmd_samr_delete_dom_user(struct cli_state *cli, int argc, if ((result = cli_samr_connect(cli, mem_ctx, MAXIMUM_ALLOWED_ACCESS, &connect_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } if ((result = cli_samr_open_domain(cli, mem_ctx, &connect_pol, MAXIMUM_ALLOWED_ACCESS, &domain_sid, &domain_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -1175,14 +1175,14 @@ static uint32 cmd_samr_delete_dom_user(struct cli_state *cli, int argc, flags, 1, &argv[1], &num_rids, &user_rids, &name_types)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } if ((result = cli_samr_open_user(cli, mem_ctx, &domain_pol, MAXIMUM_ALLOWED_ACCESS, user_rids[0], &user_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } } @@ -1190,7 +1190,7 @@ static uint32 cmd_samr_delete_dom_user(struct cli_state *cli, int argc, /* Delete user */ if ((result = cli_samr_delete_dom_user(cli, mem_ctx, &user_pol)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 70552c9c725..836c0484445 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -84,7 +84,7 @@ static uint32 cmd_spoolss_not_implemented (struct cli_state *cli, int argc, char **argv) { printf ("(*) This command is not currently implemented.\n"); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /**************************************************************************** @@ -152,7 +152,7 @@ static uint32 cmd_spoolss_open_printer_ex(struct cli_state *cli, int argc, char if (argc != 2) { printf("Usage: %s \n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!cli) @@ -182,10 +182,10 @@ static uint32 cmd_spoolss_open_printer_ex(struct cli_state *cli, int argc, char result = cli_spoolss_open_printer_ex (cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS, servername, user, &hnd); - if (result == NT_STATUS_NOPROBLEMO) { + if (result == NT_STATUS_OK) { printf ("Printer %s opened successfully\n", printername); result = cli_spoolss_close_printer (cli, mem_ctx, &hnd); - if (result != NT_STATUS_NOPROBLEMO) { + if (result != NT_STATUS_OK) { printf ("Error closing printer handle! (%s)\n", get_nt_error_msg(result)); } } @@ -344,7 +344,7 @@ static uint32 cmd_spoolss_enum_printers(struct cli_state *cli, int argc, char ** if (argc > 2) { printf("Usage: %s [level]\n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -371,7 +371,7 @@ static uint32 cmd_spoolss_enum_printers(struct cli_state *cli, int argc, char ** result = cli_spoolss_enum_printers(cli, mem_ctx, PRINTER_ENUM_LOCAL, info_level, &returned, &ctr); - if (result == NT_STATUS_NOPROBLEMO) + if (result == NT_STATUS_OK) { if (!returned) printf ("No Printers printers returned.\n"); @@ -452,7 +452,7 @@ static uint32 cmd_spoolss_enum_ports(struct cli_state *cli, int argc, char **arg if (argc > 2) { printf("Usage: %s [level]\n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -478,7 +478,7 @@ static uint32 cmd_spoolss_enum_ports(struct cli_state *cli, int argc, char **arg result = cli_spoolss_enum_ports(cli, mem_ctx, info_level, &returned, &ctr); - if (result == NT_STATUS_NOPROBLEMO) { + if (result == NT_STATUS_OK) { int i; for (i = 0; i < returned; i++) { @@ -519,7 +519,7 @@ static uint32 cmd_spoolss_getprinter(struct cli_state *cli, int argc, char **arg if (argc == 1 || argc > 3) { printf("Usage: %s [level]\n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -549,7 +549,7 @@ static uint32 cmd_spoolss_getprinter(struct cli_state *cli, int argc, char **arg /* get a printer handle */ if ((result = cli_spoolss_open_printer_ex( cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS, servername, - user, &pol)) != NT_STATUS_NOPROBLEMO) { + user, &pol)) != NT_STATUS_OK) { goto done; } @@ -557,7 +557,7 @@ static uint32 cmd_spoolss_getprinter(struct cli_state *cli, int argc, char **arg /* Get printer info */ if ((result = cli_spoolss_getprinter(cli, mem_ctx, &pol, info_level, &ctr)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto done; } @@ -720,7 +720,7 @@ static uint32 cmd_spoolss_getdriver(struct cli_state *cli, int argc, char **argv if ((argc == 1) || (argc > 3)) { printf("Usage: %s [level]\n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -747,7 +747,7 @@ static uint32 cmd_spoolss_getdriver(struct cli_state *cli, int argc, char **argv /* Open a printer handle */ if ((result=cli_spoolss_open_printer_ex (cli, mem_ctx, printername, "", - MAXIMUM_ALLOWED_ACCESS, servername, user, &pol)) != NT_STATUS_NOPROBLEMO) + MAXIMUM_ALLOWED_ACCESS, servername, user, &pol)) != NT_STATUS_OK) { printf ("Error opening printer handle for %s!\n", printername); return result; @@ -763,7 +763,7 @@ static uint32 cmd_spoolss_getdriver(struct cli_state *cli, int argc, char **argv switch (result) { - case ERRsuccess: + case NT_STATUS_OK: break; case ERRunknownprinterdriver: @@ -805,7 +805,7 @@ static uint32 cmd_spoolss_getdriver(struct cli_state *cli, int argc, char **argv talloc_destroy(mem_ctx); if (result==ERRunknownprinterdriver) - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; else return result; @@ -827,7 +827,7 @@ static uint32 cmd_spoolss_enum_drivers(struct cli_state *cli, int argc, char **a if (argc > 2) { printf("Usage: enumdrivers [level]\n"); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -862,7 +862,7 @@ static uint32 cmd_spoolss_enum_drivers(struct cli_state *cli, int argc, char **a continue; - if (result != NT_STATUS_NOPROBLEMO) + if (result != NT_STATUS_OK) { printf ("Error getting driver for environment [%s] - %s\n", archi_table[i].long_archi, get_nt_error_msg(result)); @@ -900,7 +900,7 @@ static uint32 cmd_spoolss_enum_drivers(struct cli_state *cli, int argc, char **a talloc_destroy(mem_ctx); if (result==ERRunknownprinterdriver) - return ERRsuccess; + return NT_STATUS_OK; else return result; @@ -933,7 +933,7 @@ static uint32 cmd_spoolss_getdriverdir(struct cli_state *cli, int argc, char **a if (argc > 2) { printf("Usage: %s [environment]\n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } /* Initialise RPC connection */ @@ -958,7 +958,7 @@ static uint32 cmd_spoolss_getdriverdir(struct cli_state *cli, int argc, char **a /* Get the directory. Only use Info level 1 */ if ((result = cli_spoolss_getprinterdriverdir (cli, mem_ctx, 1, env, &ctr)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) { return result; } @@ -1100,7 +1100,7 @@ static uint32 cmd_spoolss_addprinterdriver (struct cli_state *cli, int argc, cha printf ("\t:::\\\n"); printf ("\t:\n"); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -1137,7 +1137,7 @@ static uint32 cmd_spoolss_addprinterdriver (struct cli_state *cli, int argc, cha ctr.info3 = &info3; if ((result = cli_spoolss_addprinterdriver (cli, mem_ctx, level, &ctr)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) { return result; } @@ -1167,7 +1167,7 @@ static uint32 cmd_spoolss_addprinterex (struct cli_state *cli, int argc, char ** if (argc != 5) { printf ("Usage: %s \n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -1219,7 +1219,7 @@ static uint32 cmd_spoolss_addprinterex (struct cli_state *cli, int argc, char ** ctr.printers_2 = &info2; if ((result = cli_spoolss_addprinterex (cli, mem_ctx, level, &ctr)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) { cli_nt_session_close (cli); return result; @@ -1252,7 +1252,7 @@ static uint32 cmd_spoolss_setdriver (struct cli_state *cli, int argc, char **arg if (argc != 3) { printf ("Usage: %s \n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -1278,7 +1278,7 @@ static uint32 cmd_spoolss_setdriver (struct cli_state *cli, int argc, char **arg /* get a printer handle */ if ((result = cli_spoolss_open_printer_ex(cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS, servername, user, &pol)) - != NT_STATUS_NOPROBLEMO) + != NT_STATUS_OK) { goto done; } @@ -1288,7 +1288,7 @@ static uint32 cmd_spoolss_setdriver (struct cli_state *cli, int argc, char **arg /* Get printer info */ ZERO_STRUCT (info2); ctr.printers_2 = &info2; - if ((result = cli_spoolss_getprinter(cli, mem_ctx, &pol, level, &ctr)) != NT_STATUS_NOPROBLEMO) + if ((result = cli_spoolss_getprinter(cli, mem_ctx, &pol, level, &ctr)) != NT_STATUS_OK) { printf ("Unable to retrieve printer information!\n"); goto done; @@ -1296,7 +1296,7 @@ static uint32 cmd_spoolss_setdriver (struct cli_state *cli, int argc, char **arg /* set the printer driver */ init_unistr(&ctr.printers_2->drivername, argv[2]); - if ((result = cli_spoolss_setprinter(cli, mem_ctx, &pol, level, &ctr, 0)) != NT_STATUS_NOPROBLEMO) + if ((result = cli_spoolss_setprinter(cli, mem_ctx, &pol, level, &ctr, 0)) != NT_STATUS_OK) { printf ("SetPrinter call failed!\n"); goto done;; @@ -1326,7 +1326,7 @@ static uint32 cmd_spoolss_deletedriver (struct cli_state *cli, int argc, char ** if (argc != 2) { printf ("Usage: %s \n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (!(mem_ctx=talloc_init())) @@ -1351,7 +1351,7 @@ static uint32 cmd_spoolss_deletedriver (struct cli_state *cli, int argc, char ** { /* make the call to remove the driver */ if ((result = cli_spoolss_deleteprinterdriver(cli, mem_ctx, - archi_table[i].long_archi, argv[1])) != NT_STATUS_NOPROBLEMO) + archi_table[i].long_archi, argv[1])) != NT_STATUS_OK) { printf ("Failed to remove driver %s for arch [%s] - error %s!\n", argv[1], archi_table[i].long_archi, get_nt_error_msg(result)); @@ -1365,7 +1365,7 @@ static uint32 cmd_spoolss_deletedriver (struct cli_state *cli, int argc, char ** cli_nt_session_close (cli); talloc_destroy(mem_ctx); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c index b74dc5a8333..63d84db9c8b 100644 --- a/source3/rpcclient/cmd_srvsvc.c +++ b/source3/rpcclient/cmd_srvsvc.c @@ -212,7 +212,7 @@ static uint32 cmd_srvsvc_srv_query_info(struct cli_state *cli, int argc, if ((result = cli_srvsvc_net_srv_get_info(cli, mem_ctx, info_level, &ctr) - != NT_STATUS_NOPROBLEMO)) { + != NT_STATUS_OK)) { goto done; } diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index d833043401c..d49fd13340c 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -213,13 +213,13 @@ void fetch_domain_sid(struct cli_state *cli) if ((result = cli_lsa_open_policy(cli, mem_ctx, True, SEC_RIGHTS_MAXIMUM_ALLOWED, - &pol) != NT_STATUS_NOPROBLEMO)) { + &pol) != NT_STATUS_OK)) { goto error; } if ((result = cli_lsa_query_info_policy(cli, mem_ctx, &pol, info_class, domain_name, &domain_sid)) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { goto error; } @@ -234,7 +234,7 @@ void fetch_domain_sid(struct cli_state *cli) error: fprintf(stderr, "could not obtain sid for domain %s\n", cli->domain); - if (result != NT_STATUS_NOPROBLEMO) { + if (result != NT_STATUS_OK) { fprintf(stderr, "error: %s\n", get_nt_error_msg(result)); } @@ -327,7 +327,7 @@ static uint32 cmd_debuglevel(struct cli_state *cli, int argc, char **argv) { if (argc > 2) { printf("Usage: %s [debuglevel]\n", argv[0]); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } if (argc == 2) { @@ -336,13 +336,13 @@ static uint32 cmd_debuglevel(struct cli_state *cli, int argc, char **argv) printf("debuglevel is %d\n", DEBUGLEVEL); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } static uint32 cmd_quit(struct cli_state *cli, int argc, char **argv) { exit(0); - return NT_STATUS_NOPROBLEMO; /* NOTREACHED */ + return NT_STATUS_OK; /* NOTREACHED */ } /* Build in rpcclient commands */ diff --git a/source3/smbd/auth.c b/source3/smbd/auth.c index ec493b7c065..d6bc8aeadcc 100644 --- a/source3/smbd/auth.c +++ b/source3/smbd/auth.c @@ -68,15 +68,15 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info, return NT_STATUS_LOGON_FAILURE; } - if (nt_status != NT_STATUS_NOPROBLEMO) { + if (nt_status != NT_STATUS_OK) { nt_status = check_rhosts_security(user_info, server_info); } - if ((lp_security() == SEC_DOMAIN) && (nt_status != NT_STATUS_NOPROBLEMO)) { + if ((lp_security() == SEC_DOMAIN) && (nt_status != NT_STATUS_OK)) { nt_status = check_domain_security(user_info, server_info); } - if ((lp_security() == SEC_SERVER) && (nt_status != NT_STATUS_NOPROBLEMO)) { + if ((lp_security() == SEC_SERVER) && (nt_status != NT_STATUS_OK)) { nt_status = check_server_security(user_info, server_info); } @@ -84,7 +84,7 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info, smb_user_control(user_info->smb_username.str, nt_status); } - if (nt_status != NT_STATUS_NOPROBLEMO) { + if (nt_status != NT_STATUS_OK) { if ((user_info->plaintext_password.len > 0) && (!lp_plaintext_to_smbpasswd())) { nt_status = check_unix_security(user_info, server_info); @@ -94,14 +94,14 @@ NTSTATUS check_password(const auth_usersupplied_info *user_info, } } - if ((nt_status == NT_STATUS_NOPROBLEMO) && !done_pam) { + if ((nt_status == NT_STATUS_OK) && !done_pam) { /* We might not be root if we are an RPC call */ become_root(); nt_status = smb_pam_accountcheck(user_info->smb_username.str); unbecome_root(); } - if (nt_status == NT_STATUS_NOPROBLEMO) { + if (nt_status == NT_STATUS_OK) { DEBUG(5, ("check_password: Password for user %s suceeded\n", user_info->smb_username.str)); } else { DEBUG(3, ("check_password: Password for user %s FAILED with error %s\n", user_info->smb_username.str, get_nt_error_msg(nt_status))); @@ -233,11 +233,11 @@ BOOL password_ok(char *user, char *password, int pwlen) /* The password could be either NTLM or plain LM. Try NTLM first, but fall-through as required. */ - if (pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen) == NT_STATUS_NOPROBLEMO) { + if (pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen) == NT_STATUS_OK) { return True; } - if (pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0) == NT_STATUS_NOPROBLEMO) { + if (pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0) == NT_STATUS_OK) { return True; } diff --git a/source3/smbd/auth_rhosts.c b/source3/smbd/auth_rhosts.c index f11f9cf777c..a4914f2ef16 100644 --- a/source3/smbd/auth_rhosts.c +++ b/source3/smbd/auth_rhosts.c @@ -175,7 +175,7 @@ uint32 check_rhosts_security(const auth_usersupplied_info *user_info, become_root(); if (check_hosts_equiv(user_info->smb_username.str)) { - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; } unbecome_root(); diff --git a/source3/smbd/auth_server.c b/source3/smbd/auth_server.c index ad66f0c4ac9..9636094fa36 100644 --- a/source3/smbd/auth_server.c +++ b/source3/smbd/auth_server.c @@ -214,7 +214,7 @@ use this machine as the password server.\n")); /* Make this cli_nt_error() when the conversion is in */ nt_status = NT_STATUS_LOGON_FAILURE; } else { - nt_status = NT_STATUS_NOPROBLEMO; + nt_status = NT_STATUS_OK; } /* if logged in as guest then reject */ diff --git a/source3/smbd/auth_smbpasswd.c b/source3/smbd/auth_smbpasswd.c index 1a5d02e4a44..54847581679 100644 --- a/source3/smbd/auth_smbpasswd.c +++ b/source3/smbd/auth_smbpasswd.c @@ -127,7 +127,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_ if (lp_null_passwords()) { DEBUG(3,("Account for user '%s' has no password and null passwords are allowed.\n", user_info->smb_username.str)); - return(NT_STATUS_NOPROBLEMO); + return(NT_STATUS_OK); } else { @@ -156,7 +156,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_ user_info->requested_domain.str, (char *)server_info->session_key)) { - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } DEBUG(4,("smb_password_ok: NTLMv2 password check failed\n")); @@ -169,7 +169,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_ nt_pw, user_info->chal, server_info->session_key)) { DEBUG(4,("smb_password_ok: NT MD4 password check succeeded\n")); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } else { DEBUG(4,("smb_password_ok: NT MD4 password check failed\n")); return NT_STATUS_WRONG_PASSWORD; @@ -185,7 +185,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_ lm_pw, user_info->chal, server_info->session_key)) { DEBUG(4,("smb_password_ok: LM password check succeeded\n")); - return NT_STATUS_NOPROBLEMO; + return NT_STATUS_OK; } else { DEBUG(4,("smb_password_ok: LM password check failed\n")); return NT_STATUS_WRONG_PASSWORD; diff --git a/source3/smbd/auth_unix.c b/source3/smbd/auth_unix.c index 89e670747f2..fda44fd91ce 100644 --- a/source3/smbd/auth_unix.c +++ b/source3/smbd/auth_unix.c @@ -76,7 +76,7 @@ uint32 check_unix_security(const auth_usersupplied_info *user_info, auth_servers nt_status = (pass_check(user_info->smb_username.str, user_info->plaintext_password.str, user_info->plaintext_password.len, lp_update_encrypted() ? update_smbpassword_file : NULL) - ? NT_STATUS_NOPROBLEMO : NT_STATUS_LOGON_FAILURE); + ? NT_STATUS_OK : NT_STATUS_LOGON_FAILURE); unbecome_root(); return nt_status; diff --git a/source3/smbd/auth_util.c b/source3/smbd/auth_util.c index 4a0f45f8436..5ccf9638894 100644 --- a/source3/smbd/auth_util.c +++ b/source3/smbd/auth_util.c @@ -105,7 +105,7 @@ void smb_user_control(char *unix_user, uint32 nt_status) { struct passwd *pwd=NULL; - if(nt_status == NT_STATUS_NOPROBLEMO) { + if(nt_status == NT_STATUS_OK) { /* * User validated ok against Domain controller. * If the admin wants us to try and create a UNIX diff --git a/source3/smbd/error.c b/source3/smbd/error.c index f2613dc3a8d..a74b62de01e 100644 --- a/source3/smbd/error.c +++ b/source3/smbd/error.c @@ -84,7 +84,7 @@ int unix_error_packet(char *outbuf,int def_class,uint32 def_code,int line) } } - return error_packet(outbuf,NT_STATUS_OK,eclass,ecode,line); + return error_packet(outbuf,NT_STATUS(0),eclass,ecode,line); } @@ -119,7 +119,7 @@ int error_packet(char *outbuf,NTSTATUS ntstatus, } SSVAL(outbuf,smb_flg2, SVAL(outbuf,smb_flg2)&~FLAGS2_32_BIT_ERROR_CODES); - SVAL(outbuf,smb_rcls) = eclass; + SSVAL(outbuf,smb_rcls,eclass); SSVAL(outbuf,smb_err,ecode); DEBUG(3,("error packet at line %d cmd=%d (%s) eclass=%d ecode=%d\n", diff --git a/source3/smbd/service.c b/source3/smbd/service.c index edac97194e3..df0f6f20953 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -217,14 +217,13 @@ int find_service(char *service) do some basic sainity checks on the share. This function modifies dev, ecode. ****************************************************************************/ -static BOOL share_sanity_checks(int snum, char* service, char *dev, int *ecode) +static NTSTATUS share_sanity_checks(int snum, char* service, char *dev) { if (!lp_snum_ok(snum) || !check_access(smbd_server_fd(), lp_hostsallow(snum), lp_hostsdeny(snum))) { - *ecode = ERRaccess; - return False; + return NT_STATUS_ACCESS_DENIED; } /* you can only connect to the IPC$ service as an ipc device */ @@ -243,15 +242,15 @@ static BOOL share_sanity_checks(int snum, char* service, char *dev, int *ecode) strupper(dev); if (!lp_print_ok(snum) && (strncmp(dev,"LPT",3) == 0)) { DEBUG(1,("Attempt to connect to non-printer as a printer\n")); - *ecode = ERRinvdevice; - return False; + return NT_STATUS_BAD_DEVICE_TYPE; } /* Behave as a printer if we are supposed to */ if (lp_print_ok(snum) && (strcmp(dev, "A:") == 0)) { pstrcpy(dev, "LPT1:"); } - return True; + + return NT_STATUS_OK; } @@ -319,7 +318,8 @@ static void set_admin_user(connection_struct *conn) /**************************************************************************** make a connection to a service ****************************************************************************/ -connection_struct *make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid, int *ecode) +connection_struct *make_connection(char *service,char *user,char *password, + int pwlen, char *dev,uint16 vuid, NTSTATUS *status) { int snum; struct passwd *pass = NULL; @@ -334,13 +334,13 @@ connection_struct *make_connection(char *service,char *user,char *password, int if (snum < 0) { if (strequal(service,"IPC$") || strequal(service,"ADMIN$")) { DEBUG(3,("refusing IPC connection\n")); - *ecode = ERRnoipc; + *status = NT_STATUS_ACCESS_DENIED; return NULL; } DEBUG(0,("%s (%s) couldn't find service %s\n", remote_machine, client_addr(), service)); - *ecode = ERRnosuchshare; + *status = NT_STATUS_BAD_NETWORK_PATH; return NULL; } @@ -349,7 +349,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int fstring dos_username; fstrcpy(dos_username, user); return(make_connection(dos_username,user,password, - pwlen,dev,vuid,ecode)); + pwlen,dev,vuid,status)); } if(lp_security() != SEC_SHARE) { @@ -357,7 +357,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int fstring dos_username; fstrcpy(user,validated_username(vuid)); fstrcpy(dos_username, user); - return(make_connection(dos_username,user,password,pwlen,dev,vuid,ecode)); + return(make_connection(dos_username,user,password,pwlen,dev,vuid,status)); } } else { /* Security = share. Try with current_user_info.smb_name @@ -366,12 +366,12 @@ connection_struct *make_connection(char *service,char *user,char *password, int fstring dos_username; fstrcpy(user,current_user_info.smb_name); fstrcpy(dos_username, user); - return(make_connection(dos_username,user,password,pwlen,dev,vuid,ecode)); + return(make_connection(dos_username,user,password,pwlen,dev,vuid,status)); } } } - if (!share_sanity_checks(snum, service, dev, ecode)) { + if (NT_STATUS_IS_ERR(share_sanity_checks(snum, service, dev))) { return NULL; } @@ -387,14 +387,14 @@ connection_struct *make_connection(char *service,char *user,char *password, int /* shall we let them in? */ if (!authorise_login(snum,user,password,pwlen,&guest,&force,vuid)) { DEBUG( 2, ( "Invalid username/password for %s [%s]\n", service, user ) ); - *ecode = ERRbadpw; + *status = NT_STATUS_WRONG_PASSWORD; return NULL; } conn = conn_new(); if (!conn) { DEBUG(0,("Couldn't find free connection.\n")); - *ecode = ERRnoresource; + *status = NT_STATUS_INSUFFICIENT_RESOURCES; return NULL; } @@ -403,7 +403,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int if (pass == NULL) { DEBUG(0,( "Couldn't find account %s\n",user)); - *ecode = ERRbaduid; + *status = NT_STATUS_NO_SUCH_USER; conn_free(conn); return NULL; } @@ -543,7 +543,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int if (!can_write) { if (!share_access_check(conn, snum, vuid, FILE_READ_DATA)) { /* No access, read or write. */ - *ecode = ERRaccess; + *status = NT_STATUS_ACCESS_DENIED; DEBUG(0,( "make_connection: connection to %s denied due to security descriptor.\n", service )); conn_free(conn); @@ -567,7 +567,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int lp_max_connections(SNUM(conn)), False)) { DEBUG(1,("too many connections - rejected\n")); - *ecode = ERRnoresource; + *status = NT_STATUS_INSUFFICIENT_RESOURCES; conn_free(conn); return NULL; } @@ -585,7 +585,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int lp_servicename(SNUM(conn)), lp_max_connections(SNUM(conn))); conn_free(conn); - *ecode = ERRsrverror; + *status = NT_STATUS_UNSUCCESSFUL; return NULL; } } @@ -596,7 +596,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int lp_servicename(SNUM(conn)), lp_max_connections(SNUM(conn))); conn_free(conn); - *ecode = ERRbadpw; + *status = NT_STATUS_WRONG_PASSWORD; return NULL; } @@ -609,7 +609,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int lp_servicename(SNUM(conn)), lp_max_connections(SNUM(conn))); conn_free(conn); - *ecode = ERRnosuchshare; + *status = NT_STATUS_BAD_NETWORK_NAME; return NULL; } @@ -638,7 +638,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int DEBUG(1,("preexec gave %d - failing connection\n", ret)); yield_connection(conn, lp_servicename(SNUM(conn)), lp_max_connections(SNUM(conn))); conn_free(conn); - *ecode = ERRsrverror; + *status = NT_STATUS_UNSUCCESSFUL; return NULL; } } diff --git a/source3/torture/scanner.c b/source3/torture/scanner.c index 5c1c59ca8c3..19505d257d1 100644 --- a/source3/torture/scanner.c +++ b/source3/torture/scanner.c @@ -30,7 +30,7 @@ /**************************************************************************** look for a partial hit ****************************************************************************/ -static void trans2_check_hit(char *format, int op, int level, uint32 status) +static void trans2_check_hit(char *format, int op, int level, NTSTATUS status) { switch (status) { case NT_STATUS_INVALID_LEVEL: @@ -103,7 +103,7 @@ static uint32 try_trans2_len(struct cli_state *cli, if (ret == 0) break; *data_len += 2; } - if (ret == NT_STATUS_NOPROBLEMO) { + if (ret == NT_STATUS_OK) { printf("found %s level=%d data_len=%d rparam_len=%d rdata_len=%d\n", format, level, *data_len, *rparam_len, *rdata_len); } else { @@ -122,7 +122,7 @@ static BOOL scan_trans2(struct cli_state *cli, int op, int level, int param_len = 0; int rparam_len, rdata_len; pstring param, data; - uint32 status; + NTSTATUS status; memset(data, 0, sizeof(data)); data_len = 4; @@ -236,7 +236,7 @@ BOOL torture_trans2_scan(int dummy) /**************************************************************************** look for a partial hit ****************************************************************************/ -static void nttrans_check_hit(char *format, int op, int level, uint32 status) +static void nttrans_check_hit(char *format, int op, int level, NTSTATUS status) { switch (status) { case NT_STATUS_INVALID_LEVEL: @@ -307,7 +307,7 @@ static uint32 try_nttrans_len(struct cli_state *cli, if (ret == 0) break; *data_len += 2; } - if (ret == NT_STATUS_NOPROBLEMO) { + if (ret == NT_STATUS_OK) { printf("found %s level=%d data_len=%d rparam_len=%d rdata_len=%d\n", format, level, *data_len, *rparam_len, *rdata_len); } else { @@ -326,7 +326,7 @@ static BOOL scan_nttrans(struct cli_state *cli, int op, int level, int param_len = 0; int rparam_len, rdata_len; pstring param, data; - uint32 status; + NTSTATUS status; memset(data, 0, sizeof(data)); data_len = 4; diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 36d88d518a6..e92049d8f3b 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -188,7 +188,7 @@ static BOOL check_error(int line, struct cli_state *c, } } else { - uint32 status; + NTSTATUS status; /* Check NT error */ diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 9e8cbb1ddd1..53f9db1a6c1 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -94,7 +94,7 @@ static BOOL cacls_open_policy_hnd(void) if (cli_lsa_open_policy(&lsa_cli, lsa_cli.mem_ctx, True, GENERIC_EXECUTE_ACCESS, &pol) - != NT_STATUS_NOPROBLEMO) { + != NT_STATUS_OK) { return False; } @@ -119,7 +119,7 @@ static void SidToString(fstring str, DOM_SID *sid) if (!cacls_open_policy_hnd() || cli_lsa_lookup_sids(&lsa_cli, lsa_cli.mem_ctx, &pol, 1, sid, &names, &types, - &num_names) != NT_STATUS_NOPROBLEMO || + &num_names) != NT_STATUS_OK || !names || !names[0]) { return; } @@ -143,7 +143,7 @@ static BOOL StringToSid(DOM_SID *sid, char *str) if (!cacls_open_policy_hnd() || cli_lsa_lookup_names(&lsa_cli, lsa_cli.mem_ctx, &pol, 1, &str, &sids, &types, - &num_sids) != NT_STATUS_NOPROBLEMO) { + &num_sids) != NT_STATUS_OK) { result = False; goto done; } diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index 5cfe1152c8a..3911987991b 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -162,13 +162,13 @@ Join a domain using the administrator username and password /* Macro for checking RPC error codes to make things more readable */ #define CHECK_RPC_ERR(rpc, msg) \ - if ((result = rpc) != NT_STATUS_NOPROBLEMO) { \ + if ((result = rpc) != NT_STATUS_OK) { \ DEBUG(0, (msg ": %s\n", get_nt_error_msg(result))); \ goto done; \ } #define CHECK_RPC_ERR_DEBUG(rpc, debug_args) \ - if ((result = rpc) != NT_STATUS_NOPROBLEMO) { \ + if ((result = rpc) != NT_STATUS_OK) { \ DEBUG(0, debug_args); \ goto done; \ } @@ -330,7 +330,7 @@ static int join_domain_byuser(char *domain, char *remote_machine, ("could not re-open existing user %s: %s\n", acct_name, get_nt_error_msg(result))); - } else if (result != NT_STATUS_NOPROBLEMO) { + } else if (result != NT_STATUS_OK) { DEBUG(0, ("error creating domain user: %s\n", get_nt_error_msg(result))); goto done;