| 1 | /*
|
|---|
| 2 | * Unix SMB/CIFS implementation.
|
|---|
| 3 | * server auto-generated by pidl. DO NOT MODIFY!
|
|---|
| 4 | */
|
|---|
| 5 |
|
|---|
| 6 | #include "includes.h"
|
|---|
| 7 | #include "librpc/gen_ndr/srv_samr.h"
|
|---|
| 8 |
|
|---|
| 9 | static bool api_samr_Connect(pipes_struct *p)
|
|---|
| 10 | {
|
|---|
| 11 | const struct ndr_interface_call *call;
|
|---|
| 12 | struct ndr_pull *pull;
|
|---|
| 13 | struct ndr_push *push;
|
|---|
| 14 | enum ndr_err_code ndr_err;
|
|---|
| 15 | DATA_BLOB blob;
|
|---|
| 16 | struct samr_Connect *r;
|
|---|
| 17 |
|
|---|
| 18 | call = &ndr_table_samr.calls[NDR_SAMR_CONNECT];
|
|---|
| 19 |
|
|---|
| 20 | r = talloc(talloc_tos(), struct samr_Connect);
|
|---|
| 21 | if (r == NULL) {
|
|---|
| 22 | return false;
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 26 | talloc_free(r);
|
|---|
| 27 | return false;
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 31 | if (pull == NULL) {
|
|---|
| 32 | talloc_free(r);
|
|---|
| 33 | return false;
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 37 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 38 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 39 | talloc_free(r);
|
|---|
| 40 | return false;
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | if (DEBUGLEVEL >= 10) {
|
|---|
| 44 | NDR_PRINT_IN_DEBUG(samr_Connect, r);
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | ZERO_STRUCT(r->out);
|
|---|
| 48 | r->out.connect_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 49 | if (r->out.connect_handle == NULL) {
|
|---|
| 50 | talloc_free(r);
|
|---|
| 51 | return false;
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | r->out.result = _samr_Connect(p, r);
|
|---|
| 55 |
|
|---|
| 56 | if (p->rng_fault_state) {
|
|---|
| 57 | talloc_free(r);
|
|---|
| 58 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 59 | return true;
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 | if (DEBUGLEVEL >= 10) {
|
|---|
| 63 | NDR_PRINT_OUT_DEBUG(samr_Connect, r);
|
|---|
| 64 | }
|
|---|
| 65 |
|
|---|
| 66 | push = ndr_push_init_ctx(r);
|
|---|
| 67 | if (push == NULL) {
|
|---|
| 68 | talloc_free(r);
|
|---|
| 69 | return false;
|
|---|
| 70 | }
|
|---|
| 71 |
|
|---|
| 72 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 73 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 74 | talloc_free(r);
|
|---|
| 75 | return false;
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | blob = ndr_push_blob(push);
|
|---|
| 79 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 80 | talloc_free(r);
|
|---|
| 81 | return false;
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 | talloc_free(r);
|
|---|
| 85 |
|
|---|
| 86 | return true;
|
|---|
| 87 | }
|
|---|
| 88 |
|
|---|
| 89 | static bool api_samr_Close(pipes_struct *p)
|
|---|
| 90 | {
|
|---|
| 91 | const struct ndr_interface_call *call;
|
|---|
| 92 | struct ndr_pull *pull;
|
|---|
| 93 | struct ndr_push *push;
|
|---|
| 94 | enum ndr_err_code ndr_err;
|
|---|
| 95 | DATA_BLOB blob;
|
|---|
| 96 | struct samr_Close *r;
|
|---|
| 97 |
|
|---|
| 98 | call = &ndr_table_samr.calls[NDR_SAMR_CLOSE];
|
|---|
| 99 |
|
|---|
| 100 | r = talloc(talloc_tos(), struct samr_Close);
|
|---|
| 101 | if (r == NULL) {
|
|---|
| 102 | return false;
|
|---|
| 103 | }
|
|---|
| 104 |
|
|---|
| 105 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 106 | talloc_free(r);
|
|---|
| 107 | return false;
|
|---|
| 108 | }
|
|---|
| 109 |
|
|---|
| 110 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 111 | if (pull == NULL) {
|
|---|
| 112 | talloc_free(r);
|
|---|
| 113 | return false;
|
|---|
| 114 | }
|
|---|
| 115 |
|
|---|
| 116 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 117 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 118 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 119 | talloc_free(r);
|
|---|
| 120 | return false;
|
|---|
| 121 | }
|
|---|
| 122 |
|
|---|
| 123 | if (DEBUGLEVEL >= 10) {
|
|---|
| 124 | NDR_PRINT_IN_DEBUG(samr_Close, r);
|
|---|
| 125 | }
|
|---|
| 126 |
|
|---|
| 127 | ZERO_STRUCT(r->out);
|
|---|
| 128 | r->out.handle = r->in.handle;
|
|---|
| 129 | r->out.result = _samr_Close(p, r);
|
|---|
| 130 |
|
|---|
| 131 | if (p->rng_fault_state) {
|
|---|
| 132 | talloc_free(r);
|
|---|
| 133 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 134 | return true;
|
|---|
| 135 | }
|
|---|
| 136 |
|
|---|
| 137 | if (DEBUGLEVEL >= 10) {
|
|---|
| 138 | NDR_PRINT_OUT_DEBUG(samr_Close, r);
|
|---|
| 139 | }
|
|---|
| 140 |
|
|---|
| 141 | push = ndr_push_init_ctx(r);
|
|---|
| 142 | if (push == NULL) {
|
|---|
| 143 | talloc_free(r);
|
|---|
| 144 | return false;
|
|---|
| 145 | }
|
|---|
| 146 |
|
|---|
| 147 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 148 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 149 | talloc_free(r);
|
|---|
| 150 | return false;
|
|---|
| 151 | }
|
|---|
| 152 |
|
|---|
| 153 | blob = ndr_push_blob(push);
|
|---|
| 154 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 155 | talloc_free(r);
|
|---|
| 156 | return false;
|
|---|
| 157 | }
|
|---|
| 158 |
|
|---|
| 159 | talloc_free(r);
|
|---|
| 160 |
|
|---|
| 161 | return true;
|
|---|
| 162 | }
|
|---|
| 163 |
|
|---|
| 164 | static bool api_samr_SetSecurity(pipes_struct *p)
|
|---|
| 165 | {
|
|---|
| 166 | const struct ndr_interface_call *call;
|
|---|
| 167 | struct ndr_pull *pull;
|
|---|
| 168 | struct ndr_push *push;
|
|---|
| 169 | enum ndr_err_code ndr_err;
|
|---|
| 170 | DATA_BLOB blob;
|
|---|
| 171 | struct samr_SetSecurity *r;
|
|---|
| 172 |
|
|---|
| 173 | call = &ndr_table_samr.calls[NDR_SAMR_SETSECURITY];
|
|---|
| 174 |
|
|---|
| 175 | r = talloc(talloc_tos(), struct samr_SetSecurity);
|
|---|
| 176 | if (r == NULL) {
|
|---|
| 177 | return false;
|
|---|
| 178 | }
|
|---|
| 179 |
|
|---|
| 180 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 181 | talloc_free(r);
|
|---|
| 182 | return false;
|
|---|
| 183 | }
|
|---|
| 184 |
|
|---|
| 185 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 186 | if (pull == NULL) {
|
|---|
| 187 | talloc_free(r);
|
|---|
| 188 | return false;
|
|---|
| 189 | }
|
|---|
| 190 |
|
|---|
| 191 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 192 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 193 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 194 | talloc_free(r);
|
|---|
| 195 | return false;
|
|---|
| 196 | }
|
|---|
| 197 |
|
|---|
| 198 | if (DEBUGLEVEL >= 10) {
|
|---|
| 199 | NDR_PRINT_IN_DEBUG(samr_SetSecurity, r);
|
|---|
| 200 | }
|
|---|
| 201 |
|
|---|
| 202 | r->out.result = _samr_SetSecurity(p, r);
|
|---|
| 203 |
|
|---|
| 204 | if (p->rng_fault_state) {
|
|---|
| 205 | talloc_free(r);
|
|---|
| 206 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 207 | return true;
|
|---|
| 208 | }
|
|---|
| 209 |
|
|---|
| 210 | if (DEBUGLEVEL >= 10) {
|
|---|
| 211 | NDR_PRINT_OUT_DEBUG(samr_SetSecurity, r);
|
|---|
| 212 | }
|
|---|
| 213 |
|
|---|
| 214 | push = ndr_push_init_ctx(r);
|
|---|
| 215 | if (push == NULL) {
|
|---|
| 216 | talloc_free(r);
|
|---|
| 217 | return false;
|
|---|
| 218 | }
|
|---|
| 219 |
|
|---|
| 220 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 221 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 222 | talloc_free(r);
|
|---|
| 223 | return false;
|
|---|
| 224 | }
|
|---|
| 225 |
|
|---|
| 226 | blob = ndr_push_blob(push);
|
|---|
| 227 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 228 | talloc_free(r);
|
|---|
| 229 | return false;
|
|---|
| 230 | }
|
|---|
| 231 |
|
|---|
| 232 | talloc_free(r);
|
|---|
| 233 |
|
|---|
| 234 | return true;
|
|---|
| 235 | }
|
|---|
| 236 |
|
|---|
| 237 | static bool api_samr_QuerySecurity(pipes_struct *p)
|
|---|
| 238 | {
|
|---|
| 239 | const struct ndr_interface_call *call;
|
|---|
| 240 | struct ndr_pull *pull;
|
|---|
| 241 | struct ndr_push *push;
|
|---|
| 242 | enum ndr_err_code ndr_err;
|
|---|
| 243 | DATA_BLOB blob;
|
|---|
| 244 | struct samr_QuerySecurity *r;
|
|---|
| 245 |
|
|---|
| 246 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYSECURITY];
|
|---|
| 247 |
|
|---|
| 248 | r = talloc(talloc_tos(), struct samr_QuerySecurity);
|
|---|
| 249 | if (r == NULL) {
|
|---|
| 250 | return false;
|
|---|
| 251 | }
|
|---|
| 252 |
|
|---|
| 253 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 254 | talloc_free(r);
|
|---|
| 255 | return false;
|
|---|
| 256 | }
|
|---|
| 257 |
|
|---|
| 258 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 259 | if (pull == NULL) {
|
|---|
| 260 | talloc_free(r);
|
|---|
| 261 | return false;
|
|---|
| 262 | }
|
|---|
| 263 |
|
|---|
| 264 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 265 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 266 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 267 | talloc_free(r);
|
|---|
| 268 | return false;
|
|---|
| 269 | }
|
|---|
| 270 |
|
|---|
| 271 | if (DEBUGLEVEL >= 10) {
|
|---|
| 272 | NDR_PRINT_IN_DEBUG(samr_QuerySecurity, r);
|
|---|
| 273 | }
|
|---|
| 274 |
|
|---|
| 275 | ZERO_STRUCT(r->out);
|
|---|
| 276 | r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *);
|
|---|
| 277 | if (r->out.sdbuf == NULL) {
|
|---|
| 278 | talloc_free(r);
|
|---|
| 279 | return false;
|
|---|
| 280 | }
|
|---|
| 281 |
|
|---|
| 282 | r->out.result = _samr_QuerySecurity(p, r);
|
|---|
| 283 |
|
|---|
| 284 | if (p->rng_fault_state) {
|
|---|
| 285 | talloc_free(r);
|
|---|
| 286 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 287 | return true;
|
|---|
| 288 | }
|
|---|
| 289 |
|
|---|
| 290 | if (DEBUGLEVEL >= 10) {
|
|---|
| 291 | NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, r);
|
|---|
| 292 | }
|
|---|
| 293 |
|
|---|
| 294 | push = ndr_push_init_ctx(r);
|
|---|
| 295 | if (push == NULL) {
|
|---|
| 296 | talloc_free(r);
|
|---|
| 297 | return false;
|
|---|
| 298 | }
|
|---|
| 299 |
|
|---|
| 300 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 301 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 302 | talloc_free(r);
|
|---|
| 303 | return false;
|
|---|
| 304 | }
|
|---|
| 305 |
|
|---|
| 306 | blob = ndr_push_blob(push);
|
|---|
| 307 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 308 | talloc_free(r);
|
|---|
| 309 | return false;
|
|---|
| 310 | }
|
|---|
| 311 |
|
|---|
| 312 | talloc_free(r);
|
|---|
| 313 |
|
|---|
| 314 | return true;
|
|---|
| 315 | }
|
|---|
| 316 |
|
|---|
| 317 | static bool api_samr_Shutdown(pipes_struct *p)
|
|---|
| 318 | {
|
|---|
| 319 | const struct ndr_interface_call *call;
|
|---|
| 320 | struct ndr_pull *pull;
|
|---|
| 321 | struct ndr_push *push;
|
|---|
| 322 | enum ndr_err_code ndr_err;
|
|---|
| 323 | DATA_BLOB blob;
|
|---|
| 324 | struct samr_Shutdown *r;
|
|---|
| 325 |
|
|---|
| 326 | call = &ndr_table_samr.calls[NDR_SAMR_SHUTDOWN];
|
|---|
| 327 |
|
|---|
| 328 | r = talloc(talloc_tos(), struct samr_Shutdown);
|
|---|
| 329 | if (r == NULL) {
|
|---|
| 330 | return false;
|
|---|
| 331 | }
|
|---|
| 332 |
|
|---|
| 333 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 334 | talloc_free(r);
|
|---|
| 335 | return false;
|
|---|
| 336 | }
|
|---|
| 337 |
|
|---|
| 338 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 339 | if (pull == NULL) {
|
|---|
| 340 | talloc_free(r);
|
|---|
| 341 | return false;
|
|---|
| 342 | }
|
|---|
| 343 |
|
|---|
| 344 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 345 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 346 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 347 | talloc_free(r);
|
|---|
| 348 | return false;
|
|---|
| 349 | }
|
|---|
| 350 |
|
|---|
| 351 | if (DEBUGLEVEL >= 10) {
|
|---|
| 352 | NDR_PRINT_IN_DEBUG(samr_Shutdown, r);
|
|---|
| 353 | }
|
|---|
| 354 |
|
|---|
| 355 | r->out.result = _samr_Shutdown(p, r);
|
|---|
| 356 |
|
|---|
| 357 | if (p->rng_fault_state) {
|
|---|
| 358 | talloc_free(r);
|
|---|
| 359 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 360 | return true;
|
|---|
| 361 | }
|
|---|
| 362 |
|
|---|
| 363 | if (DEBUGLEVEL >= 10) {
|
|---|
| 364 | NDR_PRINT_OUT_DEBUG(samr_Shutdown, r);
|
|---|
| 365 | }
|
|---|
| 366 |
|
|---|
| 367 | push = ndr_push_init_ctx(r);
|
|---|
| 368 | if (push == NULL) {
|
|---|
| 369 | talloc_free(r);
|
|---|
| 370 | return false;
|
|---|
| 371 | }
|
|---|
| 372 |
|
|---|
| 373 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 374 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 375 | talloc_free(r);
|
|---|
| 376 | return false;
|
|---|
| 377 | }
|
|---|
| 378 |
|
|---|
| 379 | blob = ndr_push_blob(push);
|
|---|
| 380 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 381 | talloc_free(r);
|
|---|
| 382 | return false;
|
|---|
| 383 | }
|
|---|
| 384 |
|
|---|
| 385 | talloc_free(r);
|
|---|
| 386 |
|
|---|
| 387 | return true;
|
|---|
| 388 | }
|
|---|
| 389 |
|
|---|
| 390 | static bool api_samr_LookupDomain(pipes_struct *p)
|
|---|
| 391 | {
|
|---|
| 392 | const struct ndr_interface_call *call;
|
|---|
| 393 | struct ndr_pull *pull;
|
|---|
| 394 | struct ndr_push *push;
|
|---|
| 395 | enum ndr_err_code ndr_err;
|
|---|
| 396 | DATA_BLOB blob;
|
|---|
| 397 | struct samr_LookupDomain *r;
|
|---|
| 398 |
|
|---|
| 399 | call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPDOMAIN];
|
|---|
| 400 |
|
|---|
| 401 | r = talloc(talloc_tos(), struct samr_LookupDomain);
|
|---|
| 402 | if (r == NULL) {
|
|---|
| 403 | return false;
|
|---|
| 404 | }
|
|---|
| 405 |
|
|---|
| 406 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 407 | talloc_free(r);
|
|---|
| 408 | return false;
|
|---|
| 409 | }
|
|---|
| 410 |
|
|---|
| 411 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 412 | if (pull == NULL) {
|
|---|
| 413 | talloc_free(r);
|
|---|
| 414 | return false;
|
|---|
| 415 | }
|
|---|
| 416 |
|
|---|
| 417 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 418 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 419 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 420 | talloc_free(r);
|
|---|
| 421 | return false;
|
|---|
| 422 | }
|
|---|
| 423 |
|
|---|
| 424 | if (DEBUGLEVEL >= 10) {
|
|---|
| 425 | NDR_PRINT_IN_DEBUG(samr_LookupDomain, r);
|
|---|
| 426 | }
|
|---|
| 427 |
|
|---|
| 428 | ZERO_STRUCT(r->out);
|
|---|
| 429 | r->out.sid = talloc_zero(r, struct dom_sid2 *);
|
|---|
| 430 | if (r->out.sid == NULL) {
|
|---|
| 431 | talloc_free(r);
|
|---|
| 432 | return false;
|
|---|
| 433 | }
|
|---|
| 434 |
|
|---|
| 435 | r->out.result = _samr_LookupDomain(p, r);
|
|---|
| 436 |
|
|---|
| 437 | if (p->rng_fault_state) {
|
|---|
| 438 | talloc_free(r);
|
|---|
| 439 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 440 | return true;
|
|---|
| 441 | }
|
|---|
| 442 |
|
|---|
| 443 | if (DEBUGLEVEL >= 10) {
|
|---|
| 444 | NDR_PRINT_OUT_DEBUG(samr_LookupDomain, r);
|
|---|
| 445 | }
|
|---|
| 446 |
|
|---|
| 447 | push = ndr_push_init_ctx(r);
|
|---|
| 448 | if (push == NULL) {
|
|---|
| 449 | talloc_free(r);
|
|---|
| 450 | return false;
|
|---|
| 451 | }
|
|---|
| 452 |
|
|---|
| 453 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 454 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 455 | talloc_free(r);
|
|---|
| 456 | return false;
|
|---|
| 457 | }
|
|---|
| 458 |
|
|---|
| 459 | blob = ndr_push_blob(push);
|
|---|
| 460 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 461 | talloc_free(r);
|
|---|
| 462 | return false;
|
|---|
| 463 | }
|
|---|
| 464 |
|
|---|
| 465 | talloc_free(r);
|
|---|
| 466 |
|
|---|
| 467 | return true;
|
|---|
| 468 | }
|
|---|
| 469 |
|
|---|
| 470 | static bool api_samr_EnumDomains(pipes_struct *p)
|
|---|
| 471 | {
|
|---|
| 472 | const struct ndr_interface_call *call;
|
|---|
| 473 | struct ndr_pull *pull;
|
|---|
| 474 | struct ndr_push *push;
|
|---|
| 475 | enum ndr_err_code ndr_err;
|
|---|
| 476 | DATA_BLOB blob;
|
|---|
| 477 | struct samr_EnumDomains *r;
|
|---|
| 478 |
|
|---|
| 479 | call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINS];
|
|---|
| 480 |
|
|---|
| 481 | r = talloc(talloc_tos(), struct samr_EnumDomains);
|
|---|
| 482 | if (r == NULL) {
|
|---|
| 483 | return false;
|
|---|
| 484 | }
|
|---|
| 485 |
|
|---|
| 486 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 487 | talloc_free(r);
|
|---|
| 488 | return false;
|
|---|
| 489 | }
|
|---|
| 490 |
|
|---|
| 491 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 492 | if (pull == NULL) {
|
|---|
| 493 | talloc_free(r);
|
|---|
| 494 | return false;
|
|---|
| 495 | }
|
|---|
| 496 |
|
|---|
| 497 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 498 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 499 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 500 | talloc_free(r);
|
|---|
| 501 | return false;
|
|---|
| 502 | }
|
|---|
| 503 |
|
|---|
| 504 | if (DEBUGLEVEL >= 10) {
|
|---|
| 505 | NDR_PRINT_IN_DEBUG(samr_EnumDomains, r);
|
|---|
| 506 | }
|
|---|
| 507 |
|
|---|
| 508 | ZERO_STRUCT(r->out);
|
|---|
| 509 | r->out.resume_handle = r->in.resume_handle;
|
|---|
| 510 | r->out.sam = talloc_zero(r, struct samr_SamArray *);
|
|---|
| 511 | if (r->out.sam == NULL) {
|
|---|
| 512 | talloc_free(r);
|
|---|
| 513 | return false;
|
|---|
| 514 | }
|
|---|
| 515 |
|
|---|
| 516 | r->out.num_entries = talloc_zero(r, uint32_t);
|
|---|
| 517 | if (r->out.num_entries == NULL) {
|
|---|
| 518 | talloc_free(r);
|
|---|
| 519 | return false;
|
|---|
| 520 | }
|
|---|
| 521 |
|
|---|
| 522 | r->out.result = _samr_EnumDomains(p, r);
|
|---|
| 523 |
|
|---|
| 524 | if (p->rng_fault_state) {
|
|---|
| 525 | talloc_free(r);
|
|---|
| 526 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 527 | return true;
|
|---|
| 528 | }
|
|---|
| 529 |
|
|---|
| 530 | if (DEBUGLEVEL >= 10) {
|
|---|
| 531 | NDR_PRINT_OUT_DEBUG(samr_EnumDomains, r);
|
|---|
| 532 | }
|
|---|
| 533 |
|
|---|
| 534 | push = ndr_push_init_ctx(r);
|
|---|
| 535 | if (push == NULL) {
|
|---|
| 536 | talloc_free(r);
|
|---|
| 537 | return false;
|
|---|
| 538 | }
|
|---|
| 539 |
|
|---|
| 540 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 541 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 542 | talloc_free(r);
|
|---|
| 543 | return false;
|
|---|
| 544 | }
|
|---|
| 545 |
|
|---|
| 546 | blob = ndr_push_blob(push);
|
|---|
| 547 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 548 | talloc_free(r);
|
|---|
| 549 | return false;
|
|---|
| 550 | }
|
|---|
| 551 |
|
|---|
| 552 | talloc_free(r);
|
|---|
| 553 |
|
|---|
| 554 | return true;
|
|---|
| 555 | }
|
|---|
| 556 |
|
|---|
| 557 | static bool api_samr_OpenDomain(pipes_struct *p)
|
|---|
| 558 | {
|
|---|
| 559 | const struct ndr_interface_call *call;
|
|---|
| 560 | struct ndr_pull *pull;
|
|---|
| 561 | struct ndr_push *push;
|
|---|
| 562 | enum ndr_err_code ndr_err;
|
|---|
| 563 | DATA_BLOB blob;
|
|---|
| 564 | struct samr_OpenDomain *r;
|
|---|
| 565 |
|
|---|
| 566 | call = &ndr_table_samr.calls[NDR_SAMR_OPENDOMAIN];
|
|---|
| 567 |
|
|---|
| 568 | r = talloc(talloc_tos(), struct samr_OpenDomain);
|
|---|
| 569 | if (r == NULL) {
|
|---|
| 570 | return false;
|
|---|
| 571 | }
|
|---|
| 572 |
|
|---|
| 573 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 574 | talloc_free(r);
|
|---|
| 575 | return false;
|
|---|
| 576 | }
|
|---|
| 577 |
|
|---|
| 578 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 579 | if (pull == NULL) {
|
|---|
| 580 | talloc_free(r);
|
|---|
| 581 | return false;
|
|---|
| 582 | }
|
|---|
| 583 |
|
|---|
| 584 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 585 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 586 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 587 | talloc_free(r);
|
|---|
| 588 | return false;
|
|---|
| 589 | }
|
|---|
| 590 |
|
|---|
| 591 | if (DEBUGLEVEL >= 10) {
|
|---|
| 592 | NDR_PRINT_IN_DEBUG(samr_OpenDomain, r);
|
|---|
| 593 | }
|
|---|
| 594 |
|
|---|
| 595 | ZERO_STRUCT(r->out);
|
|---|
| 596 | r->out.domain_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 597 | if (r->out.domain_handle == NULL) {
|
|---|
| 598 | talloc_free(r);
|
|---|
| 599 | return false;
|
|---|
| 600 | }
|
|---|
| 601 |
|
|---|
| 602 | r->out.result = _samr_OpenDomain(p, r);
|
|---|
| 603 |
|
|---|
| 604 | if (p->rng_fault_state) {
|
|---|
| 605 | talloc_free(r);
|
|---|
| 606 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 607 | return true;
|
|---|
| 608 | }
|
|---|
| 609 |
|
|---|
| 610 | if (DEBUGLEVEL >= 10) {
|
|---|
| 611 | NDR_PRINT_OUT_DEBUG(samr_OpenDomain, r);
|
|---|
| 612 | }
|
|---|
| 613 |
|
|---|
| 614 | push = ndr_push_init_ctx(r);
|
|---|
| 615 | if (push == NULL) {
|
|---|
| 616 | talloc_free(r);
|
|---|
| 617 | return false;
|
|---|
| 618 | }
|
|---|
| 619 |
|
|---|
| 620 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 621 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 622 | talloc_free(r);
|
|---|
| 623 | return false;
|
|---|
| 624 | }
|
|---|
| 625 |
|
|---|
| 626 | blob = ndr_push_blob(push);
|
|---|
| 627 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 628 | talloc_free(r);
|
|---|
| 629 | return false;
|
|---|
| 630 | }
|
|---|
| 631 |
|
|---|
| 632 | talloc_free(r);
|
|---|
| 633 |
|
|---|
| 634 | return true;
|
|---|
| 635 | }
|
|---|
| 636 |
|
|---|
| 637 | static bool api_samr_QueryDomainInfo(pipes_struct *p)
|
|---|
| 638 | {
|
|---|
| 639 | const struct ndr_interface_call *call;
|
|---|
| 640 | struct ndr_pull *pull;
|
|---|
| 641 | struct ndr_push *push;
|
|---|
| 642 | enum ndr_err_code ndr_err;
|
|---|
| 643 | DATA_BLOB blob;
|
|---|
| 644 | struct samr_QueryDomainInfo *r;
|
|---|
| 645 |
|
|---|
| 646 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO];
|
|---|
| 647 |
|
|---|
| 648 | r = talloc(talloc_tos(), struct samr_QueryDomainInfo);
|
|---|
| 649 | if (r == NULL) {
|
|---|
| 650 | return false;
|
|---|
| 651 | }
|
|---|
| 652 |
|
|---|
| 653 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 654 | talloc_free(r);
|
|---|
| 655 | return false;
|
|---|
| 656 | }
|
|---|
| 657 |
|
|---|
| 658 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 659 | if (pull == NULL) {
|
|---|
| 660 | talloc_free(r);
|
|---|
| 661 | return false;
|
|---|
| 662 | }
|
|---|
| 663 |
|
|---|
| 664 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 665 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 666 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 667 | talloc_free(r);
|
|---|
| 668 | return false;
|
|---|
| 669 | }
|
|---|
| 670 |
|
|---|
| 671 | if (DEBUGLEVEL >= 10) {
|
|---|
| 672 | NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, r);
|
|---|
| 673 | }
|
|---|
| 674 |
|
|---|
| 675 | ZERO_STRUCT(r->out);
|
|---|
| 676 | r->out.info = talloc_zero(r, union samr_DomainInfo *);
|
|---|
| 677 | if (r->out.info == NULL) {
|
|---|
| 678 | talloc_free(r);
|
|---|
| 679 | return false;
|
|---|
| 680 | }
|
|---|
| 681 |
|
|---|
| 682 | r->out.result = _samr_QueryDomainInfo(p, r);
|
|---|
| 683 |
|
|---|
| 684 | if (p->rng_fault_state) {
|
|---|
| 685 | talloc_free(r);
|
|---|
| 686 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 687 | return true;
|
|---|
| 688 | }
|
|---|
| 689 |
|
|---|
| 690 | if (DEBUGLEVEL >= 10) {
|
|---|
| 691 | NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, r);
|
|---|
| 692 | }
|
|---|
| 693 |
|
|---|
| 694 | push = ndr_push_init_ctx(r);
|
|---|
| 695 | if (push == NULL) {
|
|---|
| 696 | talloc_free(r);
|
|---|
| 697 | return false;
|
|---|
| 698 | }
|
|---|
| 699 |
|
|---|
| 700 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 701 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 702 | talloc_free(r);
|
|---|
| 703 | return false;
|
|---|
| 704 | }
|
|---|
| 705 |
|
|---|
| 706 | blob = ndr_push_blob(push);
|
|---|
| 707 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 708 | talloc_free(r);
|
|---|
| 709 | return false;
|
|---|
| 710 | }
|
|---|
| 711 |
|
|---|
| 712 | talloc_free(r);
|
|---|
| 713 |
|
|---|
| 714 | return true;
|
|---|
| 715 | }
|
|---|
| 716 |
|
|---|
| 717 | static bool api_samr_SetDomainInfo(pipes_struct *p)
|
|---|
| 718 | {
|
|---|
| 719 | const struct ndr_interface_call *call;
|
|---|
| 720 | struct ndr_pull *pull;
|
|---|
| 721 | struct ndr_push *push;
|
|---|
| 722 | enum ndr_err_code ndr_err;
|
|---|
| 723 | DATA_BLOB blob;
|
|---|
| 724 | struct samr_SetDomainInfo *r;
|
|---|
| 725 |
|
|---|
| 726 | call = &ndr_table_samr.calls[NDR_SAMR_SETDOMAININFO];
|
|---|
| 727 |
|
|---|
| 728 | r = talloc(talloc_tos(), struct samr_SetDomainInfo);
|
|---|
| 729 | if (r == NULL) {
|
|---|
| 730 | return false;
|
|---|
| 731 | }
|
|---|
| 732 |
|
|---|
| 733 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 734 | talloc_free(r);
|
|---|
| 735 | return false;
|
|---|
| 736 | }
|
|---|
| 737 |
|
|---|
| 738 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 739 | if (pull == NULL) {
|
|---|
| 740 | talloc_free(r);
|
|---|
| 741 | return false;
|
|---|
| 742 | }
|
|---|
| 743 |
|
|---|
| 744 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 745 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 746 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 747 | talloc_free(r);
|
|---|
| 748 | return false;
|
|---|
| 749 | }
|
|---|
| 750 |
|
|---|
| 751 | if (DEBUGLEVEL >= 10) {
|
|---|
| 752 | NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, r);
|
|---|
| 753 | }
|
|---|
| 754 |
|
|---|
| 755 | r->out.result = _samr_SetDomainInfo(p, r);
|
|---|
| 756 |
|
|---|
| 757 | if (p->rng_fault_state) {
|
|---|
| 758 | talloc_free(r);
|
|---|
| 759 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 760 | return true;
|
|---|
| 761 | }
|
|---|
| 762 |
|
|---|
| 763 | if (DEBUGLEVEL >= 10) {
|
|---|
| 764 | NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, r);
|
|---|
| 765 | }
|
|---|
| 766 |
|
|---|
| 767 | push = ndr_push_init_ctx(r);
|
|---|
| 768 | if (push == NULL) {
|
|---|
| 769 | talloc_free(r);
|
|---|
| 770 | return false;
|
|---|
| 771 | }
|
|---|
| 772 |
|
|---|
| 773 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 774 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 775 | talloc_free(r);
|
|---|
| 776 | return false;
|
|---|
| 777 | }
|
|---|
| 778 |
|
|---|
| 779 | blob = ndr_push_blob(push);
|
|---|
| 780 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 781 | talloc_free(r);
|
|---|
| 782 | return false;
|
|---|
| 783 | }
|
|---|
| 784 |
|
|---|
| 785 | talloc_free(r);
|
|---|
| 786 |
|
|---|
| 787 | return true;
|
|---|
| 788 | }
|
|---|
| 789 |
|
|---|
| 790 | static bool api_samr_CreateDomainGroup(pipes_struct *p)
|
|---|
| 791 | {
|
|---|
| 792 | const struct ndr_interface_call *call;
|
|---|
| 793 | struct ndr_pull *pull;
|
|---|
| 794 | struct ndr_push *push;
|
|---|
| 795 | enum ndr_err_code ndr_err;
|
|---|
| 796 | DATA_BLOB blob;
|
|---|
| 797 | struct samr_CreateDomainGroup *r;
|
|---|
| 798 |
|
|---|
| 799 | call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMAINGROUP];
|
|---|
| 800 |
|
|---|
| 801 | r = talloc(talloc_tos(), struct samr_CreateDomainGroup);
|
|---|
| 802 | if (r == NULL) {
|
|---|
| 803 | return false;
|
|---|
| 804 | }
|
|---|
| 805 |
|
|---|
| 806 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 807 | talloc_free(r);
|
|---|
| 808 | return false;
|
|---|
| 809 | }
|
|---|
| 810 |
|
|---|
| 811 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 812 | if (pull == NULL) {
|
|---|
| 813 | talloc_free(r);
|
|---|
| 814 | return false;
|
|---|
| 815 | }
|
|---|
| 816 |
|
|---|
| 817 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 818 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 819 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 820 | talloc_free(r);
|
|---|
| 821 | return false;
|
|---|
| 822 | }
|
|---|
| 823 |
|
|---|
| 824 | if (DEBUGLEVEL >= 10) {
|
|---|
| 825 | NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, r);
|
|---|
| 826 | }
|
|---|
| 827 |
|
|---|
| 828 | ZERO_STRUCT(r->out);
|
|---|
| 829 | r->out.group_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 830 | if (r->out.group_handle == NULL) {
|
|---|
| 831 | talloc_free(r);
|
|---|
| 832 | return false;
|
|---|
| 833 | }
|
|---|
| 834 |
|
|---|
| 835 | r->out.rid = talloc_zero(r, uint32_t);
|
|---|
| 836 | if (r->out.rid == NULL) {
|
|---|
| 837 | talloc_free(r);
|
|---|
| 838 | return false;
|
|---|
| 839 | }
|
|---|
| 840 |
|
|---|
| 841 | r->out.result = _samr_CreateDomainGroup(p, r);
|
|---|
| 842 |
|
|---|
| 843 | if (p->rng_fault_state) {
|
|---|
| 844 | talloc_free(r);
|
|---|
| 845 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 846 | return true;
|
|---|
| 847 | }
|
|---|
| 848 |
|
|---|
| 849 | if (DEBUGLEVEL >= 10) {
|
|---|
| 850 | NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, r);
|
|---|
| 851 | }
|
|---|
| 852 |
|
|---|
| 853 | push = ndr_push_init_ctx(r);
|
|---|
| 854 | if (push == NULL) {
|
|---|
| 855 | talloc_free(r);
|
|---|
| 856 | return false;
|
|---|
| 857 | }
|
|---|
| 858 |
|
|---|
| 859 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 860 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 861 | talloc_free(r);
|
|---|
| 862 | return false;
|
|---|
| 863 | }
|
|---|
| 864 |
|
|---|
| 865 | blob = ndr_push_blob(push);
|
|---|
| 866 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 867 | talloc_free(r);
|
|---|
| 868 | return false;
|
|---|
| 869 | }
|
|---|
| 870 |
|
|---|
| 871 | talloc_free(r);
|
|---|
| 872 |
|
|---|
| 873 | return true;
|
|---|
| 874 | }
|
|---|
| 875 |
|
|---|
| 876 | static bool api_samr_EnumDomainGroups(pipes_struct *p)
|
|---|
| 877 | {
|
|---|
| 878 | const struct ndr_interface_call *call;
|
|---|
| 879 | struct ndr_pull *pull;
|
|---|
| 880 | struct ndr_push *push;
|
|---|
| 881 | enum ndr_err_code ndr_err;
|
|---|
| 882 | DATA_BLOB blob;
|
|---|
| 883 | struct samr_EnumDomainGroups *r;
|
|---|
| 884 |
|
|---|
| 885 | call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINGROUPS];
|
|---|
| 886 |
|
|---|
| 887 | r = talloc(talloc_tos(), struct samr_EnumDomainGroups);
|
|---|
| 888 | if (r == NULL) {
|
|---|
| 889 | return false;
|
|---|
| 890 | }
|
|---|
| 891 |
|
|---|
| 892 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 893 | talloc_free(r);
|
|---|
| 894 | return false;
|
|---|
| 895 | }
|
|---|
| 896 |
|
|---|
| 897 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 898 | if (pull == NULL) {
|
|---|
| 899 | talloc_free(r);
|
|---|
| 900 | return false;
|
|---|
| 901 | }
|
|---|
| 902 |
|
|---|
| 903 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 904 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 905 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 906 | talloc_free(r);
|
|---|
| 907 | return false;
|
|---|
| 908 | }
|
|---|
| 909 |
|
|---|
| 910 | if (DEBUGLEVEL >= 10) {
|
|---|
| 911 | NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, r);
|
|---|
| 912 | }
|
|---|
| 913 |
|
|---|
| 914 | ZERO_STRUCT(r->out);
|
|---|
| 915 | r->out.resume_handle = r->in.resume_handle;
|
|---|
| 916 | r->out.sam = talloc_zero(r, struct samr_SamArray *);
|
|---|
| 917 | if (r->out.sam == NULL) {
|
|---|
| 918 | talloc_free(r);
|
|---|
| 919 | return false;
|
|---|
| 920 | }
|
|---|
| 921 |
|
|---|
| 922 | r->out.num_entries = talloc_zero(r, uint32_t);
|
|---|
| 923 | if (r->out.num_entries == NULL) {
|
|---|
| 924 | talloc_free(r);
|
|---|
| 925 | return false;
|
|---|
| 926 | }
|
|---|
| 927 |
|
|---|
| 928 | r->out.result = _samr_EnumDomainGroups(p, r);
|
|---|
| 929 |
|
|---|
| 930 | if (p->rng_fault_state) {
|
|---|
| 931 | talloc_free(r);
|
|---|
| 932 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 933 | return true;
|
|---|
| 934 | }
|
|---|
| 935 |
|
|---|
| 936 | if (DEBUGLEVEL >= 10) {
|
|---|
| 937 | NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, r);
|
|---|
| 938 | }
|
|---|
| 939 |
|
|---|
| 940 | push = ndr_push_init_ctx(r);
|
|---|
| 941 | if (push == NULL) {
|
|---|
| 942 | talloc_free(r);
|
|---|
| 943 | return false;
|
|---|
| 944 | }
|
|---|
| 945 |
|
|---|
| 946 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 947 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 948 | talloc_free(r);
|
|---|
| 949 | return false;
|
|---|
| 950 | }
|
|---|
| 951 |
|
|---|
| 952 | blob = ndr_push_blob(push);
|
|---|
| 953 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 954 | talloc_free(r);
|
|---|
| 955 | return false;
|
|---|
| 956 | }
|
|---|
| 957 |
|
|---|
| 958 | talloc_free(r);
|
|---|
| 959 |
|
|---|
| 960 | return true;
|
|---|
| 961 | }
|
|---|
| 962 |
|
|---|
| 963 | static bool api_samr_CreateUser(pipes_struct *p)
|
|---|
| 964 | {
|
|---|
| 965 | const struct ndr_interface_call *call;
|
|---|
| 966 | struct ndr_pull *pull;
|
|---|
| 967 | struct ndr_push *push;
|
|---|
| 968 | enum ndr_err_code ndr_err;
|
|---|
| 969 | DATA_BLOB blob;
|
|---|
| 970 | struct samr_CreateUser *r;
|
|---|
| 971 |
|
|---|
| 972 | call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER];
|
|---|
| 973 |
|
|---|
| 974 | r = talloc(talloc_tos(), struct samr_CreateUser);
|
|---|
| 975 | if (r == NULL) {
|
|---|
| 976 | return false;
|
|---|
| 977 | }
|
|---|
| 978 |
|
|---|
| 979 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 980 | talloc_free(r);
|
|---|
| 981 | return false;
|
|---|
| 982 | }
|
|---|
| 983 |
|
|---|
| 984 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 985 | if (pull == NULL) {
|
|---|
| 986 | talloc_free(r);
|
|---|
| 987 | return false;
|
|---|
| 988 | }
|
|---|
| 989 |
|
|---|
| 990 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 991 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 992 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 993 | talloc_free(r);
|
|---|
| 994 | return false;
|
|---|
| 995 | }
|
|---|
| 996 |
|
|---|
| 997 | if (DEBUGLEVEL >= 10) {
|
|---|
| 998 | NDR_PRINT_IN_DEBUG(samr_CreateUser, r);
|
|---|
| 999 | }
|
|---|
| 1000 |
|
|---|
| 1001 | ZERO_STRUCT(r->out);
|
|---|
| 1002 | r->out.user_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 1003 | if (r->out.user_handle == NULL) {
|
|---|
| 1004 | talloc_free(r);
|
|---|
| 1005 | return false;
|
|---|
| 1006 | }
|
|---|
| 1007 |
|
|---|
| 1008 | r->out.rid = talloc_zero(r, uint32_t);
|
|---|
| 1009 | if (r->out.rid == NULL) {
|
|---|
| 1010 | talloc_free(r);
|
|---|
| 1011 | return false;
|
|---|
| 1012 | }
|
|---|
| 1013 |
|
|---|
| 1014 | r->out.result = _samr_CreateUser(p, r);
|
|---|
| 1015 |
|
|---|
| 1016 | if (p->rng_fault_state) {
|
|---|
| 1017 | talloc_free(r);
|
|---|
| 1018 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1019 | return true;
|
|---|
| 1020 | }
|
|---|
| 1021 |
|
|---|
| 1022 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1023 | NDR_PRINT_OUT_DEBUG(samr_CreateUser, r);
|
|---|
| 1024 | }
|
|---|
| 1025 |
|
|---|
| 1026 | push = ndr_push_init_ctx(r);
|
|---|
| 1027 | if (push == NULL) {
|
|---|
| 1028 | talloc_free(r);
|
|---|
| 1029 | return false;
|
|---|
| 1030 | }
|
|---|
| 1031 |
|
|---|
| 1032 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1033 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1034 | talloc_free(r);
|
|---|
| 1035 | return false;
|
|---|
| 1036 | }
|
|---|
| 1037 |
|
|---|
| 1038 | blob = ndr_push_blob(push);
|
|---|
| 1039 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1040 | talloc_free(r);
|
|---|
| 1041 | return false;
|
|---|
| 1042 | }
|
|---|
| 1043 |
|
|---|
| 1044 | talloc_free(r);
|
|---|
| 1045 |
|
|---|
| 1046 | return true;
|
|---|
| 1047 | }
|
|---|
| 1048 |
|
|---|
| 1049 | static bool api_samr_EnumDomainUsers(pipes_struct *p)
|
|---|
| 1050 | {
|
|---|
| 1051 | const struct ndr_interface_call *call;
|
|---|
| 1052 | struct ndr_pull *pull;
|
|---|
| 1053 | struct ndr_push *push;
|
|---|
| 1054 | enum ndr_err_code ndr_err;
|
|---|
| 1055 | DATA_BLOB blob;
|
|---|
| 1056 | struct samr_EnumDomainUsers *r;
|
|---|
| 1057 |
|
|---|
| 1058 | call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINUSERS];
|
|---|
| 1059 |
|
|---|
| 1060 | r = talloc(talloc_tos(), struct samr_EnumDomainUsers);
|
|---|
| 1061 | if (r == NULL) {
|
|---|
| 1062 | return false;
|
|---|
| 1063 | }
|
|---|
| 1064 |
|
|---|
| 1065 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1066 | talloc_free(r);
|
|---|
| 1067 | return false;
|
|---|
| 1068 | }
|
|---|
| 1069 |
|
|---|
| 1070 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1071 | if (pull == NULL) {
|
|---|
| 1072 | talloc_free(r);
|
|---|
| 1073 | return false;
|
|---|
| 1074 | }
|
|---|
| 1075 |
|
|---|
| 1076 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1077 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1078 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1079 | talloc_free(r);
|
|---|
| 1080 | return false;
|
|---|
| 1081 | }
|
|---|
| 1082 |
|
|---|
| 1083 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1084 | NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, r);
|
|---|
| 1085 | }
|
|---|
| 1086 |
|
|---|
| 1087 | ZERO_STRUCT(r->out);
|
|---|
| 1088 | r->out.resume_handle = r->in.resume_handle;
|
|---|
| 1089 | r->out.sam = talloc_zero(r, struct samr_SamArray *);
|
|---|
| 1090 | if (r->out.sam == NULL) {
|
|---|
| 1091 | talloc_free(r);
|
|---|
| 1092 | return false;
|
|---|
| 1093 | }
|
|---|
| 1094 |
|
|---|
| 1095 | r->out.num_entries = talloc_zero(r, uint32_t);
|
|---|
| 1096 | if (r->out.num_entries == NULL) {
|
|---|
| 1097 | talloc_free(r);
|
|---|
| 1098 | return false;
|
|---|
| 1099 | }
|
|---|
| 1100 |
|
|---|
| 1101 | r->out.result = _samr_EnumDomainUsers(p, r);
|
|---|
| 1102 |
|
|---|
| 1103 | if (p->rng_fault_state) {
|
|---|
| 1104 | talloc_free(r);
|
|---|
| 1105 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1106 | return true;
|
|---|
| 1107 | }
|
|---|
| 1108 |
|
|---|
| 1109 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1110 | NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, r);
|
|---|
| 1111 | }
|
|---|
| 1112 |
|
|---|
| 1113 | push = ndr_push_init_ctx(r);
|
|---|
| 1114 | if (push == NULL) {
|
|---|
| 1115 | talloc_free(r);
|
|---|
| 1116 | return false;
|
|---|
| 1117 | }
|
|---|
| 1118 |
|
|---|
| 1119 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1120 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1121 | talloc_free(r);
|
|---|
| 1122 | return false;
|
|---|
| 1123 | }
|
|---|
| 1124 |
|
|---|
| 1125 | blob = ndr_push_blob(push);
|
|---|
| 1126 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1127 | talloc_free(r);
|
|---|
| 1128 | return false;
|
|---|
| 1129 | }
|
|---|
| 1130 |
|
|---|
| 1131 | talloc_free(r);
|
|---|
| 1132 |
|
|---|
| 1133 | return true;
|
|---|
| 1134 | }
|
|---|
| 1135 |
|
|---|
| 1136 | static bool api_samr_CreateDomAlias(pipes_struct *p)
|
|---|
| 1137 | {
|
|---|
| 1138 | const struct ndr_interface_call *call;
|
|---|
| 1139 | struct ndr_pull *pull;
|
|---|
| 1140 | struct ndr_push *push;
|
|---|
| 1141 | enum ndr_err_code ndr_err;
|
|---|
| 1142 | DATA_BLOB blob;
|
|---|
| 1143 | struct samr_CreateDomAlias *r;
|
|---|
| 1144 |
|
|---|
| 1145 | call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMALIAS];
|
|---|
| 1146 |
|
|---|
| 1147 | r = talloc(talloc_tos(), struct samr_CreateDomAlias);
|
|---|
| 1148 | if (r == NULL) {
|
|---|
| 1149 | return false;
|
|---|
| 1150 | }
|
|---|
| 1151 |
|
|---|
| 1152 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1153 | talloc_free(r);
|
|---|
| 1154 | return false;
|
|---|
| 1155 | }
|
|---|
| 1156 |
|
|---|
| 1157 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1158 | if (pull == NULL) {
|
|---|
| 1159 | talloc_free(r);
|
|---|
| 1160 | return false;
|
|---|
| 1161 | }
|
|---|
| 1162 |
|
|---|
| 1163 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1164 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1165 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1166 | talloc_free(r);
|
|---|
| 1167 | return false;
|
|---|
| 1168 | }
|
|---|
| 1169 |
|
|---|
| 1170 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1171 | NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, r);
|
|---|
| 1172 | }
|
|---|
| 1173 |
|
|---|
| 1174 | ZERO_STRUCT(r->out);
|
|---|
| 1175 | r->out.alias_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 1176 | if (r->out.alias_handle == NULL) {
|
|---|
| 1177 | talloc_free(r);
|
|---|
| 1178 | return false;
|
|---|
| 1179 | }
|
|---|
| 1180 |
|
|---|
| 1181 | r->out.rid = talloc_zero(r, uint32_t);
|
|---|
| 1182 | if (r->out.rid == NULL) {
|
|---|
| 1183 | talloc_free(r);
|
|---|
| 1184 | return false;
|
|---|
| 1185 | }
|
|---|
| 1186 |
|
|---|
| 1187 | r->out.result = _samr_CreateDomAlias(p, r);
|
|---|
| 1188 |
|
|---|
| 1189 | if (p->rng_fault_state) {
|
|---|
| 1190 | talloc_free(r);
|
|---|
| 1191 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1192 | return true;
|
|---|
| 1193 | }
|
|---|
| 1194 |
|
|---|
| 1195 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1196 | NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, r);
|
|---|
| 1197 | }
|
|---|
| 1198 |
|
|---|
| 1199 | push = ndr_push_init_ctx(r);
|
|---|
| 1200 | if (push == NULL) {
|
|---|
| 1201 | talloc_free(r);
|
|---|
| 1202 | return false;
|
|---|
| 1203 | }
|
|---|
| 1204 |
|
|---|
| 1205 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1206 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1207 | talloc_free(r);
|
|---|
| 1208 | return false;
|
|---|
| 1209 | }
|
|---|
| 1210 |
|
|---|
| 1211 | blob = ndr_push_blob(push);
|
|---|
| 1212 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1213 | talloc_free(r);
|
|---|
| 1214 | return false;
|
|---|
| 1215 | }
|
|---|
| 1216 |
|
|---|
| 1217 | talloc_free(r);
|
|---|
| 1218 |
|
|---|
| 1219 | return true;
|
|---|
| 1220 | }
|
|---|
| 1221 |
|
|---|
| 1222 | static bool api_samr_EnumDomainAliases(pipes_struct *p)
|
|---|
| 1223 | {
|
|---|
| 1224 | const struct ndr_interface_call *call;
|
|---|
| 1225 | struct ndr_pull *pull;
|
|---|
| 1226 | struct ndr_push *push;
|
|---|
| 1227 | enum ndr_err_code ndr_err;
|
|---|
| 1228 | DATA_BLOB blob;
|
|---|
| 1229 | struct samr_EnumDomainAliases *r;
|
|---|
| 1230 |
|
|---|
| 1231 | call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINALIASES];
|
|---|
| 1232 |
|
|---|
| 1233 | r = talloc(talloc_tos(), struct samr_EnumDomainAliases);
|
|---|
| 1234 | if (r == NULL) {
|
|---|
| 1235 | return false;
|
|---|
| 1236 | }
|
|---|
| 1237 |
|
|---|
| 1238 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1239 | talloc_free(r);
|
|---|
| 1240 | return false;
|
|---|
| 1241 | }
|
|---|
| 1242 |
|
|---|
| 1243 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1244 | if (pull == NULL) {
|
|---|
| 1245 | talloc_free(r);
|
|---|
| 1246 | return false;
|
|---|
| 1247 | }
|
|---|
| 1248 |
|
|---|
| 1249 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1250 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1251 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1252 | talloc_free(r);
|
|---|
| 1253 | return false;
|
|---|
| 1254 | }
|
|---|
| 1255 |
|
|---|
| 1256 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1257 | NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, r);
|
|---|
| 1258 | }
|
|---|
| 1259 |
|
|---|
| 1260 | ZERO_STRUCT(r->out);
|
|---|
| 1261 | r->out.resume_handle = r->in.resume_handle;
|
|---|
| 1262 | r->out.sam = talloc_zero(r, struct samr_SamArray *);
|
|---|
| 1263 | if (r->out.sam == NULL) {
|
|---|
| 1264 | talloc_free(r);
|
|---|
| 1265 | return false;
|
|---|
| 1266 | }
|
|---|
| 1267 |
|
|---|
| 1268 | r->out.num_entries = talloc_zero(r, uint32_t);
|
|---|
| 1269 | if (r->out.num_entries == NULL) {
|
|---|
| 1270 | talloc_free(r);
|
|---|
| 1271 | return false;
|
|---|
| 1272 | }
|
|---|
| 1273 |
|
|---|
| 1274 | r->out.result = _samr_EnumDomainAliases(p, r);
|
|---|
| 1275 |
|
|---|
| 1276 | if (p->rng_fault_state) {
|
|---|
| 1277 | talloc_free(r);
|
|---|
| 1278 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1279 | return true;
|
|---|
| 1280 | }
|
|---|
| 1281 |
|
|---|
| 1282 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1283 | NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, r);
|
|---|
| 1284 | }
|
|---|
| 1285 |
|
|---|
| 1286 | push = ndr_push_init_ctx(r);
|
|---|
| 1287 | if (push == NULL) {
|
|---|
| 1288 | talloc_free(r);
|
|---|
| 1289 | return false;
|
|---|
| 1290 | }
|
|---|
| 1291 |
|
|---|
| 1292 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1293 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1294 | talloc_free(r);
|
|---|
| 1295 | return false;
|
|---|
| 1296 | }
|
|---|
| 1297 |
|
|---|
| 1298 | blob = ndr_push_blob(push);
|
|---|
| 1299 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1300 | talloc_free(r);
|
|---|
| 1301 | return false;
|
|---|
| 1302 | }
|
|---|
| 1303 |
|
|---|
| 1304 | talloc_free(r);
|
|---|
| 1305 |
|
|---|
| 1306 | return true;
|
|---|
| 1307 | }
|
|---|
| 1308 |
|
|---|
| 1309 | static bool api_samr_GetAliasMembership(pipes_struct *p)
|
|---|
| 1310 | {
|
|---|
| 1311 | const struct ndr_interface_call *call;
|
|---|
| 1312 | struct ndr_pull *pull;
|
|---|
| 1313 | struct ndr_push *push;
|
|---|
| 1314 | enum ndr_err_code ndr_err;
|
|---|
| 1315 | DATA_BLOB blob;
|
|---|
| 1316 | struct samr_GetAliasMembership *r;
|
|---|
| 1317 |
|
|---|
| 1318 | call = &ndr_table_samr.calls[NDR_SAMR_GETALIASMEMBERSHIP];
|
|---|
| 1319 |
|
|---|
| 1320 | r = talloc(talloc_tos(), struct samr_GetAliasMembership);
|
|---|
| 1321 | if (r == NULL) {
|
|---|
| 1322 | return false;
|
|---|
| 1323 | }
|
|---|
| 1324 |
|
|---|
| 1325 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1326 | talloc_free(r);
|
|---|
| 1327 | return false;
|
|---|
| 1328 | }
|
|---|
| 1329 |
|
|---|
| 1330 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1331 | if (pull == NULL) {
|
|---|
| 1332 | talloc_free(r);
|
|---|
| 1333 | return false;
|
|---|
| 1334 | }
|
|---|
| 1335 |
|
|---|
| 1336 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1337 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1338 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1339 | talloc_free(r);
|
|---|
| 1340 | return false;
|
|---|
| 1341 | }
|
|---|
| 1342 |
|
|---|
| 1343 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1344 | NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, r);
|
|---|
| 1345 | }
|
|---|
| 1346 |
|
|---|
| 1347 | ZERO_STRUCT(r->out);
|
|---|
| 1348 | r->out.rids = talloc_zero(r, struct samr_Ids);
|
|---|
| 1349 | if (r->out.rids == NULL) {
|
|---|
| 1350 | talloc_free(r);
|
|---|
| 1351 | return false;
|
|---|
| 1352 | }
|
|---|
| 1353 |
|
|---|
| 1354 | r->out.result = _samr_GetAliasMembership(p, r);
|
|---|
| 1355 |
|
|---|
| 1356 | if (p->rng_fault_state) {
|
|---|
| 1357 | talloc_free(r);
|
|---|
| 1358 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1359 | return true;
|
|---|
| 1360 | }
|
|---|
| 1361 |
|
|---|
| 1362 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1363 | NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, r);
|
|---|
| 1364 | }
|
|---|
| 1365 |
|
|---|
| 1366 | push = ndr_push_init_ctx(r);
|
|---|
| 1367 | if (push == NULL) {
|
|---|
| 1368 | talloc_free(r);
|
|---|
| 1369 | return false;
|
|---|
| 1370 | }
|
|---|
| 1371 |
|
|---|
| 1372 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1373 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1374 | talloc_free(r);
|
|---|
| 1375 | return false;
|
|---|
| 1376 | }
|
|---|
| 1377 |
|
|---|
| 1378 | blob = ndr_push_blob(push);
|
|---|
| 1379 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1380 | talloc_free(r);
|
|---|
| 1381 | return false;
|
|---|
| 1382 | }
|
|---|
| 1383 |
|
|---|
| 1384 | talloc_free(r);
|
|---|
| 1385 |
|
|---|
| 1386 | return true;
|
|---|
| 1387 | }
|
|---|
| 1388 |
|
|---|
| 1389 | static bool api_samr_LookupNames(pipes_struct *p)
|
|---|
| 1390 | {
|
|---|
| 1391 | const struct ndr_interface_call *call;
|
|---|
| 1392 | struct ndr_pull *pull;
|
|---|
| 1393 | struct ndr_push *push;
|
|---|
| 1394 | enum ndr_err_code ndr_err;
|
|---|
| 1395 | DATA_BLOB blob;
|
|---|
| 1396 | struct samr_LookupNames *r;
|
|---|
| 1397 |
|
|---|
| 1398 | call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPNAMES];
|
|---|
| 1399 |
|
|---|
| 1400 | r = talloc(talloc_tos(), struct samr_LookupNames);
|
|---|
| 1401 | if (r == NULL) {
|
|---|
| 1402 | return false;
|
|---|
| 1403 | }
|
|---|
| 1404 |
|
|---|
| 1405 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1406 | talloc_free(r);
|
|---|
| 1407 | return false;
|
|---|
| 1408 | }
|
|---|
| 1409 |
|
|---|
| 1410 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1411 | if (pull == NULL) {
|
|---|
| 1412 | talloc_free(r);
|
|---|
| 1413 | return false;
|
|---|
| 1414 | }
|
|---|
| 1415 |
|
|---|
| 1416 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1417 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1418 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1419 | talloc_free(r);
|
|---|
| 1420 | return false;
|
|---|
| 1421 | }
|
|---|
| 1422 |
|
|---|
| 1423 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1424 | NDR_PRINT_IN_DEBUG(samr_LookupNames, r);
|
|---|
| 1425 | }
|
|---|
| 1426 |
|
|---|
| 1427 | ZERO_STRUCT(r->out);
|
|---|
| 1428 | r->out.rids = talloc_zero(r, struct samr_Ids);
|
|---|
| 1429 | if (r->out.rids == NULL) {
|
|---|
| 1430 | talloc_free(r);
|
|---|
| 1431 | return false;
|
|---|
| 1432 | }
|
|---|
| 1433 |
|
|---|
| 1434 | r->out.types = talloc_zero(r, struct samr_Ids);
|
|---|
| 1435 | if (r->out.types == NULL) {
|
|---|
| 1436 | talloc_free(r);
|
|---|
| 1437 | return false;
|
|---|
| 1438 | }
|
|---|
| 1439 |
|
|---|
| 1440 | r->out.result = _samr_LookupNames(p, r);
|
|---|
| 1441 |
|
|---|
| 1442 | if (p->rng_fault_state) {
|
|---|
| 1443 | talloc_free(r);
|
|---|
| 1444 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1445 | return true;
|
|---|
| 1446 | }
|
|---|
| 1447 |
|
|---|
| 1448 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1449 | NDR_PRINT_OUT_DEBUG(samr_LookupNames, r);
|
|---|
| 1450 | }
|
|---|
| 1451 |
|
|---|
| 1452 | push = ndr_push_init_ctx(r);
|
|---|
| 1453 | if (push == NULL) {
|
|---|
| 1454 | talloc_free(r);
|
|---|
| 1455 | return false;
|
|---|
| 1456 | }
|
|---|
| 1457 |
|
|---|
| 1458 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1459 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1460 | talloc_free(r);
|
|---|
| 1461 | return false;
|
|---|
| 1462 | }
|
|---|
| 1463 |
|
|---|
| 1464 | blob = ndr_push_blob(push);
|
|---|
| 1465 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1466 | talloc_free(r);
|
|---|
| 1467 | return false;
|
|---|
| 1468 | }
|
|---|
| 1469 |
|
|---|
| 1470 | talloc_free(r);
|
|---|
| 1471 |
|
|---|
| 1472 | return true;
|
|---|
| 1473 | }
|
|---|
| 1474 |
|
|---|
| 1475 | static bool api_samr_LookupRids(pipes_struct *p)
|
|---|
| 1476 | {
|
|---|
| 1477 | const struct ndr_interface_call *call;
|
|---|
| 1478 | struct ndr_pull *pull;
|
|---|
| 1479 | struct ndr_push *push;
|
|---|
| 1480 | enum ndr_err_code ndr_err;
|
|---|
| 1481 | DATA_BLOB blob;
|
|---|
| 1482 | struct samr_LookupRids *r;
|
|---|
| 1483 |
|
|---|
| 1484 | call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPRIDS];
|
|---|
| 1485 |
|
|---|
| 1486 | r = talloc(talloc_tos(), struct samr_LookupRids);
|
|---|
| 1487 | if (r == NULL) {
|
|---|
| 1488 | return false;
|
|---|
| 1489 | }
|
|---|
| 1490 |
|
|---|
| 1491 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1492 | talloc_free(r);
|
|---|
| 1493 | return false;
|
|---|
| 1494 | }
|
|---|
| 1495 |
|
|---|
| 1496 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1497 | if (pull == NULL) {
|
|---|
| 1498 | talloc_free(r);
|
|---|
| 1499 | return false;
|
|---|
| 1500 | }
|
|---|
| 1501 |
|
|---|
| 1502 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1503 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1504 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1505 | talloc_free(r);
|
|---|
| 1506 | return false;
|
|---|
| 1507 | }
|
|---|
| 1508 |
|
|---|
| 1509 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1510 | NDR_PRINT_IN_DEBUG(samr_LookupRids, r);
|
|---|
| 1511 | }
|
|---|
| 1512 |
|
|---|
| 1513 | ZERO_STRUCT(r->out);
|
|---|
| 1514 | r->out.names = talloc_zero(r, struct lsa_Strings);
|
|---|
| 1515 | if (r->out.names == NULL) {
|
|---|
| 1516 | talloc_free(r);
|
|---|
| 1517 | return false;
|
|---|
| 1518 | }
|
|---|
| 1519 |
|
|---|
| 1520 | r->out.types = talloc_zero(r, struct samr_Ids);
|
|---|
| 1521 | if (r->out.types == NULL) {
|
|---|
| 1522 | talloc_free(r);
|
|---|
| 1523 | return false;
|
|---|
| 1524 | }
|
|---|
| 1525 |
|
|---|
| 1526 | r->out.result = _samr_LookupRids(p, r);
|
|---|
| 1527 |
|
|---|
| 1528 | if (p->rng_fault_state) {
|
|---|
| 1529 | talloc_free(r);
|
|---|
| 1530 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1531 | return true;
|
|---|
| 1532 | }
|
|---|
| 1533 |
|
|---|
| 1534 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1535 | NDR_PRINT_OUT_DEBUG(samr_LookupRids, r);
|
|---|
| 1536 | }
|
|---|
| 1537 |
|
|---|
| 1538 | push = ndr_push_init_ctx(r);
|
|---|
| 1539 | if (push == NULL) {
|
|---|
| 1540 | talloc_free(r);
|
|---|
| 1541 | return false;
|
|---|
| 1542 | }
|
|---|
| 1543 |
|
|---|
| 1544 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1545 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1546 | talloc_free(r);
|
|---|
| 1547 | return false;
|
|---|
| 1548 | }
|
|---|
| 1549 |
|
|---|
| 1550 | blob = ndr_push_blob(push);
|
|---|
| 1551 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1552 | talloc_free(r);
|
|---|
| 1553 | return false;
|
|---|
| 1554 | }
|
|---|
| 1555 |
|
|---|
| 1556 | talloc_free(r);
|
|---|
| 1557 |
|
|---|
| 1558 | return true;
|
|---|
| 1559 | }
|
|---|
| 1560 |
|
|---|
| 1561 | static bool api_samr_OpenGroup(pipes_struct *p)
|
|---|
| 1562 | {
|
|---|
| 1563 | const struct ndr_interface_call *call;
|
|---|
| 1564 | struct ndr_pull *pull;
|
|---|
| 1565 | struct ndr_push *push;
|
|---|
| 1566 | enum ndr_err_code ndr_err;
|
|---|
| 1567 | DATA_BLOB blob;
|
|---|
| 1568 | struct samr_OpenGroup *r;
|
|---|
| 1569 |
|
|---|
| 1570 | call = &ndr_table_samr.calls[NDR_SAMR_OPENGROUP];
|
|---|
| 1571 |
|
|---|
| 1572 | r = talloc(talloc_tos(), struct samr_OpenGroup);
|
|---|
| 1573 | if (r == NULL) {
|
|---|
| 1574 | return false;
|
|---|
| 1575 | }
|
|---|
| 1576 |
|
|---|
| 1577 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1578 | talloc_free(r);
|
|---|
| 1579 | return false;
|
|---|
| 1580 | }
|
|---|
| 1581 |
|
|---|
| 1582 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1583 | if (pull == NULL) {
|
|---|
| 1584 | talloc_free(r);
|
|---|
| 1585 | return false;
|
|---|
| 1586 | }
|
|---|
| 1587 |
|
|---|
| 1588 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1589 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1590 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1591 | talloc_free(r);
|
|---|
| 1592 | return false;
|
|---|
| 1593 | }
|
|---|
| 1594 |
|
|---|
| 1595 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1596 | NDR_PRINT_IN_DEBUG(samr_OpenGroup, r);
|
|---|
| 1597 | }
|
|---|
| 1598 |
|
|---|
| 1599 | ZERO_STRUCT(r->out);
|
|---|
| 1600 | r->out.group_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 1601 | if (r->out.group_handle == NULL) {
|
|---|
| 1602 | talloc_free(r);
|
|---|
| 1603 | return false;
|
|---|
| 1604 | }
|
|---|
| 1605 |
|
|---|
| 1606 | r->out.result = _samr_OpenGroup(p, r);
|
|---|
| 1607 |
|
|---|
| 1608 | if (p->rng_fault_state) {
|
|---|
| 1609 | talloc_free(r);
|
|---|
| 1610 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1611 | return true;
|
|---|
| 1612 | }
|
|---|
| 1613 |
|
|---|
| 1614 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1615 | NDR_PRINT_OUT_DEBUG(samr_OpenGroup, r);
|
|---|
| 1616 | }
|
|---|
| 1617 |
|
|---|
| 1618 | push = ndr_push_init_ctx(r);
|
|---|
| 1619 | if (push == NULL) {
|
|---|
| 1620 | talloc_free(r);
|
|---|
| 1621 | return false;
|
|---|
| 1622 | }
|
|---|
| 1623 |
|
|---|
| 1624 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1625 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1626 | talloc_free(r);
|
|---|
| 1627 | return false;
|
|---|
| 1628 | }
|
|---|
| 1629 |
|
|---|
| 1630 | blob = ndr_push_blob(push);
|
|---|
| 1631 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1632 | talloc_free(r);
|
|---|
| 1633 | return false;
|
|---|
| 1634 | }
|
|---|
| 1635 |
|
|---|
| 1636 | talloc_free(r);
|
|---|
| 1637 |
|
|---|
| 1638 | return true;
|
|---|
| 1639 | }
|
|---|
| 1640 |
|
|---|
| 1641 | static bool api_samr_QueryGroupInfo(pipes_struct *p)
|
|---|
| 1642 | {
|
|---|
| 1643 | const struct ndr_interface_call *call;
|
|---|
| 1644 | struct ndr_pull *pull;
|
|---|
| 1645 | struct ndr_push *push;
|
|---|
| 1646 | enum ndr_err_code ndr_err;
|
|---|
| 1647 | DATA_BLOB blob;
|
|---|
| 1648 | struct samr_QueryGroupInfo *r;
|
|---|
| 1649 |
|
|---|
| 1650 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPINFO];
|
|---|
| 1651 |
|
|---|
| 1652 | r = talloc(talloc_tos(), struct samr_QueryGroupInfo);
|
|---|
| 1653 | if (r == NULL) {
|
|---|
| 1654 | return false;
|
|---|
| 1655 | }
|
|---|
| 1656 |
|
|---|
| 1657 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1658 | talloc_free(r);
|
|---|
| 1659 | return false;
|
|---|
| 1660 | }
|
|---|
| 1661 |
|
|---|
| 1662 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1663 | if (pull == NULL) {
|
|---|
| 1664 | talloc_free(r);
|
|---|
| 1665 | return false;
|
|---|
| 1666 | }
|
|---|
| 1667 |
|
|---|
| 1668 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1669 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1670 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1671 | talloc_free(r);
|
|---|
| 1672 | return false;
|
|---|
| 1673 | }
|
|---|
| 1674 |
|
|---|
| 1675 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1676 | NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, r);
|
|---|
| 1677 | }
|
|---|
| 1678 |
|
|---|
| 1679 | ZERO_STRUCT(r->out);
|
|---|
| 1680 | r->out.info = talloc_zero(r, union samr_GroupInfo *);
|
|---|
| 1681 | if (r->out.info == NULL) {
|
|---|
| 1682 | talloc_free(r);
|
|---|
| 1683 | return false;
|
|---|
| 1684 | }
|
|---|
| 1685 |
|
|---|
| 1686 | r->out.result = _samr_QueryGroupInfo(p, r);
|
|---|
| 1687 |
|
|---|
| 1688 | if (p->rng_fault_state) {
|
|---|
| 1689 | talloc_free(r);
|
|---|
| 1690 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1691 | return true;
|
|---|
| 1692 | }
|
|---|
| 1693 |
|
|---|
| 1694 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1695 | NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, r);
|
|---|
| 1696 | }
|
|---|
| 1697 |
|
|---|
| 1698 | push = ndr_push_init_ctx(r);
|
|---|
| 1699 | if (push == NULL) {
|
|---|
| 1700 | talloc_free(r);
|
|---|
| 1701 | return false;
|
|---|
| 1702 | }
|
|---|
| 1703 |
|
|---|
| 1704 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1705 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1706 | talloc_free(r);
|
|---|
| 1707 | return false;
|
|---|
| 1708 | }
|
|---|
| 1709 |
|
|---|
| 1710 | blob = ndr_push_blob(push);
|
|---|
| 1711 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1712 | talloc_free(r);
|
|---|
| 1713 | return false;
|
|---|
| 1714 | }
|
|---|
| 1715 |
|
|---|
| 1716 | talloc_free(r);
|
|---|
| 1717 |
|
|---|
| 1718 | return true;
|
|---|
| 1719 | }
|
|---|
| 1720 |
|
|---|
| 1721 | static bool api_samr_SetGroupInfo(pipes_struct *p)
|
|---|
| 1722 | {
|
|---|
| 1723 | const struct ndr_interface_call *call;
|
|---|
| 1724 | struct ndr_pull *pull;
|
|---|
| 1725 | struct ndr_push *push;
|
|---|
| 1726 | enum ndr_err_code ndr_err;
|
|---|
| 1727 | DATA_BLOB blob;
|
|---|
| 1728 | struct samr_SetGroupInfo *r;
|
|---|
| 1729 |
|
|---|
| 1730 | call = &ndr_table_samr.calls[NDR_SAMR_SETGROUPINFO];
|
|---|
| 1731 |
|
|---|
| 1732 | r = talloc(talloc_tos(), struct samr_SetGroupInfo);
|
|---|
| 1733 | if (r == NULL) {
|
|---|
| 1734 | return false;
|
|---|
| 1735 | }
|
|---|
| 1736 |
|
|---|
| 1737 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1738 | talloc_free(r);
|
|---|
| 1739 | return false;
|
|---|
| 1740 | }
|
|---|
| 1741 |
|
|---|
| 1742 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1743 | if (pull == NULL) {
|
|---|
| 1744 | talloc_free(r);
|
|---|
| 1745 | return false;
|
|---|
| 1746 | }
|
|---|
| 1747 |
|
|---|
| 1748 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1749 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1750 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1751 | talloc_free(r);
|
|---|
| 1752 | return false;
|
|---|
| 1753 | }
|
|---|
| 1754 |
|
|---|
| 1755 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1756 | NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, r);
|
|---|
| 1757 | }
|
|---|
| 1758 |
|
|---|
| 1759 | r->out.result = _samr_SetGroupInfo(p, r);
|
|---|
| 1760 |
|
|---|
| 1761 | if (p->rng_fault_state) {
|
|---|
| 1762 | talloc_free(r);
|
|---|
| 1763 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1764 | return true;
|
|---|
| 1765 | }
|
|---|
| 1766 |
|
|---|
| 1767 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1768 | NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, r);
|
|---|
| 1769 | }
|
|---|
| 1770 |
|
|---|
| 1771 | push = ndr_push_init_ctx(r);
|
|---|
| 1772 | if (push == NULL) {
|
|---|
| 1773 | talloc_free(r);
|
|---|
| 1774 | return false;
|
|---|
| 1775 | }
|
|---|
| 1776 |
|
|---|
| 1777 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1778 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1779 | talloc_free(r);
|
|---|
| 1780 | return false;
|
|---|
| 1781 | }
|
|---|
| 1782 |
|
|---|
| 1783 | blob = ndr_push_blob(push);
|
|---|
| 1784 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1785 | talloc_free(r);
|
|---|
| 1786 | return false;
|
|---|
| 1787 | }
|
|---|
| 1788 |
|
|---|
| 1789 | talloc_free(r);
|
|---|
| 1790 |
|
|---|
| 1791 | return true;
|
|---|
| 1792 | }
|
|---|
| 1793 |
|
|---|
| 1794 | static bool api_samr_AddGroupMember(pipes_struct *p)
|
|---|
| 1795 | {
|
|---|
| 1796 | const struct ndr_interface_call *call;
|
|---|
| 1797 | struct ndr_pull *pull;
|
|---|
| 1798 | struct ndr_push *push;
|
|---|
| 1799 | enum ndr_err_code ndr_err;
|
|---|
| 1800 | DATA_BLOB blob;
|
|---|
| 1801 | struct samr_AddGroupMember *r;
|
|---|
| 1802 |
|
|---|
| 1803 | call = &ndr_table_samr.calls[NDR_SAMR_ADDGROUPMEMBER];
|
|---|
| 1804 |
|
|---|
| 1805 | r = talloc(talloc_tos(), struct samr_AddGroupMember);
|
|---|
| 1806 | if (r == NULL) {
|
|---|
| 1807 | return false;
|
|---|
| 1808 | }
|
|---|
| 1809 |
|
|---|
| 1810 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1811 | talloc_free(r);
|
|---|
| 1812 | return false;
|
|---|
| 1813 | }
|
|---|
| 1814 |
|
|---|
| 1815 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1816 | if (pull == NULL) {
|
|---|
| 1817 | talloc_free(r);
|
|---|
| 1818 | return false;
|
|---|
| 1819 | }
|
|---|
| 1820 |
|
|---|
| 1821 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1822 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1823 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1824 | talloc_free(r);
|
|---|
| 1825 | return false;
|
|---|
| 1826 | }
|
|---|
| 1827 |
|
|---|
| 1828 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1829 | NDR_PRINT_IN_DEBUG(samr_AddGroupMember, r);
|
|---|
| 1830 | }
|
|---|
| 1831 |
|
|---|
| 1832 | r->out.result = _samr_AddGroupMember(p, r);
|
|---|
| 1833 |
|
|---|
| 1834 | if (p->rng_fault_state) {
|
|---|
| 1835 | talloc_free(r);
|
|---|
| 1836 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1837 | return true;
|
|---|
| 1838 | }
|
|---|
| 1839 |
|
|---|
| 1840 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1841 | NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, r);
|
|---|
| 1842 | }
|
|---|
| 1843 |
|
|---|
| 1844 | push = ndr_push_init_ctx(r);
|
|---|
| 1845 | if (push == NULL) {
|
|---|
| 1846 | talloc_free(r);
|
|---|
| 1847 | return false;
|
|---|
| 1848 | }
|
|---|
| 1849 |
|
|---|
| 1850 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1851 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1852 | talloc_free(r);
|
|---|
| 1853 | return false;
|
|---|
| 1854 | }
|
|---|
| 1855 |
|
|---|
| 1856 | blob = ndr_push_blob(push);
|
|---|
| 1857 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1858 | talloc_free(r);
|
|---|
| 1859 | return false;
|
|---|
| 1860 | }
|
|---|
| 1861 |
|
|---|
| 1862 | talloc_free(r);
|
|---|
| 1863 |
|
|---|
| 1864 | return true;
|
|---|
| 1865 | }
|
|---|
| 1866 |
|
|---|
| 1867 | static bool api_samr_DeleteDomainGroup(pipes_struct *p)
|
|---|
| 1868 | {
|
|---|
| 1869 | const struct ndr_interface_call *call;
|
|---|
| 1870 | struct ndr_pull *pull;
|
|---|
| 1871 | struct ndr_push *push;
|
|---|
| 1872 | enum ndr_err_code ndr_err;
|
|---|
| 1873 | DATA_BLOB blob;
|
|---|
| 1874 | struct samr_DeleteDomainGroup *r;
|
|---|
| 1875 |
|
|---|
| 1876 | call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMAINGROUP];
|
|---|
| 1877 |
|
|---|
| 1878 | r = talloc(talloc_tos(), struct samr_DeleteDomainGroup);
|
|---|
| 1879 | if (r == NULL) {
|
|---|
| 1880 | return false;
|
|---|
| 1881 | }
|
|---|
| 1882 |
|
|---|
| 1883 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1884 | talloc_free(r);
|
|---|
| 1885 | return false;
|
|---|
| 1886 | }
|
|---|
| 1887 |
|
|---|
| 1888 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1889 | if (pull == NULL) {
|
|---|
| 1890 | talloc_free(r);
|
|---|
| 1891 | return false;
|
|---|
| 1892 | }
|
|---|
| 1893 |
|
|---|
| 1894 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1895 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1896 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1897 | talloc_free(r);
|
|---|
| 1898 | return false;
|
|---|
| 1899 | }
|
|---|
| 1900 |
|
|---|
| 1901 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1902 | NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, r);
|
|---|
| 1903 | }
|
|---|
| 1904 |
|
|---|
| 1905 | ZERO_STRUCT(r->out);
|
|---|
| 1906 | r->out.group_handle = r->in.group_handle;
|
|---|
| 1907 | r->out.result = _samr_DeleteDomainGroup(p, r);
|
|---|
| 1908 |
|
|---|
| 1909 | if (p->rng_fault_state) {
|
|---|
| 1910 | talloc_free(r);
|
|---|
| 1911 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1912 | return true;
|
|---|
| 1913 | }
|
|---|
| 1914 |
|
|---|
| 1915 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1916 | NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, r);
|
|---|
| 1917 | }
|
|---|
| 1918 |
|
|---|
| 1919 | push = ndr_push_init_ctx(r);
|
|---|
| 1920 | if (push == NULL) {
|
|---|
| 1921 | talloc_free(r);
|
|---|
| 1922 | return false;
|
|---|
| 1923 | }
|
|---|
| 1924 |
|
|---|
| 1925 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1926 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1927 | talloc_free(r);
|
|---|
| 1928 | return false;
|
|---|
| 1929 | }
|
|---|
| 1930 |
|
|---|
| 1931 | blob = ndr_push_blob(push);
|
|---|
| 1932 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 1933 | talloc_free(r);
|
|---|
| 1934 | return false;
|
|---|
| 1935 | }
|
|---|
| 1936 |
|
|---|
| 1937 | talloc_free(r);
|
|---|
| 1938 |
|
|---|
| 1939 | return true;
|
|---|
| 1940 | }
|
|---|
| 1941 |
|
|---|
| 1942 | static bool api_samr_DeleteGroupMember(pipes_struct *p)
|
|---|
| 1943 | {
|
|---|
| 1944 | const struct ndr_interface_call *call;
|
|---|
| 1945 | struct ndr_pull *pull;
|
|---|
| 1946 | struct ndr_push *push;
|
|---|
| 1947 | enum ndr_err_code ndr_err;
|
|---|
| 1948 | DATA_BLOB blob;
|
|---|
| 1949 | struct samr_DeleteGroupMember *r;
|
|---|
| 1950 |
|
|---|
| 1951 | call = &ndr_table_samr.calls[NDR_SAMR_DELETEGROUPMEMBER];
|
|---|
| 1952 |
|
|---|
| 1953 | r = talloc(talloc_tos(), struct samr_DeleteGroupMember);
|
|---|
| 1954 | if (r == NULL) {
|
|---|
| 1955 | return false;
|
|---|
| 1956 | }
|
|---|
| 1957 |
|
|---|
| 1958 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 1959 | talloc_free(r);
|
|---|
| 1960 | return false;
|
|---|
| 1961 | }
|
|---|
| 1962 |
|
|---|
| 1963 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 1964 | if (pull == NULL) {
|
|---|
| 1965 | talloc_free(r);
|
|---|
| 1966 | return false;
|
|---|
| 1967 | }
|
|---|
| 1968 |
|
|---|
| 1969 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 1970 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 1971 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 1972 | talloc_free(r);
|
|---|
| 1973 | return false;
|
|---|
| 1974 | }
|
|---|
| 1975 |
|
|---|
| 1976 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1977 | NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, r);
|
|---|
| 1978 | }
|
|---|
| 1979 |
|
|---|
| 1980 | r->out.result = _samr_DeleteGroupMember(p, r);
|
|---|
| 1981 |
|
|---|
| 1982 | if (p->rng_fault_state) {
|
|---|
| 1983 | talloc_free(r);
|
|---|
| 1984 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 1985 | return true;
|
|---|
| 1986 | }
|
|---|
| 1987 |
|
|---|
| 1988 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1989 | NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, r);
|
|---|
| 1990 | }
|
|---|
| 1991 |
|
|---|
| 1992 | push = ndr_push_init_ctx(r);
|
|---|
| 1993 | if (push == NULL) {
|
|---|
| 1994 | talloc_free(r);
|
|---|
| 1995 | return false;
|
|---|
| 1996 | }
|
|---|
| 1997 |
|
|---|
| 1998 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 1999 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2000 | talloc_free(r);
|
|---|
| 2001 | return false;
|
|---|
| 2002 | }
|
|---|
| 2003 |
|
|---|
| 2004 | blob = ndr_push_blob(push);
|
|---|
| 2005 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2006 | talloc_free(r);
|
|---|
| 2007 | return false;
|
|---|
| 2008 | }
|
|---|
| 2009 |
|
|---|
| 2010 | talloc_free(r);
|
|---|
| 2011 |
|
|---|
| 2012 | return true;
|
|---|
| 2013 | }
|
|---|
| 2014 |
|
|---|
| 2015 | static bool api_samr_QueryGroupMember(pipes_struct *p)
|
|---|
| 2016 | {
|
|---|
| 2017 | const struct ndr_interface_call *call;
|
|---|
| 2018 | struct ndr_pull *pull;
|
|---|
| 2019 | struct ndr_push *push;
|
|---|
| 2020 | enum ndr_err_code ndr_err;
|
|---|
| 2021 | DATA_BLOB blob;
|
|---|
| 2022 | struct samr_QueryGroupMember *r;
|
|---|
| 2023 |
|
|---|
| 2024 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPMEMBER];
|
|---|
| 2025 |
|
|---|
| 2026 | r = talloc(talloc_tos(), struct samr_QueryGroupMember);
|
|---|
| 2027 | if (r == NULL) {
|
|---|
| 2028 | return false;
|
|---|
| 2029 | }
|
|---|
| 2030 |
|
|---|
| 2031 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2032 | talloc_free(r);
|
|---|
| 2033 | return false;
|
|---|
| 2034 | }
|
|---|
| 2035 |
|
|---|
| 2036 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2037 | if (pull == NULL) {
|
|---|
| 2038 | talloc_free(r);
|
|---|
| 2039 | return false;
|
|---|
| 2040 | }
|
|---|
| 2041 |
|
|---|
| 2042 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2043 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2044 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2045 | talloc_free(r);
|
|---|
| 2046 | return false;
|
|---|
| 2047 | }
|
|---|
| 2048 |
|
|---|
| 2049 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2050 | NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, r);
|
|---|
| 2051 | }
|
|---|
| 2052 |
|
|---|
| 2053 | ZERO_STRUCT(r->out);
|
|---|
| 2054 | r->out.rids = talloc_zero(r, struct samr_RidTypeArray *);
|
|---|
| 2055 | if (r->out.rids == NULL) {
|
|---|
| 2056 | talloc_free(r);
|
|---|
| 2057 | return false;
|
|---|
| 2058 | }
|
|---|
| 2059 |
|
|---|
| 2060 | r->out.result = _samr_QueryGroupMember(p, r);
|
|---|
| 2061 |
|
|---|
| 2062 | if (p->rng_fault_state) {
|
|---|
| 2063 | talloc_free(r);
|
|---|
| 2064 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2065 | return true;
|
|---|
| 2066 | }
|
|---|
| 2067 |
|
|---|
| 2068 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2069 | NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, r);
|
|---|
| 2070 | }
|
|---|
| 2071 |
|
|---|
| 2072 | push = ndr_push_init_ctx(r);
|
|---|
| 2073 | if (push == NULL) {
|
|---|
| 2074 | talloc_free(r);
|
|---|
| 2075 | return false;
|
|---|
| 2076 | }
|
|---|
| 2077 |
|
|---|
| 2078 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2079 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2080 | talloc_free(r);
|
|---|
| 2081 | return false;
|
|---|
| 2082 | }
|
|---|
| 2083 |
|
|---|
| 2084 | blob = ndr_push_blob(push);
|
|---|
| 2085 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2086 | talloc_free(r);
|
|---|
| 2087 | return false;
|
|---|
| 2088 | }
|
|---|
| 2089 |
|
|---|
| 2090 | talloc_free(r);
|
|---|
| 2091 |
|
|---|
| 2092 | return true;
|
|---|
| 2093 | }
|
|---|
| 2094 |
|
|---|
| 2095 | static bool api_samr_SetMemberAttributesOfGroup(pipes_struct *p)
|
|---|
| 2096 | {
|
|---|
| 2097 | const struct ndr_interface_call *call;
|
|---|
| 2098 | struct ndr_pull *pull;
|
|---|
| 2099 | struct ndr_push *push;
|
|---|
| 2100 | enum ndr_err_code ndr_err;
|
|---|
| 2101 | DATA_BLOB blob;
|
|---|
| 2102 | struct samr_SetMemberAttributesOfGroup *r;
|
|---|
| 2103 |
|
|---|
| 2104 | call = &ndr_table_samr.calls[NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP];
|
|---|
| 2105 |
|
|---|
| 2106 | r = talloc(talloc_tos(), struct samr_SetMemberAttributesOfGroup);
|
|---|
| 2107 | if (r == NULL) {
|
|---|
| 2108 | return false;
|
|---|
| 2109 | }
|
|---|
| 2110 |
|
|---|
| 2111 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2112 | talloc_free(r);
|
|---|
| 2113 | return false;
|
|---|
| 2114 | }
|
|---|
| 2115 |
|
|---|
| 2116 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2117 | if (pull == NULL) {
|
|---|
| 2118 | talloc_free(r);
|
|---|
| 2119 | return false;
|
|---|
| 2120 | }
|
|---|
| 2121 |
|
|---|
| 2122 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2123 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2124 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2125 | talloc_free(r);
|
|---|
| 2126 | return false;
|
|---|
| 2127 | }
|
|---|
| 2128 |
|
|---|
| 2129 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2130 | NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, r);
|
|---|
| 2131 | }
|
|---|
| 2132 |
|
|---|
| 2133 | r->out.result = _samr_SetMemberAttributesOfGroup(p, r);
|
|---|
| 2134 |
|
|---|
| 2135 | if (p->rng_fault_state) {
|
|---|
| 2136 | talloc_free(r);
|
|---|
| 2137 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2138 | return true;
|
|---|
| 2139 | }
|
|---|
| 2140 |
|
|---|
| 2141 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2142 | NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, r);
|
|---|
| 2143 | }
|
|---|
| 2144 |
|
|---|
| 2145 | push = ndr_push_init_ctx(r);
|
|---|
| 2146 | if (push == NULL) {
|
|---|
| 2147 | talloc_free(r);
|
|---|
| 2148 | return false;
|
|---|
| 2149 | }
|
|---|
| 2150 |
|
|---|
| 2151 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2152 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2153 | talloc_free(r);
|
|---|
| 2154 | return false;
|
|---|
| 2155 | }
|
|---|
| 2156 |
|
|---|
| 2157 | blob = ndr_push_blob(push);
|
|---|
| 2158 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2159 | talloc_free(r);
|
|---|
| 2160 | return false;
|
|---|
| 2161 | }
|
|---|
| 2162 |
|
|---|
| 2163 | talloc_free(r);
|
|---|
| 2164 |
|
|---|
| 2165 | return true;
|
|---|
| 2166 | }
|
|---|
| 2167 |
|
|---|
| 2168 | static bool api_samr_OpenAlias(pipes_struct *p)
|
|---|
| 2169 | {
|
|---|
| 2170 | const struct ndr_interface_call *call;
|
|---|
| 2171 | struct ndr_pull *pull;
|
|---|
| 2172 | struct ndr_push *push;
|
|---|
| 2173 | enum ndr_err_code ndr_err;
|
|---|
| 2174 | DATA_BLOB blob;
|
|---|
| 2175 | struct samr_OpenAlias *r;
|
|---|
| 2176 |
|
|---|
| 2177 | call = &ndr_table_samr.calls[NDR_SAMR_OPENALIAS];
|
|---|
| 2178 |
|
|---|
| 2179 | r = talloc(talloc_tos(), struct samr_OpenAlias);
|
|---|
| 2180 | if (r == NULL) {
|
|---|
| 2181 | return false;
|
|---|
| 2182 | }
|
|---|
| 2183 |
|
|---|
| 2184 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2185 | talloc_free(r);
|
|---|
| 2186 | return false;
|
|---|
| 2187 | }
|
|---|
| 2188 |
|
|---|
| 2189 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2190 | if (pull == NULL) {
|
|---|
| 2191 | talloc_free(r);
|
|---|
| 2192 | return false;
|
|---|
| 2193 | }
|
|---|
| 2194 |
|
|---|
| 2195 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2196 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2197 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2198 | talloc_free(r);
|
|---|
| 2199 | return false;
|
|---|
| 2200 | }
|
|---|
| 2201 |
|
|---|
| 2202 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2203 | NDR_PRINT_IN_DEBUG(samr_OpenAlias, r);
|
|---|
| 2204 | }
|
|---|
| 2205 |
|
|---|
| 2206 | ZERO_STRUCT(r->out);
|
|---|
| 2207 | r->out.alias_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 2208 | if (r->out.alias_handle == NULL) {
|
|---|
| 2209 | talloc_free(r);
|
|---|
| 2210 | return false;
|
|---|
| 2211 | }
|
|---|
| 2212 |
|
|---|
| 2213 | r->out.result = _samr_OpenAlias(p, r);
|
|---|
| 2214 |
|
|---|
| 2215 | if (p->rng_fault_state) {
|
|---|
| 2216 | talloc_free(r);
|
|---|
| 2217 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2218 | return true;
|
|---|
| 2219 | }
|
|---|
| 2220 |
|
|---|
| 2221 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2222 | NDR_PRINT_OUT_DEBUG(samr_OpenAlias, r);
|
|---|
| 2223 | }
|
|---|
| 2224 |
|
|---|
| 2225 | push = ndr_push_init_ctx(r);
|
|---|
| 2226 | if (push == NULL) {
|
|---|
| 2227 | talloc_free(r);
|
|---|
| 2228 | return false;
|
|---|
| 2229 | }
|
|---|
| 2230 |
|
|---|
| 2231 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2232 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2233 | talloc_free(r);
|
|---|
| 2234 | return false;
|
|---|
| 2235 | }
|
|---|
| 2236 |
|
|---|
| 2237 | blob = ndr_push_blob(push);
|
|---|
| 2238 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2239 | talloc_free(r);
|
|---|
| 2240 | return false;
|
|---|
| 2241 | }
|
|---|
| 2242 |
|
|---|
| 2243 | talloc_free(r);
|
|---|
| 2244 |
|
|---|
| 2245 | return true;
|
|---|
| 2246 | }
|
|---|
| 2247 |
|
|---|
| 2248 | static bool api_samr_QueryAliasInfo(pipes_struct *p)
|
|---|
| 2249 | {
|
|---|
| 2250 | const struct ndr_interface_call *call;
|
|---|
| 2251 | struct ndr_pull *pull;
|
|---|
| 2252 | struct ndr_push *push;
|
|---|
| 2253 | enum ndr_err_code ndr_err;
|
|---|
| 2254 | DATA_BLOB blob;
|
|---|
| 2255 | struct samr_QueryAliasInfo *r;
|
|---|
| 2256 |
|
|---|
| 2257 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYALIASINFO];
|
|---|
| 2258 |
|
|---|
| 2259 | r = talloc(talloc_tos(), struct samr_QueryAliasInfo);
|
|---|
| 2260 | if (r == NULL) {
|
|---|
| 2261 | return false;
|
|---|
| 2262 | }
|
|---|
| 2263 |
|
|---|
| 2264 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2265 | talloc_free(r);
|
|---|
| 2266 | return false;
|
|---|
| 2267 | }
|
|---|
| 2268 |
|
|---|
| 2269 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2270 | if (pull == NULL) {
|
|---|
| 2271 | talloc_free(r);
|
|---|
| 2272 | return false;
|
|---|
| 2273 | }
|
|---|
| 2274 |
|
|---|
| 2275 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2276 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2277 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2278 | talloc_free(r);
|
|---|
| 2279 | return false;
|
|---|
| 2280 | }
|
|---|
| 2281 |
|
|---|
| 2282 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2283 | NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, r);
|
|---|
| 2284 | }
|
|---|
| 2285 |
|
|---|
| 2286 | ZERO_STRUCT(r->out);
|
|---|
| 2287 | r->out.info = talloc_zero(r, union samr_AliasInfo *);
|
|---|
| 2288 | if (r->out.info == NULL) {
|
|---|
| 2289 | talloc_free(r);
|
|---|
| 2290 | return false;
|
|---|
| 2291 | }
|
|---|
| 2292 |
|
|---|
| 2293 | r->out.result = _samr_QueryAliasInfo(p, r);
|
|---|
| 2294 |
|
|---|
| 2295 | if (p->rng_fault_state) {
|
|---|
| 2296 | talloc_free(r);
|
|---|
| 2297 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2298 | return true;
|
|---|
| 2299 | }
|
|---|
| 2300 |
|
|---|
| 2301 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2302 | NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, r);
|
|---|
| 2303 | }
|
|---|
| 2304 |
|
|---|
| 2305 | push = ndr_push_init_ctx(r);
|
|---|
| 2306 | if (push == NULL) {
|
|---|
| 2307 | talloc_free(r);
|
|---|
| 2308 | return false;
|
|---|
| 2309 | }
|
|---|
| 2310 |
|
|---|
| 2311 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2312 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2313 | talloc_free(r);
|
|---|
| 2314 | return false;
|
|---|
| 2315 | }
|
|---|
| 2316 |
|
|---|
| 2317 | blob = ndr_push_blob(push);
|
|---|
| 2318 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2319 | talloc_free(r);
|
|---|
| 2320 | return false;
|
|---|
| 2321 | }
|
|---|
| 2322 |
|
|---|
| 2323 | talloc_free(r);
|
|---|
| 2324 |
|
|---|
| 2325 | return true;
|
|---|
| 2326 | }
|
|---|
| 2327 |
|
|---|
| 2328 | static bool api_samr_SetAliasInfo(pipes_struct *p)
|
|---|
| 2329 | {
|
|---|
| 2330 | const struct ndr_interface_call *call;
|
|---|
| 2331 | struct ndr_pull *pull;
|
|---|
| 2332 | struct ndr_push *push;
|
|---|
| 2333 | enum ndr_err_code ndr_err;
|
|---|
| 2334 | DATA_BLOB blob;
|
|---|
| 2335 | struct samr_SetAliasInfo *r;
|
|---|
| 2336 |
|
|---|
| 2337 | call = &ndr_table_samr.calls[NDR_SAMR_SETALIASINFO];
|
|---|
| 2338 |
|
|---|
| 2339 | r = talloc(talloc_tos(), struct samr_SetAliasInfo);
|
|---|
| 2340 | if (r == NULL) {
|
|---|
| 2341 | return false;
|
|---|
| 2342 | }
|
|---|
| 2343 |
|
|---|
| 2344 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2345 | talloc_free(r);
|
|---|
| 2346 | return false;
|
|---|
| 2347 | }
|
|---|
| 2348 |
|
|---|
| 2349 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2350 | if (pull == NULL) {
|
|---|
| 2351 | talloc_free(r);
|
|---|
| 2352 | return false;
|
|---|
| 2353 | }
|
|---|
| 2354 |
|
|---|
| 2355 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2356 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2357 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2358 | talloc_free(r);
|
|---|
| 2359 | return false;
|
|---|
| 2360 | }
|
|---|
| 2361 |
|
|---|
| 2362 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2363 | NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, r);
|
|---|
| 2364 | }
|
|---|
| 2365 |
|
|---|
| 2366 | r->out.result = _samr_SetAliasInfo(p, r);
|
|---|
| 2367 |
|
|---|
| 2368 | if (p->rng_fault_state) {
|
|---|
| 2369 | talloc_free(r);
|
|---|
| 2370 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2371 | return true;
|
|---|
| 2372 | }
|
|---|
| 2373 |
|
|---|
| 2374 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2375 | NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, r);
|
|---|
| 2376 | }
|
|---|
| 2377 |
|
|---|
| 2378 | push = ndr_push_init_ctx(r);
|
|---|
| 2379 | if (push == NULL) {
|
|---|
| 2380 | talloc_free(r);
|
|---|
| 2381 | return false;
|
|---|
| 2382 | }
|
|---|
| 2383 |
|
|---|
| 2384 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2385 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2386 | talloc_free(r);
|
|---|
| 2387 | return false;
|
|---|
| 2388 | }
|
|---|
| 2389 |
|
|---|
| 2390 | blob = ndr_push_blob(push);
|
|---|
| 2391 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2392 | talloc_free(r);
|
|---|
| 2393 | return false;
|
|---|
| 2394 | }
|
|---|
| 2395 |
|
|---|
| 2396 | talloc_free(r);
|
|---|
| 2397 |
|
|---|
| 2398 | return true;
|
|---|
| 2399 | }
|
|---|
| 2400 |
|
|---|
| 2401 | static bool api_samr_DeleteDomAlias(pipes_struct *p)
|
|---|
| 2402 | {
|
|---|
| 2403 | const struct ndr_interface_call *call;
|
|---|
| 2404 | struct ndr_pull *pull;
|
|---|
| 2405 | struct ndr_push *push;
|
|---|
| 2406 | enum ndr_err_code ndr_err;
|
|---|
| 2407 | DATA_BLOB blob;
|
|---|
| 2408 | struct samr_DeleteDomAlias *r;
|
|---|
| 2409 |
|
|---|
| 2410 | call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMALIAS];
|
|---|
| 2411 |
|
|---|
| 2412 | r = talloc(talloc_tos(), struct samr_DeleteDomAlias);
|
|---|
| 2413 | if (r == NULL) {
|
|---|
| 2414 | return false;
|
|---|
| 2415 | }
|
|---|
| 2416 |
|
|---|
| 2417 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2418 | talloc_free(r);
|
|---|
| 2419 | return false;
|
|---|
| 2420 | }
|
|---|
| 2421 |
|
|---|
| 2422 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2423 | if (pull == NULL) {
|
|---|
| 2424 | talloc_free(r);
|
|---|
| 2425 | return false;
|
|---|
| 2426 | }
|
|---|
| 2427 |
|
|---|
| 2428 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2429 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2430 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2431 | talloc_free(r);
|
|---|
| 2432 | return false;
|
|---|
| 2433 | }
|
|---|
| 2434 |
|
|---|
| 2435 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2436 | NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, r);
|
|---|
| 2437 | }
|
|---|
| 2438 |
|
|---|
| 2439 | ZERO_STRUCT(r->out);
|
|---|
| 2440 | r->out.alias_handle = r->in.alias_handle;
|
|---|
| 2441 | r->out.result = _samr_DeleteDomAlias(p, r);
|
|---|
| 2442 |
|
|---|
| 2443 | if (p->rng_fault_state) {
|
|---|
| 2444 | talloc_free(r);
|
|---|
| 2445 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2446 | return true;
|
|---|
| 2447 | }
|
|---|
| 2448 |
|
|---|
| 2449 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2450 | NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, r);
|
|---|
| 2451 | }
|
|---|
| 2452 |
|
|---|
| 2453 | push = ndr_push_init_ctx(r);
|
|---|
| 2454 | if (push == NULL) {
|
|---|
| 2455 | talloc_free(r);
|
|---|
| 2456 | return false;
|
|---|
| 2457 | }
|
|---|
| 2458 |
|
|---|
| 2459 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2460 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2461 | talloc_free(r);
|
|---|
| 2462 | return false;
|
|---|
| 2463 | }
|
|---|
| 2464 |
|
|---|
| 2465 | blob = ndr_push_blob(push);
|
|---|
| 2466 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2467 | talloc_free(r);
|
|---|
| 2468 | return false;
|
|---|
| 2469 | }
|
|---|
| 2470 |
|
|---|
| 2471 | talloc_free(r);
|
|---|
| 2472 |
|
|---|
| 2473 | return true;
|
|---|
| 2474 | }
|
|---|
| 2475 |
|
|---|
| 2476 | static bool api_samr_AddAliasMember(pipes_struct *p)
|
|---|
| 2477 | {
|
|---|
| 2478 | const struct ndr_interface_call *call;
|
|---|
| 2479 | struct ndr_pull *pull;
|
|---|
| 2480 | struct ndr_push *push;
|
|---|
| 2481 | enum ndr_err_code ndr_err;
|
|---|
| 2482 | DATA_BLOB blob;
|
|---|
| 2483 | struct samr_AddAliasMember *r;
|
|---|
| 2484 |
|
|---|
| 2485 | call = &ndr_table_samr.calls[NDR_SAMR_ADDALIASMEMBER];
|
|---|
| 2486 |
|
|---|
| 2487 | r = talloc(talloc_tos(), struct samr_AddAliasMember);
|
|---|
| 2488 | if (r == NULL) {
|
|---|
| 2489 | return false;
|
|---|
| 2490 | }
|
|---|
| 2491 |
|
|---|
| 2492 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2493 | talloc_free(r);
|
|---|
| 2494 | return false;
|
|---|
| 2495 | }
|
|---|
| 2496 |
|
|---|
| 2497 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2498 | if (pull == NULL) {
|
|---|
| 2499 | talloc_free(r);
|
|---|
| 2500 | return false;
|
|---|
| 2501 | }
|
|---|
| 2502 |
|
|---|
| 2503 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2504 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2505 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2506 | talloc_free(r);
|
|---|
| 2507 | return false;
|
|---|
| 2508 | }
|
|---|
| 2509 |
|
|---|
| 2510 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2511 | NDR_PRINT_IN_DEBUG(samr_AddAliasMember, r);
|
|---|
| 2512 | }
|
|---|
| 2513 |
|
|---|
| 2514 | r->out.result = _samr_AddAliasMember(p, r);
|
|---|
| 2515 |
|
|---|
| 2516 | if (p->rng_fault_state) {
|
|---|
| 2517 | talloc_free(r);
|
|---|
| 2518 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2519 | return true;
|
|---|
| 2520 | }
|
|---|
| 2521 |
|
|---|
| 2522 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2523 | NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, r);
|
|---|
| 2524 | }
|
|---|
| 2525 |
|
|---|
| 2526 | push = ndr_push_init_ctx(r);
|
|---|
| 2527 | if (push == NULL) {
|
|---|
| 2528 | talloc_free(r);
|
|---|
| 2529 | return false;
|
|---|
| 2530 | }
|
|---|
| 2531 |
|
|---|
| 2532 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2533 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2534 | talloc_free(r);
|
|---|
| 2535 | return false;
|
|---|
| 2536 | }
|
|---|
| 2537 |
|
|---|
| 2538 | blob = ndr_push_blob(push);
|
|---|
| 2539 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2540 | talloc_free(r);
|
|---|
| 2541 | return false;
|
|---|
| 2542 | }
|
|---|
| 2543 |
|
|---|
| 2544 | talloc_free(r);
|
|---|
| 2545 |
|
|---|
| 2546 | return true;
|
|---|
| 2547 | }
|
|---|
| 2548 |
|
|---|
| 2549 | static bool api_samr_DeleteAliasMember(pipes_struct *p)
|
|---|
| 2550 | {
|
|---|
| 2551 | const struct ndr_interface_call *call;
|
|---|
| 2552 | struct ndr_pull *pull;
|
|---|
| 2553 | struct ndr_push *push;
|
|---|
| 2554 | enum ndr_err_code ndr_err;
|
|---|
| 2555 | DATA_BLOB blob;
|
|---|
| 2556 | struct samr_DeleteAliasMember *r;
|
|---|
| 2557 |
|
|---|
| 2558 | call = &ndr_table_samr.calls[NDR_SAMR_DELETEALIASMEMBER];
|
|---|
| 2559 |
|
|---|
| 2560 | r = talloc(talloc_tos(), struct samr_DeleteAliasMember);
|
|---|
| 2561 | if (r == NULL) {
|
|---|
| 2562 | return false;
|
|---|
| 2563 | }
|
|---|
| 2564 |
|
|---|
| 2565 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2566 | talloc_free(r);
|
|---|
| 2567 | return false;
|
|---|
| 2568 | }
|
|---|
| 2569 |
|
|---|
| 2570 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2571 | if (pull == NULL) {
|
|---|
| 2572 | talloc_free(r);
|
|---|
| 2573 | return false;
|
|---|
| 2574 | }
|
|---|
| 2575 |
|
|---|
| 2576 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2577 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2578 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2579 | talloc_free(r);
|
|---|
| 2580 | return false;
|
|---|
| 2581 | }
|
|---|
| 2582 |
|
|---|
| 2583 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2584 | NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, r);
|
|---|
| 2585 | }
|
|---|
| 2586 |
|
|---|
| 2587 | r->out.result = _samr_DeleteAliasMember(p, r);
|
|---|
| 2588 |
|
|---|
| 2589 | if (p->rng_fault_state) {
|
|---|
| 2590 | talloc_free(r);
|
|---|
| 2591 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2592 | return true;
|
|---|
| 2593 | }
|
|---|
| 2594 |
|
|---|
| 2595 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2596 | NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, r);
|
|---|
| 2597 | }
|
|---|
| 2598 |
|
|---|
| 2599 | push = ndr_push_init_ctx(r);
|
|---|
| 2600 | if (push == NULL) {
|
|---|
| 2601 | talloc_free(r);
|
|---|
| 2602 | return false;
|
|---|
| 2603 | }
|
|---|
| 2604 |
|
|---|
| 2605 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2606 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2607 | talloc_free(r);
|
|---|
| 2608 | return false;
|
|---|
| 2609 | }
|
|---|
| 2610 |
|
|---|
| 2611 | blob = ndr_push_blob(push);
|
|---|
| 2612 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2613 | talloc_free(r);
|
|---|
| 2614 | return false;
|
|---|
| 2615 | }
|
|---|
| 2616 |
|
|---|
| 2617 | talloc_free(r);
|
|---|
| 2618 |
|
|---|
| 2619 | return true;
|
|---|
| 2620 | }
|
|---|
| 2621 |
|
|---|
| 2622 | static bool api_samr_GetMembersInAlias(pipes_struct *p)
|
|---|
| 2623 | {
|
|---|
| 2624 | const struct ndr_interface_call *call;
|
|---|
| 2625 | struct ndr_pull *pull;
|
|---|
| 2626 | struct ndr_push *push;
|
|---|
| 2627 | enum ndr_err_code ndr_err;
|
|---|
| 2628 | DATA_BLOB blob;
|
|---|
| 2629 | struct samr_GetMembersInAlias *r;
|
|---|
| 2630 |
|
|---|
| 2631 | call = &ndr_table_samr.calls[NDR_SAMR_GETMEMBERSINALIAS];
|
|---|
| 2632 |
|
|---|
| 2633 | r = talloc(talloc_tos(), struct samr_GetMembersInAlias);
|
|---|
| 2634 | if (r == NULL) {
|
|---|
| 2635 | return false;
|
|---|
| 2636 | }
|
|---|
| 2637 |
|
|---|
| 2638 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2639 | talloc_free(r);
|
|---|
| 2640 | return false;
|
|---|
| 2641 | }
|
|---|
| 2642 |
|
|---|
| 2643 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2644 | if (pull == NULL) {
|
|---|
| 2645 | talloc_free(r);
|
|---|
| 2646 | return false;
|
|---|
| 2647 | }
|
|---|
| 2648 |
|
|---|
| 2649 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2650 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2651 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2652 | talloc_free(r);
|
|---|
| 2653 | return false;
|
|---|
| 2654 | }
|
|---|
| 2655 |
|
|---|
| 2656 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2657 | NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, r);
|
|---|
| 2658 | }
|
|---|
| 2659 |
|
|---|
| 2660 | ZERO_STRUCT(r->out);
|
|---|
| 2661 | r->out.sids = talloc_zero(r, struct lsa_SidArray);
|
|---|
| 2662 | if (r->out.sids == NULL) {
|
|---|
| 2663 | talloc_free(r);
|
|---|
| 2664 | return false;
|
|---|
| 2665 | }
|
|---|
| 2666 |
|
|---|
| 2667 | r->out.result = _samr_GetMembersInAlias(p, r);
|
|---|
| 2668 |
|
|---|
| 2669 | if (p->rng_fault_state) {
|
|---|
| 2670 | talloc_free(r);
|
|---|
| 2671 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2672 | return true;
|
|---|
| 2673 | }
|
|---|
| 2674 |
|
|---|
| 2675 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2676 | NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, r);
|
|---|
| 2677 | }
|
|---|
| 2678 |
|
|---|
| 2679 | push = ndr_push_init_ctx(r);
|
|---|
| 2680 | if (push == NULL) {
|
|---|
| 2681 | talloc_free(r);
|
|---|
| 2682 | return false;
|
|---|
| 2683 | }
|
|---|
| 2684 |
|
|---|
| 2685 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2686 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2687 | talloc_free(r);
|
|---|
| 2688 | return false;
|
|---|
| 2689 | }
|
|---|
| 2690 |
|
|---|
| 2691 | blob = ndr_push_blob(push);
|
|---|
| 2692 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2693 | talloc_free(r);
|
|---|
| 2694 | return false;
|
|---|
| 2695 | }
|
|---|
| 2696 |
|
|---|
| 2697 | talloc_free(r);
|
|---|
| 2698 |
|
|---|
| 2699 | return true;
|
|---|
| 2700 | }
|
|---|
| 2701 |
|
|---|
| 2702 | static bool api_samr_OpenUser(pipes_struct *p)
|
|---|
| 2703 | {
|
|---|
| 2704 | const struct ndr_interface_call *call;
|
|---|
| 2705 | struct ndr_pull *pull;
|
|---|
| 2706 | struct ndr_push *push;
|
|---|
| 2707 | enum ndr_err_code ndr_err;
|
|---|
| 2708 | DATA_BLOB blob;
|
|---|
| 2709 | struct samr_OpenUser *r;
|
|---|
| 2710 |
|
|---|
| 2711 | call = &ndr_table_samr.calls[NDR_SAMR_OPENUSER];
|
|---|
| 2712 |
|
|---|
| 2713 | r = talloc(talloc_tos(), struct samr_OpenUser);
|
|---|
| 2714 | if (r == NULL) {
|
|---|
| 2715 | return false;
|
|---|
| 2716 | }
|
|---|
| 2717 |
|
|---|
| 2718 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2719 | talloc_free(r);
|
|---|
| 2720 | return false;
|
|---|
| 2721 | }
|
|---|
| 2722 |
|
|---|
| 2723 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2724 | if (pull == NULL) {
|
|---|
| 2725 | talloc_free(r);
|
|---|
| 2726 | return false;
|
|---|
| 2727 | }
|
|---|
| 2728 |
|
|---|
| 2729 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2730 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2731 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2732 | talloc_free(r);
|
|---|
| 2733 | return false;
|
|---|
| 2734 | }
|
|---|
| 2735 |
|
|---|
| 2736 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2737 | NDR_PRINT_IN_DEBUG(samr_OpenUser, r);
|
|---|
| 2738 | }
|
|---|
| 2739 |
|
|---|
| 2740 | ZERO_STRUCT(r->out);
|
|---|
| 2741 | r->out.user_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 2742 | if (r->out.user_handle == NULL) {
|
|---|
| 2743 | talloc_free(r);
|
|---|
| 2744 | return false;
|
|---|
| 2745 | }
|
|---|
| 2746 |
|
|---|
| 2747 | r->out.result = _samr_OpenUser(p, r);
|
|---|
| 2748 |
|
|---|
| 2749 | if (p->rng_fault_state) {
|
|---|
| 2750 | talloc_free(r);
|
|---|
| 2751 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2752 | return true;
|
|---|
| 2753 | }
|
|---|
| 2754 |
|
|---|
| 2755 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2756 | NDR_PRINT_OUT_DEBUG(samr_OpenUser, r);
|
|---|
| 2757 | }
|
|---|
| 2758 |
|
|---|
| 2759 | push = ndr_push_init_ctx(r);
|
|---|
| 2760 | if (push == NULL) {
|
|---|
| 2761 | talloc_free(r);
|
|---|
| 2762 | return false;
|
|---|
| 2763 | }
|
|---|
| 2764 |
|
|---|
| 2765 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2766 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2767 | talloc_free(r);
|
|---|
| 2768 | return false;
|
|---|
| 2769 | }
|
|---|
| 2770 |
|
|---|
| 2771 | blob = ndr_push_blob(push);
|
|---|
| 2772 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2773 | talloc_free(r);
|
|---|
| 2774 | return false;
|
|---|
| 2775 | }
|
|---|
| 2776 |
|
|---|
| 2777 | talloc_free(r);
|
|---|
| 2778 |
|
|---|
| 2779 | return true;
|
|---|
| 2780 | }
|
|---|
| 2781 |
|
|---|
| 2782 | static bool api_samr_DeleteUser(pipes_struct *p)
|
|---|
| 2783 | {
|
|---|
| 2784 | const struct ndr_interface_call *call;
|
|---|
| 2785 | struct ndr_pull *pull;
|
|---|
| 2786 | struct ndr_push *push;
|
|---|
| 2787 | enum ndr_err_code ndr_err;
|
|---|
| 2788 | DATA_BLOB blob;
|
|---|
| 2789 | struct samr_DeleteUser *r;
|
|---|
| 2790 |
|
|---|
| 2791 | call = &ndr_table_samr.calls[NDR_SAMR_DELETEUSER];
|
|---|
| 2792 |
|
|---|
| 2793 | r = talloc(talloc_tos(), struct samr_DeleteUser);
|
|---|
| 2794 | if (r == NULL) {
|
|---|
| 2795 | return false;
|
|---|
| 2796 | }
|
|---|
| 2797 |
|
|---|
| 2798 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2799 | talloc_free(r);
|
|---|
| 2800 | return false;
|
|---|
| 2801 | }
|
|---|
| 2802 |
|
|---|
| 2803 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2804 | if (pull == NULL) {
|
|---|
| 2805 | talloc_free(r);
|
|---|
| 2806 | return false;
|
|---|
| 2807 | }
|
|---|
| 2808 |
|
|---|
| 2809 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2810 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2811 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2812 | talloc_free(r);
|
|---|
| 2813 | return false;
|
|---|
| 2814 | }
|
|---|
| 2815 |
|
|---|
| 2816 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2817 | NDR_PRINT_IN_DEBUG(samr_DeleteUser, r);
|
|---|
| 2818 | }
|
|---|
| 2819 |
|
|---|
| 2820 | ZERO_STRUCT(r->out);
|
|---|
| 2821 | r->out.user_handle = r->in.user_handle;
|
|---|
| 2822 | r->out.result = _samr_DeleteUser(p, r);
|
|---|
| 2823 |
|
|---|
| 2824 | if (p->rng_fault_state) {
|
|---|
| 2825 | talloc_free(r);
|
|---|
| 2826 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2827 | return true;
|
|---|
| 2828 | }
|
|---|
| 2829 |
|
|---|
| 2830 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2831 | NDR_PRINT_OUT_DEBUG(samr_DeleteUser, r);
|
|---|
| 2832 | }
|
|---|
| 2833 |
|
|---|
| 2834 | push = ndr_push_init_ctx(r);
|
|---|
| 2835 | if (push == NULL) {
|
|---|
| 2836 | talloc_free(r);
|
|---|
| 2837 | return false;
|
|---|
| 2838 | }
|
|---|
| 2839 |
|
|---|
| 2840 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2841 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2842 | talloc_free(r);
|
|---|
| 2843 | return false;
|
|---|
| 2844 | }
|
|---|
| 2845 |
|
|---|
| 2846 | blob = ndr_push_blob(push);
|
|---|
| 2847 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2848 | talloc_free(r);
|
|---|
| 2849 | return false;
|
|---|
| 2850 | }
|
|---|
| 2851 |
|
|---|
| 2852 | talloc_free(r);
|
|---|
| 2853 |
|
|---|
| 2854 | return true;
|
|---|
| 2855 | }
|
|---|
| 2856 |
|
|---|
| 2857 | static bool api_samr_QueryUserInfo(pipes_struct *p)
|
|---|
| 2858 | {
|
|---|
| 2859 | const struct ndr_interface_call *call;
|
|---|
| 2860 | struct ndr_pull *pull;
|
|---|
| 2861 | struct ndr_push *push;
|
|---|
| 2862 | enum ndr_err_code ndr_err;
|
|---|
| 2863 | DATA_BLOB blob;
|
|---|
| 2864 | struct samr_QueryUserInfo *r;
|
|---|
| 2865 |
|
|---|
| 2866 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO];
|
|---|
| 2867 |
|
|---|
| 2868 | r = talloc(talloc_tos(), struct samr_QueryUserInfo);
|
|---|
| 2869 | if (r == NULL) {
|
|---|
| 2870 | return false;
|
|---|
| 2871 | }
|
|---|
| 2872 |
|
|---|
| 2873 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2874 | talloc_free(r);
|
|---|
| 2875 | return false;
|
|---|
| 2876 | }
|
|---|
| 2877 |
|
|---|
| 2878 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2879 | if (pull == NULL) {
|
|---|
| 2880 | talloc_free(r);
|
|---|
| 2881 | return false;
|
|---|
| 2882 | }
|
|---|
| 2883 |
|
|---|
| 2884 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2885 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2886 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2887 | talloc_free(r);
|
|---|
| 2888 | return false;
|
|---|
| 2889 | }
|
|---|
| 2890 |
|
|---|
| 2891 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2892 | NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, r);
|
|---|
| 2893 | }
|
|---|
| 2894 |
|
|---|
| 2895 | ZERO_STRUCT(r->out);
|
|---|
| 2896 | r->out.info = talloc_zero(r, union samr_UserInfo *);
|
|---|
| 2897 | if (r->out.info == NULL) {
|
|---|
| 2898 | talloc_free(r);
|
|---|
| 2899 | return false;
|
|---|
| 2900 | }
|
|---|
| 2901 |
|
|---|
| 2902 | r->out.result = _samr_QueryUserInfo(p, r);
|
|---|
| 2903 |
|
|---|
| 2904 | if (p->rng_fault_state) {
|
|---|
| 2905 | talloc_free(r);
|
|---|
| 2906 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2907 | return true;
|
|---|
| 2908 | }
|
|---|
| 2909 |
|
|---|
| 2910 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2911 | NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, r);
|
|---|
| 2912 | }
|
|---|
| 2913 |
|
|---|
| 2914 | push = ndr_push_init_ctx(r);
|
|---|
| 2915 | if (push == NULL) {
|
|---|
| 2916 | talloc_free(r);
|
|---|
| 2917 | return false;
|
|---|
| 2918 | }
|
|---|
| 2919 |
|
|---|
| 2920 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2921 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2922 | talloc_free(r);
|
|---|
| 2923 | return false;
|
|---|
| 2924 | }
|
|---|
| 2925 |
|
|---|
| 2926 | blob = ndr_push_blob(push);
|
|---|
| 2927 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 2928 | talloc_free(r);
|
|---|
| 2929 | return false;
|
|---|
| 2930 | }
|
|---|
| 2931 |
|
|---|
| 2932 | talloc_free(r);
|
|---|
| 2933 |
|
|---|
| 2934 | return true;
|
|---|
| 2935 | }
|
|---|
| 2936 |
|
|---|
| 2937 | static bool api_samr_SetUserInfo(pipes_struct *p)
|
|---|
| 2938 | {
|
|---|
| 2939 | const struct ndr_interface_call *call;
|
|---|
| 2940 | struct ndr_pull *pull;
|
|---|
| 2941 | struct ndr_push *push;
|
|---|
| 2942 | enum ndr_err_code ndr_err;
|
|---|
| 2943 | DATA_BLOB blob;
|
|---|
| 2944 | struct samr_SetUserInfo *r;
|
|---|
| 2945 |
|
|---|
| 2946 | call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO];
|
|---|
| 2947 |
|
|---|
| 2948 | r = talloc(talloc_tos(), struct samr_SetUserInfo);
|
|---|
| 2949 | if (r == NULL) {
|
|---|
| 2950 | return false;
|
|---|
| 2951 | }
|
|---|
| 2952 |
|
|---|
| 2953 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 2954 | talloc_free(r);
|
|---|
| 2955 | return false;
|
|---|
| 2956 | }
|
|---|
| 2957 |
|
|---|
| 2958 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 2959 | if (pull == NULL) {
|
|---|
| 2960 | talloc_free(r);
|
|---|
| 2961 | return false;
|
|---|
| 2962 | }
|
|---|
| 2963 |
|
|---|
| 2964 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 2965 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 2966 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2967 | talloc_free(r);
|
|---|
| 2968 | return false;
|
|---|
| 2969 | }
|
|---|
| 2970 |
|
|---|
| 2971 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2972 | NDR_PRINT_IN_DEBUG(samr_SetUserInfo, r);
|
|---|
| 2973 | }
|
|---|
| 2974 |
|
|---|
| 2975 | r->out.result = _samr_SetUserInfo(p, r);
|
|---|
| 2976 |
|
|---|
| 2977 | if (p->rng_fault_state) {
|
|---|
| 2978 | talloc_free(r);
|
|---|
| 2979 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 2980 | return true;
|
|---|
| 2981 | }
|
|---|
| 2982 |
|
|---|
| 2983 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2984 | NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, r);
|
|---|
| 2985 | }
|
|---|
| 2986 |
|
|---|
| 2987 | push = ndr_push_init_ctx(r);
|
|---|
| 2988 | if (push == NULL) {
|
|---|
| 2989 | talloc_free(r);
|
|---|
| 2990 | return false;
|
|---|
| 2991 | }
|
|---|
| 2992 |
|
|---|
| 2993 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 2994 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 2995 | talloc_free(r);
|
|---|
| 2996 | return false;
|
|---|
| 2997 | }
|
|---|
| 2998 |
|
|---|
| 2999 | blob = ndr_push_blob(push);
|
|---|
| 3000 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3001 | talloc_free(r);
|
|---|
| 3002 | return false;
|
|---|
| 3003 | }
|
|---|
| 3004 |
|
|---|
| 3005 | talloc_free(r);
|
|---|
| 3006 |
|
|---|
| 3007 | return true;
|
|---|
| 3008 | }
|
|---|
| 3009 |
|
|---|
| 3010 | static bool api_samr_ChangePasswordUser(pipes_struct *p)
|
|---|
| 3011 | {
|
|---|
| 3012 | const struct ndr_interface_call *call;
|
|---|
| 3013 | struct ndr_pull *pull;
|
|---|
| 3014 | struct ndr_push *push;
|
|---|
| 3015 | enum ndr_err_code ndr_err;
|
|---|
| 3016 | DATA_BLOB blob;
|
|---|
| 3017 | struct samr_ChangePasswordUser *r;
|
|---|
| 3018 |
|
|---|
| 3019 | call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER];
|
|---|
| 3020 |
|
|---|
| 3021 | r = talloc(talloc_tos(), struct samr_ChangePasswordUser);
|
|---|
| 3022 | if (r == NULL) {
|
|---|
| 3023 | return false;
|
|---|
| 3024 | }
|
|---|
| 3025 |
|
|---|
| 3026 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3027 | talloc_free(r);
|
|---|
| 3028 | return false;
|
|---|
| 3029 | }
|
|---|
| 3030 |
|
|---|
| 3031 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3032 | if (pull == NULL) {
|
|---|
| 3033 | talloc_free(r);
|
|---|
| 3034 | return false;
|
|---|
| 3035 | }
|
|---|
| 3036 |
|
|---|
| 3037 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3038 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3039 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3040 | talloc_free(r);
|
|---|
| 3041 | return false;
|
|---|
| 3042 | }
|
|---|
| 3043 |
|
|---|
| 3044 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3045 | NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, r);
|
|---|
| 3046 | }
|
|---|
| 3047 |
|
|---|
| 3048 | r->out.result = _samr_ChangePasswordUser(p, r);
|
|---|
| 3049 |
|
|---|
| 3050 | if (p->rng_fault_state) {
|
|---|
| 3051 | talloc_free(r);
|
|---|
| 3052 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3053 | return true;
|
|---|
| 3054 | }
|
|---|
| 3055 |
|
|---|
| 3056 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3057 | NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, r);
|
|---|
| 3058 | }
|
|---|
| 3059 |
|
|---|
| 3060 | push = ndr_push_init_ctx(r);
|
|---|
| 3061 | if (push == NULL) {
|
|---|
| 3062 | talloc_free(r);
|
|---|
| 3063 | return false;
|
|---|
| 3064 | }
|
|---|
| 3065 |
|
|---|
| 3066 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3067 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3068 | talloc_free(r);
|
|---|
| 3069 | return false;
|
|---|
| 3070 | }
|
|---|
| 3071 |
|
|---|
| 3072 | blob = ndr_push_blob(push);
|
|---|
| 3073 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3074 | talloc_free(r);
|
|---|
| 3075 | return false;
|
|---|
| 3076 | }
|
|---|
| 3077 |
|
|---|
| 3078 | talloc_free(r);
|
|---|
| 3079 |
|
|---|
| 3080 | return true;
|
|---|
| 3081 | }
|
|---|
| 3082 |
|
|---|
| 3083 | static bool api_samr_GetGroupsForUser(pipes_struct *p)
|
|---|
| 3084 | {
|
|---|
| 3085 | const struct ndr_interface_call *call;
|
|---|
| 3086 | struct ndr_pull *pull;
|
|---|
| 3087 | struct ndr_push *push;
|
|---|
| 3088 | enum ndr_err_code ndr_err;
|
|---|
| 3089 | DATA_BLOB blob;
|
|---|
| 3090 | struct samr_GetGroupsForUser *r;
|
|---|
| 3091 |
|
|---|
| 3092 | call = &ndr_table_samr.calls[NDR_SAMR_GETGROUPSFORUSER];
|
|---|
| 3093 |
|
|---|
| 3094 | r = talloc(talloc_tos(), struct samr_GetGroupsForUser);
|
|---|
| 3095 | if (r == NULL) {
|
|---|
| 3096 | return false;
|
|---|
| 3097 | }
|
|---|
| 3098 |
|
|---|
| 3099 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3100 | talloc_free(r);
|
|---|
| 3101 | return false;
|
|---|
| 3102 | }
|
|---|
| 3103 |
|
|---|
| 3104 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3105 | if (pull == NULL) {
|
|---|
| 3106 | talloc_free(r);
|
|---|
| 3107 | return false;
|
|---|
| 3108 | }
|
|---|
| 3109 |
|
|---|
| 3110 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3111 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3112 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3113 | talloc_free(r);
|
|---|
| 3114 | return false;
|
|---|
| 3115 | }
|
|---|
| 3116 |
|
|---|
| 3117 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3118 | NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, r);
|
|---|
| 3119 | }
|
|---|
| 3120 |
|
|---|
| 3121 | ZERO_STRUCT(r->out);
|
|---|
| 3122 | r->out.rids = talloc_zero(r, struct samr_RidWithAttributeArray *);
|
|---|
| 3123 | if (r->out.rids == NULL) {
|
|---|
| 3124 | talloc_free(r);
|
|---|
| 3125 | return false;
|
|---|
| 3126 | }
|
|---|
| 3127 |
|
|---|
| 3128 | r->out.result = _samr_GetGroupsForUser(p, r);
|
|---|
| 3129 |
|
|---|
| 3130 | if (p->rng_fault_state) {
|
|---|
| 3131 | talloc_free(r);
|
|---|
| 3132 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3133 | return true;
|
|---|
| 3134 | }
|
|---|
| 3135 |
|
|---|
| 3136 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3137 | NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, r);
|
|---|
| 3138 | }
|
|---|
| 3139 |
|
|---|
| 3140 | push = ndr_push_init_ctx(r);
|
|---|
| 3141 | if (push == NULL) {
|
|---|
| 3142 | talloc_free(r);
|
|---|
| 3143 | return false;
|
|---|
| 3144 | }
|
|---|
| 3145 |
|
|---|
| 3146 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3147 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3148 | talloc_free(r);
|
|---|
| 3149 | return false;
|
|---|
| 3150 | }
|
|---|
| 3151 |
|
|---|
| 3152 | blob = ndr_push_blob(push);
|
|---|
| 3153 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3154 | talloc_free(r);
|
|---|
| 3155 | return false;
|
|---|
| 3156 | }
|
|---|
| 3157 |
|
|---|
| 3158 | talloc_free(r);
|
|---|
| 3159 |
|
|---|
| 3160 | return true;
|
|---|
| 3161 | }
|
|---|
| 3162 |
|
|---|
| 3163 | static bool api_samr_QueryDisplayInfo(pipes_struct *p)
|
|---|
| 3164 | {
|
|---|
| 3165 | const struct ndr_interface_call *call;
|
|---|
| 3166 | struct ndr_pull *pull;
|
|---|
| 3167 | struct ndr_push *push;
|
|---|
| 3168 | enum ndr_err_code ndr_err;
|
|---|
| 3169 | DATA_BLOB blob;
|
|---|
| 3170 | struct samr_QueryDisplayInfo *r;
|
|---|
| 3171 |
|
|---|
| 3172 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO];
|
|---|
| 3173 |
|
|---|
| 3174 | r = talloc(talloc_tos(), struct samr_QueryDisplayInfo);
|
|---|
| 3175 | if (r == NULL) {
|
|---|
| 3176 | return false;
|
|---|
| 3177 | }
|
|---|
| 3178 |
|
|---|
| 3179 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3180 | talloc_free(r);
|
|---|
| 3181 | return false;
|
|---|
| 3182 | }
|
|---|
| 3183 |
|
|---|
| 3184 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3185 | if (pull == NULL) {
|
|---|
| 3186 | talloc_free(r);
|
|---|
| 3187 | return false;
|
|---|
| 3188 | }
|
|---|
| 3189 |
|
|---|
| 3190 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3191 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3192 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3193 | talloc_free(r);
|
|---|
| 3194 | return false;
|
|---|
| 3195 | }
|
|---|
| 3196 |
|
|---|
| 3197 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3198 | NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, r);
|
|---|
| 3199 | }
|
|---|
| 3200 |
|
|---|
| 3201 | ZERO_STRUCT(r->out);
|
|---|
| 3202 | r->out.total_size = talloc_zero(r, uint32_t);
|
|---|
| 3203 | if (r->out.total_size == NULL) {
|
|---|
| 3204 | talloc_free(r);
|
|---|
| 3205 | return false;
|
|---|
| 3206 | }
|
|---|
| 3207 |
|
|---|
| 3208 | r->out.returned_size = talloc_zero(r, uint32_t);
|
|---|
| 3209 | if (r->out.returned_size == NULL) {
|
|---|
| 3210 | talloc_free(r);
|
|---|
| 3211 | return false;
|
|---|
| 3212 | }
|
|---|
| 3213 |
|
|---|
| 3214 | r->out.info = talloc_zero(r, union samr_DispInfo);
|
|---|
| 3215 | if (r->out.info == NULL) {
|
|---|
| 3216 | talloc_free(r);
|
|---|
| 3217 | return false;
|
|---|
| 3218 | }
|
|---|
| 3219 |
|
|---|
| 3220 | r->out.result = _samr_QueryDisplayInfo(p, r);
|
|---|
| 3221 |
|
|---|
| 3222 | if (p->rng_fault_state) {
|
|---|
| 3223 | talloc_free(r);
|
|---|
| 3224 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3225 | return true;
|
|---|
| 3226 | }
|
|---|
| 3227 |
|
|---|
| 3228 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3229 | NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, r);
|
|---|
| 3230 | }
|
|---|
| 3231 |
|
|---|
| 3232 | push = ndr_push_init_ctx(r);
|
|---|
| 3233 | if (push == NULL) {
|
|---|
| 3234 | talloc_free(r);
|
|---|
| 3235 | return false;
|
|---|
| 3236 | }
|
|---|
| 3237 |
|
|---|
| 3238 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3239 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3240 | talloc_free(r);
|
|---|
| 3241 | return false;
|
|---|
| 3242 | }
|
|---|
| 3243 |
|
|---|
| 3244 | blob = ndr_push_blob(push);
|
|---|
| 3245 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3246 | talloc_free(r);
|
|---|
| 3247 | return false;
|
|---|
| 3248 | }
|
|---|
| 3249 |
|
|---|
| 3250 | talloc_free(r);
|
|---|
| 3251 |
|
|---|
| 3252 | return true;
|
|---|
| 3253 | }
|
|---|
| 3254 |
|
|---|
| 3255 | static bool api_samr_GetDisplayEnumerationIndex(pipes_struct *p)
|
|---|
| 3256 | {
|
|---|
| 3257 | const struct ndr_interface_call *call;
|
|---|
| 3258 | struct ndr_pull *pull;
|
|---|
| 3259 | struct ndr_push *push;
|
|---|
| 3260 | enum ndr_err_code ndr_err;
|
|---|
| 3261 | DATA_BLOB blob;
|
|---|
| 3262 | struct samr_GetDisplayEnumerationIndex *r;
|
|---|
| 3263 |
|
|---|
| 3264 | call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX];
|
|---|
| 3265 |
|
|---|
| 3266 | r = talloc(talloc_tos(), struct samr_GetDisplayEnumerationIndex);
|
|---|
| 3267 | if (r == NULL) {
|
|---|
| 3268 | return false;
|
|---|
| 3269 | }
|
|---|
| 3270 |
|
|---|
| 3271 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3272 | talloc_free(r);
|
|---|
| 3273 | return false;
|
|---|
| 3274 | }
|
|---|
| 3275 |
|
|---|
| 3276 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3277 | if (pull == NULL) {
|
|---|
| 3278 | talloc_free(r);
|
|---|
| 3279 | return false;
|
|---|
| 3280 | }
|
|---|
| 3281 |
|
|---|
| 3282 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3283 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3284 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3285 | talloc_free(r);
|
|---|
| 3286 | return false;
|
|---|
| 3287 | }
|
|---|
| 3288 |
|
|---|
| 3289 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3290 | NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, r);
|
|---|
| 3291 | }
|
|---|
| 3292 |
|
|---|
| 3293 | ZERO_STRUCT(r->out);
|
|---|
| 3294 | r->out.idx = talloc_zero(r, uint32_t);
|
|---|
| 3295 | if (r->out.idx == NULL) {
|
|---|
| 3296 | talloc_free(r);
|
|---|
| 3297 | return false;
|
|---|
| 3298 | }
|
|---|
| 3299 |
|
|---|
| 3300 | r->out.result = _samr_GetDisplayEnumerationIndex(p, r);
|
|---|
| 3301 |
|
|---|
| 3302 | if (p->rng_fault_state) {
|
|---|
| 3303 | talloc_free(r);
|
|---|
| 3304 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3305 | return true;
|
|---|
| 3306 | }
|
|---|
| 3307 |
|
|---|
| 3308 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3309 | NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, r);
|
|---|
| 3310 | }
|
|---|
| 3311 |
|
|---|
| 3312 | push = ndr_push_init_ctx(r);
|
|---|
| 3313 | if (push == NULL) {
|
|---|
| 3314 | talloc_free(r);
|
|---|
| 3315 | return false;
|
|---|
| 3316 | }
|
|---|
| 3317 |
|
|---|
| 3318 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3319 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3320 | talloc_free(r);
|
|---|
| 3321 | return false;
|
|---|
| 3322 | }
|
|---|
| 3323 |
|
|---|
| 3324 | blob = ndr_push_blob(push);
|
|---|
| 3325 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3326 | talloc_free(r);
|
|---|
| 3327 | return false;
|
|---|
| 3328 | }
|
|---|
| 3329 |
|
|---|
| 3330 | talloc_free(r);
|
|---|
| 3331 |
|
|---|
| 3332 | return true;
|
|---|
| 3333 | }
|
|---|
| 3334 |
|
|---|
| 3335 | static bool api_samr_TestPrivateFunctionsDomain(pipes_struct *p)
|
|---|
| 3336 | {
|
|---|
| 3337 | const struct ndr_interface_call *call;
|
|---|
| 3338 | struct ndr_pull *pull;
|
|---|
| 3339 | struct ndr_push *push;
|
|---|
| 3340 | enum ndr_err_code ndr_err;
|
|---|
| 3341 | DATA_BLOB blob;
|
|---|
| 3342 | struct samr_TestPrivateFunctionsDomain *r;
|
|---|
| 3343 |
|
|---|
| 3344 | call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN];
|
|---|
| 3345 |
|
|---|
| 3346 | r = talloc(talloc_tos(), struct samr_TestPrivateFunctionsDomain);
|
|---|
| 3347 | if (r == NULL) {
|
|---|
| 3348 | return false;
|
|---|
| 3349 | }
|
|---|
| 3350 |
|
|---|
| 3351 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3352 | talloc_free(r);
|
|---|
| 3353 | return false;
|
|---|
| 3354 | }
|
|---|
| 3355 |
|
|---|
| 3356 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3357 | if (pull == NULL) {
|
|---|
| 3358 | talloc_free(r);
|
|---|
| 3359 | return false;
|
|---|
| 3360 | }
|
|---|
| 3361 |
|
|---|
| 3362 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3363 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3364 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3365 | talloc_free(r);
|
|---|
| 3366 | return false;
|
|---|
| 3367 | }
|
|---|
| 3368 |
|
|---|
| 3369 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3370 | NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, r);
|
|---|
| 3371 | }
|
|---|
| 3372 |
|
|---|
| 3373 | r->out.result = _samr_TestPrivateFunctionsDomain(p, r);
|
|---|
| 3374 |
|
|---|
| 3375 | if (p->rng_fault_state) {
|
|---|
| 3376 | talloc_free(r);
|
|---|
| 3377 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3378 | return true;
|
|---|
| 3379 | }
|
|---|
| 3380 |
|
|---|
| 3381 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3382 | NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, r);
|
|---|
| 3383 | }
|
|---|
| 3384 |
|
|---|
| 3385 | push = ndr_push_init_ctx(r);
|
|---|
| 3386 | if (push == NULL) {
|
|---|
| 3387 | talloc_free(r);
|
|---|
| 3388 | return false;
|
|---|
| 3389 | }
|
|---|
| 3390 |
|
|---|
| 3391 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3392 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3393 | talloc_free(r);
|
|---|
| 3394 | return false;
|
|---|
| 3395 | }
|
|---|
| 3396 |
|
|---|
| 3397 | blob = ndr_push_blob(push);
|
|---|
| 3398 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3399 | talloc_free(r);
|
|---|
| 3400 | return false;
|
|---|
| 3401 | }
|
|---|
| 3402 |
|
|---|
| 3403 | talloc_free(r);
|
|---|
| 3404 |
|
|---|
| 3405 | return true;
|
|---|
| 3406 | }
|
|---|
| 3407 |
|
|---|
| 3408 | static bool api_samr_TestPrivateFunctionsUser(pipes_struct *p)
|
|---|
| 3409 | {
|
|---|
| 3410 | const struct ndr_interface_call *call;
|
|---|
| 3411 | struct ndr_pull *pull;
|
|---|
| 3412 | struct ndr_push *push;
|
|---|
| 3413 | enum ndr_err_code ndr_err;
|
|---|
| 3414 | DATA_BLOB blob;
|
|---|
| 3415 | struct samr_TestPrivateFunctionsUser *r;
|
|---|
| 3416 |
|
|---|
| 3417 | call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSUSER];
|
|---|
| 3418 |
|
|---|
| 3419 | r = talloc(talloc_tos(), struct samr_TestPrivateFunctionsUser);
|
|---|
| 3420 | if (r == NULL) {
|
|---|
| 3421 | return false;
|
|---|
| 3422 | }
|
|---|
| 3423 |
|
|---|
| 3424 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3425 | talloc_free(r);
|
|---|
| 3426 | return false;
|
|---|
| 3427 | }
|
|---|
| 3428 |
|
|---|
| 3429 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3430 | if (pull == NULL) {
|
|---|
| 3431 | talloc_free(r);
|
|---|
| 3432 | return false;
|
|---|
| 3433 | }
|
|---|
| 3434 |
|
|---|
| 3435 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3436 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3437 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3438 | talloc_free(r);
|
|---|
| 3439 | return false;
|
|---|
| 3440 | }
|
|---|
| 3441 |
|
|---|
| 3442 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3443 | NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, r);
|
|---|
| 3444 | }
|
|---|
| 3445 |
|
|---|
| 3446 | r->out.result = _samr_TestPrivateFunctionsUser(p, r);
|
|---|
| 3447 |
|
|---|
| 3448 | if (p->rng_fault_state) {
|
|---|
| 3449 | talloc_free(r);
|
|---|
| 3450 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3451 | return true;
|
|---|
| 3452 | }
|
|---|
| 3453 |
|
|---|
| 3454 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3455 | NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, r);
|
|---|
| 3456 | }
|
|---|
| 3457 |
|
|---|
| 3458 | push = ndr_push_init_ctx(r);
|
|---|
| 3459 | if (push == NULL) {
|
|---|
| 3460 | talloc_free(r);
|
|---|
| 3461 | return false;
|
|---|
| 3462 | }
|
|---|
| 3463 |
|
|---|
| 3464 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3465 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3466 | talloc_free(r);
|
|---|
| 3467 | return false;
|
|---|
| 3468 | }
|
|---|
| 3469 |
|
|---|
| 3470 | blob = ndr_push_blob(push);
|
|---|
| 3471 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3472 | talloc_free(r);
|
|---|
| 3473 | return false;
|
|---|
| 3474 | }
|
|---|
| 3475 |
|
|---|
| 3476 | talloc_free(r);
|
|---|
| 3477 |
|
|---|
| 3478 | return true;
|
|---|
| 3479 | }
|
|---|
| 3480 |
|
|---|
| 3481 | static bool api_samr_GetUserPwInfo(pipes_struct *p)
|
|---|
| 3482 | {
|
|---|
| 3483 | const struct ndr_interface_call *call;
|
|---|
| 3484 | struct ndr_pull *pull;
|
|---|
| 3485 | struct ndr_push *push;
|
|---|
| 3486 | enum ndr_err_code ndr_err;
|
|---|
| 3487 | DATA_BLOB blob;
|
|---|
| 3488 | struct samr_GetUserPwInfo *r;
|
|---|
| 3489 |
|
|---|
| 3490 | call = &ndr_table_samr.calls[NDR_SAMR_GETUSERPWINFO];
|
|---|
| 3491 |
|
|---|
| 3492 | r = talloc(talloc_tos(), struct samr_GetUserPwInfo);
|
|---|
| 3493 | if (r == NULL) {
|
|---|
| 3494 | return false;
|
|---|
| 3495 | }
|
|---|
| 3496 |
|
|---|
| 3497 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3498 | talloc_free(r);
|
|---|
| 3499 | return false;
|
|---|
| 3500 | }
|
|---|
| 3501 |
|
|---|
| 3502 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3503 | if (pull == NULL) {
|
|---|
| 3504 | talloc_free(r);
|
|---|
| 3505 | return false;
|
|---|
| 3506 | }
|
|---|
| 3507 |
|
|---|
| 3508 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3509 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3510 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3511 | talloc_free(r);
|
|---|
| 3512 | return false;
|
|---|
| 3513 | }
|
|---|
| 3514 |
|
|---|
| 3515 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3516 | NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, r);
|
|---|
| 3517 | }
|
|---|
| 3518 |
|
|---|
| 3519 | ZERO_STRUCT(r->out);
|
|---|
| 3520 | r->out.info = talloc_zero(r, struct samr_PwInfo);
|
|---|
| 3521 | if (r->out.info == NULL) {
|
|---|
| 3522 | talloc_free(r);
|
|---|
| 3523 | return false;
|
|---|
| 3524 | }
|
|---|
| 3525 |
|
|---|
| 3526 | r->out.result = _samr_GetUserPwInfo(p, r);
|
|---|
| 3527 |
|
|---|
| 3528 | if (p->rng_fault_state) {
|
|---|
| 3529 | talloc_free(r);
|
|---|
| 3530 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3531 | return true;
|
|---|
| 3532 | }
|
|---|
| 3533 |
|
|---|
| 3534 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3535 | NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, r);
|
|---|
| 3536 | }
|
|---|
| 3537 |
|
|---|
| 3538 | push = ndr_push_init_ctx(r);
|
|---|
| 3539 | if (push == NULL) {
|
|---|
| 3540 | talloc_free(r);
|
|---|
| 3541 | return false;
|
|---|
| 3542 | }
|
|---|
| 3543 |
|
|---|
| 3544 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3545 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3546 | talloc_free(r);
|
|---|
| 3547 | return false;
|
|---|
| 3548 | }
|
|---|
| 3549 |
|
|---|
| 3550 | blob = ndr_push_blob(push);
|
|---|
| 3551 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3552 | talloc_free(r);
|
|---|
| 3553 | return false;
|
|---|
| 3554 | }
|
|---|
| 3555 |
|
|---|
| 3556 | talloc_free(r);
|
|---|
| 3557 |
|
|---|
| 3558 | return true;
|
|---|
| 3559 | }
|
|---|
| 3560 |
|
|---|
| 3561 | static bool api_samr_RemoveMemberFromForeignDomain(pipes_struct *p)
|
|---|
| 3562 | {
|
|---|
| 3563 | const struct ndr_interface_call *call;
|
|---|
| 3564 | struct ndr_pull *pull;
|
|---|
| 3565 | struct ndr_push *push;
|
|---|
| 3566 | enum ndr_err_code ndr_err;
|
|---|
| 3567 | DATA_BLOB blob;
|
|---|
| 3568 | struct samr_RemoveMemberFromForeignDomain *r;
|
|---|
| 3569 |
|
|---|
| 3570 | call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN];
|
|---|
| 3571 |
|
|---|
| 3572 | r = talloc(talloc_tos(), struct samr_RemoveMemberFromForeignDomain);
|
|---|
| 3573 | if (r == NULL) {
|
|---|
| 3574 | return false;
|
|---|
| 3575 | }
|
|---|
| 3576 |
|
|---|
| 3577 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3578 | talloc_free(r);
|
|---|
| 3579 | return false;
|
|---|
| 3580 | }
|
|---|
| 3581 |
|
|---|
| 3582 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3583 | if (pull == NULL) {
|
|---|
| 3584 | talloc_free(r);
|
|---|
| 3585 | return false;
|
|---|
| 3586 | }
|
|---|
| 3587 |
|
|---|
| 3588 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3589 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3590 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3591 | talloc_free(r);
|
|---|
| 3592 | return false;
|
|---|
| 3593 | }
|
|---|
| 3594 |
|
|---|
| 3595 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3596 | NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, r);
|
|---|
| 3597 | }
|
|---|
| 3598 |
|
|---|
| 3599 | r->out.result = _samr_RemoveMemberFromForeignDomain(p, r);
|
|---|
| 3600 |
|
|---|
| 3601 | if (p->rng_fault_state) {
|
|---|
| 3602 | talloc_free(r);
|
|---|
| 3603 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3604 | return true;
|
|---|
| 3605 | }
|
|---|
| 3606 |
|
|---|
| 3607 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3608 | NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, r);
|
|---|
| 3609 | }
|
|---|
| 3610 |
|
|---|
| 3611 | push = ndr_push_init_ctx(r);
|
|---|
| 3612 | if (push == NULL) {
|
|---|
| 3613 | talloc_free(r);
|
|---|
| 3614 | return false;
|
|---|
| 3615 | }
|
|---|
| 3616 |
|
|---|
| 3617 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3618 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3619 | talloc_free(r);
|
|---|
| 3620 | return false;
|
|---|
| 3621 | }
|
|---|
| 3622 |
|
|---|
| 3623 | blob = ndr_push_blob(push);
|
|---|
| 3624 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3625 | talloc_free(r);
|
|---|
| 3626 | return false;
|
|---|
| 3627 | }
|
|---|
| 3628 |
|
|---|
| 3629 | talloc_free(r);
|
|---|
| 3630 |
|
|---|
| 3631 | return true;
|
|---|
| 3632 | }
|
|---|
| 3633 |
|
|---|
| 3634 | static bool api_samr_QueryDomainInfo2(pipes_struct *p)
|
|---|
| 3635 | {
|
|---|
| 3636 | const struct ndr_interface_call *call;
|
|---|
| 3637 | struct ndr_pull *pull;
|
|---|
| 3638 | struct ndr_push *push;
|
|---|
| 3639 | enum ndr_err_code ndr_err;
|
|---|
| 3640 | DATA_BLOB blob;
|
|---|
| 3641 | struct samr_QueryDomainInfo2 *r;
|
|---|
| 3642 |
|
|---|
| 3643 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO2];
|
|---|
| 3644 |
|
|---|
| 3645 | r = talloc(talloc_tos(), struct samr_QueryDomainInfo2);
|
|---|
| 3646 | if (r == NULL) {
|
|---|
| 3647 | return false;
|
|---|
| 3648 | }
|
|---|
| 3649 |
|
|---|
| 3650 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3651 | talloc_free(r);
|
|---|
| 3652 | return false;
|
|---|
| 3653 | }
|
|---|
| 3654 |
|
|---|
| 3655 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3656 | if (pull == NULL) {
|
|---|
| 3657 | talloc_free(r);
|
|---|
| 3658 | return false;
|
|---|
| 3659 | }
|
|---|
| 3660 |
|
|---|
| 3661 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3662 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3663 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3664 | talloc_free(r);
|
|---|
| 3665 | return false;
|
|---|
| 3666 | }
|
|---|
| 3667 |
|
|---|
| 3668 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3669 | NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, r);
|
|---|
| 3670 | }
|
|---|
| 3671 |
|
|---|
| 3672 | ZERO_STRUCT(r->out);
|
|---|
| 3673 | r->out.info = talloc_zero(r, union samr_DomainInfo *);
|
|---|
| 3674 | if (r->out.info == NULL) {
|
|---|
| 3675 | talloc_free(r);
|
|---|
| 3676 | return false;
|
|---|
| 3677 | }
|
|---|
| 3678 |
|
|---|
| 3679 | r->out.result = _samr_QueryDomainInfo2(p, r);
|
|---|
| 3680 |
|
|---|
| 3681 | if (p->rng_fault_state) {
|
|---|
| 3682 | talloc_free(r);
|
|---|
| 3683 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3684 | return true;
|
|---|
| 3685 | }
|
|---|
| 3686 |
|
|---|
| 3687 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3688 | NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, r);
|
|---|
| 3689 | }
|
|---|
| 3690 |
|
|---|
| 3691 | push = ndr_push_init_ctx(r);
|
|---|
| 3692 | if (push == NULL) {
|
|---|
| 3693 | talloc_free(r);
|
|---|
| 3694 | return false;
|
|---|
| 3695 | }
|
|---|
| 3696 |
|
|---|
| 3697 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3698 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3699 | talloc_free(r);
|
|---|
| 3700 | return false;
|
|---|
| 3701 | }
|
|---|
| 3702 |
|
|---|
| 3703 | blob = ndr_push_blob(push);
|
|---|
| 3704 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3705 | talloc_free(r);
|
|---|
| 3706 | return false;
|
|---|
| 3707 | }
|
|---|
| 3708 |
|
|---|
| 3709 | talloc_free(r);
|
|---|
| 3710 |
|
|---|
| 3711 | return true;
|
|---|
| 3712 | }
|
|---|
| 3713 |
|
|---|
| 3714 | static bool api_samr_QueryUserInfo2(pipes_struct *p)
|
|---|
| 3715 | {
|
|---|
| 3716 | const struct ndr_interface_call *call;
|
|---|
| 3717 | struct ndr_pull *pull;
|
|---|
| 3718 | struct ndr_push *push;
|
|---|
| 3719 | enum ndr_err_code ndr_err;
|
|---|
| 3720 | DATA_BLOB blob;
|
|---|
| 3721 | struct samr_QueryUserInfo2 *r;
|
|---|
| 3722 |
|
|---|
| 3723 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO2];
|
|---|
| 3724 |
|
|---|
| 3725 | r = talloc(talloc_tos(), struct samr_QueryUserInfo2);
|
|---|
| 3726 | if (r == NULL) {
|
|---|
| 3727 | return false;
|
|---|
| 3728 | }
|
|---|
| 3729 |
|
|---|
| 3730 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3731 | talloc_free(r);
|
|---|
| 3732 | return false;
|
|---|
| 3733 | }
|
|---|
| 3734 |
|
|---|
| 3735 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3736 | if (pull == NULL) {
|
|---|
| 3737 | talloc_free(r);
|
|---|
| 3738 | return false;
|
|---|
| 3739 | }
|
|---|
| 3740 |
|
|---|
| 3741 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3742 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3743 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3744 | talloc_free(r);
|
|---|
| 3745 | return false;
|
|---|
| 3746 | }
|
|---|
| 3747 |
|
|---|
| 3748 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3749 | NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, r);
|
|---|
| 3750 | }
|
|---|
| 3751 |
|
|---|
| 3752 | ZERO_STRUCT(r->out);
|
|---|
| 3753 | r->out.info = talloc_zero(r, union samr_UserInfo);
|
|---|
| 3754 | if (r->out.info == NULL) {
|
|---|
| 3755 | talloc_free(r);
|
|---|
| 3756 | return false;
|
|---|
| 3757 | }
|
|---|
| 3758 |
|
|---|
| 3759 | r->out.result = _samr_QueryUserInfo2(p, r);
|
|---|
| 3760 |
|
|---|
| 3761 | if (p->rng_fault_state) {
|
|---|
| 3762 | talloc_free(r);
|
|---|
| 3763 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3764 | return true;
|
|---|
| 3765 | }
|
|---|
| 3766 |
|
|---|
| 3767 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3768 | NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, r);
|
|---|
| 3769 | }
|
|---|
| 3770 |
|
|---|
| 3771 | push = ndr_push_init_ctx(r);
|
|---|
| 3772 | if (push == NULL) {
|
|---|
| 3773 | talloc_free(r);
|
|---|
| 3774 | return false;
|
|---|
| 3775 | }
|
|---|
| 3776 |
|
|---|
| 3777 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3778 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3779 | talloc_free(r);
|
|---|
| 3780 | return false;
|
|---|
| 3781 | }
|
|---|
| 3782 |
|
|---|
| 3783 | blob = ndr_push_blob(push);
|
|---|
| 3784 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3785 | talloc_free(r);
|
|---|
| 3786 | return false;
|
|---|
| 3787 | }
|
|---|
| 3788 |
|
|---|
| 3789 | talloc_free(r);
|
|---|
| 3790 |
|
|---|
| 3791 | return true;
|
|---|
| 3792 | }
|
|---|
| 3793 |
|
|---|
| 3794 | static bool api_samr_QueryDisplayInfo2(pipes_struct *p)
|
|---|
| 3795 | {
|
|---|
| 3796 | const struct ndr_interface_call *call;
|
|---|
| 3797 | struct ndr_pull *pull;
|
|---|
| 3798 | struct ndr_push *push;
|
|---|
| 3799 | enum ndr_err_code ndr_err;
|
|---|
| 3800 | DATA_BLOB blob;
|
|---|
| 3801 | struct samr_QueryDisplayInfo2 *r;
|
|---|
| 3802 |
|
|---|
| 3803 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO2];
|
|---|
| 3804 |
|
|---|
| 3805 | r = talloc(talloc_tos(), struct samr_QueryDisplayInfo2);
|
|---|
| 3806 | if (r == NULL) {
|
|---|
| 3807 | return false;
|
|---|
| 3808 | }
|
|---|
| 3809 |
|
|---|
| 3810 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3811 | talloc_free(r);
|
|---|
| 3812 | return false;
|
|---|
| 3813 | }
|
|---|
| 3814 |
|
|---|
| 3815 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3816 | if (pull == NULL) {
|
|---|
| 3817 | talloc_free(r);
|
|---|
| 3818 | return false;
|
|---|
| 3819 | }
|
|---|
| 3820 |
|
|---|
| 3821 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3822 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3823 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3824 | talloc_free(r);
|
|---|
| 3825 | return false;
|
|---|
| 3826 | }
|
|---|
| 3827 |
|
|---|
| 3828 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3829 | NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, r);
|
|---|
| 3830 | }
|
|---|
| 3831 |
|
|---|
| 3832 | ZERO_STRUCT(r->out);
|
|---|
| 3833 | r->out.total_size = talloc_zero(r, uint32_t);
|
|---|
| 3834 | if (r->out.total_size == NULL) {
|
|---|
| 3835 | talloc_free(r);
|
|---|
| 3836 | return false;
|
|---|
| 3837 | }
|
|---|
| 3838 |
|
|---|
| 3839 | r->out.returned_size = talloc_zero(r, uint32_t);
|
|---|
| 3840 | if (r->out.returned_size == NULL) {
|
|---|
| 3841 | talloc_free(r);
|
|---|
| 3842 | return false;
|
|---|
| 3843 | }
|
|---|
| 3844 |
|
|---|
| 3845 | r->out.info = talloc_zero(r, union samr_DispInfo);
|
|---|
| 3846 | if (r->out.info == NULL) {
|
|---|
| 3847 | talloc_free(r);
|
|---|
| 3848 | return false;
|
|---|
| 3849 | }
|
|---|
| 3850 |
|
|---|
| 3851 | r->out.result = _samr_QueryDisplayInfo2(p, r);
|
|---|
| 3852 |
|
|---|
| 3853 | if (p->rng_fault_state) {
|
|---|
| 3854 | talloc_free(r);
|
|---|
| 3855 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3856 | return true;
|
|---|
| 3857 | }
|
|---|
| 3858 |
|
|---|
| 3859 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3860 | NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, r);
|
|---|
| 3861 | }
|
|---|
| 3862 |
|
|---|
| 3863 | push = ndr_push_init_ctx(r);
|
|---|
| 3864 | if (push == NULL) {
|
|---|
| 3865 | talloc_free(r);
|
|---|
| 3866 | return false;
|
|---|
| 3867 | }
|
|---|
| 3868 |
|
|---|
| 3869 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3870 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3871 | talloc_free(r);
|
|---|
| 3872 | return false;
|
|---|
| 3873 | }
|
|---|
| 3874 |
|
|---|
| 3875 | blob = ndr_push_blob(push);
|
|---|
| 3876 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3877 | talloc_free(r);
|
|---|
| 3878 | return false;
|
|---|
| 3879 | }
|
|---|
| 3880 |
|
|---|
| 3881 | talloc_free(r);
|
|---|
| 3882 |
|
|---|
| 3883 | return true;
|
|---|
| 3884 | }
|
|---|
| 3885 |
|
|---|
| 3886 | static bool api_samr_GetDisplayEnumerationIndex2(pipes_struct *p)
|
|---|
| 3887 | {
|
|---|
| 3888 | const struct ndr_interface_call *call;
|
|---|
| 3889 | struct ndr_pull *pull;
|
|---|
| 3890 | struct ndr_push *push;
|
|---|
| 3891 | enum ndr_err_code ndr_err;
|
|---|
| 3892 | DATA_BLOB blob;
|
|---|
| 3893 | struct samr_GetDisplayEnumerationIndex2 *r;
|
|---|
| 3894 |
|
|---|
| 3895 | call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX2];
|
|---|
| 3896 |
|
|---|
| 3897 | r = talloc(talloc_tos(), struct samr_GetDisplayEnumerationIndex2);
|
|---|
| 3898 | if (r == NULL) {
|
|---|
| 3899 | return false;
|
|---|
| 3900 | }
|
|---|
| 3901 |
|
|---|
| 3902 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3903 | talloc_free(r);
|
|---|
| 3904 | return false;
|
|---|
| 3905 | }
|
|---|
| 3906 |
|
|---|
| 3907 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3908 | if (pull == NULL) {
|
|---|
| 3909 | talloc_free(r);
|
|---|
| 3910 | return false;
|
|---|
| 3911 | }
|
|---|
| 3912 |
|
|---|
| 3913 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3914 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3915 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3916 | talloc_free(r);
|
|---|
| 3917 | return false;
|
|---|
| 3918 | }
|
|---|
| 3919 |
|
|---|
| 3920 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3921 | NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, r);
|
|---|
| 3922 | }
|
|---|
| 3923 |
|
|---|
| 3924 | ZERO_STRUCT(r->out);
|
|---|
| 3925 | r->out.idx = talloc_zero(r, uint32_t);
|
|---|
| 3926 | if (r->out.idx == NULL) {
|
|---|
| 3927 | talloc_free(r);
|
|---|
| 3928 | return false;
|
|---|
| 3929 | }
|
|---|
| 3930 |
|
|---|
| 3931 | r->out.result = _samr_GetDisplayEnumerationIndex2(p, r);
|
|---|
| 3932 |
|
|---|
| 3933 | if (p->rng_fault_state) {
|
|---|
| 3934 | talloc_free(r);
|
|---|
| 3935 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 3936 | return true;
|
|---|
| 3937 | }
|
|---|
| 3938 |
|
|---|
| 3939 | if (DEBUGLEVEL >= 10) {
|
|---|
| 3940 | NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, r);
|
|---|
| 3941 | }
|
|---|
| 3942 |
|
|---|
| 3943 | push = ndr_push_init_ctx(r);
|
|---|
| 3944 | if (push == NULL) {
|
|---|
| 3945 | talloc_free(r);
|
|---|
| 3946 | return false;
|
|---|
| 3947 | }
|
|---|
| 3948 |
|
|---|
| 3949 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 3950 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3951 | talloc_free(r);
|
|---|
| 3952 | return false;
|
|---|
| 3953 | }
|
|---|
| 3954 |
|
|---|
| 3955 | blob = ndr_push_blob(push);
|
|---|
| 3956 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 3957 | talloc_free(r);
|
|---|
| 3958 | return false;
|
|---|
| 3959 | }
|
|---|
| 3960 |
|
|---|
| 3961 | talloc_free(r);
|
|---|
| 3962 |
|
|---|
| 3963 | return true;
|
|---|
| 3964 | }
|
|---|
| 3965 |
|
|---|
| 3966 | static bool api_samr_CreateUser2(pipes_struct *p)
|
|---|
| 3967 | {
|
|---|
| 3968 | const struct ndr_interface_call *call;
|
|---|
| 3969 | struct ndr_pull *pull;
|
|---|
| 3970 | struct ndr_push *push;
|
|---|
| 3971 | enum ndr_err_code ndr_err;
|
|---|
| 3972 | DATA_BLOB blob;
|
|---|
| 3973 | struct samr_CreateUser2 *r;
|
|---|
| 3974 |
|
|---|
| 3975 | call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER2];
|
|---|
| 3976 |
|
|---|
| 3977 | r = talloc(talloc_tos(), struct samr_CreateUser2);
|
|---|
| 3978 | if (r == NULL) {
|
|---|
| 3979 | return false;
|
|---|
| 3980 | }
|
|---|
| 3981 |
|
|---|
| 3982 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 3983 | talloc_free(r);
|
|---|
| 3984 | return false;
|
|---|
| 3985 | }
|
|---|
| 3986 |
|
|---|
| 3987 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 3988 | if (pull == NULL) {
|
|---|
| 3989 | talloc_free(r);
|
|---|
| 3990 | return false;
|
|---|
| 3991 | }
|
|---|
| 3992 |
|
|---|
| 3993 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 3994 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 3995 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 3996 | talloc_free(r);
|
|---|
| 3997 | return false;
|
|---|
| 3998 | }
|
|---|
| 3999 |
|
|---|
| 4000 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4001 | NDR_PRINT_IN_DEBUG(samr_CreateUser2, r);
|
|---|
| 4002 | }
|
|---|
| 4003 |
|
|---|
| 4004 | ZERO_STRUCT(r->out);
|
|---|
| 4005 | r->out.user_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 4006 | if (r->out.user_handle == NULL) {
|
|---|
| 4007 | talloc_free(r);
|
|---|
| 4008 | return false;
|
|---|
| 4009 | }
|
|---|
| 4010 |
|
|---|
| 4011 | r->out.access_granted = talloc_zero(r, uint32_t);
|
|---|
| 4012 | if (r->out.access_granted == NULL) {
|
|---|
| 4013 | talloc_free(r);
|
|---|
| 4014 | return false;
|
|---|
| 4015 | }
|
|---|
| 4016 |
|
|---|
| 4017 | r->out.rid = talloc_zero(r, uint32_t);
|
|---|
| 4018 | if (r->out.rid == NULL) {
|
|---|
| 4019 | talloc_free(r);
|
|---|
| 4020 | return false;
|
|---|
| 4021 | }
|
|---|
| 4022 |
|
|---|
| 4023 | r->out.result = _samr_CreateUser2(p, r);
|
|---|
| 4024 |
|
|---|
| 4025 | if (p->rng_fault_state) {
|
|---|
| 4026 | talloc_free(r);
|
|---|
| 4027 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4028 | return true;
|
|---|
| 4029 | }
|
|---|
| 4030 |
|
|---|
| 4031 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4032 | NDR_PRINT_OUT_DEBUG(samr_CreateUser2, r);
|
|---|
| 4033 | }
|
|---|
| 4034 |
|
|---|
| 4035 | push = ndr_push_init_ctx(r);
|
|---|
| 4036 | if (push == NULL) {
|
|---|
| 4037 | talloc_free(r);
|
|---|
| 4038 | return false;
|
|---|
| 4039 | }
|
|---|
| 4040 |
|
|---|
| 4041 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4042 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4043 | talloc_free(r);
|
|---|
| 4044 | return false;
|
|---|
| 4045 | }
|
|---|
| 4046 |
|
|---|
| 4047 | blob = ndr_push_blob(push);
|
|---|
| 4048 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4049 | talloc_free(r);
|
|---|
| 4050 | return false;
|
|---|
| 4051 | }
|
|---|
| 4052 |
|
|---|
| 4053 | talloc_free(r);
|
|---|
| 4054 |
|
|---|
| 4055 | return true;
|
|---|
| 4056 | }
|
|---|
| 4057 |
|
|---|
| 4058 | static bool api_samr_QueryDisplayInfo3(pipes_struct *p)
|
|---|
| 4059 | {
|
|---|
| 4060 | const struct ndr_interface_call *call;
|
|---|
| 4061 | struct ndr_pull *pull;
|
|---|
| 4062 | struct ndr_push *push;
|
|---|
| 4063 | enum ndr_err_code ndr_err;
|
|---|
| 4064 | DATA_BLOB blob;
|
|---|
| 4065 | struct samr_QueryDisplayInfo3 *r;
|
|---|
| 4066 |
|
|---|
| 4067 | call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO3];
|
|---|
| 4068 |
|
|---|
| 4069 | r = talloc(talloc_tos(), struct samr_QueryDisplayInfo3);
|
|---|
| 4070 | if (r == NULL) {
|
|---|
| 4071 | return false;
|
|---|
| 4072 | }
|
|---|
| 4073 |
|
|---|
| 4074 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4075 | talloc_free(r);
|
|---|
| 4076 | return false;
|
|---|
| 4077 | }
|
|---|
| 4078 |
|
|---|
| 4079 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4080 | if (pull == NULL) {
|
|---|
| 4081 | talloc_free(r);
|
|---|
| 4082 | return false;
|
|---|
| 4083 | }
|
|---|
| 4084 |
|
|---|
| 4085 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4086 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4087 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4088 | talloc_free(r);
|
|---|
| 4089 | return false;
|
|---|
| 4090 | }
|
|---|
| 4091 |
|
|---|
| 4092 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4093 | NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, r);
|
|---|
| 4094 | }
|
|---|
| 4095 |
|
|---|
| 4096 | ZERO_STRUCT(r->out);
|
|---|
| 4097 | r->out.total_size = talloc_zero(r, uint32_t);
|
|---|
| 4098 | if (r->out.total_size == NULL) {
|
|---|
| 4099 | talloc_free(r);
|
|---|
| 4100 | return false;
|
|---|
| 4101 | }
|
|---|
| 4102 |
|
|---|
| 4103 | r->out.returned_size = talloc_zero(r, uint32_t);
|
|---|
| 4104 | if (r->out.returned_size == NULL) {
|
|---|
| 4105 | talloc_free(r);
|
|---|
| 4106 | return false;
|
|---|
| 4107 | }
|
|---|
| 4108 |
|
|---|
| 4109 | r->out.info = talloc_zero(r, union samr_DispInfo);
|
|---|
| 4110 | if (r->out.info == NULL) {
|
|---|
| 4111 | talloc_free(r);
|
|---|
| 4112 | return false;
|
|---|
| 4113 | }
|
|---|
| 4114 |
|
|---|
| 4115 | r->out.result = _samr_QueryDisplayInfo3(p, r);
|
|---|
| 4116 |
|
|---|
| 4117 | if (p->rng_fault_state) {
|
|---|
| 4118 | talloc_free(r);
|
|---|
| 4119 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4120 | return true;
|
|---|
| 4121 | }
|
|---|
| 4122 |
|
|---|
| 4123 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4124 | NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, r);
|
|---|
| 4125 | }
|
|---|
| 4126 |
|
|---|
| 4127 | push = ndr_push_init_ctx(r);
|
|---|
| 4128 | if (push == NULL) {
|
|---|
| 4129 | talloc_free(r);
|
|---|
| 4130 | return false;
|
|---|
| 4131 | }
|
|---|
| 4132 |
|
|---|
| 4133 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4134 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4135 | talloc_free(r);
|
|---|
| 4136 | return false;
|
|---|
| 4137 | }
|
|---|
| 4138 |
|
|---|
| 4139 | blob = ndr_push_blob(push);
|
|---|
| 4140 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4141 | talloc_free(r);
|
|---|
| 4142 | return false;
|
|---|
| 4143 | }
|
|---|
| 4144 |
|
|---|
| 4145 | talloc_free(r);
|
|---|
| 4146 |
|
|---|
| 4147 | return true;
|
|---|
| 4148 | }
|
|---|
| 4149 |
|
|---|
| 4150 | static bool api_samr_AddMultipleMembersToAlias(pipes_struct *p)
|
|---|
| 4151 | {
|
|---|
| 4152 | const struct ndr_interface_call *call;
|
|---|
| 4153 | struct ndr_pull *pull;
|
|---|
| 4154 | struct ndr_push *push;
|
|---|
| 4155 | enum ndr_err_code ndr_err;
|
|---|
| 4156 | DATA_BLOB blob;
|
|---|
| 4157 | struct samr_AddMultipleMembersToAlias *r;
|
|---|
| 4158 |
|
|---|
| 4159 | call = &ndr_table_samr.calls[NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS];
|
|---|
| 4160 |
|
|---|
| 4161 | r = talloc(talloc_tos(), struct samr_AddMultipleMembersToAlias);
|
|---|
| 4162 | if (r == NULL) {
|
|---|
| 4163 | return false;
|
|---|
| 4164 | }
|
|---|
| 4165 |
|
|---|
| 4166 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4167 | talloc_free(r);
|
|---|
| 4168 | return false;
|
|---|
| 4169 | }
|
|---|
| 4170 |
|
|---|
| 4171 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4172 | if (pull == NULL) {
|
|---|
| 4173 | talloc_free(r);
|
|---|
| 4174 | return false;
|
|---|
| 4175 | }
|
|---|
| 4176 |
|
|---|
| 4177 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4178 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4179 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4180 | talloc_free(r);
|
|---|
| 4181 | return false;
|
|---|
| 4182 | }
|
|---|
| 4183 |
|
|---|
| 4184 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4185 | NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, r);
|
|---|
| 4186 | }
|
|---|
| 4187 |
|
|---|
| 4188 | r->out.result = _samr_AddMultipleMembersToAlias(p, r);
|
|---|
| 4189 |
|
|---|
| 4190 | if (p->rng_fault_state) {
|
|---|
| 4191 | talloc_free(r);
|
|---|
| 4192 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4193 | return true;
|
|---|
| 4194 | }
|
|---|
| 4195 |
|
|---|
| 4196 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4197 | NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, r);
|
|---|
| 4198 | }
|
|---|
| 4199 |
|
|---|
| 4200 | push = ndr_push_init_ctx(r);
|
|---|
| 4201 | if (push == NULL) {
|
|---|
| 4202 | talloc_free(r);
|
|---|
| 4203 | return false;
|
|---|
| 4204 | }
|
|---|
| 4205 |
|
|---|
| 4206 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4207 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4208 | talloc_free(r);
|
|---|
| 4209 | return false;
|
|---|
| 4210 | }
|
|---|
| 4211 |
|
|---|
| 4212 | blob = ndr_push_blob(push);
|
|---|
| 4213 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4214 | talloc_free(r);
|
|---|
| 4215 | return false;
|
|---|
| 4216 | }
|
|---|
| 4217 |
|
|---|
| 4218 | talloc_free(r);
|
|---|
| 4219 |
|
|---|
| 4220 | return true;
|
|---|
| 4221 | }
|
|---|
| 4222 |
|
|---|
| 4223 | static bool api_samr_RemoveMultipleMembersFromAlias(pipes_struct *p)
|
|---|
| 4224 | {
|
|---|
| 4225 | const struct ndr_interface_call *call;
|
|---|
| 4226 | struct ndr_pull *pull;
|
|---|
| 4227 | struct ndr_push *push;
|
|---|
| 4228 | enum ndr_err_code ndr_err;
|
|---|
| 4229 | DATA_BLOB blob;
|
|---|
| 4230 | struct samr_RemoveMultipleMembersFromAlias *r;
|
|---|
| 4231 |
|
|---|
| 4232 | call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS];
|
|---|
| 4233 |
|
|---|
| 4234 | r = talloc(talloc_tos(), struct samr_RemoveMultipleMembersFromAlias);
|
|---|
| 4235 | if (r == NULL) {
|
|---|
| 4236 | return false;
|
|---|
| 4237 | }
|
|---|
| 4238 |
|
|---|
| 4239 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4240 | talloc_free(r);
|
|---|
| 4241 | return false;
|
|---|
| 4242 | }
|
|---|
| 4243 |
|
|---|
| 4244 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4245 | if (pull == NULL) {
|
|---|
| 4246 | talloc_free(r);
|
|---|
| 4247 | return false;
|
|---|
| 4248 | }
|
|---|
| 4249 |
|
|---|
| 4250 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4251 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4252 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4253 | talloc_free(r);
|
|---|
| 4254 | return false;
|
|---|
| 4255 | }
|
|---|
| 4256 |
|
|---|
| 4257 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4258 | NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, r);
|
|---|
| 4259 | }
|
|---|
| 4260 |
|
|---|
| 4261 | r->out.result = _samr_RemoveMultipleMembersFromAlias(p, r);
|
|---|
| 4262 |
|
|---|
| 4263 | if (p->rng_fault_state) {
|
|---|
| 4264 | talloc_free(r);
|
|---|
| 4265 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4266 | return true;
|
|---|
| 4267 | }
|
|---|
| 4268 |
|
|---|
| 4269 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4270 | NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, r);
|
|---|
| 4271 | }
|
|---|
| 4272 |
|
|---|
| 4273 | push = ndr_push_init_ctx(r);
|
|---|
| 4274 | if (push == NULL) {
|
|---|
| 4275 | talloc_free(r);
|
|---|
| 4276 | return false;
|
|---|
| 4277 | }
|
|---|
| 4278 |
|
|---|
| 4279 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4280 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4281 | talloc_free(r);
|
|---|
| 4282 | return false;
|
|---|
| 4283 | }
|
|---|
| 4284 |
|
|---|
| 4285 | blob = ndr_push_blob(push);
|
|---|
| 4286 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4287 | talloc_free(r);
|
|---|
| 4288 | return false;
|
|---|
| 4289 | }
|
|---|
| 4290 |
|
|---|
| 4291 | talloc_free(r);
|
|---|
| 4292 |
|
|---|
| 4293 | return true;
|
|---|
| 4294 | }
|
|---|
| 4295 |
|
|---|
| 4296 | static bool api_samr_OemChangePasswordUser2(pipes_struct *p)
|
|---|
| 4297 | {
|
|---|
| 4298 | const struct ndr_interface_call *call;
|
|---|
| 4299 | struct ndr_pull *pull;
|
|---|
| 4300 | struct ndr_push *push;
|
|---|
| 4301 | enum ndr_err_code ndr_err;
|
|---|
| 4302 | DATA_BLOB blob;
|
|---|
| 4303 | struct samr_OemChangePasswordUser2 *r;
|
|---|
| 4304 |
|
|---|
| 4305 | call = &ndr_table_samr.calls[NDR_SAMR_OEMCHANGEPASSWORDUSER2];
|
|---|
| 4306 |
|
|---|
| 4307 | r = talloc(talloc_tos(), struct samr_OemChangePasswordUser2);
|
|---|
| 4308 | if (r == NULL) {
|
|---|
| 4309 | return false;
|
|---|
| 4310 | }
|
|---|
| 4311 |
|
|---|
| 4312 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4313 | talloc_free(r);
|
|---|
| 4314 | return false;
|
|---|
| 4315 | }
|
|---|
| 4316 |
|
|---|
| 4317 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4318 | if (pull == NULL) {
|
|---|
| 4319 | talloc_free(r);
|
|---|
| 4320 | return false;
|
|---|
| 4321 | }
|
|---|
| 4322 |
|
|---|
| 4323 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4324 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4325 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4326 | talloc_free(r);
|
|---|
| 4327 | return false;
|
|---|
| 4328 | }
|
|---|
| 4329 |
|
|---|
| 4330 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4331 | NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, r);
|
|---|
| 4332 | }
|
|---|
| 4333 |
|
|---|
| 4334 | r->out.result = _samr_OemChangePasswordUser2(p, r);
|
|---|
| 4335 |
|
|---|
| 4336 | if (p->rng_fault_state) {
|
|---|
| 4337 | talloc_free(r);
|
|---|
| 4338 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4339 | return true;
|
|---|
| 4340 | }
|
|---|
| 4341 |
|
|---|
| 4342 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4343 | NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, r);
|
|---|
| 4344 | }
|
|---|
| 4345 |
|
|---|
| 4346 | push = ndr_push_init_ctx(r);
|
|---|
| 4347 | if (push == NULL) {
|
|---|
| 4348 | talloc_free(r);
|
|---|
| 4349 | return false;
|
|---|
| 4350 | }
|
|---|
| 4351 |
|
|---|
| 4352 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4353 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4354 | talloc_free(r);
|
|---|
| 4355 | return false;
|
|---|
| 4356 | }
|
|---|
| 4357 |
|
|---|
| 4358 | blob = ndr_push_blob(push);
|
|---|
| 4359 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4360 | talloc_free(r);
|
|---|
| 4361 | return false;
|
|---|
| 4362 | }
|
|---|
| 4363 |
|
|---|
| 4364 | talloc_free(r);
|
|---|
| 4365 |
|
|---|
| 4366 | return true;
|
|---|
| 4367 | }
|
|---|
| 4368 |
|
|---|
| 4369 | static bool api_samr_ChangePasswordUser2(pipes_struct *p)
|
|---|
| 4370 | {
|
|---|
| 4371 | const struct ndr_interface_call *call;
|
|---|
| 4372 | struct ndr_pull *pull;
|
|---|
| 4373 | struct ndr_push *push;
|
|---|
| 4374 | enum ndr_err_code ndr_err;
|
|---|
| 4375 | DATA_BLOB blob;
|
|---|
| 4376 | struct samr_ChangePasswordUser2 *r;
|
|---|
| 4377 |
|
|---|
| 4378 | call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER2];
|
|---|
| 4379 |
|
|---|
| 4380 | r = talloc(talloc_tos(), struct samr_ChangePasswordUser2);
|
|---|
| 4381 | if (r == NULL) {
|
|---|
| 4382 | return false;
|
|---|
| 4383 | }
|
|---|
| 4384 |
|
|---|
| 4385 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4386 | talloc_free(r);
|
|---|
| 4387 | return false;
|
|---|
| 4388 | }
|
|---|
| 4389 |
|
|---|
| 4390 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4391 | if (pull == NULL) {
|
|---|
| 4392 | talloc_free(r);
|
|---|
| 4393 | return false;
|
|---|
| 4394 | }
|
|---|
| 4395 |
|
|---|
| 4396 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4397 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4398 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4399 | talloc_free(r);
|
|---|
| 4400 | return false;
|
|---|
| 4401 | }
|
|---|
| 4402 |
|
|---|
| 4403 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4404 | NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, r);
|
|---|
| 4405 | }
|
|---|
| 4406 |
|
|---|
| 4407 | r->out.result = _samr_ChangePasswordUser2(p, r);
|
|---|
| 4408 |
|
|---|
| 4409 | if (p->rng_fault_state) {
|
|---|
| 4410 | talloc_free(r);
|
|---|
| 4411 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4412 | return true;
|
|---|
| 4413 | }
|
|---|
| 4414 |
|
|---|
| 4415 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4416 | NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, r);
|
|---|
| 4417 | }
|
|---|
| 4418 |
|
|---|
| 4419 | push = ndr_push_init_ctx(r);
|
|---|
| 4420 | if (push == NULL) {
|
|---|
| 4421 | talloc_free(r);
|
|---|
| 4422 | return false;
|
|---|
| 4423 | }
|
|---|
| 4424 |
|
|---|
| 4425 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4426 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4427 | talloc_free(r);
|
|---|
| 4428 | return false;
|
|---|
| 4429 | }
|
|---|
| 4430 |
|
|---|
| 4431 | blob = ndr_push_blob(push);
|
|---|
| 4432 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4433 | talloc_free(r);
|
|---|
| 4434 | return false;
|
|---|
| 4435 | }
|
|---|
| 4436 |
|
|---|
| 4437 | talloc_free(r);
|
|---|
| 4438 |
|
|---|
| 4439 | return true;
|
|---|
| 4440 | }
|
|---|
| 4441 |
|
|---|
| 4442 | static bool api_samr_GetDomPwInfo(pipes_struct *p)
|
|---|
| 4443 | {
|
|---|
| 4444 | const struct ndr_interface_call *call;
|
|---|
| 4445 | struct ndr_pull *pull;
|
|---|
| 4446 | struct ndr_push *push;
|
|---|
| 4447 | enum ndr_err_code ndr_err;
|
|---|
| 4448 | DATA_BLOB blob;
|
|---|
| 4449 | struct samr_GetDomPwInfo *r;
|
|---|
| 4450 |
|
|---|
| 4451 | call = &ndr_table_samr.calls[NDR_SAMR_GETDOMPWINFO];
|
|---|
| 4452 |
|
|---|
| 4453 | r = talloc(talloc_tos(), struct samr_GetDomPwInfo);
|
|---|
| 4454 | if (r == NULL) {
|
|---|
| 4455 | return false;
|
|---|
| 4456 | }
|
|---|
| 4457 |
|
|---|
| 4458 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4459 | talloc_free(r);
|
|---|
| 4460 | return false;
|
|---|
| 4461 | }
|
|---|
| 4462 |
|
|---|
| 4463 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4464 | if (pull == NULL) {
|
|---|
| 4465 | talloc_free(r);
|
|---|
| 4466 | return false;
|
|---|
| 4467 | }
|
|---|
| 4468 |
|
|---|
| 4469 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4470 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4471 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4472 | talloc_free(r);
|
|---|
| 4473 | return false;
|
|---|
| 4474 | }
|
|---|
| 4475 |
|
|---|
| 4476 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4477 | NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, r);
|
|---|
| 4478 | }
|
|---|
| 4479 |
|
|---|
| 4480 | ZERO_STRUCT(r->out);
|
|---|
| 4481 | r->out.info = talloc_zero(r, struct samr_PwInfo);
|
|---|
| 4482 | if (r->out.info == NULL) {
|
|---|
| 4483 | talloc_free(r);
|
|---|
| 4484 | return false;
|
|---|
| 4485 | }
|
|---|
| 4486 |
|
|---|
| 4487 | r->out.result = _samr_GetDomPwInfo(p, r);
|
|---|
| 4488 |
|
|---|
| 4489 | if (p->rng_fault_state) {
|
|---|
| 4490 | talloc_free(r);
|
|---|
| 4491 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4492 | return true;
|
|---|
| 4493 | }
|
|---|
| 4494 |
|
|---|
| 4495 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4496 | NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, r);
|
|---|
| 4497 | }
|
|---|
| 4498 |
|
|---|
| 4499 | push = ndr_push_init_ctx(r);
|
|---|
| 4500 | if (push == NULL) {
|
|---|
| 4501 | talloc_free(r);
|
|---|
| 4502 | return false;
|
|---|
| 4503 | }
|
|---|
| 4504 |
|
|---|
| 4505 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4506 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4507 | talloc_free(r);
|
|---|
| 4508 | return false;
|
|---|
| 4509 | }
|
|---|
| 4510 |
|
|---|
| 4511 | blob = ndr_push_blob(push);
|
|---|
| 4512 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4513 | talloc_free(r);
|
|---|
| 4514 | return false;
|
|---|
| 4515 | }
|
|---|
| 4516 |
|
|---|
| 4517 | talloc_free(r);
|
|---|
| 4518 |
|
|---|
| 4519 | return true;
|
|---|
| 4520 | }
|
|---|
| 4521 |
|
|---|
| 4522 | static bool api_samr_Connect2(pipes_struct *p)
|
|---|
| 4523 | {
|
|---|
| 4524 | const struct ndr_interface_call *call;
|
|---|
| 4525 | struct ndr_pull *pull;
|
|---|
| 4526 | struct ndr_push *push;
|
|---|
| 4527 | enum ndr_err_code ndr_err;
|
|---|
| 4528 | DATA_BLOB blob;
|
|---|
| 4529 | struct samr_Connect2 *r;
|
|---|
| 4530 |
|
|---|
| 4531 | call = &ndr_table_samr.calls[NDR_SAMR_CONNECT2];
|
|---|
| 4532 |
|
|---|
| 4533 | r = talloc(talloc_tos(), struct samr_Connect2);
|
|---|
| 4534 | if (r == NULL) {
|
|---|
| 4535 | return false;
|
|---|
| 4536 | }
|
|---|
| 4537 |
|
|---|
| 4538 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4539 | talloc_free(r);
|
|---|
| 4540 | return false;
|
|---|
| 4541 | }
|
|---|
| 4542 |
|
|---|
| 4543 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4544 | if (pull == NULL) {
|
|---|
| 4545 | talloc_free(r);
|
|---|
| 4546 | return false;
|
|---|
| 4547 | }
|
|---|
| 4548 |
|
|---|
| 4549 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4550 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4551 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4552 | talloc_free(r);
|
|---|
| 4553 | return false;
|
|---|
| 4554 | }
|
|---|
| 4555 |
|
|---|
| 4556 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4557 | NDR_PRINT_IN_DEBUG(samr_Connect2, r);
|
|---|
| 4558 | }
|
|---|
| 4559 |
|
|---|
| 4560 | ZERO_STRUCT(r->out);
|
|---|
| 4561 | r->out.connect_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 4562 | if (r->out.connect_handle == NULL) {
|
|---|
| 4563 | talloc_free(r);
|
|---|
| 4564 | return false;
|
|---|
| 4565 | }
|
|---|
| 4566 |
|
|---|
| 4567 | r->out.result = _samr_Connect2(p, r);
|
|---|
| 4568 |
|
|---|
| 4569 | if (p->rng_fault_state) {
|
|---|
| 4570 | talloc_free(r);
|
|---|
| 4571 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4572 | return true;
|
|---|
| 4573 | }
|
|---|
| 4574 |
|
|---|
| 4575 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4576 | NDR_PRINT_OUT_DEBUG(samr_Connect2, r);
|
|---|
| 4577 | }
|
|---|
| 4578 |
|
|---|
| 4579 | push = ndr_push_init_ctx(r);
|
|---|
| 4580 | if (push == NULL) {
|
|---|
| 4581 | talloc_free(r);
|
|---|
| 4582 | return false;
|
|---|
| 4583 | }
|
|---|
| 4584 |
|
|---|
| 4585 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4586 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4587 | talloc_free(r);
|
|---|
| 4588 | return false;
|
|---|
| 4589 | }
|
|---|
| 4590 |
|
|---|
| 4591 | blob = ndr_push_blob(push);
|
|---|
| 4592 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4593 | talloc_free(r);
|
|---|
| 4594 | return false;
|
|---|
| 4595 | }
|
|---|
| 4596 |
|
|---|
| 4597 | talloc_free(r);
|
|---|
| 4598 |
|
|---|
| 4599 | return true;
|
|---|
| 4600 | }
|
|---|
| 4601 |
|
|---|
| 4602 | static bool api_samr_SetUserInfo2(pipes_struct *p)
|
|---|
| 4603 | {
|
|---|
| 4604 | const struct ndr_interface_call *call;
|
|---|
| 4605 | struct ndr_pull *pull;
|
|---|
| 4606 | struct ndr_push *push;
|
|---|
| 4607 | enum ndr_err_code ndr_err;
|
|---|
| 4608 | DATA_BLOB blob;
|
|---|
| 4609 | struct samr_SetUserInfo2 *r;
|
|---|
| 4610 |
|
|---|
| 4611 | call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO2];
|
|---|
| 4612 |
|
|---|
| 4613 | r = talloc(talloc_tos(), struct samr_SetUserInfo2);
|
|---|
| 4614 | if (r == NULL) {
|
|---|
| 4615 | return false;
|
|---|
| 4616 | }
|
|---|
| 4617 |
|
|---|
| 4618 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4619 | talloc_free(r);
|
|---|
| 4620 | return false;
|
|---|
| 4621 | }
|
|---|
| 4622 |
|
|---|
| 4623 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4624 | if (pull == NULL) {
|
|---|
| 4625 | talloc_free(r);
|
|---|
| 4626 | return false;
|
|---|
| 4627 | }
|
|---|
| 4628 |
|
|---|
| 4629 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4630 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4631 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4632 | talloc_free(r);
|
|---|
| 4633 | return false;
|
|---|
| 4634 | }
|
|---|
| 4635 |
|
|---|
| 4636 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4637 | NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, r);
|
|---|
| 4638 | }
|
|---|
| 4639 |
|
|---|
| 4640 | r->out.result = _samr_SetUserInfo2(p, r);
|
|---|
| 4641 |
|
|---|
| 4642 | if (p->rng_fault_state) {
|
|---|
| 4643 | talloc_free(r);
|
|---|
| 4644 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4645 | return true;
|
|---|
| 4646 | }
|
|---|
| 4647 |
|
|---|
| 4648 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4649 | NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, r);
|
|---|
| 4650 | }
|
|---|
| 4651 |
|
|---|
| 4652 | push = ndr_push_init_ctx(r);
|
|---|
| 4653 | if (push == NULL) {
|
|---|
| 4654 | talloc_free(r);
|
|---|
| 4655 | return false;
|
|---|
| 4656 | }
|
|---|
| 4657 |
|
|---|
| 4658 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4659 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4660 | talloc_free(r);
|
|---|
| 4661 | return false;
|
|---|
| 4662 | }
|
|---|
| 4663 |
|
|---|
| 4664 | blob = ndr_push_blob(push);
|
|---|
| 4665 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4666 | talloc_free(r);
|
|---|
| 4667 | return false;
|
|---|
| 4668 | }
|
|---|
| 4669 |
|
|---|
| 4670 | talloc_free(r);
|
|---|
| 4671 |
|
|---|
| 4672 | return true;
|
|---|
| 4673 | }
|
|---|
| 4674 |
|
|---|
| 4675 | static bool api_samr_SetBootKeyInformation(pipes_struct *p)
|
|---|
| 4676 | {
|
|---|
| 4677 | const struct ndr_interface_call *call;
|
|---|
| 4678 | struct ndr_pull *pull;
|
|---|
| 4679 | struct ndr_push *push;
|
|---|
| 4680 | enum ndr_err_code ndr_err;
|
|---|
| 4681 | DATA_BLOB blob;
|
|---|
| 4682 | struct samr_SetBootKeyInformation *r;
|
|---|
| 4683 |
|
|---|
| 4684 | call = &ndr_table_samr.calls[NDR_SAMR_SETBOOTKEYINFORMATION];
|
|---|
| 4685 |
|
|---|
| 4686 | r = talloc(talloc_tos(), struct samr_SetBootKeyInformation);
|
|---|
| 4687 | if (r == NULL) {
|
|---|
| 4688 | return false;
|
|---|
| 4689 | }
|
|---|
| 4690 |
|
|---|
| 4691 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4692 | talloc_free(r);
|
|---|
| 4693 | return false;
|
|---|
| 4694 | }
|
|---|
| 4695 |
|
|---|
| 4696 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4697 | if (pull == NULL) {
|
|---|
| 4698 | talloc_free(r);
|
|---|
| 4699 | return false;
|
|---|
| 4700 | }
|
|---|
| 4701 |
|
|---|
| 4702 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4703 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4704 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4705 | talloc_free(r);
|
|---|
| 4706 | return false;
|
|---|
| 4707 | }
|
|---|
| 4708 |
|
|---|
| 4709 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4710 | NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, r);
|
|---|
| 4711 | }
|
|---|
| 4712 |
|
|---|
| 4713 | r->out.result = _samr_SetBootKeyInformation(p, r);
|
|---|
| 4714 |
|
|---|
| 4715 | if (p->rng_fault_state) {
|
|---|
| 4716 | talloc_free(r);
|
|---|
| 4717 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4718 | return true;
|
|---|
| 4719 | }
|
|---|
| 4720 |
|
|---|
| 4721 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4722 | NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, r);
|
|---|
| 4723 | }
|
|---|
| 4724 |
|
|---|
| 4725 | push = ndr_push_init_ctx(r);
|
|---|
| 4726 | if (push == NULL) {
|
|---|
| 4727 | talloc_free(r);
|
|---|
| 4728 | return false;
|
|---|
| 4729 | }
|
|---|
| 4730 |
|
|---|
| 4731 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4732 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4733 | talloc_free(r);
|
|---|
| 4734 | return false;
|
|---|
| 4735 | }
|
|---|
| 4736 |
|
|---|
| 4737 | blob = ndr_push_blob(push);
|
|---|
| 4738 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4739 | talloc_free(r);
|
|---|
| 4740 | return false;
|
|---|
| 4741 | }
|
|---|
| 4742 |
|
|---|
| 4743 | talloc_free(r);
|
|---|
| 4744 |
|
|---|
| 4745 | return true;
|
|---|
| 4746 | }
|
|---|
| 4747 |
|
|---|
| 4748 | static bool api_samr_GetBootKeyInformation(pipes_struct *p)
|
|---|
| 4749 | {
|
|---|
| 4750 | const struct ndr_interface_call *call;
|
|---|
| 4751 | struct ndr_pull *pull;
|
|---|
| 4752 | struct ndr_push *push;
|
|---|
| 4753 | enum ndr_err_code ndr_err;
|
|---|
| 4754 | DATA_BLOB blob;
|
|---|
| 4755 | struct samr_GetBootKeyInformation *r;
|
|---|
| 4756 |
|
|---|
| 4757 | call = &ndr_table_samr.calls[NDR_SAMR_GETBOOTKEYINFORMATION];
|
|---|
| 4758 |
|
|---|
| 4759 | r = talloc(talloc_tos(), struct samr_GetBootKeyInformation);
|
|---|
| 4760 | if (r == NULL) {
|
|---|
| 4761 | return false;
|
|---|
| 4762 | }
|
|---|
| 4763 |
|
|---|
| 4764 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4765 | talloc_free(r);
|
|---|
| 4766 | return false;
|
|---|
| 4767 | }
|
|---|
| 4768 |
|
|---|
| 4769 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4770 | if (pull == NULL) {
|
|---|
| 4771 | talloc_free(r);
|
|---|
| 4772 | return false;
|
|---|
| 4773 | }
|
|---|
| 4774 |
|
|---|
| 4775 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4776 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4777 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4778 | talloc_free(r);
|
|---|
| 4779 | return false;
|
|---|
| 4780 | }
|
|---|
| 4781 |
|
|---|
| 4782 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4783 | NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, r);
|
|---|
| 4784 | }
|
|---|
| 4785 |
|
|---|
| 4786 | ZERO_STRUCT(r->out);
|
|---|
| 4787 | r->out.unknown = talloc_zero(r, uint32_t);
|
|---|
| 4788 | if (r->out.unknown == NULL) {
|
|---|
| 4789 | talloc_free(r);
|
|---|
| 4790 | return false;
|
|---|
| 4791 | }
|
|---|
| 4792 |
|
|---|
| 4793 | r->out.result = _samr_GetBootKeyInformation(p, r);
|
|---|
| 4794 |
|
|---|
| 4795 | if (p->rng_fault_state) {
|
|---|
| 4796 | talloc_free(r);
|
|---|
| 4797 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4798 | return true;
|
|---|
| 4799 | }
|
|---|
| 4800 |
|
|---|
| 4801 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4802 | NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, r);
|
|---|
| 4803 | }
|
|---|
| 4804 |
|
|---|
| 4805 | push = ndr_push_init_ctx(r);
|
|---|
| 4806 | if (push == NULL) {
|
|---|
| 4807 | talloc_free(r);
|
|---|
| 4808 | return false;
|
|---|
| 4809 | }
|
|---|
| 4810 |
|
|---|
| 4811 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4812 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4813 | talloc_free(r);
|
|---|
| 4814 | return false;
|
|---|
| 4815 | }
|
|---|
| 4816 |
|
|---|
| 4817 | blob = ndr_push_blob(push);
|
|---|
| 4818 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4819 | talloc_free(r);
|
|---|
| 4820 | return false;
|
|---|
| 4821 | }
|
|---|
| 4822 |
|
|---|
| 4823 | talloc_free(r);
|
|---|
| 4824 |
|
|---|
| 4825 | return true;
|
|---|
| 4826 | }
|
|---|
| 4827 |
|
|---|
| 4828 | static bool api_samr_Connect3(pipes_struct *p)
|
|---|
| 4829 | {
|
|---|
| 4830 | const struct ndr_interface_call *call;
|
|---|
| 4831 | struct ndr_pull *pull;
|
|---|
| 4832 | struct ndr_push *push;
|
|---|
| 4833 | enum ndr_err_code ndr_err;
|
|---|
| 4834 | DATA_BLOB blob;
|
|---|
| 4835 | struct samr_Connect3 *r;
|
|---|
| 4836 |
|
|---|
| 4837 | call = &ndr_table_samr.calls[NDR_SAMR_CONNECT3];
|
|---|
| 4838 |
|
|---|
| 4839 | r = talloc(talloc_tos(), struct samr_Connect3);
|
|---|
| 4840 | if (r == NULL) {
|
|---|
| 4841 | return false;
|
|---|
| 4842 | }
|
|---|
| 4843 |
|
|---|
| 4844 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4845 | talloc_free(r);
|
|---|
| 4846 | return false;
|
|---|
| 4847 | }
|
|---|
| 4848 |
|
|---|
| 4849 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4850 | if (pull == NULL) {
|
|---|
| 4851 | talloc_free(r);
|
|---|
| 4852 | return false;
|
|---|
| 4853 | }
|
|---|
| 4854 |
|
|---|
| 4855 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4856 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4857 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4858 | talloc_free(r);
|
|---|
| 4859 | return false;
|
|---|
| 4860 | }
|
|---|
| 4861 |
|
|---|
| 4862 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4863 | NDR_PRINT_IN_DEBUG(samr_Connect3, r);
|
|---|
| 4864 | }
|
|---|
| 4865 |
|
|---|
| 4866 | ZERO_STRUCT(r->out);
|
|---|
| 4867 | r->out.connect_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 4868 | if (r->out.connect_handle == NULL) {
|
|---|
| 4869 | talloc_free(r);
|
|---|
| 4870 | return false;
|
|---|
| 4871 | }
|
|---|
| 4872 |
|
|---|
| 4873 | r->out.result = _samr_Connect3(p, r);
|
|---|
| 4874 |
|
|---|
| 4875 | if (p->rng_fault_state) {
|
|---|
| 4876 | talloc_free(r);
|
|---|
| 4877 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4878 | return true;
|
|---|
| 4879 | }
|
|---|
| 4880 |
|
|---|
| 4881 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4882 | NDR_PRINT_OUT_DEBUG(samr_Connect3, r);
|
|---|
| 4883 | }
|
|---|
| 4884 |
|
|---|
| 4885 | push = ndr_push_init_ctx(r);
|
|---|
| 4886 | if (push == NULL) {
|
|---|
| 4887 | talloc_free(r);
|
|---|
| 4888 | return false;
|
|---|
| 4889 | }
|
|---|
| 4890 |
|
|---|
| 4891 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4892 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4893 | talloc_free(r);
|
|---|
| 4894 | return false;
|
|---|
| 4895 | }
|
|---|
| 4896 |
|
|---|
| 4897 | blob = ndr_push_blob(push);
|
|---|
| 4898 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4899 | talloc_free(r);
|
|---|
| 4900 | return false;
|
|---|
| 4901 | }
|
|---|
| 4902 |
|
|---|
| 4903 | talloc_free(r);
|
|---|
| 4904 |
|
|---|
| 4905 | return true;
|
|---|
| 4906 | }
|
|---|
| 4907 |
|
|---|
| 4908 | static bool api_samr_Connect4(pipes_struct *p)
|
|---|
| 4909 | {
|
|---|
| 4910 | const struct ndr_interface_call *call;
|
|---|
| 4911 | struct ndr_pull *pull;
|
|---|
| 4912 | struct ndr_push *push;
|
|---|
| 4913 | enum ndr_err_code ndr_err;
|
|---|
| 4914 | DATA_BLOB blob;
|
|---|
| 4915 | struct samr_Connect4 *r;
|
|---|
| 4916 |
|
|---|
| 4917 | call = &ndr_table_samr.calls[NDR_SAMR_CONNECT4];
|
|---|
| 4918 |
|
|---|
| 4919 | r = talloc(talloc_tos(), struct samr_Connect4);
|
|---|
| 4920 | if (r == NULL) {
|
|---|
| 4921 | return false;
|
|---|
| 4922 | }
|
|---|
| 4923 |
|
|---|
| 4924 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 4925 | talloc_free(r);
|
|---|
| 4926 | return false;
|
|---|
| 4927 | }
|
|---|
| 4928 |
|
|---|
| 4929 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 4930 | if (pull == NULL) {
|
|---|
| 4931 | talloc_free(r);
|
|---|
| 4932 | return false;
|
|---|
| 4933 | }
|
|---|
| 4934 |
|
|---|
| 4935 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 4936 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 4937 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4938 | talloc_free(r);
|
|---|
| 4939 | return false;
|
|---|
| 4940 | }
|
|---|
| 4941 |
|
|---|
| 4942 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4943 | NDR_PRINT_IN_DEBUG(samr_Connect4, r);
|
|---|
| 4944 | }
|
|---|
| 4945 |
|
|---|
| 4946 | ZERO_STRUCT(r->out);
|
|---|
| 4947 | r->out.connect_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 4948 | if (r->out.connect_handle == NULL) {
|
|---|
| 4949 | talloc_free(r);
|
|---|
| 4950 | return false;
|
|---|
| 4951 | }
|
|---|
| 4952 |
|
|---|
| 4953 | r->out.result = _samr_Connect4(p, r);
|
|---|
| 4954 |
|
|---|
| 4955 | if (p->rng_fault_state) {
|
|---|
| 4956 | talloc_free(r);
|
|---|
| 4957 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 4958 | return true;
|
|---|
| 4959 | }
|
|---|
| 4960 |
|
|---|
| 4961 | if (DEBUGLEVEL >= 10) {
|
|---|
| 4962 | NDR_PRINT_OUT_DEBUG(samr_Connect4, r);
|
|---|
| 4963 | }
|
|---|
| 4964 |
|
|---|
| 4965 | push = ndr_push_init_ctx(r);
|
|---|
| 4966 | if (push == NULL) {
|
|---|
| 4967 | talloc_free(r);
|
|---|
| 4968 | return false;
|
|---|
| 4969 | }
|
|---|
| 4970 |
|
|---|
| 4971 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 4972 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 4973 | talloc_free(r);
|
|---|
| 4974 | return false;
|
|---|
| 4975 | }
|
|---|
| 4976 |
|
|---|
| 4977 | blob = ndr_push_blob(push);
|
|---|
| 4978 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 4979 | talloc_free(r);
|
|---|
| 4980 | return false;
|
|---|
| 4981 | }
|
|---|
| 4982 |
|
|---|
| 4983 | talloc_free(r);
|
|---|
| 4984 |
|
|---|
| 4985 | return true;
|
|---|
| 4986 | }
|
|---|
| 4987 |
|
|---|
| 4988 | static bool api_samr_ChangePasswordUser3(pipes_struct *p)
|
|---|
| 4989 | {
|
|---|
| 4990 | const struct ndr_interface_call *call;
|
|---|
| 4991 | struct ndr_pull *pull;
|
|---|
| 4992 | struct ndr_push *push;
|
|---|
| 4993 | enum ndr_err_code ndr_err;
|
|---|
| 4994 | DATA_BLOB blob;
|
|---|
| 4995 | struct samr_ChangePasswordUser3 *r;
|
|---|
| 4996 |
|
|---|
| 4997 | call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER3];
|
|---|
| 4998 |
|
|---|
| 4999 | r = talloc(talloc_tos(), struct samr_ChangePasswordUser3);
|
|---|
| 5000 | if (r == NULL) {
|
|---|
| 5001 | return false;
|
|---|
| 5002 | }
|
|---|
| 5003 |
|
|---|
| 5004 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 5005 | talloc_free(r);
|
|---|
| 5006 | return false;
|
|---|
| 5007 | }
|
|---|
| 5008 |
|
|---|
| 5009 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 5010 | if (pull == NULL) {
|
|---|
| 5011 | talloc_free(r);
|
|---|
| 5012 | return false;
|
|---|
| 5013 | }
|
|---|
| 5014 |
|
|---|
| 5015 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 5016 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 5017 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5018 | talloc_free(r);
|
|---|
| 5019 | return false;
|
|---|
| 5020 | }
|
|---|
| 5021 |
|
|---|
| 5022 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5023 | NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, r);
|
|---|
| 5024 | }
|
|---|
| 5025 |
|
|---|
| 5026 | ZERO_STRUCT(r->out);
|
|---|
| 5027 | r->out.dominfo = talloc_zero(r, struct samr_DomInfo1 *);
|
|---|
| 5028 | if (r->out.dominfo == NULL) {
|
|---|
| 5029 | talloc_free(r);
|
|---|
| 5030 | return false;
|
|---|
| 5031 | }
|
|---|
| 5032 |
|
|---|
| 5033 | r->out.reject = talloc_zero(r, struct samr_ChangeReject *);
|
|---|
| 5034 | if (r->out.reject == NULL) {
|
|---|
| 5035 | talloc_free(r);
|
|---|
| 5036 | return false;
|
|---|
| 5037 | }
|
|---|
| 5038 |
|
|---|
| 5039 | r->out.result = _samr_ChangePasswordUser3(p, r);
|
|---|
| 5040 |
|
|---|
| 5041 | if (p->rng_fault_state) {
|
|---|
| 5042 | talloc_free(r);
|
|---|
| 5043 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 5044 | return true;
|
|---|
| 5045 | }
|
|---|
| 5046 |
|
|---|
| 5047 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5048 | NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, r);
|
|---|
| 5049 | }
|
|---|
| 5050 |
|
|---|
| 5051 | push = ndr_push_init_ctx(r);
|
|---|
| 5052 | if (push == NULL) {
|
|---|
| 5053 | talloc_free(r);
|
|---|
| 5054 | return false;
|
|---|
| 5055 | }
|
|---|
| 5056 |
|
|---|
| 5057 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 5058 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5059 | talloc_free(r);
|
|---|
| 5060 | return false;
|
|---|
| 5061 | }
|
|---|
| 5062 |
|
|---|
| 5063 | blob = ndr_push_blob(push);
|
|---|
| 5064 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 5065 | talloc_free(r);
|
|---|
| 5066 | return false;
|
|---|
| 5067 | }
|
|---|
| 5068 |
|
|---|
| 5069 | talloc_free(r);
|
|---|
| 5070 |
|
|---|
| 5071 | return true;
|
|---|
| 5072 | }
|
|---|
| 5073 |
|
|---|
| 5074 | static bool api_samr_Connect5(pipes_struct *p)
|
|---|
| 5075 | {
|
|---|
| 5076 | const struct ndr_interface_call *call;
|
|---|
| 5077 | struct ndr_pull *pull;
|
|---|
| 5078 | struct ndr_push *push;
|
|---|
| 5079 | enum ndr_err_code ndr_err;
|
|---|
| 5080 | DATA_BLOB blob;
|
|---|
| 5081 | struct samr_Connect5 *r;
|
|---|
| 5082 |
|
|---|
| 5083 | call = &ndr_table_samr.calls[NDR_SAMR_CONNECT5];
|
|---|
| 5084 |
|
|---|
| 5085 | r = talloc(talloc_tos(), struct samr_Connect5);
|
|---|
| 5086 | if (r == NULL) {
|
|---|
| 5087 | return false;
|
|---|
| 5088 | }
|
|---|
| 5089 |
|
|---|
| 5090 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 5091 | talloc_free(r);
|
|---|
| 5092 | return false;
|
|---|
| 5093 | }
|
|---|
| 5094 |
|
|---|
| 5095 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 5096 | if (pull == NULL) {
|
|---|
| 5097 | talloc_free(r);
|
|---|
| 5098 | return false;
|
|---|
| 5099 | }
|
|---|
| 5100 |
|
|---|
| 5101 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 5102 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 5103 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5104 | talloc_free(r);
|
|---|
| 5105 | return false;
|
|---|
| 5106 | }
|
|---|
| 5107 |
|
|---|
| 5108 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5109 | NDR_PRINT_IN_DEBUG(samr_Connect5, r);
|
|---|
| 5110 | }
|
|---|
| 5111 |
|
|---|
| 5112 | ZERO_STRUCT(r->out);
|
|---|
| 5113 | r->out.level_out = talloc_zero(r, uint32_t);
|
|---|
| 5114 | if (r->out.level_out == NULL) {
|
|---|
| 5115 | talloc_free(r);
|
|---|
| 5116 | return false;
|
|---|
| 5117 | }
|
|---|
| 5118 |
|
|---|
| 5119 | r->out.info_out = talloc_zero(r, union samr_ConnectInfo);
|
|---|
| 5120 | if (r->out.info_out == NULL) {
|
|---|
| 5121 | talloc_free(r);
|
|---|
| 5122 | return false;
|
|---|
| 5123 | }
|
|---|
| 5124 |
|
|---|
| 5125 | r->out.connect_handle = talloc_zero(r, struct policy_handle);
|
|---|
| 5126 | if (r->out.connect_handle == NULL) {
|
|---|
| 5127 | talloc_free(r);
|
|---|
| 5128 | return false;
|
|---|
| 5129 | }
|
|---|
| 5130 |
|
|---|
| 5131 | r->out.result = _samr_Connect5(p, r);
|
|---|
| 5132 |
|
|---|
| 5133 | if (p->rng_fault_state) {
|
|---|
| 5134 | talloc_free(r);
|
|---|
| 5135 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 5136 | return true;
|
|---|
| 5137 | }
|
|---|
| 5138 |
|
|---|
| 5139 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5140 | NDR_PRINT_OUT_DEBUG(samr_Connect5, r);
|
|---|
| 5141 | }
|
|---|
| 5142 |
|
|---|
| 5143 | push = ndr_push_init_ctx(r);
|
|---|
| 5144 | if (push == NULL) {
|
|---|
| 5145 | talloc_free(r);
|
|---|
| 5146 | return false;
|
|---|
| 5147 | }
|
|---|
| 5148 |
|
|---|
| 5149 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 5150 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5151 | talloc_free(r);
|
|---|
| 5152 | return false;
|
|---|
| 5153 | }
|
|---|
| 5154 |
|
|---|
| 5155 | blob = ndr_push_blob(push);
|
|---|
| 5156 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 5157 | talloc_free(r);
|
|---|
| 5158 | return false;
|
|---|
| 5159 | }
|
|---|
| 5160 |
|
|---|
| 5161 | talloc_free(r);
|
|---|
| 5162 |
|
|---|
| 5163 | return true;
|
|---|
| 5164 | }
|
|---|
| 5165 |
|
|---|
| 5166 | static bool api_samr_RidToSid(pipes_struct *p)
|
|---|
| 5167 | {
|
|---|
| 5168 | const struct ndr_interface_call *call;
|
|---|
| 5169 | struct ndr_pull *pull;
|
|---|
| 5170 | struct ndr_push *push;
|
|---|
| 5171 | enum ndr_err_code ndr_err;
|
|---|
| 5172 | DATA_BLOB blob;
|
|---|
| 5173 | struct samr_RidToSid *r;
|
|---|
| 5174 |
|
|---|
| 5175 | call = &ndr_table_samr.calls[NDR_SAMR_RIDTOSID];
|
|---|
| 5176 |
|
|---|
| 5177 | r = talloc(talloc_tos(), struct samr_RidToSid);
|
|---|
| 5178 | if (r == NULL) {
|
|---|
| 5179 | return false;
|
|---|
| 5180 | }
|
|---|
| 5181 |
|
|---|
| 5182 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 5183 | talloc_free(r);
|
|---|
| 5184 | return false;
|
|---|
| 5185 | }
|
|---|
| 5186 |
|
|---|
| 5187 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 5188 | if (pull == NULL) {
|
|---|
| 5189 | talloc_free(r);
|
|---|
| 5190 | return false;
|
|---|
| 5191 | }
|
|---|
| 5192 |
|
|---|
| 5193 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 5194 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 5195 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5196 | talloc_free(r);
|
|---|
| 5197 | return false;
|
|---|
| 5198 | }
|
|---|
| 5199 |
|
|---|
| 5200 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5201 | NDR_PRINT_IN_DEBUG(samr_RidToSid, r);
|
|---|
| 5202 | }
|
|---|
| 5203 |
|
|---|
| 5204 | ZERO_STRUCT(r->out);
|
|---|
| 5205 | r->out.sid = talloc_zero(r, struct dom_sid2);
|
|---|
| 5206 | if (r->out.sid == NULL) {
|
|---|
| 5207 | talloc_free(r);
|
|---|
| 5208 | return false;
|
|---|
| 5209 | }
|
|---|
| 5210 |
|
|---|
| 5211 | r->out.result = _samr_RidToSid(p, r);
|
|---|
| 5212 |
|
|---|
| 5213 | if (p->rng_fault_state) {
|
|---|
| 5214 | talloc_free(r);
|
|---|
| 5215 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 5216 | return true;
|
|---|
| 5217 | }
|
|---|
| 5218 |
|
|---|
| 5219 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5220 | NDR_PRINT_OUT_DEBUG(samr_RidToSid, r);
|
|---|
| 5221 | }
|
|---|
| 5222 |
|
|---|
| 5223 | push = ndr_push_init_ctx(r);
|
|---|
| 5224 | if (push == NULL) {
|
|---|
| 5225 | talloc_free(r);
|
|---|
| 5226 | return false;
|
|---|
| 5227 | }
|
|---|
| 5228 |
|
|---|
| 5229 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 5230 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5231 | talloc_free(r);
|
|---|
| 5232 | return false;
|
|---|
| 5233 | }
|
|---|
| 5234 |
|
|---|
| 5235 | blob = ndr_push_blob(push);
|
|---|
| 5236 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 5237 | talloc_free(r);
|
|---|
| 5238 | return false;
|
|---|
| 5239 | }
|
|---|
| 5240 |
|
|---|
| 5241 | talloc_free(r);
|
|---|
| 5242 |
|
|---|
| 5243 | return true;
|
|---|
| 5244 | }
|
|---|
| 5245 |
|
|---|
| 5246 | static bool api_samr_SetDsrmPassword(pipes_struct *p)
|
|---|
| 5247 | {
|
|---|
| 5248 | const struct ndr_interface_call *call;
|
|---|
| 5249 | struct ndr_pull *pull;
|
|---|
| 5250 | struct ndr_push *push;
|
|---|
| 5251 | enum ndr_err_code ndr_err;
|
|---|
| 5252 | DATA_BLOB blob;
|
|---|
| 5253 | struct samr_SetDsrmPassword *r;
|
|---|
| 5254 |
|
|---|
| 5255 | call = &ndr_table_samr.calls[NDR_SAMR_SETDSRMPASSWORD];
|
|---|
| 5256 |
|
|---|
| 5257 | r = talloc(talloc_tos(), struct samr_SetDsrmPassword);
|
|---|
| 5258 | if (r == NULL) {
|
|---|
| 5259 | return false;
|
|---|
| 5260 | }
|
|---|
| 5261 |
|
|---|
| 5262 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 5263 | talloc_free(r);
|
|---|
| 5264 | return false;
|
|---|
| 5265 | }
|
|---|
| 5266 |
|
|---|
| 5267 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 5268 | if (pull == NULL) {
|
|---|
| 5269 | talloc_free(r);
|
|---|
| 5270 | return false;
|
|---|
| 5271 | }
|
|---|
| 5272 |
|
|---|
| 5273 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 5274 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 5275 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5276 | talloc_free(r);
|
|---|
| 5277 | return false;
|
|---|
| 5278 | }
|
|---|
| 5279 |
|
|---|
| 5280 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5281 | NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, r);
|
|---|
| 5282 | }
|
|---|
| 5283 |
|
|---|
| 5284 | r->out.result = _samr_SetDsrmPassword(p, r);
|
|---|
| 5285 |
|
|---|
| 5286 | if (p->rng_fault_state) {
|
|---|
| 5287 | talloc_free(r);
|
|---|
| 5288 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 5289 | return true;
|
|---|
| 5290 | }
|
|---|
| 5291 |
|
|---|
| 5292 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5293 | NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, r);
|
|---|
| 5294 | }
|
|---|
| 5295 |
|
|---|
| 5296 | push = ndr_push_init_ctx(r);
|
|---|
| 5297 | if (push == NULL) {
|
|---|
| 5298 | talloc_free(r);
|
|---|
| 5299 | return false;
|
|---|
| 5300 | }
|
|---|
| 5301 |
|
|---|
| 5302 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 5303 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5304 | talloc_free(r);
|
|---|
| 5305 | return false;
|
|---|
| 5306 | }
|
|---|
| 5307 |
|
|---|
| 5308 | blob = ndr_push_blob(push);
|
|---|
| 5309 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 5310 | talloc_free(r);
|
|---|
| 5311 | return false;
|
|---|
| 5312 | }
|
|---|
| 5313 |
|
|---|
| 5314 | talloc_free(r);
|
|---|
| 5315 |
|
|---|
| 5316 | return true;
|
|---|
| 5317 | }
|
|---|
| 5318 |
|
|---|
| 5319 | static bool api_samr_ValidatePassword(pipes_struct *p)
|
|---|
| 5320 | {
|
|---|
| 5321 | const struct ndr_interface_call *call;
|
|---|
| 5322 | struct ndr_pull *pull;
|
|---|
| 5323 | struct ndr_push *push;
|
|---|
| 5324 | enum ndr_err_code ndr_err;
|
|---|
| 5325 | DATA_BLOB blob;
|
|---|
| 5326 | struct samr_ValidatePassword *r;
|
|---|
| 5327 |
|
|---|
| 5328 | call = &ndr_table_samr.calls[NDR_SAMR_VALIDATEPASSWORD];
|
|---|
| 5329 |
|
|---|
| 5330 | r = talloc(talloc_tos(), struct samr_ValidatePassword);
|
|---|
| 5331 | if (r == NULL) {
|
|---|
| 5332 | return false;
|
|---|
| 5333 | }
|
|---|
| 5334 |
|
|---|
| 5335 | if (!prs_data_blob(&p->in_data.data, &blob, r)) {
|
|---|
| 5336 | talloc_free(r);
|
|---|
| 5337 | return false;
|
|---|
| 5338 | }
|
|---|
| 5339 |
|
|---|
| 5340 | pull = ndr_pull_init_blob(&blob, r);
|
|---|
| 5341 | if (pull == NULL) {
|
|---|
| 5342 | talloc_free(r);
|
|---|
| 5343 | return false;
|
|---|
| 5344 | }
|
|---|
| 5345 |
|
|---|
| 5346 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
|---|
| 5347 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
|---|
| 5348 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5349 | talloc_free(r);
|
|---|
| 5350 | return false;
|
|---|
| 5351 | }
|
|---|
| 5352 |
|
|---|
| 5353 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5354 | NDR_PRINT_IN_DEBUG(samr_ValidatePassword, r);
|
|---|
| 5355 | }
|
|---|
| 5356 |
|
|---|
| 5357 | ZERO_STRUCT(r->out);
|
|---|
| 5358 | r->out.rep = talloc_zero(r, union samr_ValidatePasswordRep);
|
|---|
| 5359 | if (r->out.rep == NULL) {
|
|---|
| 5360 | talloc_free(r);
|
|---|
| 5361 | return false;
|
|---|
| 5362 | }
|
|---|
| 5363 |
|
|---|
| 5364 | r->out.result = _samr_ValidatePassword(p, r);
|
|---|
| 5365 |
|
|---|
| 5366 | if (p->rng_fault_state) {
|
|---|
| 5367 | talloc_free(r);
|
|---|
| 5368 | /* Return true here, srv_pipe_hnd.c will take care */
|
|---|
| 5369 | return true;
|
|---|
| 5370 | }
|
|---|
| 5371 |
|
|---|
| 5372 | if (DEBUGLEVEL >= 10) {
|
|---|
| 5373 | NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, r);
|
|---|
| 5374 | }
|
|---|
| 5375 |
|
|---|
| 5376 | push = ndr_push_init_ctx(r);
|
|---|
| 5377 | if (push == NULL) {
|
|---|
| 5378 | talloc_free(r);
|
|---|
| 5379 | return false;
|
|---|
| 5380 | }
|
|---|
| 5381 |
|
|---|
| 5382 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
|---|
| 5383 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
|---|
| 5384 | talloc_free(r);
|
|---|
| 5385 | return false;
|
|---|
| 5386 | }
|
|---|
| 5387 |
|
|---|
| 5388 | blob = ndr_push_blob(push);
|
|---|
| 5389 | if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
|
|---|
| 5390 | talloc_free(r);
|
|---|
| 5391 | return false;
|
|---|
| 5392 | }
|
|---|
| 5393 |
|
|---|
| 5394 | talloc_free(r);
|
|---|
| 5395 |
|
|---|
| 5396 | return true;
|
|---|
| 5397 | }
|
|---|
| 5398 |
|
|---|
| 5399 |
|
|---|
| 5400 | /* Tables */
|
|---|
| 5401 | static struct api_struct api_samr_cmds[] =
|
|---|
| 5402 | {
|
|---|
| 5403 | {"SAMR_CONNECT", NDR_SAMR_CONNECT, api_samr_Connect},
|
|---|
| 5404 | {"SAMR_CLOSE", NDR_SAMR_CLOSE, api_samr_Close},
|
|---|
| 5405 | {"SAMR_SETSECURITY", NDR_SAMR_SETSECURITY, api_samr_SetSecurity},
|
|---|
| 5406 | {"SAMR_QUERYSECURITY", NDR_SAMR_QUERYSECURITY, api_samr_QuerySecurity},
|
|---|
| 5407 | {"SAMR_SHUTDOWN", NDR_SAMR_SHUTDOWN, api_samr_Shutdown},
|
|---|
| 5408 | {"SAMR_LOOKUPDOMAIN", NDR_SAMR_LOOKUPDOMAIN, api_samr_LookupDomain},
|
|---|
| 5409 | {"SAMR_ENUMDOMAINS", NDR_SAMR_ENUMDOMAINS, api_samr_EnumDomains},
|
|---|
| 5410 | {"SAMR_OPENDOMAIN", NDR_SAMR_OPENDOMAIN, api_samr_OpenDomain},
|
|---|
| 5411 | {"SAMR_QUERYDOMAININFO", NDR_SAMR_QUERYDOMAININFO, api_samr_QueryDomainInfo},
|
|---|
| 5412 | {"SAMR_SETDOMAININFO", NDR_SAMR_SETDOMAININFO, api_samr_SetDomainInfo},
|
|---|
| 5413 | {"SAMR_CREATEDOMAINGROUP", NDR_SAMR_CREATEDOMAINGROUP, api_samr_CreateDomainGroup},
|
|---|
| 5414 | {"SAMR_ENUMDOMAINGROUPS", NDR_SAMR_ENUMDOMAINGROUPS, api_samr_EnumDomainGroups},
|
|---|
| 5415 | {"SAMR_CREATEUSER", NDR_SAMR_CREATEUSER, api_samr_CreateUser},
|
|---|
| 5416 | {"SAMR_ENUMDOMAINUSERS", NDR_SAMR_ENUMDOMAINUSERS, api_samr_EnumDomainUsers},
|
|---|
| 5417 | {"SAMR_CREATEDOMALIAS", NDR_SAMR_CREATEDOMALIAS, api_samr_CreateDomAlias},
|
|---|
| 5418 | {"SAMR_ENUMDOMAINALIASES", NDR_SAMR_ENUMDOMAINALIASES, api_samr_EnumDomainAliases},
|
|---|
| 5419 | {"SAMR_GETALIASMEMBERSHIP", NDR_SAMR_GETALIASMEMBERSHIP, api_samr_GetAliasMembership},
|
|---|
| 5420 | {"SAMR_LOOKUPNAMES", NDR_SAMR_LOOKUPNAMES, api_samr_LookupNames},
|
|---|
| 5421 | {"SAMR_LOOKUPRIDS", NDR_SAMR_LOOKUPRIDS, api_samr_LookupRids},
|
|---|
| 5422 | {"SAMR_OPENGROUP", NDR_SAMR_OPENGROUP, api_samr_OpenGroup},
|
|---|
| 5423 | {"SAMR_QUERYGROUPINFO", NDR_SAMR_QUERYGROUPINFO, api_samr_QueryGroupInfo},
|
|---|
| 5424 | {"SAMR_SETGROUPINFO", NDR_SAMR_SETGROUPINFO, api_samr_SetGroupInfo},
|
|---|
| 5425 | {"SAMR_ADDGROUPMEMBER", NDR_SAMR_ADDGROUPMEMBER, api_samr_AddGroupMember},
|
|---|
| 5426 | {"SAMR_DELETEDOMAINGROUP", NDR_SAMR_DELETEDOMAINGROUP, api_samr_DeleteDomainGroup},
|
|---|
| 5427 | {"SAMR_DELETEGROUPMEMBER", NDR_SAMR_DELETEGROUPMEMBER, api_samr_DeleteGroupMember},
|
|---|
| 5428 | {"SAMR_QUERYGROUPMEMBER", NDR_SAMR_QUERYGROUPMEMBER, api_samr_QueryGroupMember},
|
|---|
| 5429 | {"SAMR_SETMEMBERATTRIBUTESOFGROUP", NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, api_samr_SetMemberAttributesOfGroup},
|
|---|
| 5430 | {"SAMR_OPENALIAS", NDR_SAMR_OPENALIAS, api_samr_OpenAlias},
|
|---|
| 5431 | {"SAMR_QUERYALIASINFO", NDR_SAMR_QUERYALIASINFO, api_samr_QueryAliasInfo},
|
|---|
| 5432 | {"SAMR_SETALIASINFO", NDR_SAMR_SETALIASINFO, api_samr_SetAliasInfo},
|
|---|
| 5433 | {"SAMR_DELETEDOMALIAS", NDR_SAMR_DELETEDOMALIAS, api_samr_DeleteDomAlias},
|
|---|
| 5434 | {"SAMR_ADDALIASMEMBER", NDR_SAMR_ADDALIASMEMBER, api_samr_AddAliasMember},
|
|---|
| 5435 | {"SAMR_DELETEALIASMEMBER", NDR_SAMR_DELETEALIASMEMBER, api_samr_DeleteAliasMember},
|
|---|
| 5436 | {"SAMR_GETMEMBERSINALIAS", NDR_SAMR_GETMEMBERSINALIAS, api_samr_GetMembersInAlias},
|
|---|
| 5437 | {"SAMR_OPENUSER", NDR_SAMR_OPENUSER, api_samr_OpenUser},
|
|---|
| 5438 | {"SAMR_DELETEUSER", NDR_SAMR_DELETEUSER, api_samr_DeleteUser},
|
|---|
| 5439 | {"SAMR_QUERYUSERINFO", NDR_SAMR_QUERYUSERINFO, api_samr_QueryUserInfo},
|
|---|
| 5440 | {"SAMR_SETUSERINFO", NDR_SAMR_SETUSERINFO, api_samr_SetUserInfo},
|
|---|
| 5441 | {"SAMR_CHANGEPASSWORDUSER", NDR_SAMR_CHANGEPASSWORDUSER, api_samr_ChangePasswordUser},
|
|---|
| 5442 | {"SAMR_GETGROUPSFORUSER", NDR_SAMR_GETGROUPSFORUSER, api_samr_GetGroupsForUser},
|
|---|
| 5443 | {"SAMR_QUERYDISPLAYINFO", NDR_SAMR_QUERYDISPLAYINFO, api_samr_QueryDisplayInfo},
|
|---|
| 5444 | {"SAMR_GETDISPLAYENUMERATIONINDEX", NDR_SAMR_GETDISPLAYENUMERATIONINDEX, api_samr_GetDisplayEnumerationIndex},
|
|---|
| 5445 | {"SAMR_TESTPRIVATEFUNCTIONSDOMAIN", NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, api_samr_TestPrivateFunctionsDomain},
|
|---|
| 5446 | {"SAMR_TESTPRIVATEFUNCTIONSUSER", NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, api_samr_TestPrivateFunctionsUser},
|
|---|
| 5447 | {"SAMR_GETUSERPWINFO", NDR_SAMR_GETUSERPWINFO, api_samr_GetUserPwInfo},
|
|---|
| 5448 | {"SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN", NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, api_samr_RemoveMemberFromForeignDomain},
|
|---|
| 5449 | {"SAMR_QUERYDOMAININFO2", NDR_SAMR_QUERYDOMAININFO2, api_samr_QueryDomainInfo2},
|
|---|
| 5450 | {"SAMR_QUERYUSERINFO2", NDR_SAMR_QUERYUSERINFO2, api_samr_QueryUserInfo2},
|
|---|
| 5451 | {"SAMR_QUERYDISPLAYINFO2", NDR_SAMR_QUERYDISPLAYINFO2, api_samr_QueryDisplayInfo2},
|
|---|
| 5452 | {"SAMR_GETDISPLAYENUMERATIONINDEX2", NDR_SAMR_GETDISPLAYENUMERATIONINDEX2, api_samr_GetDisplayEnumerationIndex2},
|
|---|
| 5453 | {"SAMR_CREATEUSER2", NDR_SAMR_CREATEUSER2, api_samr_CreateUser2},
|
|---|
| 5454 | {"SAMR_QUERYDISPLAYINFO3", NDR_SAMR_QUERYDISPLAYINFO3, api_samr_QueryDisplayInfo3},
|
|---|
| 5455 | {"SAMR_ADDMULTIPLEMEMBERSTOALIAS", NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS, api_samr_AddMultipleMembersToAlias},
|
|---|
| 5456 | {"SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS", NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS, api_samr_RemoveMultipleMembersFromAlias},
|
|---|
| 5457 | {"SAMR_OEMCHANGEPASSWORDUSER2", NDR_SAMR_OEMCHANGEPASSWORDUSER2, api_samr_OemChangePasswordUser2},
|
|---|
| 5458 | {"SAMR_CHANGEPASSWORDUSER2", NDR_SAMR_CHANGEPASSWORDUSER2, api_samr_ChangePasswordUser2},
|
|---|
| 5459 | {"SAMR_GETDOMPWINFO", NDR_SAMR_GETDOMPWINFO, api_samr_GetDomPwInfo},
|
|---|
| 5460 | {"SAMR_CONNECT2", NDR_SAMR_CONNECT2, api_samr_Connect2},
|
|---|
| 5461 | {"SAMR_SETUSERINFO2", NDR_SAMR_SETUSERINFO2, api_samr_SetUserInfo2},
|
|---|
| 5462 | {"SAMR_SETBOOTKEYINFORMATION", NDR_SAMR_SETBOOTKEYINFORMATION, api_samr_SetBootKeyInformation},
|
|---|
| 5463 | {"SAMR_GETBOOTKEYINFORMATION", NDR_SAMR_GETBOOTKEYINFORMATION, api_samr_GetBootKeyInformation},
|
|---|
| 5464 | {"SAMR_CONNECT3", NDR_SAMR_CONNECT3, api_samr_Connect3},
|
|---|
| 5465 | {"SAMR_CONNECT4", NDR_SAMR_CONNECT4, api_samr_Connect4},
|
|---|
| 5466 | {"SAMR_CHANGEPASSWORDUSER3", NDR_SAMR_CHANGEPASSWORDUSER3, api_samr_ChangePasswordUser3},
|
|---|
| 5467 | {"SAMR_CONNECT5", NDR_SAMR_CONNECT5, api_samr_Connect5},
|
|---|
| 5468 | {"SAMR_RIDTOSID", NDR_SAMR_RIDTOSID, api_samr_RidToSid},
|
|---|
| 5469 | {"SAMR_SETDSRMPASSWORD", NDR_SAMR_SETDSRMPASSWORD, api_samr_SetDsrmPassword},
|
|---|
| 5470 | {"SAMR_VALIDATEPASSWORD", NDR_SAMR_VALIDATEPASSWORD, api_samr_ValidatePassword},
|
|---|
| 5471 | };
|
|---|
| 5472 |
|
|---|
| 5473 | void samr_get_pipe_fns(struct api_struct **fns, int *n_fns)
|
|---|
| 5474 | {
|
|---|
| 5475 | *fns = api_samr_cmds;
|
|---|
| 5476 | *n_fns = sizeof(api_samr_cmds) / sizeof(struct api_struct);
|
|---|
| 5477 | }
|
|---|
| 5478 |
|
|---|
| 5479 | NTSTATUS rpc_samr_init(void)
|
|---|
| 5480 | {
|
|---|
| 5481 | return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "samr", "samr", api_samr_cmds, sizeof(api_samr_cmds) / sizeof(struct api_struct));
|
|---|
| 5482 | }
|
|---|