diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-10-10 07:55:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:22 -0500 |
commit | 6b0b563fa43ad4c7de3573dc7962a2698e140f72 (patch) | |
tree | b0bacef7886a01bcc716c29e3f359d866468d14c /source3 | |
parent | b71a0be998c0171a01c632f3e14e9764c2dda6c2 (diff) | |
download | samba-6b0b563fa43ad4c7de3573dc7962a2698e140f72.tar.gz samba-6b0b563fa43ad4c7de3573dc7962a2698e140f72.tar.bz2 samba-6b0b563fa43ad4c7de3573dc7962a2698e140f72.zip |
r19221: Monster-Checkin after "make idl"
(This used to be commit 416466a16f58ac644baacaa2522c4e98176d0e70)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/librpc/gen_ndr/srv_dfs.c | 276 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_echo.c | 120 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_eventlog.c | 288 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_initshutdown.c | 36 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_lsa.c | 984 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_netlogon.c | 564 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_srvsvc.c | 648 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_svcctl.c | 528 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_unixinfo.c | 60 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_winreg.c | 420 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_wkssvc.c | 372 |
11 files changed, 3580 insertions, 716 deletions
diff --git a/source3/librpc/gen_ndr/srv_dfs.c b/source3/librpc/gen_ndr/srv_dfs.c index 4c16201e9f..fe34b6e323 100644 --- a/source3/librpc/gen_ndr/srv_dfs.c +++ b/source3/librpc/gen_ndr/srv_dfs.c @@ -21,8 +21,10 @@ static BOOL api_dfs_GetManagerVersion(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_GetManagerVersion(pull, NDR_IN, &r); @@ -43,6 +45,12 @@ static BOOL api_dfs_GetManagerVersion(pipes_struct *p) _dfs_GetManagerVersion(p, r.out.exist_flag); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_GetManagerVersion, &r); @@ -59,7 +67,7 @@ static BOOL api_dfs_GetManagerVersion(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -84,8 +92,10 @@ static BOOL api_dfs_Add(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_Add(pull, NDR_IN, &r); @@ -99,6 +109,12 @@ static BOOL api_dfs_Add(pipes_struct *p) r.out.result = _dfs_Add(p, r.in.path, r.in.server, r.in.share, r.in.comment, r.in.flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_Add, &r); @@ -115,7 +131,7 @@ static BOOL api_dfs_Add(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -140,8 +156,10 @@ static BOOL api_dfs_Remove(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_Remove(pull, NDR_IN, &r); @@ -155,6 +173,12 @@ static BOOL api_dfs_Remove(pipes_struct *p) r.out.result = _dfs_Remove(p, r.in.path, r.in.server, r.in.share); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_Remove, &r); @@ -171,7 +195,7 @@ static BOOL api_dfs_Remove(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -196,8 +220,10 @@ static BOOL api_dfs_SetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_SetInfo(pull, NDR_IN, &r); @@ -211,6 +237,12 @@ static BOOL api_dfs_SetInfo(pipes_struct *p) r.out.result = _dfs_SetInfo(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_SetInfo, &r); @@ -227,7 +259,7 @@ static BOOL api_dfs_SetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -252,8 +284,10 @@ static BOOL api_dfs_GetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_GetInfo(pull, NDR_IN, &r); @@ -274,6 +308,12 @@ static BOOL api_dfs_GetInfo(pipes_struct *p) r.out.result = _dfs_GetInfo(p, r.in.path, r.in.server, r.in.share, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_GetInfo, &r); @@ -290,7 +330,7 @@ static BOOL api_dfs_GetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -315,8 +355,10 @@ static BOOL api_dfs_Enum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_Enum(pull, NDR_IN, &r); @@ -333,6 +375,12 @@ static BOOL api_dfs_Enum(pipes_struct *p) r.out.total = r.in.total; r.out.result = _dfs_Enum(p, r.in.level, r.in.bufsize, r.in.info, r.in.unknown, r.in.total); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_Enum, &r); @@ -349,7 +397,7 @@ static BOOL api_dfs_Enum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -374,8 +422,10 @@ static BOOL api_dfs_Rename(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_Rename(pull, NDR_IN, &r); @@ -389,6 +439,12 @@ static BOOL api_dfs_Rename(pipes_struct *p) r.out.result = _dfs_Rename(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_Rename, &r); @@ -405,7 +461,7 @@ static BOOL api_dfs_Rename(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -430,8 +486,10 @@ static BOOL api_dfs_Move(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_Move(pull, NDR_IN, &r); @@ -445,6 +503,12 @@ static BOOL api_dfs_Move(pipes_struct *p) r.out.result = _dfs_Move(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_Move, &r); @@ -461,7 +525,7 @@ static BOOL api_dfs_Move(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -486,8 +550,10 @@ static BOOL api_dfs_ManagerGetConfigInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_ManagerGetConfigInfo(pull, NDR_IN, &r); @@ -501,6 +567,12 @@ static BOOL api_dfs_ManagerGetConfigInfo(pipes_struct *p) r.out.result = _dfs_ManagerGetConfigInfo(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_ManagerGetConfigInfo, &r); @@ -517,7 +589,7 @@ static BOOL api_dfs_ManagerGetConfigInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -542,8 +614,10 @@ static BOOL api_dfs_ManagerSendSiteInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_ManagerSendSiteInfo(pull, NDR_IN, &r); @@ -557,6 +631,12 @@ static BOOL api_dfs_ManagerSendSiteInfo(pipes_struct *p) r.out.result = _dfs_ManagerSendSiteInfo(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_ManagerSendSiteInfo, &r); @@ -573,7 +653,7 @@ static BOOL api_dfs_ManagerSendSiteInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -598,8 +678,10 @@ static BOOL api_dfs_AddFtRoot(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_AddFtRoot(pull, NDR_IN, &r); @@ -613,6 +695,12 @@ static BOOL api_dfs_AddFtRoot(pipes_struct *p) r.out.result = _dfs_AddFtRoot(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_AddFtRoot, &r); @@ -629,7 +717,7 @@ static BOOL api_dfs_AddFtRoot(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -654,8 +742,10 @@ static BOOL api_dfs_RemoveFtRoot(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_RemoveFtRoot(pull, NDR_IN, &r); @@ -669,6 +759,12 @@ static BOOL api_dfs_RemoveFtRoot(pipes_struct *p) r.out.result = _dfs_RemoveFtRoot(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, &r); @@ -685,7 +781,7 @@ static BOOL api_dfs_RemoveFtRoot(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -710,8 +806,10 @@ static BOOL api_dfs_AddStdRoot(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_AddStdRoot(pull, NDR_IN, &r); @@ -725,6 +823,12 @@ static BOOL api_dfs_AddStdRoot(pipes_struct *p) r.out.result = _dfs_AddStdRoot(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_AddStdRoot, &r); @@ -741,7 +845,7 @@ static BOOL api_dfs_AddStdRoot(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -766,8 +870,10 @@ static BOOL api_dfs_RemoveStdRoot(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_RemoveStdRoot(pull, NDR_IN, &r); @@ -781,6 +887,12 @@ static BOOL api_dfs_RemoveStdRoot(pipes_struct *p) r.out.result = _dfs_RemoveStdRoot(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_RemoveStdRoot, &r); @@ -797,7 +909,7 @@ static BOOL api_dfs_RemoveStdRoot(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -822,8 +934,10 @@ static BOOL api_dfs_ManagerInitialize(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_ManagerInitialize(pull, NDR_IN, &r); @@ -837,6 +951,12 @@ static BOOL api_dfs_ManagerInitialize(pipes_struct *p) r.out.result = _dfs_ManagerInitialize(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_ManagerInitialize, &r); @@ -853,7 +973,7 @@ static BOOL api_dfs_ManagerInitialize(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -878,8 +998,10 @@ static BOOL api_dfs_AddStdRootForced(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_AddStdRootForced(pull, NDR_IN, &r); @@ -893,6 +1015,12 @@ static BOOL api_dfs_AddStdRootForced(pipes_struct *p) r.out.result = _dfs_AddStdRootForced(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_AddStdRootForced, &r); @@ -909,7 +1037,7 @@ static BOOL api_dfs_AddStdRootForced(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -934,8 +1062,10 @@ static BOOL api_dfs_GetDcAddress(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_GetDcAddress(pull, NDR_IN, &r); @@ -949,6 +1079,12 @@ static BOOL api_dfs_GetDcAddress(pipes_struct *p) r.out.result = _dfs_GetDcAddress(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, &r); @@ -965,7 +1101,7 @@ static BOOL api_dfs_GetDcAddress(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -990,8 +1126,10 @@ static BOOL api_dfs_SetDcAddress(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_SetDcAddress(pull, NDR_IN, &r); @@ -1005,6 +1143,12 @@ static BOOL api_dfs_SetDcAddress(pipes_struct *p) r.out.result = _dfs_SetDcAddress(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_SetDcAddress, &r); @@ -1021,7 +1165,7 @@ static BOOL api_dfs_SetDcAddress(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1046,8 +1190,10 @@ static BOOL api_dfs_FlushFtTable(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_FlushFtTable(pull, NDR_IN, &r); @@ -1061,6 +1207,12 @@ static BOOL api_dfs_FlushFtTable(pipes_struct *p) r.out.result = _dfs_FlushFtTable(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_FlushFtTable, &r); @@ -1077,7 +1229,7 @@ static BOOL api_dfs_FlushFtTable(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1102,8 +1254,10 @@ static BOOL api_dfs_Add2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_Add2(pull, NDR_IN, &r); @@ -1117,6 +1271,12 @@ static BOOL api_dfs_Add2(pipes_struct *p) r.out.result = _dfs_Add2(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_Add2, &r); @@ -1133,7 +1293,7 @@ static BOOL api_dfs_Add2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1158,8 +1318,10 @@ static BOOL api_dfs_Remove2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_Remove2(pull, NDR_IN, &r); @@ -1173,6 +1335,12 @@ static BOOL api_dfs_Remove2(pipes_struct *p) r.out.result = _dfs_Remove2(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_Remove2, &r); @@ -1189,7 +1357,7 @@ static BOOL api_dfs_Remove2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1214,8 +1382,10 @@ static BOOL api_dfs_EnumEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_EnumEx(pull, NDR_IN, &r); @@ -1232,6 +1402,12 @@ static BOOL api_dfs_EnumEx(pipes_struct *p) r.out.total = r.in.total; r.out.result = _dfs_EnumEx(p, r.in.name, r.in.level, r.in.bufsize, r.in.info, r.in.total); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_EnumEx, &r); @@ -1248,7 +1424,7 @@ static BOOL api_dfs_EnumEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1273,8 +1449,10 @@ static BOOL api_dfs_SetInfo2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_dfs_SetInfo2(pull, NDR_IN, &r); @@ -1288,6 +1466,12 @@ static BOOL api_dfs_SetInfo2(pipes_struct *p) r.out.result = _dfs_SetInfo2(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(dfs_SetInfo2, &r); @@ -1304,7 +1488,7 @@ static BOOL api_dfs_SetInfo2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 444c934bea..e72d1eafe2 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -21,8 +21,10 @@ static BOOL api_echo_AddOne(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_AddOne(pull, NDR_IN, &r); @@ -43,6 +45,12 @@ static BOOL api_echo_AddOne(pipes_struct *p) _echo_AddOne(p, r.in.in_data, r.out.out_data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_AddOne, &r); @@ -59,7 +67,7 @@ static BOOL api_echo_AddOne(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -84,8 +92,10 @@ static BOOL api_echo_EchoData(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_EchoData(pull, NDR_IN, &r); @@ -106,6 +116,12 @@ static BOOL api_echo_EchoData(pipes_struct *p) _echo_EchoData(p, r.in.len, r.in.in_data, r.out.out_data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_EchoData, &r); @@ -122,7 +138,7 @@ static BOOL api_echo_EchoData(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -147,8 +163,10 @@ static BOOL api_echo_SinkData(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_SinkData(pull, NDR_IN, &r); @@ -162,6 +180,12 @@ static BOOL api_echo_SinkData(pipes_struct *p) _echo_SinkData(p, r.in.len, r.in.data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_SinkData, &r); @@ -178,7 +202,7 @@ static BOOL api_echo_SinkData(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -203,8 +227,10 @@ static BOOL api_echo_SourceData(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_SourceData(pull, NDR_IN, &r); @@ -225,6 +251,12 @@ static BOOL api_echo_SourceData(pipes_struct *p) _echo_SourceData(p, r.in.len, r.out.data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_SourceData, &r); @@ -241,7 +273,7 @@ static BOOL api_echo_SourceData(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -266,8 +298,10 @@ static BOOL api_echo_TestCall(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestCall(pull, NDR_IN, &r); @@ -288,6 +322,12 @@ static BOOL api_echo_TestCall(pipes_struct *p) _echo_TestCall(p, r.in.s1, r.out.s2); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestCall, &r); @@ -304,7 +344,7 @@ static BOOL api_echo_TestCall(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -329,8 +369,10 @@ static BOOL api_echo_TestCall2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestCall2(pull, NDR_IN, &r); @@ -351,6 +393,12 @@ static BOOL api_echo_TestCall2(pipes_struct *p) r.out.result = _echo_TestCall2(p, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r); @@ -367,7 +415,7 @@ static BOOL api_echo_TestCall2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -392,8 +440,10 @@ static BOOL api_echo_TestSleep(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestSleep(pull, NDR_IN, &r); @@ -407,6 +457,12 @@ static BOOL api_echo_TestSleep(pipes_struct *p) r.out.result = _echo_TestSleep(p, r.in.seconds); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r); @@ -423,7 +479,7 @@ static BOOL api_echo_TestSleep(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -448,8 +504,10 @@ static BOOL api_echo_TestEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestEnum(pull, NDR_IN, &r); @@ -467,6 +525,12 @@ static BOOL api_echo_TestEnum(pipes_struct *p) r.out.foo3 = r.in.foo3; _echo_TestEnum(p, r.in.foo1, r.in.foo2, r.in.foo3); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r); @@ -483,7 +547,7 @@ static BOOL api_echo_TestEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -508,8 +572,10 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestSurrounding(pull, NDR_IN, &r); @@ -525,6 +591,12 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) r.out.data = r.in.data; _echo_TestSurrounding(p, r.in.data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r); @@ -541,7 +613,7 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -566,8 +638,10 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestDoublePointer(pull, NDR_IN, &r); @@ -581,6 +655,12 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) r.out.result = _echo_TestDoublePointer(p, r.in.data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r); @@ -597,7 +677,7 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_eventlog.c b/source3/librpc/gen_ndr/srv_eventlog.c index 67027d3f9d..466d523262 100644 --- a/source3/librpc/gen_ndr/srv_eventlog.c +++ b/source3/librpc/gen_ndr/srv_eventlog.c @@ -21,8 +21,10 @@ static BOOL api_eventlog_ClearEventLogW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_ClearEventLogW(pull, NDR_IN, &r); @@ -36,6 +38,12 @@ static BOOL api_eventlog_ClearEventLogW(pipes_struct *p) r.out.result = _eventlog_ClearEventLogW(p, r.in.handle, r.in.unknown); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &r); @@ -52,7 +60,7 @@ static BOOL api_eventlog_ClearEventLogW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -77,8 +85,10 @@ static BOOL api_eventlog_BackupEventLogW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_BackupEventLogW(pull, NDR_IN, &r); @@ -92,6 +102,12 @@ static BOOL api_eventlog_BackupEventLogW(pipes_struct *p) r.out.result = _eventlog_BackupEventLogW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &r); @@ -108,7 +124,7 @@ static BOOL api_eventlog_BackupEventLogW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -133,8 +149,10 @@ static BOOL api_eventlog_CloseEventLog(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_CloseEventLog(pull, NDR_IN, &r); @@ -150,6 +168,12 @@ static BOOL api_eventlog_CloseEventLog(pipes_struct *p) r.out.handle = r.in.handle; r.out.result = _eventlog_CloseEventLog(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &r); @@ -166,7 +190,7 @@ static BOOL api_eventlog_CloseEventLog(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -191,8 +215,10 @@ static BOOL api_eventlog_DeregisterEventSource(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_DeregisterEventSource(pull, NDR_IN, &r); @@ -206,6 +232,12 @@ static BOOL api_eventlog_DeregisterEventSource(pipes_struct *p) r.out.result = _eventlog_DeregisterEventSource(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &r); @@ -222,7 +254,7 @@ static BOOL api_eventlog_DeregisterEventSource(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -247,8 +279,10 @@ static BOOL api_eventlog_GetNumRecords(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_GetNumRecords(pull, NDR_IN, &r); @@ -269,6 +303,12 @@ static BOOL api_eventlog_GetNumRecords(pipes_struct *p) r.out.result = _eventlog_GetNumRecords(p, r.in.handle, r.out.number); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &r); @@ -285,7 +325,7 @@ static BOOL api_eventlog_GetNumRecords(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -310,8 +350,10 @@ static BOOL api_eventlog_GetOldestRecord(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_GetOldestRecord(pull, NDR_IN, &r); @@ -325,6 +367,12 @@ static BOOL api_eventlog_GetOldestRecord(pipes_struct *p) r.out.result = _eventlog_GetOldestRecord(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &r); @@ -341,7 +389,7 @@ static BOOL api_eventlog_GetOldestRecord(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -366,8 +414,10 @@ static BOOL api_eventlog_ChangeNotify(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_ChangeNotify(pull, NDR_IN, &r); @@ -381,6 +431,12 @@ static BOOL api_eventlog_ChangeNotify(pipes_struct *p) r.out.result = _eventlog_ChangeNotify(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &r); @@ -397,7 +453,7 @@ static BOOL api_eventlog_ChangeNotify(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -422,8 +478,10 @@ static BOOL api_eventlog_OpenEventLogW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_OpenEventLogW(pull, NDR_IN, &r); @@ -444,6 +502,12 @@ static BOOL api_eventlog_OpenEventLogW(pipes_struct *p) r.out.result = _eventlog_OpenEventLogW(p, r.in.unknown0, r.in.logname, r.in.servername, r.in.unknown2, r.in.unknown3, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &r); @@ -460,7 +524,7 @@ static BOOL api_eventlog_OpenEventLogW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -485,8 +549,10 @@ static BOOL api_eventlog_RegisterEventSourceW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_RegisterEventSourceW(pull, NDR_IN, &r); @@ -500,6 +566,12 @@ static BOOL api_eventlog_RegisterEventSourceW(pipes_struct *p) r.out.result = _eventlog_RegisterEventSourceW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &r); @@ -516,7 +588,7 @@ static BOOL api_eventlog_RegisterEventSourceW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -541,8 +613,10 @@ static BOOL api_eventlog_OpenBackupEventLogW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_OpenBackupEventLogW(pull, NDR_IN, &r); @@ -556,6 +630,12 @@ static BOOL api_eventlog_OpenBackupEventLogW(pipes_struct *p) r.out.result = _eventlog_OpenBackupEventLogW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &r); @@ -572,7 +652,7 @@ static BOOL api_eventlog_OpenBackupEventLogW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -597,8 +677,10 @@ static BOOL api_eventlog_ReadEventLogW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_ReadEventLogW(pull, NDR_IN, &r); @@ -631,6 +713,12 @@ static BOOL api_eventlog_ReadEventLogW(pipes_struct *p) r.out.result = _eventlog_ReadEventLogW(p, r.in.handle, r.in.flags, r.in.offset, r.in.number_of_bytes, r.out.data, r.out.sent_size, r.out.real_size); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &r); @@ -647,7 +735,7 @@ static BOOL api_eventlog_ReadEventLogW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -672,8 +760,10 @@ static BOOL api_eventlog_ReportEventW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_ReportEventW(pull, NDR_IN, &r); @@ -687,6 +777,12 @@ static BOOL api_eventlog_ReportEventW(pipes_struct *p) r.out.result = _eventlog_ReportEventW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &r); @@ -703,7 +799,7 @@ static BOOL api_eventlog_ReportEventW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -728,8 +824,10 @@ static BOOL api_eventlog_ClearEventLogA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_ClearEventLogA(pull, NDR_IN, &r); @@ -743,6 +841,12 @@ static BOOL api_eventlog_ClearEventLogA(pipes_struct *p) r.out.result = _eventlog_ClearEventLogA(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &r); @@ -759,7 +863,7 @@ static BOOL api_eventlog_ClearEventLogA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -784,8 +888,10 @@ static BOOL api_eventlog_BackupEventLogA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_BackupEventLogA(pull, NDR_IN, &r); @@ -799,6 +905,12 @@ static BOOL api_eventlog_BackupEventLogA(pipes_struct *p) r.out.result = _eventlog_BackupEventLogA(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &r); @@ -815,7 +927,7 @@ static BOOL api_eventlog_BackupEventLogA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -840,8 +952,10 @@ static BOOL api_eventlog_OpenEventLogA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_OpenEventLogA(pull, NDR_IN, &r); @@ -855,6 +969,12 @@ static BOOL api_eventlog_OpenEventLogA(pipes_struct *p) r.out.result = _eventlog_OpenEventLogA(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &r); @@ -871,7 +991,7 @@ static BOOL api_eventlog_OpenEventLogA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -896,8 +1016,10 @@ static BOOL api_eventlog_RegisterEventSourceA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_RegisterEventSourceA(pull, NDR_IN, &r); @@ -911,6 +1033,12 @@ static BOOL api_eventlog_RegisterEventSourceA(pipes_struct *p) r.out.result = _eventlog_RegisterEventSourceA(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &r); @@ -927,7 +1055,7 @@ static BOOL api_eventlog_RegisterEventSourceA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -952,8 +1080,10 @@ static BOOL api_eventlog_OpenBackupEventLogA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_OpenBackupEventLogA(pull, NDR_IN, &r); @@ -967,6 +1097,12 @@ static BOOL api_eventlog_OpenBackupEventLogA(pipes_struct *p) r.out.result = _eventlog_OpenBackupEventLogA(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &r); @@ -983,7 +1119,7 @@ static BOOL api_eventlog_OpenBackupEventLogA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1008,8 +1144,10 @@ static BOOL api_eventlog_ReadEventLogA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_ReadEventLogA(pull, NDR_IN, &r); @@ -1023,6 +1161,12 @@ static BOOL api_eventlog_ReadEventLogA(pipes_struct *p) r.out.result = _eventlog_ReadEventLogA(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &r); @@ -1039,7 +1183,7 @@ static BOOL api_eventlog_ReadEventLogA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1064,8 +1208,10 @@ static BOOL api_eventlog_ReportEventA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_ReportEventA(pull, NDR_IN, &r); @@ -1079,6 +1225,12 @@ static BOOL api_eventlog_ReportEventA(pipes_struct *p) r.out.result = _eventlog_ReportEventA(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &r); @@ -1095,7 +1247,7 @@ static BOOL api_eventlog_ReportEventA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1120,8 +1272,10 @@ static BOOL api_eventlog_RegisterClusterSvc(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_RegisterClusterSvc(pull, NDR_IN, &r); @@ -1135,6 +1289,12 @@ static BOOL api_eventlog_RegisterClusterSvc(pipes_struct *p) r.out.result = _eventlog_RegisterClusterSvc(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &r); @@ -1151,7 +1311,7 @@ static BOOL api_eventlog_RegisterClusterSvc(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1176,8 +1336,10 @@ static BOOL api_eventlog_DeregisterClusterSvc(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_DeregisterClusterSvc(pull, NDR_IN, &r); @@ -1191,6 +1353,12 @@ static BOOL api_eventlog_DeregisterClusterSvc(pipes_struct *p) r.out.result = _eventlog_DeregisterClusterSvc(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &r); @@ -1207,7 +1375,7 @@ static BOOL api_eventlog_DeregisterClusterSvc(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1232,8 +1400,10 @@ static BOOL api_eventlog_WriteClusterEvents(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_WriteClusterEvents(pull, NDR_IN, &r); @@ -1247,6 +1417,12 @@ static BOOL api_eventlog_WriteClusterEvents(pipes_struct *p) r.out.result = _eventlog_WriteClusterEvents(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &r); @@ -1263,7 +1439,7 @@ static BOOL api_eventlog_WriteClusterEvents(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1288,8 +1464,10 @@ static BOOL api_eventlog_GetLogIntormation(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_GetLogIntormation(pull, NDR_IN, &r); @@ -1303,6 +1481,12 @@ static BOOL api_eventlog_GetLogIntormation(pipes_struct *p) r.out.result = _eventlog_GetLogIntormation(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, &r); @@ -1319,7 +1503,7 @@ static BOOL api_eventlog_GetLogIntormation(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1344,8 +1528,10 @@ static BOOL api_eventlog_FlushEventLog(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_eventlog_FlushEventLog(pull, NDR_IN, &r); @@ -1359,6 +1545,12 @@ static BOOL api_eventlog_FlushEventLog(pipes_struct *p) r.out.result = _eventlog_FlushEventLog(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &r); @@ -1375,7 +1567,7 @@ static BOOL api_eventlog_FlushEventLog(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index 0bcadf423f..fab8288188 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -21,8 +21,10 @@ static BOOL api_initshutdown_Init(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_initshutdown_Init(pull, NDR_IN, &r); @@ -36,6 +38,12 @@ static BOOL api_initshutdown_Init(pipes_struct *p) r.out.result = _initshutdown_Init(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(initshutdown_Init, &r); @@ -52,7 +60,7 @@ static BOOL api_initshutdown_Init(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -77,8 +85,10 @@ static BOOL api_initshutdown_Abort(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_initshutdown_Abort(pull, NDR_IN, &r); @@ -92,6 +102,12 @@ static BOOL api_initshutdown_Abort(pipes_struct *p) r.out.result = _initshutdown_Abort(p, r.in.server); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &r); @@ -108,7 +124,7 @@ static BOOL api_initshutdown_Abort(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -133,8 +149,10 @@ static BOOL api_initshutdown_InitEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_initshutdown_InitEx(pull, NDR_IN, &r); @@ -148,6 +166,12 @@ static BOOL api_initshutdown_InitEx(pipes_struct *p) r.out.result = _initshutdown_InitEx(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot, r.in.reason); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &r); @@ -164,7 +188,7 @@ static BOOL api_initshutdown_InitEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_lsa.c b/source3/librpc/gen_ndr/srv_lsa.c index d6f3477f87..7caa149dd6 100644 --- a/source3/librpc/gen_ndr/srv_lsa.c +++ b/source3/librpc/gen_ndr/srv_lsa.c @@ -21,8 +21,10 @@ static BOOL api_lsa_Close(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_Close(pull, NDR_IN, &r); @@ -38,6 +40,12 @@ static BOOL api_lsa_Close(pipes_struct *p) r.out.handle = r.in.handle; r.out.result = _lsa_Close(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_Close, &r); @@ -54,7 +62,7 @@ static BOOL api_lsa_Close(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -79,8 +87,10 @@ static BOOL api_lsa_Delete(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_Delete(pull, NDR_IN, &r); @@ -94,6 +104,12 @@ static BOOL api_lsa_Delete(pipes_struct *p) r.out.result = _lsa_Delete(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_Delete, &r); @@ -110,7 +126,7 @@ static BOOL api_lsa_Delete(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -135,8 +151,10 @@ static BOOL api_lsa_EnumPrivs(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_EnumPrivs(pull, NDR_IN, &r); @@ -158,6 +176,12 @@ static BOOL api_lsa_EnumPrivs(pipes_struct *p) r.out.result = _lsa_EnumPrivs(p, r.in.handle, r.in.resume_handle, r.in.max_count, r.out.privs); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, &r); @@ -174,7 +198,7 @@ static BOOL api_lsa_EnumPrivs(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -199,8 +223,10 @@ static BOOL api_lsa_QuerySecurity(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_QuerySecurity(pull, NDR_IN, &r); @@ -221,6 +247,12 @@ static BOOL api_lsa_QuerySecurity(pipes_struct *p) r.out.result = _lsa_QuerySecurity(p, r.in.handle, r.in.sec_info, r.out.sdbuf); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, &r); @@ -237,7 +269,7 @@ static BOOL api_lsa_QuerySecurity(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -262,8 +294,10 @@ static BOOL api_lsa_SetSecObj(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetSecObj(pull, NDR_IN, &r); @@ -277,6 +311,12 @@ static BOOL api_lsa_SetSecObj(pipes_struct *p) r.out.result = _lsa_SetSecObj(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, &r); @@ -293,7 +333,7 @@ static BOOL api_lsa_SetSecObj(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -318,8 +358,10 @@ static BOOL api_lsa_ChangePassword(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_ChangePassword(pull, NDR_IN, &r); @@ -333,6 +375,12 @@ static BOOL api_lsa_ChangePassword(pipes_struct *p) r.out.result = _lsa_ChangePassword(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, &r); @@ -349,7 +397,7 @@ static BOOL api_lsa_ChangePassword(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -374,8 +422,10 @@ static BOOL api_lsa_OpenPolicy(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_OpenPolicy(pull, NDR_IN, &r); @@ -396,6 +446,12 @@ static BOOL api_lsa_OpenPolicy(pipes_struct *p) r.out.result = _lsa_OpenPolicy(p, r.in.system_name, r.in.attr, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, &r); @@ -412,7 +468,7 @@ static BOOL api_lsa_OpenPolicy(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -437,8 +493,10 @@ static BOOL api_lsa_QueryInfoPolicy(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_QueryInfoPolicy(pull, NDR_IN, &r); @@ -459,6 +517,12 @@ static BOOL api_lsa_QueryInfoPolicy(pipes_struct *p) r.out.result = _lsa_QueryInfoPolicy(p, r.in.handle, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, &r); @@ -475,7 +539,7 @@ static BOOL api_lsa_QueryInfoPolicy(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -500,8 +564,10 @@ static BOOL api_lsa_SetInfoPolicy(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetInfoPolicy(pull, NDR_IN, &r); @@ -515,6 +581,12 @@ static BOOL api_lsa_SetInfoPolicy(pipes_struct *p) r.out.result = _lsa_SetInfoPolicy(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, &r); @@ -531,7 +603,7 @@ static BOOL api_lsa_SetInfoPolicy(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -556,8 +628,10 @@ static BOOL api_lsa_ClearAuditLog(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_ClearAuditLog(pull, NDR_IN, &r); @@ -571,6 +645,12 @@ static BOOL api_lsa_ClearAuditLog(pipes_struct *p) r.out.result = _lsa_ClearAuditLog(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, &r); @@ -587,7 +667,7 @@ static BOOL api_lsa_ClearAuditLog(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -612,8 +692,10 @@ static BOOL api_lsa_CreateAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CreateAccount(pull, NDR_IN, &r); @@ -634,6 +716,12 @@ static BOOL api_lsa_CreateAccount(pipes_struct *p) r.out.result = _lsa_CreateAccount(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.acct_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, &r); @@ -650,7 +738,7 @@ static BOOL api_lsa_CreateAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -675,8 +763,10 @@ static BOOL api_lsa_EnumAccounts(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_EnumAccounts(pull, NDR_IN, &r); @@ -698,6 +788,12 @@ static BOOL api_lsa_EnumAccounts(pipes_struct *p) r.out.result = _lsa_EnumAccounts(p, r.in.handle, r.in.resume_handle, r.in.num_entries, r.out.sids); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, &r); @@ -714,7 +810,7 @@ static BOOL api_lsa_EnumAccounts(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -739,8 +835,10 @@ static BOOL api_lsa_CreateTrustedDomain(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CreateTrustedDomain(pull, NDR_IN, &r); @@ -761,6 +859,12 @@ static BOOL api_lsa_CreateTrustedDomain(pipes_struct *p) r.out.result = _lsa_CreateTrustedDomain(p, r.in.handle, r.in.info, r.in.access_mask, r.out.trustdom_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, &r); @@ -777,7 +881,7 @@ static BOOL api_lsa_CreateTrustedDomain(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -802,8 +906,10 @@ static BOOL api_lsa_EnumTrustDom(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_EnumTrustDom(pull, NDR_IN, &r); @@ -825,6 +931,12 @@ static BOOL api_lsa_EnumTrustDom(pipes_struct *p) r.out.result = _lsa_EnumTrustDom(p, r.in.handle, r.in.resume_handle, r.in.max_size, r.out.domains); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, &r); @@ -841,7 +953,7 @@ static BOOL api_lsa_EnumTrustDom(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -866,8 +978,10 @@ static BOOL api_lsa_LookupNames(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupNames(pull, NDR_IN, &r); @@ -890,6 +1004,12 @@ static BOOL api_lsa_LookupNames(pipes_struct *p) r.out.count = r.in.count; r.out.result = _lsa_LookupNames(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupNames, &r); @@ -906,7 +1026,7 @@ static BOOL api_lsa_LookupNames(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -931,8 +1051,10 @@ static BOOL api_lsa_LookupSids(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupSids(pull, NDR_IN, &r); @@ -955,6 +1077,12 @@ static BOOL api_lsa_LookupSids(pipes_struct *p) r.out.count = r.in.count; r.out.result = _lsa_LookupSids(p, r.in.handle, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupSids, &r); @@ -971,7 +1099,7 @@ static BOOL api_lsa_LookupSids(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -996,8 +1124,10 @@ static BOOL api_lsa_CreateSecret(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CreateSecret(pull, NDR_IN, &r); @@ -1018,6 +1148,12 @@ static BOOL api_lsa_CreateSecret(pipes_struct *p) r.out.result = _lsa_CreateSecret(p, r.in.handle, r.in.name, r.in.access_mask, r.out.sec_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, &r); @@ -1034,7 +1170,7 @@ static BOOL api_lsa_CreateSecret(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1059,8 +1195,10 @@ static BOOL api_lsa_OpenAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_OpenAccount(pull, NDR_IN, &r); @@ -1081,6 +1219,12 @@ static BOOL api_lsa_OpenAccount(pipes_struct *p) r.out.result = _lsa_OpenAccount(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.acct_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, &r); @@ -1097,7 +1241,7 @@ static BOOL api_lsa_OpenAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1122,8 +1266,10 @@ static BOOL api_lsa_EnumPrivsAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_EnumPrivsAccount(pull, NDR_IN, &r); @@ -1144,6 +1290,12 @@ static BOOL api_lsa_EnumPrivsAccount(pipes_struct *p) r.out.result = _lsa_EnumPrivsAccount(p, r.in.handle, r.out.privs); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, &r); @@ -1160,7 +1312,7 @@ static BOOL api_lsa_EnumPrivsAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1185,8 +1337,10 @@ static BOOL api_lsa_AddPrivilegesToAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_AddPrivilegesToAccount(pull, NDR_IN, &r); @@ -1200,6 +1354,12 @@ static BOOL api_lsa_AddPrivilegesToAccount(pipes_struct *p) r.out.result = _lsa_AddPrivilegesToAccount(p, r.in.handle, r.in.privs); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, &r); @@ -1216,7 +1376,7 @@ static BOOL api_lsa_AddPrivilegesToAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1241,8 +1401,10 @@ static BOOL api_lsa_RemovePrivilegesFromAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_RemovePrivilegesFromAccount(pull, NDR_IN, &r); @@ -1256,6 +1418,12 @@ static BOOL api_lsa_RemovePrivilegesFromAccount(pipes_struct *p) r.out.result = _lsa_RemovePrivilegesFromAccount(p, r.in.handle, r.in.remove_all, r.in.privs); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, &r); @@ -1272,7 +1440,7 @@ static BOOL api_lsa_RemovePrivilegesFromAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1297,8 +1465,10 @@ static BOOL api_lsa_GetQuotasForAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_GetQuotasForAccount(pull, NDR_IN, &r); @@ -1312,6 +1482,12 @@ static BOOL api_lsa_GetQuotasForAccount(pipes_struct *p) r.out.result = _lsa_GetQuotasForAccount(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, &r); @@ -1328,7 +1504,7 @@ static BOOL api_lsa_GetQuotasForAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1353,8 +1529,10 @@ static BOOL api_lsa_SetQuotasForAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetQuotasForAccount(pull, NDR_IN, &r); @@ -1368,6 +1546,12 @@ static BOOL api_lsa_SetQuotasForAccount(pipes_struct *p) r.out.result = _lsa_SetQuotasForAccount(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, &r); @@ -1384,7 +1568,7 @@ static BOOL api_lsa_SetQuotasForAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1409,8 +1593,10 @@ static BOOL api_lsa_GetSystemAccessAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_GetSystemAccessAccount(pull, NDR_IN, &r); @@ -1424,6 +1610,12 @@ static BOOL api_lsa_GetSystemAccessAccount(pipes_struct *p) r.out.result = _lsa_GetSystemAccessAccount(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, &r); @@ -1440,7 +1632,7 @@ static BOOL api_lsa_GetSystemAccessAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1465,8 +1657,10 @@ static BOOL api_lsa_SetSystemAccessAccount(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetSystemAccessAccount(pull, NDR_IN, &r); @@ -1480,6 +1674,12 @@ static BOOL api_lsa_SetSystemAccessAccount(pipes_struct *p) r.out.result = _lsa_SetSystemAccessAccount(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, &r); @@ -1496,7 +1696,7 @@ static BOOL api_lsa_SetSystemAccessAccount(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1521,8 +1721,10 @@ static BOOL api_lsa_OpenTrustedDomain(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_OpenTrustedDomain(pull, NDR_IN, &r); @@ -1543,6 +1745,12 @@ static BOOL api_lsa_OpenTrustedDomain(pipes_struct *p) r.out.result = _lsa_OpenTrustedDomain(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.trustdom_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, &r); @@ -1559,7 +1767,7 @@ static BOOL api_lsa_OpenTrustedDomain(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1584,8 +1792,10 @@ static BOOL api_lsa_QueryTrustedDomainInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_QueryTrustedDomainInfo(pull, NDR_IN, &r); @@ -1606,6 +1816,12 @@ static BOOL api_lsa_QueryTrustedDomainInfo(pipes_struct *p) r.out.result = _lsa_QueryTrustedDomainInfo(p, r.in.trustdom_handle, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, &r); @@ -1622,7 +1838,7 @@ static BOOL api_lsa_QueryTrustedDomainInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1647,8 +1863,10 @@ static BOOL api_lsa_SetInformationTrustedDomain(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetInformationTrustedDomain(pull, NDR_IN, &r); @@ -1662,6 +1880,12 @@ static BOOL api_lsa_SetInformationTrustedDomain(pipes_struct *p) r.out.result = _lsa_SetInformationTrustedDomain(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, &r); @@ -1678,7 +1902,7 @@ static BOOL api_lsa_SetInformationTrustedDomain(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1703,8 +1927,10 @@ static BOOL api_lsa_OpenSecret(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_OpenSecret(pull, NDR_IN, &r); @@ -1725,6 +1951,12 @@ static BOOL api_lsa_OpenSecret(pipes_struct *p) r.out.result = _lsa_OpenSecret(p, r.in.handle, r.in.name, r.in.access_mask, r.out.sec_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, &r); @@ -1741,7 +1973,7 @@ static BOOL api_lsa_OpenSecret(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1766,8 +1998,10 @@ static BOOL api_lsa_SetSecret(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetSecret(pull, NDR_IN, &r); @@ -1781,6 +2015,12 @@ static BOOL api_lsa_SetSecret(pipes_struct *p) r.out.result = _lsa_SetSecret(p, r.in.sec_handle, r.in.new_val, r.in.old_val); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetSecret, &r); @@ -1797,7 +2037,7 @@ static BOOL api_lsa_SetSecret(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1822,8 +2062,10 @@ static BOOL api_lsa_QuerySecret(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_QuerySecret(pull, NDR_IN, &r); @@ -1842,6 +2084,12 @@ static BOOL api_lsa_QuerySecret(pipes_struct *p) r.out.old_mtime = r.in.old_mtime; r.out.result = _lsa_QuerySecret(p, r.in.sec_handle, r.in.new_val, r.in.new_mtime, r.in.old_val, r.in.old_mtime); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, &r); @@ -1858,7 +2106,7 @@ static BOOL api_lsa_QuerySecret(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1883,8 +2131,10 @@ static BOOL api_lsa_LookupPrivValue(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupPrivValue(pull, NDR_IN, &r); @@ -1905,6 +2155,12 @@ static BOOL api_lsa_LookupPrivValue(pipes_struct *p) r.out.result = _lsa_LookupPrivValue(p, r.in.handle, r.in.name, r.out.luid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, &r); @@ -1921,7 +2177,7 @@ static BOOL api_lsa_LookupPrivValue(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1946,8 +2202,10 @@ static BOOL api_lsa_LookupPrivName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupPrivName(pull, NDR_IN, &r); @@ -1968,6 +2226,12 @@ static BOOL api_lsa_LookupPrivName(pipes_struct *p) r.out.result = _lsa_LookupPrivName(p, r.in.handle, r.in.luid, r.out.name); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, &r); @@ -1984,7 +2248,7 @@ static BOOL api_lsa_LookupPrivName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2009,8 +2273,10 @@ static BOOL api_lsa_LookupPrivDisplayName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupPrivDisplayName(pull, NDR_IN, &r); @@ -2032,6 +2298,12 @@ static BOOL api_lsa_LookupPrivDisplayName(pipes_struct *p) r.out.language_id = r.in.language_id; r.out.result = _lsa_LookupPrivDisplayName(p, r.in.handle, r.in.name, r.out.disp_name, r.in.language_id, r.in.unknown); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, &r); @@ -2048,7 +2320,7 @@ static BOOL api_lsa_LookupPrivDisplayName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2073,8 +2345,10 @@ static BOOL api_lsa_DeleteObject(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_DeleteObject(pull, NDR_IN, &r); @@ -2088,6 +2362,12 @@ static BOOL api_lsa_DeleteObject(pipes_struct *p) r.out.result = _lsa_DeleteObject(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, &r); @@ -2104,7 +2384,7 @@ static BOOL api_lsa_DeleteObject(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2129,8 +2409,10 @@ static BOOL api_lsa_EnumAccountsWithUserRight(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_EnumAccountsWithUserRight(pull, NDR_IN, &r); @@ -2151,6 +2433,12 @@ static BOOL api_lsa_EnumAccountsWithUserRight(pipes_struct *p) r.out.result = _lsa_EnumAccountsWithUserRight(p, r.in.handle, r.in.name, r.out.sids); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, &r); @@ -2167,7 +2455,7 @@ static BOOL api_lsa_EnumAccountsWithUserRight(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2192,8 +2480,10 @@ static BOOL api_lsa_EnumAccountRights(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_EnumAccountRights(pull, NDR_IN, &r); @@ -2214,6 +2504,12 @@ static BOOL api_lsa_EnumAccountRights(pipes_struct *p) r.out.result = _lsa_EnumAccountRights(p, r.in.handle, r.in.sid, r.out.rights); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, &r); @@ -2230,7 +2526,7 @@ static BOOL api_lsa_EnumAccountRights(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2255,8 +2551,10 @@ static BOOL api_lsa_AddAccountRights(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_AddAccountRights(pull, NDR_IN, &r); @@ -2270,6 +2568,12 @@ static BOOL api_lsa_AddAccountRights(pipes_struct *p) r.out.result = _lsa_AddAccountRights(p, r.in.handle, r.in.sid, r.in.rights); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, &r); @@ -2286,7 +2590,7 @@ static BOOL api_lsa_AddAccountRights(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2311,8 +2615,10 @@ static BOOL api_lsa_RemoveAccountRights(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_RemoveAccountRights(pull, NDR_IN, &r); @@ -2326,6 +2632,12 @@ static BOOL api_lsa_RemoveAccountRights(pipes_struct *p) r.out.result = _lsa_RemoveAccountRights(p, r.in.handle, r.in.sid, r.in.unknown, r.in.rights); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, &r); @@ -2342,7 +2654,7 @@ static BOOL api_lsa_RemoveAccountRights(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2367,8 +2679,10 @@ static BOOL api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_QueryTrustedDomainInfoBySid(pull, NDR_IN, &r); @@ -2389,6 +2703,12 @@ static BOOL api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p) r.out.result = _lsa_QueryTrustedDomainInfoBySid(p, r.in.handle, r.in.dom_sid, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r); @@ -2405,7 +2725,7 @@ static BOOL api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2430,8 +2750,10 @@ static BOOL api_lsa_SetTrustedDomainInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetTrustedDomainInfo(pull, NDR_IN, &r); @@ -2445,6 +2767,12 @@ static BOOL api_lsa_SetTrustedDomainInfo(pipes_struct *p) r.out.result = _lsa_SetTrustedDomainInfo(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, &r); @@ -2461,7 +2789,7 @@ static BOOL api_lsa_SetTrustedDomainInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2486,8 +2814,10 @@ static BOOL api_lsa_DeleteTrustedDomain(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_DeleteTrustedDomain(pull, NDR_IN, &r); @@ -2501,6 +2831,12 @@ static BOOL api_lsa_DeleteTrustedDomain(pipes_struct *p) r.out.result = _lsa_DeleteTrustedDomain(p, r.in.handle, r.in.dom_sid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, &r); @@ -2517,7 +2853,7 @@ static BOOL api_lsa_DeleteTrustedDomain(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2542,8 +2878,10 @@ static BOOL api_lsa_StorePrivateData(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_StorePrivateData(pull, NDR_IN, &r); @@ -2557,6 +2895,12 @@ static BOOL api_lsa_StorePrivateData(pipes_struct *p) r.out.result = _lsa_StorePrivateData(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, &r); @@ -2573,7 +2917,7 @@ static BOOL api_lsa_StorePrivateData(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2598,8 +2942,10 @@ static BOOL api_lsa_RetrievePrivateData(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_RetrievePrivateData(pull, NDR_IN, &r); @@ -2613,6 +2959,12 @@ static BOOL api_lsa_RetrievePrivateData(pipes_struct *p) r.out.result = _lsa_RetrievePrivateData(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, &r); @@ -2629,7 +2981,7 @@ static BOOL api_lsa_RetrievePrivateData(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2654,8 +3006,10 @@ static BOOL api_lsa_OpenPolicy2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_OpenPolicy2(pull, NDR_IN, &r); @@ -2676,6 +3030,12 @@ static BOOL api_lsa_OpenPolicy2(pipes_struct *p) r.out.result = _lsa_OpenPolicy2(p, r.in.system_name, r.in.attr, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, &r); @@ -2692,7 +3052,7 @@ static BOOL api_lsa_OpenPolicy2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2717,8 +3077,10 @@ static BOOL api_lsa_GetUserName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_GetUserName(pull, NDR_IN, &r); @@ -2735,6 +3097,12 @@ static BOOL api_lsa_GetUserName(pipes_struct *p) r.out.authority_name = r.in.authority_name; r.out.result = _lsa_GetUserName(p, r.in.system_name, r.in.account_name, r.in.authority_name); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_GetUserName, &r); @@ -2751,7 +3119,7 @@ static BOOL api_lsa_GetUserName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2776,8 +3144,10 @@ static BOOL api_lsa_QueryInfoPolicy2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_QueryInfoPolicy2(pull, NDR_IN, &r); @@ -2798,6 +3168,12 @@ static BOOL api_lsa_QueryInfoPolicy2(pipes_struct *p) r.out.result = _lsa_QueryInfoPolicy2(p, r.in.handle, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, &r); @@ -2814,7 +3190,7 @@ static BOOL api_lsa_QueryInfoPolicy2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2839,8 +3215,10 @@ static BOOL api_lsa_SetInfoPolicy2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetInfoPolicy2(pull, NDR_IN, &r); @@ -2854,6 +3232,12 @@ static BOOL api_lsa_SetInfoPolicy2(pipes_struct *p) r.out.result = _lsa_SetInfoPolicy2(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, &r); @@ -2870,7 +3254,7 @@ static BOOL api_lsa_SetInfoPolicy2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2895,8 +3279,10 @@ static BOOL api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_QueryTrustedDomainInfoByName(pull, NDR_IN, &r); @@ -2917,6 +3303,12 @@ static BOOL api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p) r.out.result = _lsa_QueryTrustedDomainInfoByName(p, r.in.handle, r.in.trusted_domain, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, &r); @@ -2933,7 +3325,7 @@ static BOOL api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2958,8 +3350,10 @@ static BOOL api_lsa_SetTrustedDomainInfoByName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetTrustedDomainInfoByName(pull, NDR_IN, &r); @@ -2973,6 +3367,12 @@ static BOOL api_lsa_SetTrustedDomainInfoByName(pipes_struct *p) r.out.result = _lsa_SetTrustedDomainInfoByName(p, r.in.handle, r.in.trusted_domain, r.in.level, r.in.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, &r); @@ -2989,7 +3389,7 @@ static BOOL api_lsa_SetTrustedDomainInfoByName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3014,8 +3414,10 @@ static BOOL api_lsa_EnumTrustedDomainsEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_EnumTrustedDomainsEx(pull, NDR_IN, &r); @@ -3037,6 +3439,12 @@ static BOOL api_lsa_EnumTrustedDomainsEx(pipes_struct *p) r.out.result = _lsa_EnumTrustedDomainsEx(p, r.in.handle, r.in.resume_handle, r.out.domains, r.in.max_size); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, &r); @@ -3053,7 +3461,7 @@ static BOOL api_lsa_EnumTrustedDomainsEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3078,8 +3486,10 @@ static BOOL api_lsa_CreateTrustedDomainEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CreateTrustedDomainEx(pull, NDR_IN, &r); @@ -3093,6 +3503,12 @@ static BOOL api_lsa_CreateTrustedDomainEx(pipes_struct *p) r.out.result = _lsa_CreateTrustedDomainEx(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, &r); @@ -3109,7 +3525,7 @@ static BOOL api_lsa_CreateTrustedDomainEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3134,8 +3550,10 @@ static BOOL api_lsa_CloseTrustedDomainEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CloseTrustedDomainEx(pull, NDR_IN, &r); @@ -3151,6 +3569,12 @@ static BOOL api_lsa_CloseTrustedDomainEx(pipes_struct *p) r.out.handle = r.in.handle; r.out.result = _lsa_CloseTrustedDomainEx(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, &r); @@ -3167,7 +3591,7 @@ static BOOL api_lsa_CloseTrustedDomainEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3192,8 +3616,10 @@ static BOOL api_lsa_QueryDomainInformationPolicy(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_QueryDomainInformationPolicy(pull, NDR_IN, &r); @@ -3214,6 +3640,12 @@ static BOOL api_lsa_QueryDomainInformationPolicy(pipes_struct *p) r.out.result = _lsa_QueryDomainInformationPolicy(p, r.in.handle, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, &r); @@ -3230,7 +3662,7 @@ static BOOL api_lsa_QueryDomainInformationPolicy(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3255,8 +3687,10 @@ static BOOL api_lsa_SetDomainInformationPolicy(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_SetDomainInformationPolicy(pull, NDR_IN, &r); @@ -3270,6 +3704,12 @@ static BOOL api_lsa_SetDomainInformationPolicy(pipes_struct *p) r.out.result = _lsa_SetDomainInformationPolicy(p, r.in.handle, r.in.level, r.in.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, &r); @@ -3286,7 +3726,7 @@ static BOOL api_lsa_SetDomainInformationPolicy(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3311,8 +3751,10 @@ static BOOL api_lsa_OpenTrustedDomainByName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_OpenTrustedDomainByName(pull, NDR_IN, &r); @@ -3333,6 +3775,12 @@ static BOOL api_lsa_OpenTrustedDomainByName(pipes_struct *p) r.out.result = _lsa_OpenTrustedDomainByName(p, r.in.handle, r.in.name, r.in.access_mask, r.out.trustdom_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, &r); @@ -3349,7 +3797,7 @@ static BOOL api_lsa_OpenTrustedDomainByName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3374,8 +3822,10 @@ static BOOL api_lsa_TestCall(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_TestCall(pull, NDR_IN, &r); @@ -3389,6 +3839,12 @@ static BOOL api_lsa_TestCall(pipes_struct *p) r.out.result = _lsa_TestCall(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_TestCall, &r); @@ -3405,7 +3861,7 @@ static BOOL api_lsa_TestCall(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3430,8 +3886,10 @@ static BOOL api_lsa_LookupSids2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupSids2(pull, NDR_IN, &r); @@ -3454,6 +3912,12 @@ static BOOL api_lsa_LookupSids2(pipes_struct *p) r.out.count = r.in.count; r.out.result = _lsa_LookupSids2(p, r.in.handle, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, &r); @@ -3470,7 +3934,7 @@ static BOOL api_lsa_LookupSids2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3495,8 +3959,10 @@ static BOOL api_lsa_LookupNames2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupNames2(pull, NDR_IN, &r); @@ -3519,6 +3985,12 @@ static BOOL api_lsa_LookupNames2(pipes_struct *p) r.out.count = r.in.count; r.out.result = _lsa_LookupNames2(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, &r); @@ -3535,7 +4007,7 @@ static BOOL api_lsa_LookupNames2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3560,8 +4032,10 @@ static BOOL api_lsa_CreateTrustedDomainEx2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CreateTrustedDomainEx2(pull, NDR_IN, &r); @@ -3575,6 +4049,12 @@ static BOOL api_lsa_CreateTrustedDomainEx2(pipes_struct *p) r.out.result = _lsa_CreateTrustedDomainEx2(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, &r); @@ -3591,7 +4071,7 @@ static BOOL api_lsa_CreateTrustedDomainEx2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3616,8 +4096,10 @@ static BOOL api_lsa_CREDRWRITE(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRWRITE(pull, NDR_IN, &r); @@ -3631,6 +4113,12 @@ static BOOL api_lsa_CREDRWRITE(pipes_struct *p) r.out.result = _lsa_CREDRWRITE(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, &r); @@ -3647,7 +4135,7 @@ static BOOL api_lsa_CREDRWRITE(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3672,8 +4160,10 @@ static BOOL api_lsa_CREDRREAD(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRREAD(pull, NDR_IN, &r); @@ -3687,6 +4177,12 @@ static BOOL api_lsa_CREDRREAD(pipes_struct *p) r.out.result = _lsa_CREDRREAD(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, &r); @@ -3703,7 +4199,7 @@ static BOOL api_lsa_CREDRREAD(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3728,8 +4224,10 @@ static BOOL api_lsa_CREDRENUMERATE(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRENUMERATE(pull, NDR_IN, &r); @@ -3743,6 +4241,12 @@ static BOOL api_lsa_CREDRENUMERATE(pipes_struct *p) r.out.result = _lsa_CREDRENUMERATE(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, &r); @@ -3759,7 +4263,7 @@ static BOOL api_lsa_CREDRENUMERATE(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3784,8 +4288,10 @@ static BOOL api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRWRITEDOMAINCREDENTIALS(pull, NDR_IN, &r); @@ -3799,6 +4305,12 @@ static BOOL api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p) r.out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r); @@ -3815,7 +4327,7 @@ static BOOL api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3840,8 +4352,10 @@ static BOOL api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRREADDOMAINCREDENTIALS(pull, NDR_IN, &r); @@ -3855,6 +4369,12 @@ static BOOL api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p) r.out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r); @@ -3871,7 +4391,7 @@ static BOOL api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3896,8 +4416,10 @@ static BOOL api_lsa_CREDRDELETE(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRDELETE(pull, NDR_IN, &r); @@ -3911,6 +4433,12 @@ static BOOL api_lsa_CREDRDELETE(pipes_struct *p) r.out.result = _lsa_CREDRDELETE(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, &r); @@ -3927,7 +4455,7 @@ static BOOL api_lsa_CREDRDELETE(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3952,8 +4480,10 @@ static BOOL api_lsa_CREDRGETTARGETINFO(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRGETTARGETINFO(pull, NDR_IN, &r); @@ -3967,6 +4497,12 @@ static BOOL api_lsa_CREDRGETTARGETINFO(pipes_struct *p) r.out.result = _lsa_CREDRGETTARGETINFO(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, &r); @@ -3983,7 +4519,7 @@ static BOOL api_lsa_CREDRGETTARGETINFO(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4008,8 +4544,10 @@ static BOOL api_lsa_CREDRPROFILELOADED(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRPROFILELOADED(pull, NDR_IN, &r); @@ -4023,6 +4561,12 @@ static BOOL api_lsa_CREDRPROFILELOADED(pipes_struct *p) r.out.result = _lsa_CREDRPROFILELOADED(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, &r); @@ -4039,7 +4583,7 @@ static BOOL api_lsa_CREDRPROFILELOADED(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4064,8 +4608,10 @@ static BOOL api_lsa_LookupNames3(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupNames3(pull, NDR_IN, &r); @@ -4088,6 +4634,12 @@ static BOOL api_lsa_LookupNames3(pipes_struct *p) r.out.count = r.in.count; r.out.result = _lsa_LookupNames3(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, &r); @@ -4104,7 +4656,7 @@ static BOOL api_lsa_LookupNames3(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4129,8 +4681,10 @@ static BOOL api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRGETSESSIONTYPES(pull, NDR_IN, &r); @@ -4144,6 +4698,12 @@ static BOOL api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p) r.out.result = _lsa_CREDRGETSESSIONTYPES(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, &r); @@ -4160,7 +4720,7 @@ static BOOL api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4185,8 +4745,10 @@ static BOOL api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSARREGISTERAUDITEVENT(pull, NDR_IN, &r); @@ -4200,6 +4762,12 @@ static BOOL api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p) r.out.result = _lsa_LSARREGISTERAUDITEVENT(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r); @@ -4216,7 +4784,7 @@ static BOOL api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4241,8 +4809,10 @@ static BOOL api_lsa_LSARGENAUDITEVENT(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSARGENAUDITEVENT(pull, NDR_IN, &r); @@ -4256,6 +4826,12 @@ static BOOL api_lsa_LSARGENAUDITEVENT(pipes_struct *p) r.out.result = _lsa_LSARGENAUDITEVENT(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, &r); @@ -4272,7 +4848,7 @@ static BOOL api_lsa_LSARGENAUDITEVENT(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4297,8 +4873,10 @@ static BOOL api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSARUNREGISTERAUDITEVENT(pull, NDR_IN, &r); @@ -4312,6 +4890,12 @@ static BOOL api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) r.out.result = _lsa_LSARUNREGISTERAUDITEVENT(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r); @@ -4328,7 +4912,7 @@ static BOOL api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4353,8 +4937,10 @@ static BOOL api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSARQUERYFORESTTRUSTINFORMATION(pull, NDR_IN, &r); @@ -4368,6 +4954,12 @@ static BOOL api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p) r.out.result = _lsa_LSARQUERYFORESTTRUSTINFORMATION(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSARQUERYFORESTTRUSTINFORMATION, &r); @@ -4384,7 +4976,7 @@ static BOOL api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4409,8 +5001,10 @@ static BOOL api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSARSETFORESTTRUSTINFORMATION(pull, NDR_IN, &r); @@ -4424,6 +5018,12 @@ static BOOL api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p) r.out.result = _lsa_LSARSETFORESTTRUSTINFORMATION(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r); @@ -4440,7 +5040,7 @@ static BOOL api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4465,8 +5065,10 @@ static BOOL api_lsa_CREDRRENAME(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_CREDRRENAME(pull, NDR_IN, &r); @@ -4480,6 +5082,12 @@ static BOOL api_lsa_CREDRRENAME(pipes_struct *p) r.out.result = _lsa_CREDRRENAME(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, &r); @@ -4496,7 +5104,7 @@ static BOOL api_lsa_CREDRRENAME(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4521,8 +5129,10 @@ static BOOL api_lsa_LookupSids3(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupSids3(pull, NDR_IN, &r); @@ -4545,6 +5155,12 @@ static BOOL api_lsa_LookupSids3(pipes_struct *p) r.out.count = r.in.count; r.out.result = _lsa_LookupSids3(p, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, &r); @@ -4561,7 +5177,7 @@ static BOOL api_lsa_LookupSids3(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4586,8 +5202,10 @@ static BOOL api_lsa_LookupNames4(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LookupNames4(pull, NDR_IN, &r); @@ -4610,6 +5228,12 @@ static BOOL api_lsa_LookupNames4(pipes_struct *p) r.out.count = r.in.count; r.out.result = _lsa_LookupNames4(p, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, &r); @@ -4626,7 +5250,7 @@ static BOOL api_lsa_LookupNames4(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4651,8 +5275,10 @@ static BOOL api_lsa_LSAROPENPOLICYSCE(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSAROPENPOLICYSCE(pull, NDR_IN, &r); @@ -4666,6 +5292,12 @@ static BOOL api_lsa_LSAROPENPOLICYSCE(pipes_struct *p) r.out.result = _lsa_LSAROPENPOLICYSCE(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, &r); @@ -4682,7 +5314,7 @@ static BOOL api_lsa_LSAROPENPOLICYSCE(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4707,8 +5339,10 @@ static BOOL api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pull, NDR_IN, &r); @@ -4722,6 +5356,12 @@ static BOOL api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p) r.out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &r); @@ -4738,7 +5378,7 @@ static BOOL api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4763,8 +5403,10 @@ static BOOL api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pull, NDR_IN, &r); @@ -4778,6 +5420,12 @@ static BOOL api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p) r.out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &r); @@ -4794,7 +5442,7 @@ static BOOL api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -4819,8 +5467,10 @@ static BOOL api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_lsa_LSARADTREPORTSECURITYEVENT(pull, NDR_IN, &r); @@ -4834,6 +5484,12 @@ static BOOL api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p) r.out.result = _lsa_LSARADTREPORTSECURITYEVENT(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &r); @@ -4850,7 +5506,7 @@ static BOOL api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_netlogon.c b/source3/librpc/gen_ndr/srv_netlogon.c index 75605c6650..2a33db9f19 100644 --- a/source3/librpc/gen_ndr/srv_netlogon.c +++ b/source3/librpc/gen_ndr/srv_netlogon.c @@ -21,8 +21,10 @@ static BOOL api_netr_LogonUasLogon(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonUasLogon(pull, NDR_IN, &r); @@ -43,6 +45,12 @@ static BOOL api_netr_LogonUasLogon(pipes_struct *p) r.out.result = _netr_LogonUasLogon(p, r.in.server_name, r.in.account_name, r.in.workstation, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, &r); @@ -59,7 +67,7 @@ static BOOL api_netr_LogonUasLogon(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -84,8 +92,10 @@ static BOOL api_netr_LogonUasLogoff(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonUasLogoff(pull, NDR_IN, &r); @@ -106,6 +116,12 @@ static BOOL api_netr_LogonUasLogoff(pipes_struct *p) r.out.result = _netr_LogonUasLogoff(p, r.in.server_name, r.in.account_name, r.in.workstation, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, &r); @@ -122,7 +138,7 @@ static BOOL api_netr_LogonUasLogoff(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -147,8 +163,10 @@ static BOOL api_netr_LogonSamLogon(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonSamLogon(pull, NDR_IN, &r); @@ -176,6 +194,12 @@ static BOOL api_netr_LogonSamLogon(pipes_struct *p) r.out.result = _netr_LogonSamLogon(p, r.in.server_name, r.in.computer_name, r.in.credential, r.in.return_authenticator, r.in.logon_level, r.in.logon, r.in.validation_level, r.out.validation, r.out.authoritative); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, &r); @@ -192,7 +216,7 @@ static BOOL api_netr_LogonSamLogon(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -217,8 +241,10 @@ static BOOL api_netr_LogonSamLogoff(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonSamLogoff(pull, NDR_IN, &r); @@ -234,6 +260,12 @@ static BOOL api_netr_LogonSamLogoff(pipes_struct *p) r.out.return_authenticator = r.in.return_authenticator; r.out.result = _netr_LogonSamLogoff(p, r.in.server_name, r.in.computer_name, r.in.credential, r.in.return_authenticator, r.in.logon_level, r.in.logon); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, &r); @@ -250,7 +282,7 @@ static BOOL api_netr_LogonSamLogoff(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -275,8 +307,10 @@ static BOOL api_netr_ServerReqChallenge(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_ServerReqChallenge(pull, NDR_IN, &r); @@ -292,6 +326,12 @@ static BOOL api_netr_ServerReqChallenge(pipes_struct *p) r.out.credentials = r.in.credentials; r.out.result = _netr_ServerReqChallenge(p, r.in.server_name, r.in.computer_name, r.in.credentials); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r); @@ -308,7 +348,7 @@ static BOOL api_netr_ServerReqChallenge(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -333,8 +373,10 @@ static BOOL api_netr_ServerAuthenticate(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_ServerAuthenticate(pull, NDR_IN, &r); @@ -350,6 +392,12 @@ static BOOL api_netr_ServerAuthenticate(pipes_struct *p) r.out.credentials = r.in.credentials; r.out.result = _netr_ServerAuthenticate(p, r.in.server_name, r.in.account_name, r.in.secure_channel_type, r.in.computer_name, r.in.credentials); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r); @@ -366,7 +414,7 @@ static BOOL api_netr_ServerAuthenticate(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -391,8 +439,10 @@ static BOOL api_netr_ServerPasswordSet(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_ServerPasswordSet(pull, NDR_IN, &r); @@ -413,6 +463,12 @@ static BOOL api_netr_ServerPasswordSet(pipes_struct *p) r.out.result = _netr_ServerPasswordSet(p, r.in.server_name, r.in.account_name, r.in.secure_channel_type, r.in.computer_name, r.in.credential, r.in.new_password, r.out.return_authenticator); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r); @@ -429,7 +485,7 @@ static BOOL api_netr_ServerPasswordSet(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -454,8 +510,10 @@ static BOOL api_netr_DatabaseDeltas(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DatabaseDeltas(pull, NDR_IN, &r); @@ -478,6 +536,12 @@ static BOOL api_netr_DatabaseDeltas(pipes_struct *p) r.out.result = _netr_DatabaseDeltas(p, r.in.logon_server, r.in.computername, r.in.credential, r.in.return_authenticator, r.in.database_id, r.in.sequence_num, r.in.preferredmaximumlength, r.out.delta_enum_array); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r); @@ -494,7 +558,7 @@ static BOOL api_netr_DatabaseDeltas(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -519,8 +583,10 @@ static BOOL api_netr_DatabaseSync(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DatabaseSync(pull, NDR_IN, &r); @@ -543,6 +609,12 @@ static BOOL api_netr_DatabaseSync(pipes_struct *p) r.out.result = _netr_DatabaseSync(p, r.in.logon_server, r.in.computername, r.in.credential, r.in.return_authenticator, r.in.database_id, r.in.sync_context, r.in.preferredmaximumlength, r.out.delta_enum_array); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r); @@ -559,7 +631,7 @@ static BOOL api_netr_DatabaseSync(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -584,8 +656,10 @@ static BOOL api_netr_AccountDeltas(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_AccountDeltas(pull, NDR_IN, &r); @@ -625,6 +699,12 @@ static BOOL api_netr_AccountDeltas(pipes_struct *p) r.out.result = _netr_AccountDeltas(p, r.in.logon_server, r.in.computername, r.in.credential, r.in.return_authenticator, r.in.uas, r.in.count, r.in.level, r.in.buffersize, r.out.buffer, r.out.count_returned, r.out.total_entries, r.out.recordid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r); @@ -641,7 +721,7 @@ static BOOL api_netr_AccountDeltas(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -666,8 +746,10 @@ static BOOL api_netr_AccountSync(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_AccountSync(pull, NDR_IN, &r); @@ -708,6 +790,12 @@ static BOOL api_netr_AccountSync(pipes_struct *p) r.out.recordid = r.in.recordid; r.out.result = _netr_AccountSync(p, r.in.logon_server, r.in.computername, r.in.credential, r.in.return_authenticator, r.in.reference, r.in.level, r.in.buffersize, r.out.buffer, r.out.count_returned, r.out.total_entries, r.out.next_reference, r.in.recordid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r); @@ -724,7 +812,7 @@ static BOOL api_netr_AccountSync(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -749,8 +837,10 @@ static BOOL api_netr_GetDcName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_GetDcName(pull, NDR_IN, &r); @@ -771,6 +861,12 @@ static BOOL api_netr_GetDcName(pipes_struct *p) r.out.result = _netr_GetDcName(p, r.in.logon_server, r.in.domainname, r.out.dcname); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r); @@ -787,7 +883,7 @@ static BOOL api_netr_GetDcName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -812,8 +908,10 @@ static BOOL api_netr_LogonControl(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonControl(pull, NDR_IN, &r); @@ -834,6 +932,12 @@ static BOOL api_netr_LogonControl(pipes_struct *p) r.out.result = _netr_LogonControl(p, r.in.logon_server, r.in.function_code, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r); @@ -850,7 +954,7 @@ static BOOL api_netr_LogonControl(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -875,8 +979,10 @@ static BOOL api_netr_GetAnyDCName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_GetAnyDCName(pull, NDR_IN, &r); @@ -897,6 +1003,12 @@ static BOOL api_netr_GetAnyDCName(pipes_struct *p) r.out.result = _netr_GetAnyDCName(p, r.in.logon_server, r.in.domainname, r.out.dcname); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r); @@ -913,7 +1025,7 @@ static BOOL api_netr_GetAnyDCName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -938,8 +1050,10 @@ static BOOL api_netr_LogonControl2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonControl2(pull, NDR_IN, &r); @@ -960,6 +1074,12 @@ static BOOL api_netr_LogonControl2(pipes_struct *p) r.out.result = _netr_LogonControl2(p, r.in.logon_server, r.in.function_code, r.in.level, r.in.data, r.out.query); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r); @@ -976,7 +1096,7 @@ static BOOL api_netr_LogonControl2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1001,8 +1121,10 @@ static BOOL api_netr_ServerAuthenticate2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_ServerAuthenticate2(pull, NDR_IN, &r); @@ -1019,6 +1141,12 @@ static BOOL api_netr_ServerAuthenticate2(pipes_struct *p) r.out.negotiate_flags = r.in.negotiate_flags; r.out.result = _netr_ServerAuthenticate2(p, r.in.server_name, r.in.account_name, r.in.secure_channel_type, r.in.computer_name, r.in.credentials, r.in.negotiate_flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r); @@ -1035,7 +1163,7 @@ static BOOL api_netr_ServerAuthenticate2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1060,8 +1188,10 @@ static BOOL api_netr_DatabaseSync2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DatabaseSync2(pull, NDR_IN, &r); @@ -1084,6 +1214,12 @@ static BOOL api_netr_DatabaseSync2(pipes_struct *p) r.out.result = _netr_DatabaseSync2(p, r.in.logon_server, r.in.computername, r.in.credential, r.in.return_authenticator, r.in.database_id, r.in.restart_state, r.in.sync_context, r.in.preferredmaximumlength, r.out.delta_enum_array); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r); @@ -1100,7 +1236,7 @@ static BOOL api_netr_DatabaseSync2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1125,8 +1261,10 @@ static BOOL api_netr_DatabaseRedo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DatabaseRedo(pull, NDR_IN, &r); @@ -1148,6 +1286,12 @@ static BOOL api_netr_DatabaseRedo(pipes_struct *p) r.out.result = _netr_DatabaseRedo(p, r.in.logon_server, r.in.computername, r.in.credential, r.in.return_authenticator, r.in.change_log_entry, r.in.change_log_entry_size, r.out.delta_enum_array); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r); @@ -1164,7 +1308,7 @@ static BOOL api_netr_DatabaseRedo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1189,8 +1333,10 @@ static BOOL api_netr_LogonControl2Ex(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonControl2Ex(pull, NDR_IN, &r); @@ -1211,6 +1357,12 @@ static BOOL api_netr_LogonControl2Ex(pipes_struct *p) r.out.result = _netr_LogonControl2Ex(p, r.in.logon_server, r.in.function_code, r.in.level, r.in.data, r.out.query); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r); @@ -1227,7 +1379,7 @@ static BOOL api_netr_LogonControl2Ex(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1252,8 +1404,10 @@ static BOOL api_netr_NETRENUMERATETRUSTEDDOMAINS(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINS(pull, NDR_IN, &r); @@ -1267,6 +1421,12 @@ static BOOL api_netr_NETRENUMERATETRUSTEDDOMAINS(pipes_struct *p) r.out.result = _netr_NETRENUMERATETRUSTEDDOMAINS(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, &r); @@ -1283,7 +1443,7 @@ static BOOL api_netr_NETRENUMERATETRUSTEDDOMAINS(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1308,8 +1468,10 @@ static BOOL api_netr_DsRGetDCName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DsRGetDCName(pull, NDR_IN, &r); @@ -1330,6 +1492,12 @@ static BOOL api_netr_DsRGetDCName(pipes_struct *p) r.out.result = _netr_DsRGetDCName(p, r.in.server_unc, r.in.domain_name, r.in.domain_guid, r.in.site_guid, r.in.flags, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r); @@ -1346,7 +1514,7 @@ static BOOL api_netr_DsRGetDCName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1371,8 +1539,10 @@ static BOOL api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRLOGONDUMMYROUTINE1(pull, NDR_IN, &r); @@ -1386,6 +1556,12 @@ static BOOL api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) r.out.result = _netr_NETRLOGONDUMMYROUTINE1(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r); @@ -1402,7 +1578,7 @@ static BOOL api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1427,8 +1603,10 @@ static BOOL api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRLOGONSETSERVICEBITS(pull, NDR_IN, &r); @@ -1442,6 +1620,12 @@ static BOOL api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p) r.out.result = _netr_NETRLOGONSETSERVICEBITS(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r); @@ -1458,7 +1642,7 @@ static BOOL api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1483,8 +1667,10 @@ static BOOL api_netr_NETRLOGONGETTRUSTRID(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRLOGONGETTRUSTRID(pull, NDR_IN, &r); @@ -1498,6 +1684,12 @@ static BOOL api_netr_NETRLOGONGETTRUSTRID(pipes_struct *p) r.out.result = _netr_NETRLOGONGETTRUSTRID(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTRUSTRID, &r); @@ -1514,7 +1706,7 @@ static BOOL api_netr_NETRLOGONGETTRUSTRID(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1539,8 +1731,10 @@ static BOOL api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(pull, NDR_IN, &r); @@ -1554,6 +1748,12 @@ static BOOL api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p) r.out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r); @@ -1570,7 +1770,7 @@ static BOOL api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1595,8 +1795,10 @@ static BOOL api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(pull, NDR_IN, &r); @@ -1610,6 +1812,12 @@ static BOOL api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p) r.out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r); @@ -1626,7 +1834,7 @@ static BOOL api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1651,8 +1859,10 @@ static BOOL api_netr_ServerAuthenticate3(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_ServerAuthenticate3(pull, NDR_IN, &r); @@ -1675,6 +1885,12 @@ static BOOL api_netr_ServerAuthenticate3(pipes_struct *p) r.out.result = _netr_ServerAuthenticate3(p, r.in.server_name, r.in.account_name, r.in.secure_channel_type, r.in.computer_name, r.in.credentials, r.in.negotiate_flags, r.out.rid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, &r); @@ -1691,7 +1907,7 @@ static BOOL api_netr_ServerAuthenticate3(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1716,8 +1932,10 @@ static BOOL api_netr_DsRGetDCNameEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DsRGetDCNameEx(pull, NDR_IN, &r); @@ -1738,6 +1956,12 @@ static BOOL api_netr_DsRGetDCNameEx(pipes_struct *p) r.out.result = _netr_DsRGetDCNameEx(p, r.in.server_unc, r.in.domain_name, r.in.domain_guid, r.in.site_name, r.in.flags, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, &r); @@ -1754,7 +1978,7 @@ static BOOL api_netr_DsRGetDCNameEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1779,8 +2003,10 @@ static BOOL api_netr_DsRGetSiteName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DsRGetSiteName(pull, NDR_IN, &r); @@ -1801,6 +2027,12 @@ static BOOL api_netr_DsRGetSiteName(pipes_struct *p) r.out.result = _netr_DsRGetSiteName(p, r.in.computer_name, r.out.site); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, &r); @@ -1817,7 +2049,7 @@ static BOOL api_netr_DsRGetSiteName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1842,8 +2074,10 @@ static BOOL api_netr_LogonGetDomainInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonGetDomainInfo(pull, NDR_IN, &r); @@ -1865,6 +2099,12 @@ static BOOL api_netr_LogonGetDomainInfo(pipes_struct *p) r.out.result = _netr_LogonGetDomainInfo(p, r.in.server_name, r.in.computer_name, r.in.credential, r.in.return_authenticator, r.in.level, r.in.query, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, &r); @@ -1881,7 +2121,7 @@ static BOOL api_netr_LogonGetDomainInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1906,8 +2146,10 @@ static BOOL api_netr_ServerPasswordSet2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_ServerPasswordSet2(pull, NDR_IN, &r); @@ -1928,6 +2170,12 @@ static BOOL api_netr_ServerPasswordSet2(pipes_struct *p) r.out.result = _netr_ServerPasswordSet2(p, r.in.server_name, r.in.account_name, r.in.secure_channel_type, r.in.computer_name, r.in.credential, r.in.new_password, r.out.return_authenticator); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r); @@ -1944,7 +2192,7 @@ static BOOL api_netr_ServerPasswordSet2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1969,8 +2217,10 @@ static BOOL api_netr_NETRSERVERPASSWORDGET(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRSERVERPASSWORDGET(pull, NDR_IN, &r); @@ -1984,6 +2234,12 @@ static BOOL api_netr_NETRSERVERPASSWORDGET(pipes_struct *p) r.out.result = _netr_NETRSERVERPASSWORDGET(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRSERVERPASSWORDGET, &r); @@ -2000,7 +2256,7 @@ static BOOL api_netr_NETRSERVERPASSWORDGET(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2025,8 +2281,10 @@ static BOOL api_netr_NETRLOGONSENDTOSAM(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRLOGONSENDTOSAM(pull, NDR_IN, &r); @@ -2040,6 +2298,12 @@ static BOOL api_netr_NETRLOGONSENDTOSAM(pipes_struct *p) r.out.result = _netr_NETRLOGONSENDTOSAM(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, &r); @@ -2056,7 +2320,7 @@ static BOOL api_netr_NETRLOGONSENDTOSAM(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2081,8 +2345,10 @@ static BOOL api_netr_DSRADDRESSTOSITENAMESW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DSRADDRESSTOSITENAMESW(pull, NDR_IN, &r); @@ -2096,6 +2362,12 @@ static BOOL api_netr_DSRADDRESSTOSITENAMESW(pipes_struct *p) r.out.result = _netr_DSRADDRESSTOSITENAMESW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESW, &r); @@ -2112,7 +2384,7 @@ static BOOL api_netr_DSRADDRESSTOSITENAMESW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2137,8 +2409,10 @@ static BOOL api_netr_DsRGetDCNameEx2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DsRGetDCNameEx2(pull, NDR_IN, &r); @@ -2159,6 +2433,12 @@ static BOOL api_netr_DsRGetDCNameEx2(pipes_struct *p) r.out.result = _netr_DsRGetDCNameEx2(p, r.in.server_unc, r.in.client_account, r.in.mask, r.in.domain_name, r.in.domain_guid, r.in.site_name, r.in.flags, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, &r); @@ -2175,7 +2455,7 @@ static BOOL api_netr_DsRGetDCNameEx2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2200,8 +2480,10 @@ static BOOL api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pull, NDR_IN, &r); @@ -2215,6 +2497,12 @@ static BOOL api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p) r.out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r); @@ -2231,7 +2519,7 @@ static BOOL api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2256,8 +2544,10 @@ static BOOL api_netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINSEX(pull, NDR_IN, &r); @@ -2271,6 +2561,12 @@ static BOOL api_netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p) r.out.result = _netr_NETRENUMERATETRUSTEDDOMAINSEX(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, &r); @@ -2287,7 +2583,7 @@ static BOOL api_netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2312,8 +2608,10 @@ static BOOL api_netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DSRADDRESSTOSITENAMESEXW(pull, NDR_IN, &r); @@ -2327,6 +2625,12 @@ static BOOL api_netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p) r.out.result = _netr_DSRADDRESSTOSITENAMESEXW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, &r); @@ -2343,7 +2647,7 @@ static BOOL api_netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2368,8 +2672,10 @@ static BOOL api_netr_DSRGETDCSITECOVERAGEW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DSRGETDCSITECOVERAGEW(pull, NDR_IN, &r); @@ -2383,6 +2689,12 @@ static BOOL api_netr_DSRGETDCSITECOVERAGEW(pipes_struct *p) r.out.result = _netr_DSRGETDCSITECOVERAGEW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DSRGETDCSITECOVERAGEW, &r); @@ -2399,7 +2711,7 @@ static BOOL api_netr_DSRGETDCSITECOVERAGEW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2424,8 +2736,10 @@ static BOOL api_netr_LogonSamLogonEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonSamLogonEx(pull, NDR_IN, &r); @@ -2453,6 +2767,12 @@ static BOOL api_netr_LogonSamLogonEx(pipes_struct *p) r.out.flags = r.in.flags; r.out.result = _netr_LogonSamLogonEx(p, r.in.server_name, r.in.computer_name, r.in.logon_level, r.in.logon, r.in.validation_level, r.out.validation, r.out.authoritative, r.in.flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, &r); @@ -2469,7 +2789,7 @@ static BOOL api_netr_LogonSamLogonEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2494,8 +2814,10 @@ static BOOL api_netr_DsrEnumerateDomainTrusts(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DsrEnumerateDomainTrusts(pull, NDR_IN, &r); @@ -2522,6 +2844,12 @@ static BOOL api_netr_DsrEnumerateDomainTrusts(pipes_struct *p) r.out.result = _netr_DsrEnumerateDomainTrusts(p, r.in.server_name, r.in.trust_flags, r.out.count, r.out.trusts); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r); @@ -2538,7 +2866,7 @@ static BOOL api_netr_DsrEnumerateDomainTrusts(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2563,8 +2891,10 @@ static BOOL api_netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS(pull, NDR_IN, &r); @@ -2578,6 +2908,12 @@ static BOOL api_netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p) r.out.result = _netr_DSRDEREGISTERDNSHOSTRECORDS(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, &r); @@ -2594,7 +2930,7 @@ static BOOL api_netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2619,8 +2955,10 @@ static BOOL api_netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRSERVERTRUSTPASSWORDSGET(pull, NDR_IN, &r); @@ -2634,6 +2972,12 @@ static BOOL api_netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p) r.out.result = _netr_NETRSERVERTRUSTPASSWORDSGET(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, &r); @@ -2650,7 +2994,7 @@ static BOOL api_netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2675,8 +3019,10 @@ static BOOL api_netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_DSRGETFORESTTRUSTINFORMATION(pull, NDR_IN, &r); @@ -2690,6 +3036,12 @@ static BOOL api_netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p) r.out.result = _netr_DSRGETFORESTTRUSTINFORMATION(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, &r); @@ -2706,7 +3058,7 @@ static BOOL api_netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2731,8 +3083,10 @@ static BOOL api_netr_NETRGETFORESTTRUSTINFORMATION(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRGETFORESTTRUSTINFORMATION(pull, NDR_IN, &r); @@ -2746,6 +3100,12 @@ static BOOL api_netr_NETRGETFORESTTRUSTINFORMATION(pipes_struct *p) r.out.result = _netr_NETRGETFORESTTRUSTINFORMATION(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, &r); @@ -2762,7 +3122,7 @@ static BOOL api_netr_NETRGETFORESTTRUSTINFORMATION(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2787,8 +3147,10 @@ static BOOL api_netr_LogonSamLogonWithFlags(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_LogonSamLogonWithFlags(pull, NDR_IN, &r); @@ -2817,6 +3179,12 @@ static BOOL api_netr_LogonSamLogonWithFlags(pipes_struct *p) r.out.flags = r.in.flags; r.out.result = _netr_LogonSamLogonWithFlags(p, r.in.server_name, r.in.computer_name, r.in.credential, r.in.return_authenticator, r.in.logon_level, r.in.logon, r.in.validation_level, r.out.validation, r.out.authoritative, r.in.flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, &r); @@ -2833,7 +3201,7 @@ static BOOL api_netr_LogonSamLogonWithFlags(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2858,8 +3226,10 @@ static BOOL api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_netr_NETRSERVERGETTRUSTINFO(pull, NDR_IN, &r); @@ -2873,6 +3243,12 @@ static BOOL api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p) r.out.result = _netr_NETRSERVERGETTRUSTINFO(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r); @@ -2889,7 +3265,7 @@ static BOOL api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_srvsvc.c b/source3/librpc/gen_ndr/srv_srvsvc.c index 7e987316d4..351b3f4032 100644 --- a/source3/librpc/gen_ndr/srv_srvsvc.c +++ b/source3/librpc/gen_ndr/srv_srvsvc.c @@ -21,8 +21,10 @@ static BOOL api_srvsvc_NetCharDevEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetCharDevEnum(pull, NDR_IN, &r); @@ -46,6 +48,12 @@ static BOOL api_srvsvc_NetCharDevEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetCharDevEnum(p, r.in.server_unc, r.in.level, r.in.ctr, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevEnum, &r); @@ -62,7 +70,7 @@ static BOOL api_srvsvc_NetCharDevEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -87,8 +95,10 @@ static BOOL api_srvsvc_NetCharDevGetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetCharDevGetInfo(pull, NDR_IN, &r); @@ -109,6 +119,12 @@ static BOOL api_srvsvc_NetCharDevGetInfo(pipes_struct *p) r.out.result = _srvsvc_NetCharDevGetInfo(p, r.in.server_unc, r.in.device_name, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevGetInfo, &r); @@ -125,7 +141,7 @@ static BOOL api_srvsvc_NetCharDevGetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -150,8 +166,10 @@ static BOOL api_srvsvc_NetCharDevControl(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetCharDevControl(pull, NDR_IN, &r); @@ -165,6 +183,12 @@ static BOOL api_srvsvc_NetCharDevControl(pipes_struct *p) r.out.result = _srvsvc_NetCharDevControl(p, r.in.server_unc, r.in.device_name, r.in.opcode); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevControl, &r); @@ -181,7 +205,7 @@ static BOOL api_srvsvc_NetCharDevControl(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -206,8 +230,10 @@ static BOOL api_srvsvc_NetCharDevQEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetCharDevQEnum(pull, NDR_IN, &r); @@ -231,6 +257,12 @@ static BOOL api_srvsvc_NetCharDevQEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetCharDevQEnum(p, r.in.server_unc, r.in.user, r.in.level, r.in.ctr, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQEnum, &r); @@ -247,7 +279,7 @@ static BOOL api_srvsvc_NetCharDevQEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -272,8 +304,10 @@ static BOOL api_srvsvc_NetCharDevQGetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetCharDevQGetInfo(pull, NDR_IN, &r); @@ -294,6 +328,12 @@ static BOOL api_srvsvc_NetCharDevQGetInfo(pipes_struct *p) r.out.result = _srvsvc_NetCharDevQGetInfo(p, r.in.server_unc, r.in.queue_name, r.in.user, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, &r); @@ -310,7 +350,7 @@ static BOOL api_srvsvc_NetCharDevQGetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -335,8 +375,10 @@ static BOOL api_srvsvc_NetCharDevQSetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetCharDevQSetInfo(pull, NDR_IN, &r); @@ -352,6 +394,12 @@ static BOOL api_srvsvc_NetCharDevQSetInfo(pipes_struct *p) r.out.parm_error = r.in.parm_error; r.out.result = _srvsvc_NetCharDevQSetInfo(p, r.in.server_unc, r.in.queue_name, r.in.level, r.in.info, r.in.parm_error); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, &r); @@ -368,7 +416,7 @@ static BOOL api_srvsvc_NetCharDevQSetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -393,8 +441,10 @@ static BOOL api_srvsvc_NetCharDevQPurge(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetCharDevQPurge(pull, NDR_IN, &r); @@ -408,6 +458,12 @@ static BOOL api_srvsvc_NetCharDevQPurge(pipes_struct *p) r.out.result = _srvsvc_NetCharDevQPurge(p, r.in.server_unc, r.in.queue_name); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, &r); @@ -424,7 +480,7 @@ static BOOL api_srvsvc_NetCharDevQPurge(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -449,8 +505,10 @@ static BOOL api_srvsvc_NetCharDevQPurgeSelf(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetCharDevQPurgeSelf(pull, NDR_IN, &r); @@ -464,6 +522,12 @@ static BOOL api_srvsvc_NetCharDevQPurgeSelf(pipes_struct *p) r.out.result = _srvsvc_NetCharDevQPurgeSelf(p, r.in.server_unc, r.in.queue_name, r.in.computer_name); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r); @@ -480,7 +544,7 @@ static BOOL api_srvsvc_NetCharDevQPurgeSelf(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -505,8 +569,10 @@ static BOOL api_srvsvc_NetConnEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetConnEnum(pull, NDR_IN, &r); @@ -530,6 +596,12 @@ static BOOL api_srvsvc_NetConnEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetConnEnum(p, r.in.server_unc, r.in.path, r.in.level, r.in.ctr, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, &r); @@ -546,7 +618,7 @@ static BOOL api_srvsvc_NetConnEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -571,8 +643,10 @@ static BOOL api_srvsvc_NetFileEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetFileEnum(pull, NDR_IN, &r); @@ -596,6 +670,12 @@ static BOOL api_srvsvc_NetFileEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetFileEnum(p, r.in.server_unc, r.in.path, r.in.user, r.in.level, r.in.ctr, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, &r); @@ -612,7 +692,7 @@ static BOOL api_srvsvc_NetFileEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -637,8 +717,10 @@ static BOOL api_srvsvc_NetFileGetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetFileGetInfo(pull, NDR_IN, &r); @@ -659,6 +741,12 @@ static BOOL api_srvsvc_NetFileGetInfo(pipes_struct *p) r.out.result = _srvsvc_NetFileGetInfo(p, r.in.server_unc, r.in.fid, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, &r); @@ -675,7 +763,7 @@ static BOOL api_srvsvc_NetFileGetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -700,8 +788,10 @@ static BOOL api_srvsvc_NetFileClose(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetFileClose(pull, NDR_IN, &r); @@ -715,6 +805,12 @@ static BOOL api_srvsvc_NetFileClose(pipes_struct *p) r.out.result = _srvsvc_NetFileClose(p, r.in.server_unc, r.in.fid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, &r); @@ -731,7 +827,7 @@ static BOOL api_srvsvc_NetFileClose(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -756,8 +852,10 @@ static BOOL api_srvsvc_NetSessEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetSessEnum(pull, NDR_IN, &r); @@ -781,6 +879,12 @@ static BOOL api_srvsvc_NetSessEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetSessEnum(p, r.in.server_unc, r.in.client, r.in.user, r.in.level, r.in.ctr, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, &r); @@ -797,7 +901,7 @@ static BOOL api_srvsvc_NetSessEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -822,8 +926,10 @@ static BOOL api_srvsvc_NetSessDel(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetSessDel(pull, NDR_IN, &r); @@ -837,6 +943,12 @@ static BOOL api_srvsvc_NetSessDel(pipes_struct *p) r.out.result = _srvsvc_NetSessDel(p, r.in.server_unc, r.in.client, r.in.user); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, &r); @@ -853,7 +965,7 @@ static BOOL api_srvsvc_NetSessDel(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -878,8 +990,10 @@ static BOOL api_srvsvc_NetShareAdd(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareAdd(pull, NDR_IN, &r); @@ -895,6 +1009,12 @@ static BOOL api_srvsvc_NetShareAdd(pipes_struct *p) r.out.parm_error = r.in.parm_error; r.out.result = _srvsvc_NetShareAdd(p, r.in.server_unc, r.in.level, r.in.info, r.in.parm_error); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, &r); @@ -911,7 +1031,7 @@ static BOOL api_srvsvc_NetShareAdd(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -936,8 +1056,10 @@ static BOOL api_srvsvc_NetShareEnumAll(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareEnumAll(pull, NDR_IN, &r); @@ -961,6 +1083,12 @@ static BOOL api_srvsvc_NetShareEnumAll(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetShareEnumAll(p, r.in.server_unc, r.in.level, r.in.ctr, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, &r); @@ -977,7 +1105,7 @@ static BOOL api_srvsvc_NetShareEnumAll(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1002,8 +1130,10 @@ static BOOL api_srvsvc_NetShareGetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareGetInfo(pull, NDR_IN, &r); @@ -1024,6 +1154,12 @@ static BOOL api_srvsvc_NetShareGetInfo(pipes_struct *p) r.out.result = _srvsvc_NetShareGetInfo(p, r.in.server_unc, r.in.share_name, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, &r); @@ -1040,7 +1176,7 @@ static BOOL api_srvsvc_NetShareGetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1065,8 +1201,10 @@ static BOOL api_srvsvc_NetShareSetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareSetInfo(pull, NDR_IN, &r); @@ -1082,6 +1220,12 @@ static BOOL api_srvsvc_NetShareSetInfo(pipes_struct *p) r.out.parm_error = r.in.parm_error; r.out.result = _srvsvc_NetShareSetInfo(p, r.in.server_unc, r.in.share_name, r.in.level, r.in.info, r.in.parm_error); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, &r); @@ -1098,7 +1242,7 @@ static BOOL api_srvsvc_NetShareSetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1123,8 +1267,10 @@ static BOOL api_srvsvc_NetShareDel(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareDel(pull, NDR_IN, &r); @@ -1138,6 +1284,12 @@ static BOOL api_srvsvc_NetShareDel(pipes_struct *p) r.out.result = _srvsvc_NetShareDel(p, r.in.server_unc, r.in.share_name, r.in.reserved); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, &r); @@ -1154,7 +1306,7 @@ static BOOL api_srvsvc_NetShareDel(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1179,8 +1331,10 @@ static BOOL api_srvsvc_NetShareDelSticky(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareDelSticky(pull, NDR_IN, &r); @@ -1194,6 +1348,12 @@ static BOOL api_srvsvc_NetShareDelSticky(pipes_struct *p) r.out.result = _srvsvc_NetShareDelSticky(p, r.in.server_unc, r.in.share_name, r.in.reserved); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, &r); @@ -1210,7 +1370,7 @@ static BOOL api_srvsvc_NetShareDelSticky(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1235,8 +1395,10 @@ static BOOL api_srvsvc_NetShareCheck(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareCheck(pull, NDR_IN, &r); @@ -1257,6 +1419,12 @@ static BOOL api_srvsvc_NetShareCheck(pipes_struct *p) r.out.result = _srvsvc_NetShareCheck(p, r.in.server_unc, r.in.device_name, r.out.type); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, &r); @@ -1273,7 +1441,7 @@ static BOOL api_srvsvc_NetShareCheck(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1298,8 +1466,10 @@ static BOOL api_srvsvc_NetSrvGetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetSrvGetInfo(pull, NDR_IN, &r); @@ -1320,6 +1490,12 @@ static BOOL api_srvsvc_NetSrvGetInfo(pipes_struct *p) r.out.result = _srvsvc_NetSrvGetInfo(p, r.in.server_unc, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, &r); @@ -1336,7 +1512,7 @@ static BOOL api_srvsvc_NetSrvGetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1361,8 +1537,10 @@ static BOOL api_srvsvc_NetSrvSetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetSrvSetInfo(pull, NDR_IN, &r); @@ -1378,6 +1556,12 @@ static BOOL api_srvsvc_NetSrvSetInfo(pipes_struct *p) r.out.parm_error = r.in.parm_error; r.out.result = _srvsvc_NetSrvSetInfo(p, r.in.server_unc, r.in.level, r.in.info, r.in.parm_error); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, &r); @@ -1394,7 +1578,7 @@ static BOOL api_srvsvc_NetSrvSetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1419,8 +1603,10 @@ static BOOL api_srvsvc_NetDiskEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetDiskEnum(pull, NDR_IN, &r); @@ -1443,6 +1629,12 @@ static BOOL api_srvsvc_NetDiskEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetDiskEnum(p, r.in.server_unc, r.in.level, r.in.info, r.in.maxlen, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, &r); @@ -1459,7 +1651,7 @@ static BOOL api_srvsvc_NetDiskEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1484,8 +1676,10 @@ static BOOL api_srvsvc_NetServerStatisticsGet(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetServerStatisticsGet(pull, NDR_IN, &r); @@ -1506,6 +1700,12 @@ static BOOL api_srvsvc_NetServerStatisticsGet(pipes_struct *p) r.out.result = _srvsvc_NetServerStatisticsGet(p, r.in.server_unc, r.in.service, r.in.level, r.in.options, r.out.stats); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, &r); @@ -1522,7 +1722,7 @@ static BOOL api_srvsvc_NetServerStatisticsGet(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1547,8 +1747,10 @@ static BOOL api_srvsvc_NetTransportAdd(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetTransportAdd(pull, NDR_IN, &r); @@ -1562,6 +1764,12 @@ static BOOL api_srvsvc_NetTransportAdd(pipes_struct *p) r.out.result = _srvsvc_NetTransportAdd(p, r.in.server_unc, r.in.level, r.in.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, &r); @@ -1578,7 +1786,7 @@ static BOOL api_srvsvc_NetTransportAdd(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1603,8 +1811,10 @@ static BOOL api_srvsvc_NetTransportEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetTransportEnum(pull, NDR_IN, &r); @@ -1628,6 +1838,12 @@ static BOOL api_srvsvc_NetTransportEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetTransportEnum(p, r.in.server_unc, r.in.level, r.in.transports, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, &r); @@ -1644,7 +1860,7 @@ static BOOL api_srvsvc_NetTransportEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1669,8 +1885,10 @@ static BOOL api_srvsvc_NetTransportDel(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetTransportDel(pull, NDR_IN, &r); @@ -1684,6 +1902,12 @@ static BOOL api_srvsvc_NetTransportDel(pipes_struct *p) r.out.result = _srvsvc_NetTransportDel(p, r.in.server_unc, r.in.unknown, r.in.transport); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, &r); @@ -1700,7 +1924,7 @@ static BOOL api_srvsvc_NetTransportDel(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1725,8 +1949,10 @@ static BOOL api_srvsvc_NetRemoteTOD(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetRemoteTOD(pull, NDR_IN, &r); @@ -1747,6 +1973,12 @@ static BOOL api_srvsvc_NetRemoteTOD(pipes_struct *p) r.out.result = _srvsvc_NetRemoteTOD(p, r.in.server_unc, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, &r); @@ -1763,7 +1995,7 @@ static BOOL api_srvsvc_NetRemoteTOD(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1788,8 +2020,10 @@ static BOOL api_srvsvc_NetSetServiceBits(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetSetServiceBits(pull, NDR_IN, &r); @@ -1803,6 +2037,12 @@ static BOOL api_srvsvc_NetSetServiceBits(pipes_struct *p) r.out.result = _srvsvc_NetSetServiceBits(p, r.in.server_unc, r.in.transport, r.in.servicebits, r.in.updateimmediately); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, &r); @@ -1819,7 +2059,7 @@ static BOOL api_srvsvc_NetSetServiceBits(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1844,8 +2084,10 @@ static BOOL api_srvsvc_NetPathType(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetPathType(pull, NDR_IN, &r); @@ -1866,6 +2108,12 @@ static BOOL api_srvsvc_NetPathType(pipes_struct *p) r.out.result = _srvsvc_NetPathType(p, r.in.server_unc, r.in.path, r.in.pathflags, r.out.pathtype); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, &r); @@ -1882,7 +2130,7 @@ static BOOL api_srvsvc_NetPathType(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1907,8 +2155,10 @@ static BOOL api_srvsvc_NetPathCanonicalize(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetPathCanonicalize(pull, NDR_IN, &r); @@ -1930,6 +2180,12 @@ static BOOL api_srvsvc_NetPathCanonicalize(pipes_struct *p) r.out.pathtype = r.in.pathtype; r.out.result = _srvsvc_NetPathCanonicalize(p, r.in.server_unc, r.in.path, r.out.can_path, r.in.maxbuf, r.in.prefix, r.in.pathtype, r.in.pathflags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, &r); @@ -1946,7 +2202,7 @@ static BOOL api_srvsvc_NetPathCanonicalize(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1971,8 +2227,10 @@ static BOOL api_srvsvc_NetPathCompare(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetPathCompare(pull, NDR_IN, &r); @@ -1986,6 +2244,12 @@ static BOOL api_srvsvc_NetPathCompare(pipes_struct *p) r.out.result = _srvsvc_NetPathCompare(p, r.in.server_unc, r.in.path1, r.in.path2, r.in.pathtype, r.in.pathflags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, &r); @@ -2002,7 +2266,7 @@ static BOOL api_srvsvc_NetPathCompare(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2027,8 +2291,10 @@ static BOOL api_srvsvc_NetNameValidate(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetNameValidate(pull, NDR_IN, &r); @@ -2042,6 +2308,12 @@ static BOOL api_srvsvc_NetNameValidate(pipes_struct *p) r.out.result = _srvsvc_NetNameValidate(p, r.in.server_unc, r.in.name, r.in.name_type, r.in.flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, &r); @@ -2058,7 +2330,7 @@ static BOOL api_srvsvc_NetNameValidate(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2083,8 +2355,10 @@ static BOOL api_srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRPRNAMECANONICALIZE(pull, NDR_IN, &r); @@ -2098,6 +2372,12 @@ static BOOL api_srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p) r.out.result = _srvsvc_NETRPRNAMECANONICALIZE(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r); @@ -2114,7 +2394,7 @@ static BOOL api_srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2139,8 +2419,10 @@ static BOOL api_srvsvc_NetPRNameCompare(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetPRNameCompare(pull, NDR_IN, &r); @@ -2154,6 +2436,12 @@ static BOOL api_srvsvc_NetPRNameCompare(pipes_struct *p) r.out.result = _srvsvc_NetPRNameCompare(p, r.in.server_unc, r.in.name1, r.in.name2, r.in.name_type, r.in.flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, &r); @@ -2170,7 +2458,7 @@ static BOOL api_srvsvc_NetPRNameCompare(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2195,8 +2483,10 @@ static BOOL api_srvsvc_NetShareEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareEnum(pull, NDR_IN, &r); @@ -2220,6 +2510,12 @@ static BOOL api_srvsvc_NetShareEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _srvsvc_NetShareEnum(p, r.in.server_unc, r.in.level, r.in.ctr, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, &r); @@ -2236,7 +2532,7 @@ static BOOL api_srvsvc_NetShareEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2261,8 +2557,10 @@ static BOOL api_srvsvc_NetShareDelStart(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareDelStart(pull, NDR_IN, &r); @@ -2283,6 +2581,12 @@ static BOOL api_srvsvc_NetShareDelStart(pipes_struct *p) r.out.result = _srvsvc_NetShareDelStart(p, r.in.server_unc, r.in.share, r.in.reserved, r.out.hnd); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, &r); @@ -2299,7 +2603,7 @@ static BOOL api_srvsvc_NetShareDelStart(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2324,8 +2628,10 @@ static BOOL api_srvsvc_NetShareDelCommit(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetShareDelCommit(pull, NDR_IN, &r); @@ -2341,6 +2647,12 @@ static BOOL api_srvsvc_NetShareDelCommit(pipes_struct *p) r.out.hnd = r.in.hnd; r.out.result = _srvsvc_NetShareDelCommit(p, r.in.hnd); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, &r); @@ -2357,7 +2669,7 @@ static BOOL api_srvsvc_NetShareDelCommit(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2382,8 +2694,10 @@ static BOOL api_srvsvc_NetGetFileSecurity(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetGetFileSecurity(pull, NDR_IN, &r); @@ -2404,6 +2718,12 @@ static BOOL api_srvsvc_NetGetFileSecurity(pipes_struct *p) r.out.result = _srvsvc_NetGetFileSecurity(p, r.in.server_unc, r.in.share, r.in.file, r.in.securityinformation, r.out.sd_buf); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, &r); @@ -2420,7 +2740,7 @@ static BOOL api_srvsvc_NetGetFileSecurity(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2445,8 +2765,10 @@ static BOOL api_srvsvc_NetSetFileSecurity(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetSetFileSecurity(pull, NDR_IN, &r); @@ -2460,6 +2782,12 @@ static BOOL api_srvsvc_NetSetFileSecurity(pipes_struct *p) r.out.result = _srvsvc_NetSetFileSecurity(p, r.in.server_unc, r.in.share, r.in.file, r.in.securityinformation, r.in.sd_buf); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, &r); @@ -2476,7 +2804,7 @@ static BOOL api_srvsvc_NetSetFileSecurity(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2501,8 +2829,10 @@ static BOOL api_srvsvc_NetServerTransportAddEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetServerTransportAddEx(pull, NDR_IN, &r); @@ -2516,6 +2846,12 @@ static BOOL api_srvsvc_NetServerTransportAddEx(pipes_struct *p) r.out.result = _srvsvc_NetServerTransportAddEx(p, r.in.server_unc, r.in.level, r.in.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, &r); @@ -2532,7 +2868,7 @@ static BOOL api_srvsvc_NetServerTransportAddEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2557,8 +2893,10 @@ static BOOL api_srvsvc_NetServerSetServiceBitsEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NetServerSetServiceBitsEx(pull, NDR_IN, &r); @@ -2572,6 +2910,12 @@ static BOOL api_srvsvc_NetServerSetServiceBitsEx(pipes_struct *p) r.out.result = _srvsvc_NetServerSetServiceBitsEx(p, r.in.server_unc, r.in.emulated_server_unc, r.in.transport, r.in.servicebitsofinterest, r.in.servicebits, r.in.updateimmediately); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r); @@ -2588,7 +2932,7 @@ static BOOL api_srvsvc_NetServerSetServiceBitsEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2613,8 +2957,10 @@ static BOOL api_srvsvc_NETRDFSGETVERSION(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSGETVERSION(pull, NDR_IN, &r); @@ -2628,6 +2974,12 @@ static BOOL api_srvsvc_NETRDFSGETVERSION(pipes_struct *p) r.out.result = _srvsvc_NETRDFSGETVERSION(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, &r); @@ -2644,7 +2996,7 @@ static BOOL api_srvsvc_NETRDFSGETVERSION(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2669,8 +3021,10 @@ static BOOL api_srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSCREATELOCALPARTITION(pull, NDR_IN, &r); @@ -2684,6 +3038,12 @@ static BOOL api_srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p) r.out.result = _srvsvc_NETRDFSCREATELOCALPARTITION(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r); @@ -2700,7 +3060,7 @@ static BOOL api_srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2725,8 +3085,10 @@ static BOOL api_srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSDELETELOCALPARTITION(pull, NDR_IN, &r); @@ -2740,6 +3102,12 @@ static BOOL api_srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p) r.out.result = _srvsvc_NETRDFSDELETELOCALPARTITION(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r); @@ -2756,7 +3124,7 @@ static BOOL api_srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2781,8 +3149,10 @@ static BOOL api_srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSSETLOCALVOLUMESTATE(pull, NDR_IN, &r); @@ -2796,6 +3166,12 @@ static BOOL api_srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p) r.out.result = _srvsvc_NETRDFSSETLOCALVOLUMESTATE(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r); @@ -2812,7 +3188,7 @@ static BOOL api_srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2837,8 +3213,10 @@ static BOOL api_srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSSETSERVERINFO(pull, NDR_IN, &r); @@ -2852,6 +3230,12 @@ static BOOL api_srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p) r.out.result = _srvsvc_NETRDFSSETSERVERINFO(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r); @@ -2868,7 +3252,7 @@ static BOOL api_srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2893,8 +3277,10 @@ static BOOL api_srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSCREATEEXITPOINT(pull, NDR_IN, &r); @@ -2908,6 +3294,12 @@ static BOOL api_srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p) r.out.result = _srvsvc_NETRDFSCREATEEXITPOINT(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r); @@ -2924,7 +3316,7 @@ static BOOL api_srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2949,8 +3341,10 @@ static BOOL api_srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSDELETEEXITPOINT(pull, NDR_IN, &r); @@ -2964,6 +3358,12 @@ static BOOL api_srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p) r.out.result = _srvsvc_NETRDFSDELETEEXITPOINT(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r); @@ -2980,7 +3380,7 @@ static BOOL api_srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3005,8 +3405,10 @@ static BOOL api_srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSMODIFYPREFIX(pull, NDR_IN, &r); @@ -3020,6 +3422,12 @@ static BOOL api_srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p) r.out.result = _srvsvc_NETRDFSMODIFYPREFIX(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r); @@ -3036,7 +3444,7 @@ static BOOL api_srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3061,8 +3469,10 @@ static BOOL api_srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSFIXLOCALVOLUME(pull, NDR_IN, &r); @@ -3076,6 +3486,12 @@ static BOOL api_srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p) r.out.result = _srvsvc_NETRDFSFIXLOCALVOLUME(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r); @@ -3092,7 +3508,7 @@ static BOOL api_srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3117,8 +3533,10 @@ static BOOL api_srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRDFSMANAGERREPORTSITEINFO(pull, NDR_IN, &r); @@ -3132,6 +3550,12 @@ static BOOL api_srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p) r.out.result = _srvsvc_NETRDFSMANAGERREPORTSITEINFO(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, &r); @@ -3148,7 +3572,7 @@ static BOOL api_srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -3173,8 +3597,10 @@ static BOOL api_srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_srvsvc_NETRSERVERTRANSPORTDELEX(pull, NDR_IN, &r); @@ -3188,6 +3614,12 @@ static BOOL api_srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p) r.out.result = _srvsvc_NETRSERVERTRANSPORTDELEX(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, &r); @@ -3204,7 +3636,7 @@ static BOOL api_srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_svcctl.c b/source3/librpc/gen_ndr/srv_svcctl.c index 9d2ad44219..efedf1ef3c 100644 --- a/source3/librpc/gen_ndr/srv_svcctl.c +++ b/source3/librpc/gen_ndr/srv_svcctl.c @@ -21,8 +21,10 @@ static BOOL api_svcctl_CloseServiceHandle(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_CloseServiceHandle(pull, NDR_IN, &r); @@ -38,6 +40,12 @@ static BOOL api_svcctl_CloseServiceHandle(pipes_struct *p) r.out.handle = r.in.handle; r.out.result = _svcctl_CloseServiceHandle(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, &r); @@ -54,7 +62,7 @@ static BOOL api_svcctl_CloseServiceHandle(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -79,8 +87,10 @@ static BOOL api_svcctl_ControlService(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_ControlService(pull, NDR_IN, &r); @@ -101,6 +111,12 @@ static BOOL api_svcctl_ControlService(pipes_struct *p) r.out.result = _svcctl_ControlService(p, r.in.handle, r.in.control, r.out.status); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_ControlService, &r); @@ -117,7 +133,7 @@ static BOOL api_svcctl_ControlService(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -142,8 +158,10 @@ static BOOL api_svcctl_DeleteService(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_DeleteService(pull, NDR_IN, &r); @@ -157,6 +175,12 @@ static BOOL api_svcctl_DeleteService(pipes_struct *p) r.out.result = _svcctl_DeleteService(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, &r); @@ -173,7 +197,7 @@ static BOOL api_svcctl_DeleteService(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -198,8 +222,10 @@ static BOOL api_svcctl_LockServiceDatabase(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_LockServiceDatabase(pull, NDR_IN, &r); @@ -220,6 +246,12 @@ static BOOL api_svcctl_LockServiceDatabase(pipes_struct *p) r.out.result = _svcctl_LockServiceDatabase(p, r.in.handle, r.out.lock); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, &r); @@ -236,7 +268,7 @@ static BOOL api_svcctl_LockServiceDatabase(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -261,8 +293,10 @@ static BOOL api_svcctl_QueryServiceObjectSecurity(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceObjectSecurity(pull, NDR_IN, &r); @@ -276,6 +310,12 @@ static BOOL api_svcctl_QueryServiceObjectSecurity(pipes_struct *p) r.out.result = _svcctl_QueryServiceObjectSecurity(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, &r); @@ -292,7 +332,7 @@ static BOOL api_svcctl_QueryServiceObjectSecurity(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -317,8 +357,10 @@ static BOOL api_svcctl_SetServiceObjectSecurity(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_SetServiceObjectSecurity(pull, NDR_IN, &r); @@ -332,6 +374,12 @@ static BOOL api_svcctl_SetServiceObjectSecurity(pipes_struct *p) r.out.result = _svcctl_SetServiceObjectSecurity(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &r); @@ -348,7 +396,7 @@ static BOOL api_svcctl_SetServiceObjectSecurity(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -373,8 +421,10 @@ static BOOL api_svcctl_QueryServiceStatus(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceStatus(pull, NDR_IN, &r); @@ -395,6 +445,12 @@ static BOOL api_svcctl_QueryServiceStatus(pipes_struct *p) r.out.result = _svcctl_QueryServiceStatus(p, r.in.handle, r.out.status); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, &r); @@ -411,7 +467,7 @@ static BOOL api_svcctl_QueryServiceStatus(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -436,8 +492,10 @@ static BOOL api_svcctl_SetServiceStatus(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_SetServiceStatus(pull, NDR_IN, &r); @@ -451,6 +509,12 @@ static BOOL api_svcctl_SetServiceStatus(pipes_struct *p) r.out.result = _svcctl_SetServiceStatus(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, &r); @@ -467,7 +531,7 @@ static BOOL api_svcctl_SetServiceStatus(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -492,8 +556,10 @@ static BOOL api_svcctl_UnlockServiceDatabase(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_UnlockServiceDatabase(pull, NDR_IN, &r); @@ -509,6 +575,12 @@ static BOOL api_svcctl_UnlockServiceDatabase(pipes_struct *p) r.out.lock = r.in.lock; r.out.result = _svcctl_UnlockServiceDatabase(p, r.in.lock); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, &r); @@ -525,7 +597,7 @@ static BOOL api_svcctl_UnlockServiceDatabase(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -550,8 +622,10 @@ static BOOL api_svcctl_NotifyBootConfigStatus(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_NotifyBootConfigStatus(pull, NDR_IN, &r); @@ -565,6 +639,12 @@ static BOOL api_svcctl_NotifyBootConfigStatus(pipes_struct *p) r.out.result = _svcctl_NotifyBootConfigStatus(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, &r); @@ -581,7 +661,7 @@ static BOOL api_svcctl_NotifyBootConfigStatus(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -606,8 +686,10 @@ static BOOL api_svcctl_SCSetServiceBitsW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_SCSetServiceBitsW(pull, NDR_IN, &r); @@ -621,6 +703,12 @@ static BOOL api_svcctl_SCSetServiceBitsW(pipes_struct *p) r.out.result = _svcctl_SCSetServiceBitsW(p, r.in.handle, r.in.bits, r.in.bitson, r.in.immediate); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, &r); @@ -637,7 +725,7 @@ static BOOL api_svcctl_SCSetServiceBitsW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -662,8 +750,10 @@ static BOOL api_svcctl_ChangeServiceConfigW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_ChangeServiceConfigW(pull, NDR_IN, &r); @@ -684,6 +774,12 @@ static BOOL api_svcctl_ChangeServiceConfigW(pipes_struct *p) r.out.result = _svcctl_ChangeServiceConfigW(p, r.in.handle, r.in.type, r.in.start, r.in.error, r.in.binary_path, r.in.load_order_group, r.out.tag_id, r.in.dependencies, r.in.service_start_name, r.in.password, r.in.display_name); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, &r); @@ -700,7 +796,7 @@ static BOOL api_svcctl_ChangeServiceConfigW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -725,8 +821,10 @@ static BOOL api_svcctl_CreateServiceW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_CreateServiceW(pull, NDR_IN, &r); @@ -748,6 +846,12 @@ static BOOL api_svcctl_CreateServiceW(pipes_struct *p) r.out.result = _svcctl_CreateServiceW(p, r.in.scmanager_handle, r.in.ServiceName, r.in.DisplayName, r.in.desired_access, r.in.type, r.in.start_type, r.in.error_control, r.in.binary_path, r.in.LoadOrderGroupKey, r.in.TagId, r.in.dependencies, r.in.dependencies_size, r.in.service_start_name, r.in.password, r.in.password_size, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, &r); @@ -764,7 +868,7 @@ static BOOL api_svcctl_CreateServiceW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -789,8 +893,10 @@ static BOOL api_svcctl_EnumDependentServicesW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_EnumDependentServicesW(pull, NDR_IN, &r); @@ -823,6 +929,12 @@ static BOOL api_svcctl_EnumDependentServicesW(pipes_struct *p) r.out.result = _svcctl_EnumDependentServicesW(p, r.in.service, r.in.state, r.out.status, r.in.buf_size, r.out.bytes_needed, r.out.services_returned); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, &r); @@ -839,7 +951,7 @@ static BOOL api_svcctl_EnumDependentServicesW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -864,8 +976,10 @@ static BOOL api_svcctl_EnumServicesStatusW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_EnumServicesStatusW(pull, NDR_IN, &r); @@ -899,6 +1013,12 @@ static BOOL api_svcctl_EnumServicesStatusW(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _svcctl_EnumServicesStatusW(p, r.in.handle, r.in.type, r.in.state, r.in.buf_size, r.out.service, r.out.bytes_needed, r.out.services_returned, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, &r); @@ -915,7 +1035,7 @@ static BOOL api_svcctl_EnumServicesStatusW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -940,8 +1060,10 @@ static BOOL api_svcctl_OpenSCManagerW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_OpenSCManagerW(pull, NDR_IN, &r); @@ -962,6 +1084,12 @@ static BOOL api_svcctl_OpenSCManagerW(pipes_struct *p) r.out.result = _svcctl_OpenSCManagerW(p, r.in.MachineName, r.in.DatabaseName, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &r); @@ -978,7 +1106,7 @@ static BOOL api_svcctl_OpenSCManagerW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1003,8 +1131,10 @@ static BOOL api_svcctl_OpenServiceW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_OpenServiceW(pull, NDR_IN, &r); @@ -1025,6 +1155,12 @@ static BOOL api_svcctl_OpenServiceW(pipes_struct *p) r.out.result = _svcctl_OpenServiceW(p, r.in.scmanager_handle, r.in.ServiceName, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, &r); @@ -1041,7 +1177,7 @@ static BOOL api_svcctl_OpenServiceW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1066,8 +1202,10 @@ static BOOL api_svcctl_QueryServiceConfigW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceConfigW(pull, NDR_IN, &r); @@ -1094,6 +1232,12 @@ static BOOL api_svcctl_QueryServiceConfigW(pipes_struct *p) r.out.result = _svcctl_QueryServiceConfigW(p, r.in.handle, r.out.query, r.in.buf_size, r.out.bytes_needed); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, &r); @@ -1110,7 +1254,7 @@ static BOOL api_svcctl_QueryServiceConfigW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1135,8 +1279,10 @@ static BOOL api_svcctl_QueryServiceLockStatusW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceLockStatusW(pull, NDR_IN, &r); @@ -1163,6 +1309,12 @@ static BOOL api_svcctl_QueryServiceLockStatusW(pipes_struct *p) r.out.result = _svcctl_QueryServiceLockStatusW(p, r.in.handle, r.in.buf_size, r.out.status, r.out.required_buf_size); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, &r); @@ -1179,7 +1331,7 @@ static BOOL api_svcctl_QueryServiceLockStatusW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1204,8 +1356,10 @@ static BOOL api_svcctl_StartServiceW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_StartServiceW(pull, NDR_IN, &r); @@ -1219,6 +1373,12 @@ static BOOL api_svcctl_StartServiceW(pipes_struct *p) r.out.result = _svcctl_StartServiceW(p, r.in.handle, r.in.NumArgs, r.in.Arguments); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, &r); @@ -1235,7 +1395,7 @@ static BOOL api_svcctl_StartServiceW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1260,8 +1420,10 @@ static BOOL api_svcctl_GetServiceDisplayNameW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_GetServiceDisplayNameW(pull, NDR_IN, &r); @@ -1283,6 +1445,12 @@ static BOOL api_svcctl_GetServiceDisplayNameW(pipes_struct *p) r.out.display_name_length = r.in.display_name_length; r.out.result = _svcctl_GetServiceDisplayNameW(p, r.in.handle, r.in.service_name, r.out.display_name, r.in.display_name_length); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, &r); @@ -1299,7 +1467,7 @@ static BOOL api_svcctl_GetServiceDisplayNameW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1324,8 +1492,10 @@ static BOOL api_svcctl_GetServiceKeyNameW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_GetServiceKeyNameW(pull, NDR_IN, &r); @@ -1347,6 +1517,12 @@ static BOOL api_svcctl_GetServiceKeyNameW(pipes_struct *p) r.out.display_name_length = r.in.display_name_length; r.out.result = _svcctl_GetServiceKeyNameW(p, r.in.handle, r.in.service_name, r.out.key_name, r.in.display_name_length); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, &r); @@ -1363,7 +1539,7 @@ static BOOL api_svcctl_GetServiceKeyNameW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1388,8 +1564,10 @@ static BOOL api_svcctl_SCSetServiceBitsA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_SCSetServiceBitsA(pull, NDR_IN, &r); @@ -1403,6 +1581,12 @@ static BOOL api_svcctl_SCSetServiceBitsA(pipes_struct *p) r.out.result = _svcctl_SCSetServiceBitsA(p, r.in.handle, r.in.bits, r.in.bitson, r.in.immediate); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, &r); @@ -1419,7 +1603,7 @@ static BOOL api_svcctl_SCSetServiceBitsA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1444,8 +1628,10 @@ static BOOL api_svcctl_ChangeServiceConfigA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_ChangeServiceConfigA(pull, NDR_IN, &r); @@ -1466,6 +1652,12 @@ static BOOL api_svcctl_ChangeServiceConfigA(pipes_struct *p) r.out.result = _svcctl_ChangeServiceConfigA(p, r.in.handle, r.in.type, r.in.start, r.in.error, r.in.binary_path, r.in.load_order_group, r.out.tag_id, r.in.dependencies, r.in.service_start_name, r.in.password, r.in.display_name); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, &r); @@ -1482,7 +1674,7 @@ static BOOL api_svcctl_ChangeServiceConfigA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1507,8 +1699,10 @@ static BOOL api_svcctl_CreateServiceA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_CreateServiceA(pull, NDR_IN, &r); @@ -1529,6 +1723,12 @@ static BOOL api_svcctl_CreateServiceA(pipes_struct *p) r.out.result = _svcctl_CreateServiceA(p, r.in.handle, r.in.ServiceName, r.in.DisplayName, r.in.desired_access, r.in.type, r.in.start_type, r.in.error_control, r.in.binary_path, r.in.LoadOrderGroupKey, r.out.TagId, r.in.dependencies, r.in.service_start_name, r.in.password); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, &r); @@ -1545,7 +1745,7 @@ static BOOL api_svcctl_CreateServiceA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1570,8 +1770,10 @@ static BOOL api_svcctl_EnumDependentServicesA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_EnumDependentServicesA(pull, NDR_IN, &r); @@ -1604,6 +1806,12 @@ static BOOL api_svcctl_EnumDependentServicesA(pipes_struct *p) r.out.result = _svcctl_EnumDependentServicesA(p, r.in.service, r.in.state, r.out.status, r.in.buf_size, r.out.bytes_needed, r.out.services_returned); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &r); @@ -1620,7 +1828,7 @@ static BOOL api_svcctl_EnumDependentServicesA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1645,8 +1853,10 @@ static BOOL api_svcctl_EnumServicesStatusA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_EnumServicesStatusA(pull, NDR_IN, &r); @@ -1680,6 +1890,12 @@ static BOOL api_svcctl_EnumServicesStatusA(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _svcctl_EnumServicesStatusA(p, r.in.handle, r.in.type, r.in.state, r.in.buf_size, r.out.service, r.out.bytes_needed, r.out.services_returned, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, &r); @@ -1696,7 +1912,7 @@ static BOOL api_svcctl_EnumServicesStatusA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1721,8 +1937,10 @@ static BOOL api_svcctl_OpenSCManagerA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_OpenSCManagerA(pull, NDR_IN, &r); @@ -1743,6 +1961,12 @@ static BOOL api_svcctl_OpenSCManagerA(pipes_struct *p) r.out.result = _svcctl_OpenSCManagerA(p, r.in.MachineName, r.in.DatabaseName, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, &r); @@ -1759,7 +1983,7 @@ static BOOL api_svcctl_OpenSCManagerA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1784,8 +2008,10 @@ static BOOL api_svcctl_OpenServiceA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_OpenServiceA(pull, NDR_IN, &r); @@ -1799,6 +2025,12 @@ static BOOL api_svcctl_OpenServiceA(pipes_struct *p) r.out.result = _svcctl_OpenServiceA(p, r.in.scmanager_handle, r.in.ServiceName, r.in.access_mask); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, &r); @@ -1815,7 +2047,7 @@ static BOOL api_svcctl_OpenServiceA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1840,8 +2072,10 @@ static BOOL api_svcctl_QueryServiceConfigA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceConfigA(pull, NDR_IN, &r); @@ -1868,6 +2102,12 @@ static BOOL api_svcctl_QueryServiceConfigA(pipes_struct *p) r.out.result = _svcctl_QueryServiceConfigA(p, r.in.handle, r.out.query, r.in.buf_size, r.out.bytes_needed); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &r); @@ -1884,7 +2124,7 @@ static BOOL api_svcctl_QueryServiceConfigA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1909,8 +2149,10 @@ static BOOL api_svcctl_QueryServiceLockStatusA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceLockStatusA(pull, NDR_IN, &r); @@ -1937,6 +2179,12 @@ static BOOL api_svcctl_QueryServiceLockStatusA(pipes_struct *p) r.out.result = _svcctl_QueryServiceLockStatusA(p, r.in.handle, r.in.buf_size, r.out.status, r.out.required_buf_size); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &r); @@ -1953,7 +2201,7 @@ static BOOL api_svcctl_QueryServiceLockStatusA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1978,8 +2226,10 @@ static BOOL api_svcctl_StartServiceA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_StartServiceA(pull, NDR_IN, &r); @@ -1993,6 +2243,12 @@ static BOOL api_svcctl_StartServiceA(pipes_struct *p) r.out.result = _svcctl_StartServiceA(p, r.in.handle, r.in.NumArgs, r.in.Arguments); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &r); @@ -2009,7 +2265,7 @@ static BOOL api_svcctl_StartServiceA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2034,8 +2290,10 @@ static BOOL api_svcctl_GetServiceDisplayNameA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_GetServiceDisplayNameA(pull, NDR_IN, &r); @@ -2057,6 +2315,12 @@ static BOOL api_svcctl_GetServiceDisplayNameA(pipes_struct *p) r.out.display_name_length = r.in.display_name_length; r.out.result = _svcctl_GetServiceDisplayNameA(p, r.in.handle, r.in.service_name, r.out.display_name, r.in.display_name_length); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &r); @@ -2073,7 +2337,7 @@ static BOOL api_svcctl_GetServiceDisplayNameA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2098,8 +2362,10 @@ static BOOL api_svcctl_GetServiceKeyNameA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_GetServiceKeyNameA(pull, NDR_IN, &r); @@ -2121,6 +2387,12 @@ static BOOL api_svcctl_GetServiceKeyNameA(pipes_struct *p) r.out.display_name_length = r.in.display_name_length; r.out.result = _svcctl_GetServiceKeyNameA(p, r.in.handle, r.in.service_name, r.out.key_name, r.in.display_name_length); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &r); @@ -2137,7 +2409,7 @@ static BOOL api_svcctl_GetServiceKeyNameA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2162,8 +2434,10 @@ static BOOL api_svcctl_GetCurrentGroupeStateW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_GetCurrentGroupeStateW(pull, NDR_IN, &r); @@ -2177,6 +2451,12 @@ static BOOL api_svcctl_GetCurrentGroupeStateW(pipes_struct *p) r.out.result = _svcctl_GetCurrentGroupeStateW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &r); @@ -2193,7 +2473,7 @@ static BOOL api_svcctl_GetCurrentGroupeStateW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2218,8 +2498,10 @@ static BOOL api_svcctl_EnumServiceGroupW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_EnumServiceGroupW(pull, NDR_IN, &r); @@ -2233,6 +2515,12 @@ static BOOL api_svcctl_EnumServiceGroupW(pipes_struct *p) r.out.result = _svcctl_EnumServiceGroupW(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &r); @@ -2249,7 +2537,7 @@ static BOOL api_svcctl_EnumServiceGroupW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2274,8 +2562,10 @@ static BOOL api_svcctl_ChangeServiceConfig2A(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_ChangeServiceConfig2A(pull, NDR_IN, &r); @@ -2289,6 +2579,12 @@ static BOOL api_svcctl_ChangeServiceConfig2A(pipes_struct *p) r.out.result = _svcctl_ChangeServiceConfig2A(p, r.in.handle, r.in.info_level, r.in.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &r); @@ -2305,7 +2601,7 @@ static BOOL api_svcctl_ChangeServiceConfig2A(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2330,8 +2626,10 @@ static BOOL api_svcctl_ChangeServiceConfig2W(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_ChangeServiceConfig2W(pull, NDR_IN, &r); @@ -2345,6 +2643,12 @@ static BOOL api_svcctl_ChangeServiceConfig2W(pipes_struct *p) r.out.result = _svcctl_ChangeServiceConfig2W(p, r.in.handle, r.in.info_level, r.in.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &r); @@ -2361,7 +2665,7 @@ static BOOL api_svcctl_ChangeServiceConfig2W(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2386,8 +2690,10 @@ static BOOL api_svcctl_QueryServiceConfig2A(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceConfig2A(pull, NDR_IN, &r); @@ -2414,6 +2720,12 @@ static BOOL api_svcctl_QueryServiceConfig2A(pipes_struct *p) r.out.result = _svcctl_QueryServiceConfig2A(p, r.in.handle, r.in.info_level, r.out.buffer, r.in.buf_size, r.out.bytes_needed); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, &r); @@ -2430,7 +2742,7 @@ static BOOL api_svcctl_QueryServiceConfig2A(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2455,8 +2767,10 @@ static BOOL api_svcctl_QueryServiceConfig2W(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceConfig2W(pull, NDR_IN, &r); @@ -2483,6 +2797,12 @@ static BOOL api_svcctl_QueryServiceConfig2W(pipes_struct *p) r.out.result = _svcctl_QueryServiceConfig2W(p, r.in.handle, r.in.info_level, r.out.buffer, r.in.buf_size, r.out.bytes_needed); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, &r); @@ -2499,7 +2819,7 @@ static BOOL api_svcctl_QueryServiceConfig2W(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2524,8 +2844,10 @@ static BOOL api_svcctl_QueryServiceStatusEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_QueryServiceStatusEx(pull, NDR_IN, &r); @@ -2552,6 +2874,12 @@ static BOOL api_svcctl_QueryServiceStatusEx(pipes_struct *p) r.out.result = _svcctl_QueryServiceStatusEx(p, r.in.handle, r.in.info_level, r.out.buffer, r.in.buf_size, r.out.bytes_needed); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, &r); @@ -2568,7 +2896,7 @@ static BOOL api_svcctl_QueryServiceStatusEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2593,8 +2921,10 @@ static BOOL api_EnumServicesStatusExA(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_EnumServicesStatusExA(pull, NDR_IN, &r); @@ -2634,6 +2964,12 @@ static BOOL api_EnumServicesStatusExA(pipes_struct *p) r.out.result = _EnumServicesStatusExA(p, r.in.scmanager, r.in.info_level, r.in.type, r.in.state, r.out.services, r.in.buf_size, r.out.bytes_needed, r.out.service_returned, r.in.resume_handle, r.out.group_name); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, &r); @@ -2650,7 +2986,7 @@ static BOOL api_EnumServicesStatusExA(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2675,8 +3011,10 @@ static BOOL api_EnumServicesStatusExW(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_EnumServicesStatusExW(pull, NDR_IN, &r); @@ -2716,6 +3054,12 @@ static BOOL api_EnumServicesStatusExW(pipes_struct *p) r.out.result = _EnumServicesStatusExW(p, r.in.scmanager, r.in.info_level, r.in.type, r.in.state, r.out.services, r.in.buf_size, r.out.bytes_needed, r.out.service_returned, r.in.resume_handle, r.out.group_name); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, &r); @@ -2732,7 +3076,7 @@ static BOOL api_EnumServicesStatusExW(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2757,8 +3101,10 @@ static BOOL api_svcctl_SCSendTSMessage(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_svcctl_SCSendTSMessage(pull, NDR_IN, &r); @@ -2772,6 +3118,12 @@ static BOOL api_svcctl_SCSendTSMessage(pipes_struct *p) r.out.result = _svcctl_SCSendTSMessage(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, &r); @@ -2788,7 +3140,7 @@ static BOOL api_svcctl_SCSendTSMessage(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_unixinfo.c b/source3/librpc/gen_ndr/srv_unixinfo.c index d3d5b5609f..a52ccb13fa 100644 --- a/source3/librpc/gen_ndr/srv_unixinfo.c +++ b/source3/librpc/gen_ndr/srv_unixinfo.c @@ -21,8 +21,10 @@ static BOOL api_unixinfo_SidToUid(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_unixinfo_SidToUid(pull, NDR_IN, &r); @@ -43,6 +45,12 @@ static BOOL api_unixinfo_SidToUid(pipes_struct *p) r.out.result = _unixinfo_SidToUid(p, r.in.sid, r.out.uid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(unixinfo_SidToUid, &r); @@ -59,7 +67,7 @@ static BOOL api_unixinfo_SidToUid(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -84,8 +92,10 @@ static BOOL api_unixinfo_UidToSid(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_unixinfo_UidToSid(pull, NDR_IN, &r); @@ -106,6 +116,12 @@ static BOOL api_unixinfo_UidToSid(pipes_struct *p) r.out.result = _unixinfo_UidToSid(p, r.in.uid, r.out.sid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(unixinfo_UidToSid, &r); @@ -122,7 +138,7 @@ static BOOL api_unixinfo_UidToSid(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -147,8 +163,10 @@ static BOOL api_unixinfo_SidToGid(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_unixinfo_SidToGid(pull, NDR_IN, &r); @@ -169,6 +187,12 @@ static BOOL api_unixinfo_SidToGid(pipes_struct *p) r.out.result = _unixinfo_SidToGid(p, r.in.sid, r.out.gid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(unixinfo_SidToGid, &r); @@ -185,7 +209,7 @@ static BOOL api_unixinfo_SidToGid(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -210,8 +234,10 @@ static BOOL api_unixinfo_GidToSid(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_unixinfo_GidToSid(pull, NDR_IN, &r); @@ -232,6 +258,12 @@ static BOOL api_unixinfo_GidToSid(pipes_struct *p) r.out.result = _unixinfo_GidToSid(p, r.in.gid, r.out.sid); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(unixinfo_GidToSid, &r); @@ -248,7 +280,7 @@ static BOOL api_unixinfo_GidToSid(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -273,8 +305,10 @@ static BOOL api_unixinfo_GetPWUid(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_unixinfo_GetPWUid(pull, NDR_IN, &r); @@ -296,6 +330,12 @@ static BOOL api_unixinfo_GetPWUid(pipes_struct *p) r.out.result = _unixinfo_GetPWUid(p, r.in.count, r.in.uids, r.out.infos); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(unixinfo_GetPWUid, &r); @@ -312,7 +352,7 @@ static BOOL api_unixinfo_GetPWUid(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_winreg.c b/source3/librpc/gen_ndr/srv_winreg.c index 2aaf0a13cb..674254c513 100644 --- a/source3/librpc/gen_ndr/srv_winreg.c +++ b/source3/librpc/gen_ndr/srv_winreg.c @@ -21,8 +21,10 @@ static BOOL api_winreg_OpenHKCR(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKCR(pull, NDR_IN, &r); @@ -43,6 +45,12 @@ static BOOL api_winreg_OpenHKCR(pipes_struct *p) r.out.result = _winreg_OpenHKCR(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, &r); @@ -59,7 +67,7 @@ static BOOL api_winreg_OpenHKCR(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -84,8 +92,10 @@ static BOOL api_winreg_OpenHKCU(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKCU(pull, NDR_IN, &r); @@ -106,6 +116,12 @@ static BOOL api_winreg_OpenHKCU(pipes_struct *p) r.out.result = _winreg_OpenHKCU(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, &r); @@ -122,7 +138,7 @@ static BOOL api_winreg_OpenHKCU(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -147,8 +163,10 @@ static BOOL api_winreg_OpenHKLM(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKLM(pull, NDR_IN, &r); @@ -169,6 +187,12 @@ static BOOL api_winreg_OpenHKLM(pipes_struct *p) r.out.result = _winreg_OpenHKLM(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, &r); @@ -185,7 +209,7 @@ static BOOL api_winreg_OpenHKLM(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -210,8 +234,10 @@ static BOOL api_winreg_OpenHKPD(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKPD(pull, NDR_IN, &r); @@ -232,6 +258,12 @@ static BOOL api_winreg_OpenHKPD(pipes_struct *p) r.out.result = _winreg_OpenHKPD(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, &r); @@ -248,7 +280,7 @@ static BOOL api_winreg_OpenHKPD(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -273,8 +305,10 @@ static BOOL api_winreg_OpenHKU(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKU(pull, NDR_IN, &r); @@ -295,6 +329,12 @@ static BOOL api_winreg_OpenHKU(pipes_struct *p) r.out.result = _winreg_OpenHKU(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, &r); @@ -311,7 +351,7 @@ static BOOL api_winreg_OpenHKU(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -336,8 +376,10 @@ static BOOL api_winreg_CloseKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_CloseKey(pull, NDR_IN, &r); @@ -353,6 +395,12 @@ static BOOL api_winreg_CloseKey(pipes_struct *p) r.out.handle = r.in.handle; r.out.result = _winreg_CloseKey(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &r); @@ -369,7 +417,7 @@ static BOOL api_winreg_CloseKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -394,8 +442,10 @@ static BOOL api_winreg_CreateKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_CreateKey(pull, NDR_IN, &r); @@ -417,6 +467,12 @@ static BOOL api_winreg_CreateKey(pipes_struct *p) r.out.action_taken = r.in.action_taken; r.out.result = _winreg_CreateKey(p, r.in.handle, r.in.name, r.in.keyclass, r.in.options, r.in.access_mask, r.in.secdesc, r.out.new_handle, r.in.action_taken); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_CreateKey, &r); @@ -433,7 +489,7 @@ static BOOL api_winreg_CreateKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -458,8 +514,10 @@ static BOOL api_winreg_DeleteKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_DeleteKey(pull, NDR_IN, &r); @@ -473,6 +531,12 @@ static BOOL api_winreg_DeleteKey(pipes_struct *p) r.out.result = _winreg_DeleteKey(p, r.in.handle, r.in.key); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, &r); @@ -489,7 +553,7 @@ static BOOL api_winreg_DeleteKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -514,8 +578,10 @@ static BOOL api_winreg_DeleteValue(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_DeleteValue(pull, NDR_IN, &r); @@ -529,6 +595,12 @@ static BOOL api_winreg_DeleteValue(pipes_struct *p) r.out.result = _winreg_DeleteValue(p, r.in.handle, r.in.value); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, &r); @@ -545,7 +617,7 @@ static BOOL api_winreg_DeleteValue(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -570,8 +642,10 @@ static BOOL api_winreg_EnumKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_EnumKey(pull, NDR_IN, &r); @@ -589,6 +663,12 @@ static BOOL api_winreg_EnumKey(pipes_struct *p) r.out.last_changed_time = r.in.last_changed_time; r.out.result = _winreg_EnumKey(p, r.in.handle, r.in.enum_index, r.in.name, r.in.keyclass, r.in.last_changed_time); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_EnumKey, &r); @@ -605,7 +685,7 @@ static BOOL api_winreg_EnumKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -630,8 +710,10 @@ static BOOL api_winreg_EnumValue(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_EnumValue(pull, NDR_IN, &r); @@ -651,6 +733,12 @@ static BOOL api_winreg_EnumValue(pipes_struct *p) r.out.value_length = r.in.value_length; r.out.result = _winreg_EnumValue(p, r.in.handle, r.in.enum_index, r.in.name, r.in.type, r.in.data, r.in.data_size, r.in.value_length); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_EnumValue, &r); @@ -667,7 +755,7 @@ static BOOL api_winreg_EnumValue(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -692,8 +780,10 @@ static BOOL api_winreg_FlushKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_FlushKey(pull, NDR_IN, &r); @@ -707,6 +797,12 @@ static BOOL api_winreg_FlushKey(pipes_struct *p) r.out.result = _winreg_FlushKey(p, r.in.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_FlushKey, &r); @@ -723,7 +819,7 @@ static BOOL api_winreg_FlushKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -748,8 +844,10 @@ static BOOL api_winreg_GetKeySecurity(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_GetKeySecurity(pull, NDR_IN, &r); @@ -765,6 +863,12 @@ static BOOL api_winreg_GetKeySecurity(pipes_struct *p) r.out.sd = r.in.sd; r.out.result = _winreg_GetKeySecurity(p, r.in.handle, r.in.sec_info, r.in.sd); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, &r); @@ -781,7 +885,7 @@ static BOOL api_winreg_GetKeySecurity(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -806,8 +910,10 @@ static BOOL api_winreg_LoadKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_LoadKey(pull, NDR_IN, &r); @@ -821,6 +927,12 @@ static BOOL api_winreg_LoadKey(pipes_struct *p) r.out.result = _winreg_LoadKey(p, r.in.handle, r.in.keyname, r.in.filename); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_LoadKey, &r); @@ -837,7 +949,7 @@ static BOOL api_winreg_LoadKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -862,8 +974,10 @@ static BOOL api_winreg_NotifyChangeKeyValue(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_NotifyChangeKeyValue(pull, NDR_IN, &r); @@ -877,6 +991,12 @@ static BOOL api_winreg_NotifyChangeKeyValue(pipes_struct *p) r.out.result = _winreg_NotifyChangeKeyValue(p, r.in.handle, r.in.watch_subtree, r.in.notify_filter, r.in.unknown, r.in.string1, r.in.string2, r.in.unknown2); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, &r); @@ -893,7 +1013,7 @@ static BOOL api_winreg_NotifyChangeKeyValue(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -918,8 +1038,10 @@ static BOOL api_winreg_OpenKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenKey(pull, NDR_IN, &r); @@ -940,6 +1062,12 @@ static BOOL api_winreg_OpenKey(pipes_struct *p) r.out.result = _winreg_OpenKey(p, r.in.parent_handle, r.in.keyname, r.in.unknown, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &r); @@ -956,7 +1084,7 @@ static BOOL api_winreg_OpenKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -981,8 +1109,10 @@ static BOOL api_winreg_QueryInfoKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_QueryInfoKey(pull, NDR_IN, &r); @@ -1046,6 +1176,12 @@ static BOOL api_winreg_QueryInfoKey(pipes_struct *p) r.out.result = _winreg_QueryInfoKey(p, r.in.handle, r.in.classname, r.out.num_subkeys, r.out.max_subkeylen, r.out.max_classlen, r.out.num_values, r.out.max_valnamelen, r.out.max_valbufsize, r.out.secdescsize, r.out.last_changed_time); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, &r); @@ -1062,7 +1198,7 @@ static BOOL api_winreg_QueryInfoKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1087,8 +1223,10 @@ static BOOL api_winreg_QueryValue(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_QueryValue(pull, NDR_IN, &r); @@ -1107,6 +1245,12 @@ static BOOL api_winreg_QueryValue(pipes_struct *p) r.out.value_length = r.in.value_length; r.out.result = _winreg_QueryValue(p, r.in.handle, r.in.value_name, r.in.type, r.in.data, r.in.data_size, r.in.value_length); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_QueryValue, &r); @@ -1123,7 +1267,7 @@ static BOOL api_winreg_QueryValue(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1148,8 +1292,10 @@ static BOOL api_winreg_ReplaceKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_ReplaceKey(pull, NDR_IN, &r); @@ -1163,6 +1309,12 @@ static BOOL api_winreg_ReplaceKey(pipes_struct *p) r.out.result = _winreg_ReplaceKey(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, &r); @@ -1179,7 +1331,7 @@ static BOOL api_winreg_ReplaceKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1204,8 +1356,10 @@ static BOOL api_winreg_RestoreKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_RestoreKey(pull, NDR_IN, &r); @@ -1219,6 +1373,12 @@ static BOOL api_winreg_RestoreKey(pipes_struct *p) r.out.result = _winreg_RestoreKey(p, r.in.handle, r.in.filename, r.in.flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, &r); @@ -1235,7 +1395,7 @@ static BOOL api_winreg_RestoreKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1260,8 +1420,10 @@ static BOOL api_winreg_SaveKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_SaveKey(pull, NDR_IN, &r); @@ -1275,6 +1437,12 @@ static BOOL api_winreg_SaveKey(pipes_struct *p) r.out.result = _winreg_SaveKey(p, r.in.handle, r.in.filename, r.in.sec_attrib); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &r); @@ -1291,7 +1459,7 @@ static BOOL api_winreg_SaveKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1316,8 +1484,10 @@ static BOOL api_winreg_SetKeySecurity(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_SetKeySecurity(pull, NDR_IN, &r); @@ -1333,6 +1503,12 @@ static BOOL api_winreg_SetKeySecurity(pipes_struct *p) r.out.sd = r.in.sd; r.out.result = _winreg_SetKeySecurity(p, r.in.handle, r.in.access_mask, r.in.sd); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &r); @@ -1349,7 +1525,7 @@ static BOOL api_winreg_SetKeySecurity(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1374,8 +1550,10 @@ static BOOL api_winreg_SetValue(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_SetValue(pull, NDR_IN, &r); @@ -1389,6 +1567,12 @@ static BOOL api_winreg_SetValue(pipes_struct *p) r.out.result = _winreg_SetValue(p, r.in.handle, r.in.name, r.in.type, r.in.data, r.in.size); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_SetValue, &r); @@ -1405,7 +1589,7 @@ static BOOL api_winreg_SetValue(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1430,8 +1614,10 @@ static BOOL api_winreg_UnLoadKey(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_UnLoadKey(pull, NDR_IN, &r); @@ -1445,6 +1631,12 @@ static BOOL api_winreg_UnLoadKey(pipes_struct *p) r.out.result = _winreg_UnLoadKey(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &r); @@ -1461,7 +1653,7 @@ static BOOL api_winreg_UnLoadKey(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1486,8 +1678,10 @@ static BOOL api_winreg_InitiateSystemShutdown(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_InitiateSystemShutdown(pull, NDR_IN, &r); @@ -1501,6 +1695,12 @@ static BOOL api_winreg_InitiateSystemShutdown(pipes_struct *p) r.out.result = _winreg_InitiateSystemShutdown(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &r); @@ -1517,7 +1717,7 @@ static BOOL api_winreg_InitiateSystemShutdown(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1542,8 +1742,10 @@ static BOOL api_winreg_AbortSystemShutdown(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_AbortSystemShutdown(pull, NDR_IN, &r); @@ -1557,6 +1759,12 @@ static BOOL api_winreg_AbortSystemShutdown(pipes_struct *p) r.out.result = _winreg_AbortSystemShutdown(p, r.in.server); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &r); @@ -1573,7 +1781,7 @@ static BOOL api_winreg_AbortSystemShutdown(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1598,8 +1806,10 @@ static BOOL api_winreg_GetVersion(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_GetVersion(pull, NDR_IN, &r); @@ -1620,6 +1830,12 @@ static BOOL api_winreg_GetVersion(pipes_struct *p) r.out.result = _winreg_GetVersion(p, r.in.handle, r.out.version); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &r); @@ -1636,7 +1852,7 @@ static BOOL api_winreg_GetVersion(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1661,8 +1877,10 @@ static BOOL api_winreg_OpenHKCC(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKCC(pull, NDR_IN, &r); @@ -1683,6 +1901,12 @@ static BOOL api_winreg_OpenHKCC(pipes_struct *p) r.out.result = _winreg_OpenHKCC(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &r); @@ -1699,7 +1923,7 @@ static BOOL api_winreg_OpenHKCC(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1724,8 +1948,10 @@ static BOOL api_winreg_OpenHKDD(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKDD(pull, NDR_IN, &r); @@ -1746,6 +1972,12 @@ static BOOL api_winreg_OpenHKDD(pipes_struct *p) r.out.result = _winreg_OpenHKDD(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &r); @@ -1762,7 +1994,7 @@ static BOOL api_winreg_OpenHKDD(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1787,8 +2019,10 @@ static BOOL api_winreg_QueryMultipleValues(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_QueryMultipleValues(pull, NDR_IN, &r); @@ -1806,6 +2040,12 @@ static BOOL api_winreg_QueryMultipleValues(pipes_struct *p) r.out.buffer_size = r.in.buffer_size; r.out.result = _winreg_QueryMultipleValues(p, r.in.key_handle, r.in.values, r.in.num_values, r.in.buffer, r.in.buffer_size); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, &r); @@ -1822,7 +2062,7 @@ static BOOL api_winreg_QueryMultipleValues(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1847,8 +2087,10 @@ static BOOL api_winreg_InitiateSystemShutdownEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_InitiateSystemShutdownEx(pull, NDR_IN, &r); @@ -1862,6 +2104,12 @@ static BOOL api_winreg_InitiateSystemShutdownEx(pipes_struct *p) r.out.result = _winreg_InitiateSystemShutdownEx(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot, r.in.reason); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, &r); @@ -1878,7 +2126,7 @@ static BOOL api_winreg_InitiateSystemShutdownEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1903,8 +2151,10 @@ static BOOL api_winreg_SaveKeyEx(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_SaveKeyEx(pull, NDR_IN, &r); @@ -1918,6 +2168,12 @@ static BOOL api_winreg_SaveKeyEx(pipes_struct *p) r.out.result = _winreg_SaveKeyEx(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, &r); @@ -1934,7 +2190,7 @@ static BOOL api_winreg_SaveKeyEx(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1959,8 +2215,10 @@ static BOOL api_winreg_OpenHKPT(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKPT(pull, NDR_IN, &r); @@ -1981,6 +2239,12 @@ static BOOL api_winreg_OpenHKPT(pipes_struct *p) r.out.result = _winreg_OpenHKPT(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, &r); @@ -1997,7 +2261,7 @@ static BOOL api_winreg_OpenHKPT(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2022,8 +2286,10 @@ static BOOL api_winreg_OpenHKPN(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_OpenHKPN(pull, NDR_IN, &r); @@ -2044,6 +2310,12 @@ static BOOL api_winreg_OpenHKPN(pipes_struct *p) r.out.result = _winreg_OpenHKPN(p, r.in.system_name, r.in.access_mask, r.out.handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, &r); @@ -2060,7 +2332,7 @@ static BOOL api_winreg_OpenHKPN(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -2085,8 +2357,10 @@ static BOOL api_winreg_QueryMultipleValues2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_winreg_QueryMultipleValues2(pull, NDR_IN, &r); @@ -2100,6 +2374,12 @@ static BOOL api_winreg_QueryMultipleValues2(pipes_struct *p) r.out.result = _winreg_QueryMultipleValues2(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, &r); @@ -2116,7 +2396,7 @@ static BOOL api_winreg_QueryMultipleValues2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } diff --git a/source3/librpc/gen_ndr/srv_wkssvc.c b/source3/librpc/gen_ndr/srv_wkssvc.c index 3392a42fc6..7ad7db0192 100644 --- a/source3/librpc/gen_ndr/srv_wkssvc.c +++ b/source3/librpc/gen_ndr/srv_wkssvc.c @@ -21,8 +21,10 @@ static BOOL api_wkssvc_NetWkstaGetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetWkstaGetInfo(pull, NDR_IN, &r); @@ -43,6 +45,12 @@ static BOOL api_wkssvc_NetWkstaGetInfo(pipes_struct *p) r.out.result = _wkssvc_NetWkstaGetInfo(p, r.in.server_name, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &r); @@ -59,7 +67,7 @@ static BOOL api_wkssvc_NetWkstaGetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -84,8 +92,10 @@ static BOOL api_wkssvc_NetWkstaSetInfo(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetWkstaSetInfo(pull, NDR_IN, &r); @@ -101,6 +111,12 @@ static BOOL api_wkssvc_NetWkstaSetInfo(pipes_struct *p) r.out.parm_error = r.in.parm_error; r.out.result = _wkssvc_NetWkstaSetInfo(p, r.in.server_name, r.in.level, r.in.info, r.in.parm_error); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &r); @@ -117,7 +133,7 @@ static BOOL api_wkssvc_NetWkstaSetInfo(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -142,8 +158,10 @@ static BOOL api_wkssvc_NetWkstaEnumUsers(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetWkstaEnumUsers(pull, NDR_IN, &r); @@ -172,6 +190,12 @@ static BOOL api_wkssvc_NetWkstaEnumUsers(pipes_struct *p) r.out.resumehandle = r.in.resumehandle; r.out.result = _wkssvc_NetWkstaEnumUsers(p, r.in.server_name, r.in.level, r.in.users, r.in.prefmaxlen, r.out.entriesread, r.out.totalentries, r.in.resumehandle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &r); @@ -188,7 +212,7 @@ static BOOL api_wkssvc_NetWkstaEnumUsers(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -213,8 +237,10 @@ static BOOL api_WKSSVC_NETRWKSTAUSERGETINFO(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRWKSTAUSERGETINFO(pull, NDR_IN, &r); @@ -228,6 +254,12 @@ static BOOL api_WKSSVC_NETRWKSTAUSERGETINFO(pipes_struct *p) r.out.result = _WKSSVC_NETRWKSTAUSERGETINFO(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRWKSTAUSERGETINFO, &r); @@ -244,7 +276,7 @@ static BOOL api_WKSSVC_NETRWKSTAUSERGETINFO(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -269,8 +301,10 @@ static BOOL api_WKSSVC_NETRWKSTAUSERSETINFO(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRWKSTAUSERSETINFO(pull, NDR_IN, &r); @@ -284,6 +318,12 @@ static BOOL api_WKSSVC_NETRWKSTAUSERSETINFO(pipes_struct *p) r.out.result = _WKSSVC_NETRWKSTAUSERSETINFO(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRWKSTAUSERSETINFO, &r); @@ -300,7 +340,7 @@ static BOOL api_WKSSVC_NETRWKSTAUSERSETINFO(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -325,8 +365,10 @@ static BOOL api_wkssvc_NetWkstaTransportEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetWkstaTransportEnum(pull, NDR_IN, &r); @@ -350,6 +392,12 @@ static BOOL api_wkssvc_NetWkstaTransportEnum(pipes_struct *p) r.out.resume_handle = r.in.resume_handle; r.out.result = _wkssvc_NetWkstaTransportEnum(p, r.in.server_name, r.in.level, r.in.ctr, r.in.max_buffer, r.out.totalentries, r.in.resume_handle); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &r); @@ -366,7 +414,7 @@ static BOOL api_wkssvc_NetWkstaTransportEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -391,8 +439,10 @@ static BOOL api_WKSSVC_NETRWKSTATRANSPORTADD(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRWKSTATRANSPORTADD(pull, NDR_IN, &r); @@ -406,6 +456,12 @@ static BOOL api_WKSSVC_NETRWKSTATRANSPORTADD(pipes_struct *p) r.out.result = _WKSSVC_NETRWKSTATRANSPORTADD(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRWKSTATRANSPORTADD, &r); @@ -422,7 +478,7 @@ static BOOL api_WKSSVC_NETRWKSTATRANSPORTADD(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -447,8 +503,10 @@ static BOOL api_WKSSVC_NETRWKSTATRANSPORTDEL(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRWKSTATRANSPORTDEL(pull, NDR_IN, &r); @@ -462,6 +520,12 @@ static BOOL api_WKSSVC_NETRWKSTATRANSPORTDEL(pipes_struct *p) r.out.result = _WKSSVC_NETRWKSTATRANSPORTDEL(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRWKSTATRANSPORTDEL, &r); @@ -478,7 +542,7 @@ static BOOL api_WKSSVC_NETRWKSTATRANSPORTDEL(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -503,8 +567,10 @@ static BOOL api_WKSSVC_NETRUSEADD(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRUSEADD(pull, NDR_IN, &r); @@ -518,6 +584,12 @@ static BOOL api_WKSSVC_NETRUSEADD(pipes_struct *p) r.out.result = _WKSSVC_NETRUSEADD(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRUSEADD, &r); @@ -534,7 +606,7 @@ static BOOL api_WKSSVC_NETRUSEADD(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -559,8 +631,10 @@ static BOOL api_WKSSVC_NETRUSEGETINFO(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRUSEGETINFO(pull, NDR_IN, &r); @@ -574,6 +648,12 @@ static BOOL api_WKSSVC_NETRUSEGETINFO(pipes_struct *p) r.out.result = _WKSSVC_NETRUSEGETINFO(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRUSEGETINFO, &r); @@ -590,7 +670,7 @@ static BOOL api_WKSSVC_NETRUSEGETINFO(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -615,8 +695,10 @@ static BOOL api_WKSSVC_NETRUSEDEL(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRUSEDEL(pull, NDR_IN, &r); @@ -630,6 +712,12 @@ static BOOL api_WKSSVC_NETRUSEDEL(pipes_struct *p) r.out.result = _WKSSVC_NETRUSEDEL(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRUSEDEL, &r); @@ -646,7 +734,7 @@ static BOOL api_WKSSVC_NETRUSEDEL(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -671,8 +759,10 @@ static BOOL api_WKSSVC_NETRUSEENUM(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRUSEENUM(pull, NDR_IN, &r); @@ -686,6 +776,12 @@ static BOOL api_WKSSVC_NETRUSEENUM(pipes_struct *p) r.out.result = _WKSSVC_NETRUSEENUM(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRUSEENUM, &r); @@ -702,7 +798,7 @@ static BOOL api_WKSSVC_NETRUSEENUM(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -727,8 +823,10 @@ static BOOL api_WKSSVC_NETRMESSAGEBUFFERSEND(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRMESSAGEBUFFERSEND(pull, NDR_IN, &r); @@ -742,6 +840,12 @@ static BOOL api_WKSSVC_NETRMESSAGEBUFFERSEND(pipes_struct *p) r.out.result = _WKSSVC_NETRMESSAGEBUFFERSEND(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRMESSAGEBUFFERSEND, &r); @@ -758,7 +862,7 @@ static BOOL api_WKSSVC_NETRMESSAGEBUFFERSEND(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -783,8 +887,10 @@ static BOOL api_WKSSVC_NETRWORKSTATIONSTATISTICSGET(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRWORKSTATIONSTATISTICSGET(pull, NDR_IN, &r); @@ -798,6 +904,12 @@ static BOOL api_WKSSVC_NETRWORKSTATIONSTATISTICSGET(pipes_struct *p) r.out.result = _WKSSVC_NETRWORKSTATIONSTATISTICSGET(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRWORKSTATIONSTATISTICSGET, &r); @@ -814,7 +926,7 @@ static BOOL api_WKSSVC_NETRWORKSTATIONSTATISTICSGET(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -839,8 +951,10 @@ static BOOL api_WKSSVC_NETRLOGONDOMAINNAMEADD(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRLOGONDOMAINNAMEADD(pull, NDR_IN, &r); @@ -854,6 +968,12 @@ static BOOL api_WKSSVC_NETRLOGONDOMAINNAMEADD(pipes_struct *p) r.out.result = _WKSSVC_NETRLOGONDOMAINNAMEADD(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRLOGONDOMAINNAMEADD, &r); @@ -870,7 +990,7 @@ static BOOL api_WKSSVC_NETRLOGONDOMAINNAMEADD(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -895,8 +1015,10 @@ static BOOL api_WKSSVC_NETRLOGONDOMAINNAMEDEL(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRLOGONDOMAINNAMEDEL(pull, NDR_IN, &r); @@ -910,6 +1032,12 @@ static BOOL api_WKSSVC_NETRLOGONDOMAINNAMEDEL(pipes_struct *p) r.out.result = _WKSSVC_NETRLOGONDOMAINNAMEDEL(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRLOGONDOMAINNAMEDEL, &r); @@ -926,7 +1054,7 @@ static BOOL api_WKSSVC_NETRLOGONDOMAINNAMEDEL(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -951,8 +1079,10 @@ static BOOL api_WKSSVC_NETRJOINDOMAIN(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRJOINDOMAIN(pull, NDR_IN, &r); @@ -966,6 +1096,12 @@ static BOOL api_WKSSVC_NETRJOINDOMAIN(pipes_struct *p) r.out.result = _WKSSVC_NETRJOINDOMAIN(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRJOINDOMAIN, &r); @@ -982,7 +1118,7 @@ static BOOL api_WKSSVC_NETRJOINDOMAIN(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1007,8 +1143,10 @@ static BOOL api_WKSSVC_NETRUNJOINDOMAIN(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRUNJOINDOMAIN(pull, NDR_IN, &r); @@ -1022,6 +1160,12 @@ static BOOL api_WKSSVC_NETRUNJOINDOMAIN(pipes_struct *p) r.out.result = _WKSSVC_NETRUNJOINDOMAIN(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRUNJOINDOMAIN, &r); @@ -1038,7 +1182,7 @@ static BOOL api_WKSSVC_NETRUNJOINDOMAIN(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1063,8 +1207,10 @@ static BOOL api_WKSSVC_NETRRENAMEMACHINEINDOMAIN(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRRENAMEMACHINEINDOMAIN(pull, NDR_IN, &r); @@ -1078,6 +1224,12 @@ static BOOL api_WKSSVC_NETRRENAMEMACHINEINDOMAIN(pipes_struct *p) r.out.result = _WKSSVC_NETRRENAMEMACHINEINDOMAIN(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRRENAMEMACHINEINDOMAIN, &r); @@ -1094,7 +1246,7 @@ static BOOL api_WKSSVC_NETRRENAMEMACHINEINDOMAIN(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1119,8 +1271,10 @@ static BOOL api_WKSSVC_NETRVALIDATENAME(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRVALIDATENAME(pull, NDR_IN, &r); @@ -1134,6 +1288,12 @@ static BOOL api_WKSSVC_NETRVALIDATENAME(pipes_struct *p) r.out.result = _WKSSVC_NETRVALIDATENAME(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRVALIDATENAME, &r); @@ -1150,7 +1310,7 @@ static BOOL api_WKSSVC_NETRVALIDATENAME(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1175,8 +1335,10 @@ static BOOL api_WKSSVC_NETRGETJOININFORMATION(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRGETJOININFORMATION(pull, NDR_IN, &r); @@ -1190,6 +1352,12 @@ static BOOL api_WKSSVC_NETRGETJOININFORMATION(pipes_struct *p) r.out.result = _WKSSVC_NETRGETJOININFORMATION(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRGETJOININFORMATION, &r); @@ -1206,7 +1374,7 @@ static BOOL api_WKSSVC_NETRGETJOININFORMATION(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1231,8 +1399,10 @@ static BOOL api_WKSSVC_NETRGETJOINABLEOUS(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRGETJOINABLEOUS(pull, NDR_IN, &r); @@ -1246,6 +1416,12 @@ static BOOL api_WKSSVC_NETRGETJOINABLEOUS(pipes_struct *p) r.out.result = _WKSSVC_NETRGETJOINABLEOUS(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRGETJOINABLEOUS, &r); @@ -1262,7 +1438,7 @@ static BOOL api_WKSSVC_NETRGETJOINABLEOUS(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1287,8 +1463,10 @@ static BOOL api_wkssvc_NetrJoinDomain2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetrJoinDomain2(pull, NDR_IN, &r); @@ -1302,6 +1480,12 @@ static BOOL api_wkssvc_NetrJoinDomain2(pipes_struct *p) r.out.result = _wkssvc_NetrJoinDomain2(p, r.in.server_name, r.in.domain_name, r.in.account_name, r.in.admin_account, r.in.encrypted_password, r.in.join_flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &r); @@ -1318,7 +1502,7 @@ static BOOL api_wkssvc_NetrJoinDomain2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1343,8 +1527,10 @@ static BOOL api_wkssvc_NetrUnjoinDomain2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetrUnjoinDomain2(pull, NDR_IN, &r); @@ -1358,6 +1544,12 @@ static BOOL api_wkssvc_NetrUnjoinDomain2(pipes_struct *p) r.out.result = _wkssvc_NetrUnjoinDomain2(p, r.in.server_name, r.in.account, r.in.encrypted_password, r.in.unjoin_flags); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &r); @@ -1374,7 +1566,7 @@ static BOOL api_wkssvc_NetrUnjoinDomain2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1399,8 +1591,10 @@ static BOOL api_wkssvc_NetrRenameMachineInDomain2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetrRenameMachineInDomain2(pull, NDR_IN, &r); @@ -1414,6 +1608,12 @@ static BOOL api_wkssvc_NetrRenameMachineInDomain2(pipes_struct *p) r.out.result = _wkssvc_NetrRenameMachineInDomain2(p, r.in.server_name, r.in.NewMachineName, r.in.Account, r.in.EncryptedPassword, r.in.RenameOptions); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r); @@ -1430,7 +1630,7 @@ static BOOL api_wkssvc_NetrRenameMachineInDomain2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1455,8 +1655,10 @@ static BOOL api_WKSSVC_NETRVALIDATENAME2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRVALIDATENAME2(pull, NDR_IN, &r); @@ -1470,6 +1672,12 @@ static BOOL api_WKSSVC_NETRVALIDATENAME2(pipes_struct *p) r.out.result = _WKSSVC_NETRVALIDATENAME2(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRVALIDATENAME2, &r); @@ -1486,7 +1694,7 @@ static BOOL api_WKSSVC_NETRVALIDATENAME2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1511,8 +1719,10 @@ static BOOL api_WKSSVC_NETRGETJOINABLEOUS2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRGETJOINABLEOUS2(pull, NDR_IN, &r); @@ -1526,6 +1736,12 @@ static BOOL api_WKSSVC_NETRGETJOINABLEOUS2(pipes_struct *p) r.out.result = _WKSSVC_NETRGETJOINABLEOUS2(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRGETJOINABLEOUS2, &r); @@ -1542,7 +1758,7 @@ static BOOL api_WKSSVC_NETRGETJOINABLEOUS2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1567,8 +1783,10 @@ static BOOL api_wkssvc_NetrAddAlternateComputerName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetrAddAlternateComputerName(pull, NDR_IN, &r); @@ -1582,6 +1800,12 @@ static BOOL api_wkssvc_NetrAddAlternateComputerName(pipes_struct *p) r.out.result = _wkssvc_NetrAddAlternateComputerName(p, r.in.server_name, r.in.NewAlternateMachineName, r.in.Account, r.in.EncryptedPassword, r.in.Reserved); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &r); @@ -1598,7 +1822,7 @@ static BOOL api_wkssvc_NetrAddAlternateComputerName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1623,8 +1847,10 @@ static BOOL api_wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_wkssvc_NetrRemoveAlternateComputerName(pull, NDR_IN, &r); @@ -1638,6 +1864,12 @@ static BOOL api_wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p) r.out.result = _wkssvc_NetrRemoveAlternateComputerName(p, r.in.server_name, r.in.AlternateMachineNameToRemove, r.in.Account, r.in.EncryptedPassword, r.in.Reserved); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r); @@ -1654,7 +1886,7 @@ static BOOL api_wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1679,8 +1911,10 @@ static BOOL api_WKSSVC_NETRSETPRIMARYCOMPUTERNAME(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRSETPRIMARYCOMPUTERNAME(pull, NDR_IN, &r); @@ -1694,6 +1928,12 @@ static BOOL api_WKSSVC_NETRSETPRIMARYCOMPUTERNAME(pipes_struct *p) r.out.result = _WKSSVC_NETRSETPRIMARYCOMPUTERNAME(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRSETPRIMARYCOMPUTERNAME, &r); @@ -1710,7 +1950,7 @@ static BOOL api_WKSSVC_NETRSETPRIMARYCOMPUTERNAME(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -1735,8 +1975,10 @@ static BOOL api_WKSSVC_NETRENUMERATECOMPUTERNAMES(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_WKSSVC_NETRENUMERATECOMPUTERNAMES(pull, NDR_IN, &r); @@ -1750,6 +1992,12 @@ static BOOL api_WKSSVC_NETRENUMERATECOMPUTERNAMES(pipes_struct *p) r.out.result = _WKSSVC_NETRENUMERATECOMPUTERNAMES(p); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(WKSSVC_NETRENUMERATECOMPUTERNAMES, &r); @@ -1766,7 +2014,7 @@ static BOOL api_WKSSVC_NETRENUMERATECOMPUTERNAMES(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } |