diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-08-27 19:46:22 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-08-27 19:46:22 +0000 |
commit | b031af348c7dcc8c74bf49945211c466b8eca079 (patch) | |
tree | c6a20abba3c8432ad2980beeab9e1d2a8528f3a4 /source3/rpc_server | |
parent | 1d726fe0e054be9017309186c24b24d032e85636 (diff) | |
download | samba-b031af348c7dcc8c74bf49945211c466b8eca079.tar.gz samba-b031af348c7dcc8c74bf49945211c466b8eca079.tar.bz2 samba-b031af348c7dcc8c74bf49945211c466b8eca079.zip |
converted another bunch of stuff to NTSTATUS
(This used to be commit 1d36250e338ae0ff9fbbf86019809205dd97d05e)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_dfs_nt.c | 6 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 64 | ||||
-rw-r--r-- | source3/rpc_server/srv_netlog_nt.c | 50 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe.c | 17 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srv_reg_nt.c | 26 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 254 | ||||
-rwxr-xr-x | source3/rpc_server/srv_spoolss.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 452 | ||||
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 149 | ||||
-rw-r--r-- | source3/rpc_server/srv_util.c | 26 | ||||
-rw-r--r-- | source3/rpc_server/srv_wkssvc_nt.c | 4 |
13 files changed, 528 insertions, 528 deletions
diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c index a84f2ceb48..034b1bbe77 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 fd4e3b6ec2..b84293b2f4 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 886e5fefca..e29d9393a6 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 4d4d058fba..60250c903f 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 3c8e44d84e..0111733bb0 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 f7263ff266..71abdd517f 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 6cd0f3b854..f00ecae3ce 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 ba59aa548c..dce082d31d 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 3500a4f3e1..011efb1bac 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 0710f05870..0ebbc2aada 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; i<ndrivers; i++) { - uint32 status; + NTSTATUS status; DEBUGADD(5,("\tdriver: [%s]\n", list[i])); ZERO_STRUCT(driver); if ((status = get_a_printer_driver(&driver, 3, list[i], architecture, version)) != 0) { @@ -5079,13 +5075,13 @@ static uint32 enumprinterdrivers_level1(fstring servername, fstring architecture return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** Enumerates all printer drivers at level 2. ****************************************************************************/ -static uint32 enumprinterdrivers_level2(fstring servername, fstring architecture, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumprinterdrivers_level2(fstring servername, fstring architecture, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { int i; int ndrivers; @@ -5118,7 +5114,7 @@ static uint32 enumprinterdrivers_level2(fstring servername, fstring architecture } for (i=0; i<ndrivers; i++) { - uint32 status; + NTSTATUS status; DEBUGADD(5,("\tdriver: [%s]\n", list[i])); ZERO_STRUCT(driver); @@ -5158,13 +5154,13 @@ static uint32 enumprinterdrivers_level2(fstring servername, fstring architecture return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** Enumerates all printer drivers at level 3. ****************************************************************************/ -static uint32 enumprinterdrivers_level3(fstring servername, fstring architecture, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) +static NTSTATUS enumprinterdrivers_level3(fstring servername, fstring architecture, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { int i; int ndrivers; @@ -5197,7 +5193,7 @@ static uint32 enumprinterdrivers_level3(fstring servername, fstring architecture } for (i=0; i<ndrivers; i++) { - uint32 status; + NTSTATUS status; DEBUGADD(5,("\tdriver: [%s]\n", list[i])); ZERO_STRUCT(driver); @@ -5240,14 +5236,14 @@ static uint32 enumprinterdrivers_level3(fstring servername, fstring architecture return ERRinsufficientbuffer; } else - return ERRsuccess; + return NT_STATUS_OK; } /**************************************************************************** Enumerates all printer drivers. ****************************************************************************/ -uint32 _spoolss_enumprinterdrivers( pipes_struct *p, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, SPOOL_R_ENUMPRINTERDRIVERS *r_u) +NTSTATUS _spoolss_enumprinterdrivers( pipes_struct *p, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, SPOOL_R_ENUMPRINTERDRIVERS *r_u) { /* UNISTR2 *name = &q_u->name; - 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 b5b38b1403..5ba460b607 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 f9e02b9bca..5393523a78 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 47566bbf3e..4bbc0e237f 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__)); |