00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "includes.h"
00029
00030 #undef DBGC_CLASS
00031 #define DBGC_CLASS DBGC_RPC_SRV
00032
00033
00034
00035
00036
00037 static BOOL api_lsa_open_policy2(pipes_struct *p)
00038 {
00039 LSA_Q_OPEN_POL2 q_u;
00040 LSA_R_OPEN_POL2 r_u;
00041 prs_struct *data = &p->in_data.data;
00042 prs_struct *rdata = &p->out_data.rdata;
00043
00044 ZERO_STRUCT(q_u);
00045 ZERO_STRUCT(r_u);
00046
00047
00048 if(!lsa_io_q_open_pol2("", &q_u, data, 0)) {
00049 DEBUG(0,("api_lsa_open_policy2: unable to unmarshall LSA_Q_OPEN_POL2.\n"));
00050 return False;
00051 }
00052
00053 r_u.status = _lsa_open_policy2(p, &q_u, &r_u);
00054
00055
00056 if(!lsa_io_r_open_pol2("", &r_u, rdata, 0)) {
00057 DEBUG(0,("api_lsa_open_policy2: unable to marshall LSA_R_OPEN_POL2.\n"));
00058 return False;
00059 }
00060
00061 return True;
00062 }
00063
00064
00065
00066
00067
00068 static BOOL api_lsa_open_policy(pipes_struct *p)
00069 {
00070 LSA_Q_OPEN_POL q_u;
00071 LSA_R_OPEN_POL r_u;
00072 prs_struct *data = &p->in_data.data;
00073 prs_struct *rdata = &p->out_data.rdata;
00074
00075 ZERO_STRUCT(q_u);
00076 ZERO_STRUCT(r_u);
00077
00078
00079 if(!lsa_io_q_open_pol("", &q_u, data, 0)) {
00080 DEBUG(0,("api_lsa_open_policy: unable to unmarshall LSA_Q_OPEN_POL.\n"));
00081 return False;
00082 }
00083
00084 r_u.status = _lsa_open_policy(p, &q_u, &r_u);
00085
00086
00087 if(!lsa_io_r_open_pol("", &r_u, rdata, 0)) {
00088 DEBUG(0,("api_lsa_open_policy: unable to marshall LSA_R_OPEN_POL.\n"));
00089 return False;
00090 }
00091
00092 return True;
00093 }
00094
00095
00096
00097
00098
00099 static BOOL api_lsa_enum_trust_dom(pipes_struct *p)
00100 {
00101 LSA_Q_ENUM_TRUST_DOM q_u;
00102 LSA_R_ENUM_TRUST_DOM r_u;
00103 prs_struct *data = &p->in_data.data;
00104 prs_struct *rdata = &p->out_data.rdata;
00105
00106 ZERO_STRUCT(q_u);
00107 ZERO_STRUCT(r_u);
00108
00109
00110 if(!lsa_io_q_enum_trust_dom("", &q_u, data, 0))
00111 return False;
00112
00113
00114 r_u.status = _lsa_enum_trust_dom(p, &q_u, &r_u);
00115
00116
00117 if(!lsa_io_r_enum_trust_dom("", &r_u, rdata, 0))
00118 return False;
00119
00120 return True;
00121 }
00122
00123
00124
00125
00126
00127 static BOOL api_lsa_query_info(pipes_struct *p)
00128 {
00129 LSA_Q_QUERY_INFO q_u;
00130 LSA_R_QUERY_INFO r_u;
00131 prs_struct *data = &p->in_data.data;
00132 prs_struct *rdata = &p->out_data.rdata;
00133
00134 ZERO_STRUCT(q_u);
00135 ZERO_STRUCT(r_u);
00136
00137
00138 if(!lsa_io_q_query("", &q_u, data, 0)) {
00139 DEBUG(0,("api_lsa_query_info: failed to unmarshall LSA_Q_QUERY_INFO.\n"));
00140 return False;
00141 }
00142
00143 r_u.status = _lsa_query_info(p, &q_u, &r_u);
00144
00145
00146 if(!lsa_io_r_query("", &r_u, rdata, 0)) {
00147 DEBUG(0,("api_lsa_query_info: failed to marshall LSA_R_QUERY_INFO.\n"));
00148 return False;
00149 }
00150
00151 return True;
00152 }
00153
00154
00155
00156
00157
00158 static BOOL api_lsa_lookup_sids(pipes_struct *p)
00159 {
00160 LSA_Q_LOOKUP_SIDS q_u;
00161 LSA_R_LOOKUP_SIDS r_u;
00162 prs_struct *data = &p->in_data.data;
00163 prs_struct *rdata = &p->out_data.rdata;
00164
00165 ZERO_STRUCT(q_u);
00166 ZERO_STRUCT(r_u);
00167
00168
00169 if(!lsa_io_q_lookup_sids("", &q_u, data, 0)) {
00170 DEBUG(0,("api_lsa_lookup_sids: failed to unmarshall LSA_Q_LOOKUP_SIDS.\n"));
00171 return False;
00172 }
00173
00174 r_u.status = _lsa_lookup_sids(p, &q_u, &r_u);
00175
00176 if(!lsa_io_r_lookup_sids("", &r_u, rdata, 0)) {
00177 DEBUG(0,("api_lsa_lookup_sids: Failed to marshall LSA_R_LOOKUP_SIDS.\n"));
00178 return False;
00179 }
00180
00181 return True;
00182 }
00183
00184
00185
00186
00187
00188 static BOOL api_lsa_lookup_names(pipes_struct *p)
00189 {
00190 LSA_Q_LOOKUP_NAMES q_u;
00191 LSA_R_LOOKUP_NAMES r_u;
00192 prs_struct *data = &p->in_data.data;
00193 prs_struct *rdata = &p->out_data.rdata;
00194
00195 ZERO_STRUCT(q_u);
00196 ZERO_STRUCT(r_u);
00197
00198
00199 if(!lsa_io_q_lookup_names("", &q_u, data, 0)) {
00200 DEBUG(0,("api_lsa_lookup_names: failed to unmarshall LSA_Q_LOOKUP_NAMES.\n"));
00201 return False;
00202 }
00203
00204 r_u.status = _lsa_lookup_names(p, &q_u, &r_u);
00205
00206
00207 if(!lsa_io_r_lookup_names("", &r_u, rdata, 0)) {
00208 DEBUG(0,("api_lsa_lookup_names: Failed to marshall LSA_R_LOOKUP_NAMES.\n"));
00209 return False;
00210 }
00211
00212 return True;
00213 }
00214
00215
00216
00217
00218
00219 static BOOL api_lsa_close(pipes_struct *p)
00220 {
00221 LSA_Q_CLOSE q_u;
00222 LSA_R_CLOSE r_u;
00223 prs_struct *data = &p->in_data.data;
00224 prs_struct *rdata = &p->out_data.rdata;
00225
00226 ZERO_STRUCT(q_u);
00227 ZERO_STRUCT(r_u);
00228
00229 if (!lsa_io_q_close("", &q_u, data, 0)) {
00230 DEBUG(0,("api_lsa_close: lsa_io_q_close failed.\n"));
00231 return False;
00232 }
00233
00234 r_u.status = _lsa_close(p, &q_u, &r_u);
00235
00236
00237 if (!lsa_io_r_close("", &r_u, rdata, 0)) {
00238 DEBUG(0,("api_lsa_close: lsa_io_r_close failed.\n"));
00239 return False;
00240 }
00241
00242 return True;
00243 }
00244
00245
00246
00247
00248
00249 static BOOL api_lsa_open_secret(pipes_struct *p)
00250 {
00251 LSA_Q_OPEN_SECRET q_u;
00252 LSA_R_OPEN_SECRET r_u;
00253 prs_struct *data = &p->in_data.data;
00254 prs_struct *rdata = &p->out_data.rdata;
00255
00256 ZERO_STRUCT(q_u);
00257 ZERO_STRUCT(r_u);
00258
00259 if(!lsa_io_q_open_secret("", &q_u, data, 0)) {
00260 DEBUG(0,("api_lsa_open_secret: failed to unmarshall LSA_Q_OPEN_SECRET.\n"));
00261 return False;
00262 }
00263
00264 r_u.status = _lsa_open_secret(p, &q_u, &r_u);
00265
00266
00267 if(!lsa_io_r_open_secret("", &r_u, rdata, 0)) {
00268 DEBUG(0,("api_lsa_open_secret: Failed to marshall LSA_R_OPEN_SECRET.\n"));
00269 return False;
00270 }
00271
00272 return True;
00273 }
00274
00275
00276
00277
00278
00279 static BOOL api_lsa_enum_privs(pipes_struct *p)
00280 {
00281 LSA_Q_ENUM_PRIVS q_u;
00282 LSA_R_ENUM_PRIVS r_u;
00283 prs_struct *data = &p->in_data.data;
00284 prs_struct *rdata = &p->out_data.rdata;
00285
00286 ZERO_STRUCT(q_u);
00287 ZERO_STRUCT(r_u);
00288
00289 if(!lsa_io_q_enum_privs("", &q_u, data, 0)) {
00290 DEBUG(0,("api_lsa_enum_privs: failed to unmarshall LSA_Q_ENUM_PRIVS.\n"));
00291 return False;
00292 }
00293
00294 r_u.status = _lsa_enum_privs(p, &q_u, &r_u);
00295
00296
00297 if(!lsa_io_r_enum_privs("", &r_u, rdata, 0)) {
00298 DEBUG(0,("api_lsa_enum_privs: Failed to marshall LSA_R_ENUM_PRIVS.\n"));
00299 return False;
00300 }
00301
00302 return True;
00303 }
00304
00305
00306
00307
00308
00309 static BOOL api_lsa_priv_get_dispname(pipes_struct *p)
00310 {
00311 LSA_Q_PRIV_GET_DISPNAME q_u;
00312 LSA_R_PRIV_GET_DISPNAME r_u;
00313 prs_struct *data = &p->in_data.data;
00314 prs_struct *rdata = &p->out_data.rdata;
00315
00316 ZERO_STRUCT(q_u);
00317 ZERO_STRUCT(r_u);
00318
00319 if(!lsa_io_q_priv_get_dispname("", &q_u, data, 0)) {
00320 DEBUG(0,("api_lsa_priv_get_dispname: failed to unmarshall LSA_Q_PRIV_GET_DISPNAME.\n"));
00321 return False;
00322 }
00323
00324 r_u.status = _lsa_priv_get_dispname(p, &q_u, &r_u);
00325
00326
00327 if(!lsa_io_r_priv_get_dispname("", &r_u, rdata, 0)) {
00328 DEBUG(0,("api_lsa_priv_get_dispname: Failed to marshall LSA_R_PRIV_GET_DISPNAME.\n"));
00329 return False;
00330 }
00331
00332 return True;
00333 }
00334
00335
00336
00337
00338
00339 static BOOL api_lsa_enum_accounts(pipes_struct *p)
00340 {
00341 LSA_Q_ENUM_ACCOUNTS q_u;
00342 LSA_R_ENUM_ACCOUNTS r_u;
00343 prs_struct *data = &p->in_data.data;
00344 prs_struct *rdata = &p->out_data.rdata;
00345
00346 ZERO_STRUCT(q_u);
00347 ZERO_STRUCT(r_u);
00348
00349 if(!lsa_io_q_enum_accounts("", &q_u, data, 0)) {
00350 DEBUG(0,("api_lsa_enum_accounts: failed to unmarshall LSA_Q_ENUM_ACCOUNTS.\n"));
00351 return False;
00352 }
00353
00354 r_u.status = _lsa_enum_accounts(p, &q_u, &r_u);
00355
00356
00357 if(!lsa_io_r_enum_accounts("", &r_u, rdata, 0)) {
00358 DEBUG(0,("api_lsa_enum_accounts: Failed to marshall LSA_R_ENUM_ACCOUNTS.\n"));
00359 return False;
00360 }
00361
00362 return True;
00363 }
00364
00365
00366
00367
00368
00369 static BOOL api_lsa_unk_get_connuser(pipes_struct *p)
00370 {
00371 LSA_Q_UNK_GET_CONNUSER q_u;
00372 LSA_R_UNK_GET_CONNUSER r_u;
00373
00374 prs_struct *data = &p->in_data.data;
00375 prs_struct *rdata = &p->out_data.rdata;
00376
00377 ZERO_STRUCT(q_u);
00378 ZERO_STRUCT(r_u);
00379
00380 if(!lsa_io_q_unk_get_connuser("", &q_u, data, 0)) {
00381 DEBUG(0,("api_lsa_unk_get_connuser: failed to unmarshall LSA_Q_UNK_GET_CONNUSER.\n"));
00382 return False;
00383 }
00384
00385 r_u.status = _lsa_unk_get_connuser(p, &q_u, &r_u);
00386
00387
00388 if(!lsa_io_r_unk_get_connuser("", &r_u, rdata, 0)) {
00389 DEBUG(0,("api_lsa_unk_get_connuser: Failed to marshall LSA_R_UNK_GET_CONNUSER.\n"));
00390 return False;
00391 }
00392
00393 return True;
00394 }
00395
00396
00397
00398
00399
00400 static BOOL api_lsa_create_account(pipes_struct *p)
00401 {
00402 LSA_Q_CREATEACCOUNT q_u;
00403 LSA_R_CREATEACCOUNT r_u;
00404
00405 prs_struct *data = &p->in_data.data;
00406 prs_struct *rdata = &p->out_data.rdata;
00407
00408 ZERO_STRUCT(q_u);
00409 ZERO_STRUCT(r_u);
00410
00411 if(!lsa_io_q_create_account("", &q_u, data, 0)) {
00412 DEBUG(0,("api_lsa_create_account: failed to unmarshall LSA_Q_CREATEACCOUNT.\n"));
00413 return False;
00414 }
00415
00416 r_u.status = _lsa_create_account(p, &q_u, &r_u);
00417
00418
00419 if(!lsa_io_r_create_account("", &r_u, rdata, 0)) {
00420 DEBUG(0,("api_lsa_create_account: Failed to marshall LSA_R_CREATEACCOUNT.\n"));
00421 return False;
00422 }
00423
00424 return True;
00425 }
00426
00427
00428
00429
00430
00431 static BOOL api_lsa_open_account(pipes_struct *p)
00432 {
00433 LSA_Q_OPENACCOUNT q_u;
00434 LSA_R_OPENACCOUNT r_u;
00435
00436 prs_struct *data = &p->in_data.data;
00437 prs_struct *rdata = &p->out_data.rdata;
00438
00439 ZERO_STRUCT(q_u);
00440 ZERO_STRUCT(r_u);
00441
00442 if(!lsa_io_q_open_account("", &q_u, data, 0)) {
00443 DEBUG(0,("api_lsa_open_account: failed to unmarshall LSA_Q_OPENACCOUNT.\n"));
00444 return False;
00445 }
00446
00447 r_u.status = _lsa_open_account(p, &q_u, &r_u);
00448
00449
00450 if(!lsa_io_r_open_account("", &r_u, rdata, 0)) {
00451 DEBUG(0,("api_lsa_open_account: Failed to marshall LSA_R_OPENACCOUNT.\n"));
00452 return False;
00453 }
00454
00455 return True;
00456 }
00457
00458
00459
00460
00461
00462 static BOOL api_lsa_enum_privsaccount(pipes_struct *p)
00463 {
00464 LSA_Q_ENUMPRIVSACCOUNT q_u;
00465 LSA_R_ENUMPRIVSACCOUNT r_u;
00466
00467 prs_struct *data = &p->in_data.data;
00468 prs_struct *rdata = &p->out_data.rdata;
00469
00470 ZERO_STRUCT(q_u);
00471 ZERO_STRUCT(r_u);
00472
00473 if(!lsa_io_q_enum_privsaccount("", &q_u, data, 0)) {
00474 DEBUG(0,("api_lsa_enum_privsaccount: failed to unmarshall LSA_Q_ENUMPRIVSACCOUNT.\n"));
00475 return False;
00476 }
00477
00478 r_u.status = _lsa_enum_privsaccount(p, rdata, &q_u, &r_u);
00479
00480
00481 if(!lsa_io_r_enum_privsaccount("", &r_u, rdata, 0)) {
00482 DEBUG(0,("api_lsa_enum_privsaccount: Failed to marshall LSA_R_ENUMPRIVSACCOUNT.\n"));
00483 return False;
00484 }
00485
00486 return True;
00487 }
00488
00489
00490
00491
00492
00493 static BOOL api_lsa_getsystemaccount(pipes_struct *p)
00494 {
00495 LSA_Q_GETSYSTEMACCOUNT q_u;
00496 LSA_R_GETSYSTEMACCOUNT r_u;
00497
00498 prs_struct *data = &p->in_data.data;
00499 prs_struct *rdata = &p->out_data.rdata;
00500
00501 ZERO_STRUCT(q_u);
00502 ZERO_STRUCT(r_u);
00503
00504 if(!lsa_io_q_getsystemaccount("", &q_u, data, 0)) {
00505 DEBUG(0,("api_lsa_getsystemaccount: failed to unmarshall LSA_Q_GETSYSTEMACCOUNT.\n"));
00506 return False;
00507 }
00508
00509 r_u.status = _lsa_getsystemaccount(p, &q_u, &r_u);
00510
00511
00512 if(!lsa_io_r_getsystemaccount("", &r_u, rdata, 0)) {
00513 DEBUG(0,("api_lsa_getsystemaccount: Failed to marshall LSA_R_GETSYSTEMACCOUNT.\n"));
00514 return False;
00515 }
00516
00517 return True;
00518 }
00519
00520
00521
00522
00523
00524
00525 static BOOL api_lsa_setsystemaccount(pipes_struct *p)
00526 {
00527 LSA_Q_SETSYSTEMACCOUNT q_u;
00528 LSA_R_SETSYSTEMACCOUNT r_u;
00529
00530 prs_struct *data = &p->in_data.data;
00531 prs_struct *rdata = &p->out_data.rdata;
00532
00533 ZERO_STRUCT(q_u);
00534 ZERO_STRUCT(r_u);
00535
00536 if(!lsa_io_q_setsystemaccount("", &q_u, data, 0)) {
00537 DEBUG(0,("api_lsa_setsystemaccount: failed to unmarshall LSA_Q_SETSYSTEMACCOUNT.\n"));
00538 return False;
00539 }
00540
00541 r_u.status = _lsa_setsystemaccount(p, &q_u, &r_u);
00542
00543
00544 if(!lsa_io_r_setsystemaccount("", &r_u, rdata, 0)) {
00545 DEBUG(0,("api_lsa_setsystemaccount: Failed to marshall LSA_R_SETSYSTEMACCOUNT.\n"));
00546 return False;
00547 }
00548
00549 return True;
00550 }
00551
00552
00553
00554
00555
00556 static BOOL api_lsa_addprivs(pipes_struct *p)
00557 {
00558 LSA_Q_ADDPRIVS q_u;
00559 LSA_R_ADDPRIVS r_u;
00560
00561 prs_struct *data = &p->in_data.data;
00562 prs_struct *rdata = &p->out_data.rdata;
00563
00564 ZERO_STRUCT(q_u);
00565 ZERO_STRUCT(r_u);
00566
00567 if(!lsa_io_q_addprivs("", &q_u, data, 0)) {
00568 DEBUG(0,("api_lsa_addprivs: failed to unmarshall LSA_Q_ADDPRIVS.\n"));
00569 return False;
00570 }
00571
00572 r_u.status = _lsa_addprivs(p, &q_u, &r_u);
00573
00574
00575 if(!lsa_io_r_addprivs("", &r_u, rdata, 0)) {
00576 DEBUG(0,("api_lsa_addprivs: Failed to marshall LSA_R_ADDPRIVS.\n"));
00577 return False;
00578 }
00579
00580 return True;
00581 }
00582
00583
00584
00585
00586
00587 static BOOL api_lsa_removeprivs(pipes_struct *p)
00588 {
00589 LSA_Q_REMOVEPRIVS q_u;
00590 LSA_R_REMOVEPRIVS r_u;
00591
00592 prs_struct *data = &p->in_data.data;
00593 prs_struct *rdata = &p->out_data.rdata;
00594
00595 ZERO_STRUCT(q_u);
00596 ZERO_STRUCT(r_u);
00597
00598 if(!lsa_io_q_removeprivs("", &q_u, data, 0)) {
00599 DEBUG(0,("api_lsa_removeprivs: failed to unmarshall LSA_Q_REMOVEPRIVS.\n"));
00600 return False;
00601 }
00602
00603 r_u.status = _lsa_removeprivs(p, &q_u, &r_u);
00604
00605
00606 if(!lsa_io_r_removeprivs("", &r_u, rdata, 0)) {
00607 DEBUG(0,("api_lsa_removeprivs: Failed to marshall LSA_R_REMOVEPRIVS.\n"));
00608 return False;
00609 }
00610
00611 return True;
00612 }
00613
00614
00615
00616
00617
00618 static BOOL api_lsa_query_secobj(pipes_struct *p)
00619 {
00620 LSA_Q_QUERY_SEC_OBJ q_u;
00621 LSA_R_QUERY_SEC_OBJ r_u;
00622
00623 prs_struct *data = &p->in_data.data;
00624 prs_struct *rdata = &p->out_data.rdata;
00625
00626 ZERO_STRUCT(q_u);
00627 ZERO_STRUCT(r_u);
00628
00629 if(!lsa_io_q_query_sec_obj("", &q_u, data, 0)) {
00630 DEBUG(0,("api_lsa_query_secobj: failed to unmarshall LSA_Q_QUERY_SEC_OBJ.\n"));
00631 return False;
00632 }
00633
00634 r_u.status = _lsa_query_secobj(p, &q_u, &r_u);
00635
00636
00637 if(!lsa_io_r_query_sec_obj("", &r_u, rdata, 0)) {
00638 DEBUG(0,("api_lsa_query_secobj: Failed to marshall LSA_R_QUERY_SEC_OBJ.\n"));
00639 return False;
00640 }
00641
00642 return True;
00643 }
00644
00645
00646
00647
00648
00649 static BOOL api_lsa_add_acct_rights(pipes_struct *p)
00650 {
00651 LSA_Q_ADD_ACCT_RIGHTS q_u;
00652 LSA_R_ADD_ACCT_RIGHTS r_u;
00653
00654 prs_struct *data = &p->in_data.data;
00655 prs_struct *rdata = &p->out_data.rdata;
00656
00657 ZERO_STRUCT(q_u);
00658 ZERO_STRUCT(r_u);
00659
00660 if(!lsa_io_q_add_acct_rights("", &q_u, data, 0)) {
00661 DEBUG(0,("api_lsa_add_acct_rights: failed to unmarshall LSA_Q_ADD_ACCT_RIGHTS.\n"));
00662 return False;
00663 }
00664
00665 r_u.status = _lsa_add_acct_rights(p, &q_u, &r_u);
00666
00667
00668 if(!lsa_io_r_add_acct_rights("", &r_u, rdata, 0)) {
00669 DEBUG(0,("api_lsa_add_acct_rights: Failed to marshall LSA_R_ADD_ACCT_RIGHTS.\n"));
00670 return False;
00671 }
00672
00673 return True;
00674 }
00675
00676
00677
00678
00679
00680 static BOOL api_lsa_remove_acct_rights(pipes_struct *p)
00681 {
00682 LSA_Q_REMOVE_ACCT_RIGHTS q_u;
00683 LSA_R_REMOVE_ACCT_RIGHTS r_u;
00684
00685 prs_struct *data = &p->in_data.data;
00686 prs_struct *rdata = &p->out_data.rdata;
00687
00688 ZERO_STRUCT(q_u);
00689 ZERO_STRUCT(r_u);
00690
00691 if(!lsa_io_q_remove_acct_rights("", &q_u, data, 0)) {
00692 DEBUG(0,("api_lsa_remove_acct_rights: failed to unmarshall LSA_Q_REMOVE_ACCT_RIGHTS.\n"));
00693 return False;
00694 }
00695
00696 r_u.status = _lsa_remove_acct_rights(p, &q_u, &r_u);
00697
00698
00699 if(!lsa_io_r_remove_acct_rights("", &r_u, rdata, 0)) {
00700 DEBUG(0,("api_lsa_remove_acct_rights: Failed to marshall LSA_R_REMOVE_ACCT_RIGHTS.\n"));
00701 return False;
00702 }
00703
00704 return True;
00705 }
00706
00707
00708
00709
00710
00711 static BOOL api_lsa_enum_acct_rights(pipes_struct *p)
00712 {
00713 LSA_Q_ENUM_ACCT_RIGHTS q_u;
00714 LSA_R_ENUM_ACCT_RIGHTS r_u;
00715
00716 prs_struct *data = &p->in_data.data;
00717 prs_struct *rdata = &p->out_data.rdata;
00718
00719 ZERO_STRUCT(q_u);
00720 ZERO_STRUCT(r_u);
00721
00722 if(!lsa_io_q_enum_acct_rights("", &q_u, data, 0)) {
00723 DEBUG(0,("api_lsa_enum_acct_rights: failed to unmarshall LSA_Q_ENUM_ACCT_RIGHTS.\n"));
00724 return False;
00725 }
00726
00727 r_u.status = _lsa_enum_acct_rights(p, &q_u, &r_u);
00728
00729
00730 if(!lsa_io_r_enum_acct_rights("", &r_u, rdata, 0)) {
00731 DEBUG(0,("api_lsa_enum_acct_rights: Failed to marshall LSA_R_ENUM_ACCT_RIGHTS.\n"));
00732 return False;
00733 }
00734
00735 return True;
00736 }
00737
00738
00739
00740
00741
00742 static BOOL api_lsa_lookup_priv_value(pipes_struct *p)
00743 {
00744 LSA_Q_LOOKUP_PRIV_VALUE q_u;
00745 LSA_R_LOOKUP_PRIV_VALUE r_u;
00746
00747 prs_struct *data = &p->in_data.data;
00748 prs_struct *rdata = &p->out_data.rdata;
00749
00750 ZERO_STRUCT(q_u);
00751 ZERO_STRUCT(r_u);
00752
00753 if(!lsa_io_q_lookup_priv_value("", &q_u, data, 0)) {
00754 DEBUG(0,("api_lsa_lookup_priv_value: failed to unmarshall LSA_Q_LOOKUP_PRIV_VALUE .\n"));
00755 return False;
00756 }
00757
00758 r_u.status = _lsa_lookup_priv_value(p, &q_u, &r_u);
00759
00760
00761 if(!lsa_io_r_lookup_priv_value("", &r_u, rdata, 0)) {
00762 DEBUG(0,("api_lsa_lookup_priv_value: Failed to marshall LSA_R_LOOKUP_PRIV_VALUE.\n"));
00763 return False;
00764 }
00765
00766 return True;
00767 }
00768
00769
00770
00771
00772 static BOOL api_lsa_open_trust_dom(pipes_struct *p)
00773 {
00774 LSA_Q_OPEN_TRUSTED_DOMAIN q_u;
00775 LSA_R_OPEN_TRUSTED_DOMAIN r_u;
00776
00777 prs_struct *data = &p->in_data.data;
00778 prs_struct *rdata = &p->out_data.rdata;
00779
00780 ZERO_STRUCT(q_u);
00781 ZERO_STRUCT(r_u);
00782
00783 if(!lsa_io_q_open_trusted_domain("", &q_u, data, 0)) {
00784 DEBUG(0,("api_lsa_open_trust_dom: failed to unmarshall LSA_Q_OPEN_TRUSTED_DOMAIN .\n"));
00785 return False;
00786 }
00787
00788 r_u.status = _lsa_open_trusted_domain(p, &q_u, &r_u);
00789
00790
00791 if(!lsa_io_r_open_trusted_domain("", &r_u, rdata, 0)) {
00792 DEBUG(0,("api_lsa_open_trust_dom: Failed to marshall LSA_R_OPEN_TRUSTED_DOMAIN.\n"));
00793 return False;
00794 }
00795
00796 return True;
00797 }
00798
00799
00800
00801
00802 static BOOL api_lsa_create_trust_dom(pipes_struct *p)
00803 {
00804 LSA_Q_CREATE_TRUSTED_DOMAIN q_u;
00805 LSA_R_CREATE_TRUSTED_DOMAIN r_u;
00806
00807 prs_struct *data = &p->in_data.data;
00808 prs_struct *rdata = &p->out_data.rdata;
00809
00810 ZERO_STRUCT(q_u);
00811 ZERO_STRUCT(r_u);
00812
00813 if(!lsa_io_q_create_trusted_domain("", &q_u, data, 0)) {
00814 DEBUG(0,("api_lsa_create_trust_dom: failed to unmarshall LSA_Q_CREATE_TRUSTED_DOMAIN .\n"));
00815 return False;
00816 }
00817
00818 r_u.status = _lsa_create_trusted_domain(p, &q_u, &r_u);
00819
00820
00821 if(!lsa_io_r_create_trusted_domain("", &r_u, rdata, 0)) {
00822 DEBUG(0,("api_lsa_create_trust_dom: Failed to marshall LSA_R_CREATE_TRUSTED_DOMAIN.\n"));
00823 return False;
00824 }
00825
00826 return True;
00827 }
00828
00829
00830
00831
00832 static BOOL api_lsa_create_secret(pipes_struct *p)
00833 {
00834 LSA_Q_CREATE_SECRET q_u;
00835 LSA_R_CREATE_SECRET r_u;
00836
00837 prs_struct *data = &p->in_data.data;
00838 prs_struct *rdata = &p->out_data.rdata;
00839
00840 ZERO_STRUCT(q_u);
00841 ZERO_STRUCT(r_u);
00842
00843 if(!lsa_io_q_create_secret("", &q_u, data, 0)) {
00844 DEBUG(0,("api_lsa_create_secret: failed to unmarshall LSA_Q_CREATE_SECRET.\n"));
00845 return False;
00846 }
00847
00848 r_u.status = _lsa_create_secret(p, &q_u, &r_u);
00849
00850
00851 if(!lsa_io_r_create_secret("", &r_u, rdata, 0)) {
00852 DEBUG(0,("api_lsa_create_secret: Failed to marshall LSA_R_CREATE_SECRET.\n"));
00853 return False;
00854 }
00855
00856 return True;
00857 }
00858
00859
00860
00861
00862 static BOOL api_lsa_set_secret(pipes_struct *p)
00863 {
00864 LSA_Q_SET_SECRET q_u;
00865 LSA_R_SET_SECRET r_u;
00866
00867 prs_struct *data = &p->in_data.data;
00868 prs_struct *rdata = &p->out_data.rdata;
00869
00870 ZERO_STRUCT(q_u);
00871 ZERO_STRUCT(r_u);
00872
00873 if(!lsa_io_q_set_secret("", &q_u, data, 0)) {
00874 DEBUG(0,("api_lsa_set_secret: failed to unmarshall LSA_Q_SET_SECRET.\n"));
00875 return False;
00876 }
00877
00878 r_u.status = _lsa_set_secret(p, &q_u, &r_u);
00879
00880
00881 if(!lsa_io_r_set_secret("", &r_u, rdata, 0)) {
00882 DEBUG(0,("api_lsa_set_secret: Failed to marshall LSA_R_SET_SECRET.\n"));
00883 return False;
00884 }
00885
00886 return True;
00887 }
00888
00889
00890
00891
00892 static BOOL api_lsa_delete_object(pipes_struct *p)
00893 {
00894 LSA_Q_DELETE_OBJECT q_u;
00895 LSA_R_DELETE_OBJECT r_u;
00896
00897 prs_struct *data = &p->in_data.data;
00898 prs_struct *rdata = &p->out_data.rdata;
00899
00900 ZERO_STRUCT(q_u);
00901 ZERO_STRUCT(r_u);
00902
00903 if(!lsa_io_q_delete_object("", &q_u, data, 0)) {
00904 DEBUG(0,("api_lsa_delete_object: failed to unmarshall LSA_Q_DELETE_OBJECT.\n"));
00905 return False;
00906 }
00907
00908 r_u.status = _lsa_delete_object(p, &q_u, &r_u);
00909
00910
00911 if(!lsa_io_r_delete_object("", &r_u, rdata, 0)) {
00912 DEBUG(0,("api_lsa_delete_object: Failed to marshall LSA_R_DELETE_OBJECT.\n"));
00913 return False;
00914 }
00915
00916 return True;
00917 }
00918
00919
00920
00921
00922
00923 static BOOL api_lsa_lookup_sids2(pipes_struct *p)
00924 {
00925 LSA_Q_LOOKUP_SIDS2 q_u;
00926 LSA_R_LOOKUP_SIDS2 r_u;
00927 prs_struct *data = &p->in_data.data;
00928 prs_struct *rdata = &p->out_data.rdata;
00929
00930 ZERO_STRUCT(q_u);
00931 ZERO_STRUCT(r_u);
00932
00933
00934 if(!lsa_io_q_lookup_sids2("", &q_u, data, 0)) {
00935 DEBUG(0,("api_lsa_lookup_sids2: failed to unmarshall LSA_Q_LOOKUP_SIDS2.\n"));
00936 return False;
00937 }
00938
00939 r_u.status = _lsa_lookup_sids2(p, &q_u, &r_u);
00940
00941 if(!lsa_io_r_lookup_sids2("", &r_u, rdata, 0)) {
00942 DEBUG(0,("api_lsa_lookup_sids2: Failed to marshall LSA_R_LOOKUP_SIDS2.\n"));
00943 return False;
00944 }
00945
00946 return True;
00947 }
00948
00949
00950
00951
00952
00953 static BOOL api_lsa_lookup_sids3(pipes_struct *p)
00954 {
00955 LSA_Q_LOOKUP_SIDS3 q_u;
00956 LSA_R_LOOKUP_SIDS3 r_u;
00957 prs_struct *data = &p->in_data.data;
00958 prs_struct *rdata = &p->out_data.rdata;
00959
00960 ZERO_STRUCT(q_u);
00961 ZERO_STRUCT(r_u);
00962
00963
00964 if(!lsa_io_q_lookup_sids3("", &q_u, data, 0)) {
00965 DEBUG(0,("api_lsa_lookup_sids3: failed to unmarshall LSA_Q_LOOKUP_SIDS3.\n"));
00966 return False;
00967 }
00968
00969 r_u.status = _lsa_lookup_sids3(p, &q_u, &r_u);
00970
00971 if(!lsa_io_r_lookup_sids3("", &r_u, rdata, 0)) {
00972 DEBUG(0,("api_lsa_lookup_sids3: Failed to marshall LSA_R_LOOKUP_SIDS3.\n"));
00973 return False;
00974 }
00975
00976 return True;
00977 }
00978
00979
00980
00981
00982
00983 static BOOL api_lsa_lookup_names2(pipes_struct *p)
00984 {
00985 LSA_Q_LOOKUP_NAMES2 q_u;
00986 LSA_R_LOOKUP_NAMES2 r_u;
00987 prs_struct *data = &p->in_data.data;
00988 prs_struct *rdata = &p->out_data.rdata;
00989
00990 ZERO_STRUCT(q_u);
00991 ZERO_STRUCT(r_u);
00992
00993
00994 if(!lsa_io_q_lookup_names2("", &q_u, data, 0)) {
00995 DEBUG(0,("api_lsa_lookup_names2: failed to unmarshall LSA_Q_LOOKUP_NAMES2.\n"));
00996 return False;
00997 }
00998
00999 r_u.status = _lsa_lookup_names2(p, &q_u, &r_u);
01000
01001
01002 if(!lsa_io_r_lookup_names2("", &r_u, rdata, 0)) {
01003 DEBUG(0,("api_lsa_lookup_names2: Failed to marshall LSA_R_LOOKUP_NAMES2.\n"));
01004 return False;
01005 }
01006
01007 return True;
01008 }
01009
01010
01011
01012
01013
01014 static BOOL api_lsa_lookup_names3(pipes_struct *p)
01015 {
01016 LSA_Q_LOOKUP_NAMES3 q_u;
01017 LSA_R_LOOKUP_NAMES3 r_u;
01018 prs_struct *data = &p->in_data.data;
01019 prs_struct *rdata = &p->out_data.rdata;
01020
01021 ZERO_STRUCT(q_u);
01022 ZERO_STRUCT(r_u);
01023
01024
01025 if(!lsa_io_q_lookup_names3("", &q_u, data, 0)) {
01026 DEBUG(0,("api_lsa_lookup_names3: failed to unmarshall LSA_Q_LOOKUP_NAMES3.\n"));
01027 return False;
01028 }
01029
01030 r_u.status = _lsa_lookup_names3(p, &q_u, &r_u);
01031
01032
01033 if(!lsa_io_r_lookup_names3("", &r_u, rdata, 0)) {
01034 DEBUG(0,("api_lsa_lookup_names3: Failed to marshall LSA_R_LOOKUP_NAMES3.\n"));
01035 return False;
01036 }
01037
01038 return True;
01039 }
01040
01041
01042
01043
01044
01045 static BOOL api_lsa_lookup_names4(pipes_struct *p)
01046 {
01047 LSA_Q_LOOKUP_NAMES4 q_u;
01048 LSA_R_LOOKUP_NAMES4 r_u;
01049 prs_struct *data = &p->in_data.data;
01050 prs_struct *rdata = &p->out_data.rdata;
01051
01052 ZERO_STRUCT(q_u);
01053 ZERO_STRUCT(r_u);
01054
01055
01056 if(!lsa_io_q_lookup_names4("", &q_u, data, 0)) {
01057 DEBUG(0,("api_lsa_lookup_names4: failed to unmarshall LSA_Q_LOOKUP_NAMES4.\n"));
01058 return False;
01059 }
01060
01061 r_u.status = _lsa_lookup_names4(p, &q_u, &r_u);
01062
01063
01064 if(!lsa_io_r_lookup_names4("", &r_u, rdata, 0)) {
01065 DEBUG(0,("api_lsa_lookup_names4: Failed to marshall LSA_R_LOOKUP_NAMES4.\n"));
01066 return False;
01067 }
01068
01069 return True;
01070 }
01071
01072 #if 0
01073
01074
01075
01076
01077
01078 static BOOL api_lsa_query_info2(pipes_struct *p)
01079 {
01080 LSA_Q_QUERY_INFO2 q_u;
01081 LSA_R_QUERY_INFO2 r_u;
01082
01083 prs_struct *data = &p->in_data.data;
01084 prs_struct *rdata = &p->out_data.rdata;
01085
01086 ZERO_STRUCT(q_u);
01087 ZERO_STRUCT(r_u);
01088
01089 if(!lsa_io_q_query_info2("", &q_u, data, 0)) {
01090 DEBUG(0,("api_lsa_query_info2: failed to unmarshall LSA_Q_QUERY_INFO2.\n"));
01091 return False;
01092 }
01093
01094 r_u.status = _lsa_query_info2(p, &q_u, &r_u);
01095
01096 if (!lsa_io_r_query_info2("", &r_u, rdata, 0)) {
01097 DEBUG(0,("api_lsa_query_info2: failed to marshall LSA_R_QUERY_INFO2.\n"));
01098 return False;
01099 }
01100
01101 return True;
01102 }
01103 #endif
01104
01105
01106
01107
01108
01109 static struct api_struct api_lsa_cmds[] =
01110 {
01111 { "LSA_OPENPOLICY2" , LSA_OPENPOLICY2 , api_lsa_open_policy2 },
01112 { "LSA_OPENPOLICY" , LSA_OPENPOLICY , api_lsa_open_policy },
01113 { "LSA_QUERYINFOPOLICY" , LSA_QUERYINFOPOLICY , api_lsa_query_info },
01114 { "LSA_ENUMTRUSTDOM" , LSA_ENUMTRUSTDOM , api_lsa_enum_trust_dom },
01115 { "LSA_CLOSE" , LSA_CLOSE , api_lsa_close },
01116 { "LSA_OPENSECRET" , LSA_OPENSECRET , api_lsa_open_secret },
01117 { "LSA_LOOKUPSIDS" , LSA_LOOKUPSIDS , api_lsa_lookup_sids },
01118 { "LSA_LOOKUPNAMES" , LSA_LOOKUPNAMES , api_lsa_lookup_names },
01119 { "LSA_ENUM_PRIVS" , LSA_ENUM_PRIVS , api_lsa_enum_privs },
01120 { "LSA_PRIV_GET_DISPNAME",LSA_PRIV_GET_DISPNAME,api_lsa_priv_get_dispname},
01121 { "LSA_ENUM_ACCOUNTS" , LSA_ENUM_ACCOUNTS , api_lsa_enum_accounts },
01122 { "LSA_UNK_GET_CONNUSER", LSA_UNK_GET_CONNUSER, api_lsa_unk_get_connuser },
01123 { "LSA_CREATEACCOUNT" , LSA_CREATEACCOUNT , api_lsa_create_account },
01124 { "LSA_OPENACCOUNT" , LSA_OPENACCOUNT , api_lsa_open_account },
01125 { "LSA_ENUMPRIVSACCOUNT", LSA_ENUMPRIVSACCOUNT, api_lsa_enum_privsaccount},
01126 { "LSA_GETSYSTEMACCOUNT", LSA_GETSYSTEMACCOUNT, api_lsa_getsystemaccount },
01127 { "LSA_SETSYSTEMACCOUNT", LSA_SETSYSTEMACCOUNT, api_lsa_setsystemaccount },
01128 { "LSA_ADDPRIVS" , LSA_ADDPRIVS , api_lsa_addprivs },
01129 { "LSA_REMOVEPRIVS" , LSA_REMOVEPRIVS , api_lsa_removeprivs },
01130 { "LSA_ADDACCTRIGHTS" , LSA_ADDACCTRIGHTS , api_lsa_add_acct_rights },
01131 { "LSA_REMOVEACCTRIGHTS", LSA_REMOVEACCTRIGHTS, api_lsa_remove_acct_rights },
01132 { "LSA_ENUMACCTRIGHTS" , LSA_ENUMACCTRIGHTS , api_lsa_enum_acct_rights },
01133 { "LSA_QUERYSECOBJ" , LSA_QUERYSECOBJ , api_lsa_query_secobj },
01134 { "LSA_LOOKUPPRIVVALUE" , LSA_LOOKUPPRIVVALUE , api_lsa_lookup_priv_value },
01135 { "LSA_OPENTRUSTDOM" , LSA_OPENTRUSTDOM , api_lsa_open_trust_dom },
01136 { "LSA_OPENSECRET" , LSA_OPENSECRET , api_lsa_open_secret },
01137 { "LSA_CREATETRUSTDOM" , LSA_CREATETRUSTDOM , api_lsa_create_trust_dom },
01138 { "LSA_CREATSECRET" , LSA_CREATESECRET , api_lsa_create_secret },
01139 { "LSA_SETSECRET" , LSA_SETSECRET , api_lsa_set_secret },
01140 { "LSA_DELETEOBJECT" , LSA_DELETEOBJECT , api_lsa_delete_object },
01141 { "LSA_LOOKUPSIDS2" , LSA_LOOKUPSIDS2 , api_lsa_lookup_sids2 },
01142 { "LSA_LOOKUPNAMES2" , LSA_LOOKUPNAMES2 , api_lsa_lookup_names2 },
01143 { "LSA_LOOKUPNAMES3" , LSA_LOOKUPNAMES3 , api_lsa_lookup_names3 },
01144 { "LSA_LOOKUPSIDS3" , LSA_LOOKUPSIDS3 , api_lsa_lookup_sids3 },
01145 { "LSA_LOOKUPNAMES4" , LSA_LOOKUPNAMES4 , api_lsa_lookup_names4 }
01146 #if 0
01147
01148
01149 { "LSA_QUERYINFO2" , LSA_QUERYINFO2 , api_lsa_query_info2 }
01150 #endif
01151 };
01152
01153 static int count_fns(void)
01154 {
01155 int funcs = sizeof(api_lsa_cmds) / sizeof(struct api_struct);
01156
01157 #if 0
01158
01159
01160
01161
01162
01163 if (!(SEC_ADS == lp_security() && ROLE_DOMAIN_PDC == lp_server_role())) {
01164 funcs -= 1;
01165 }
01166 #endif
01167
01168 return funcs;
01169 }
01170 void lsa_get_pipe_fns( struct api_struct **fns, int *n_fns )
01171 {
01172 *fns = api_lsa_cmds;
01173 *n_fns = count_fns();
01174 }
01175
01176
01177 NTSTATUS rpc_lsa_init(void)
01178 {
01179 int funcs = count_fns();
01180
01181 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsass", api_lsa_cmds,
01182 funcs);
01183 }