| 1 | /*
|
|---|
| 2 | * Unix SMB/CIFS implementation.
|
|---|
| 3 | * NetApi Support
|
|---|
| 4 | * Copyright (C) Guenther Deschner 2007-2008
|
|---|
| 5 | *
|
|---|
| 6 | * This program is free software; you can redistribute it and/or modify
|
|---|
| 7 | * it under the terms of the GNU General Public License as published by
|
|---|
| 8 | * the Free Software Foundation; either version 3 of the License, or
|
|---|
| 9 | * (at your option) any later version.
|
|---|
| 10 | *
|
|---|
| 11 | * This program is distributed in the hope that it will be useful,
|
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | * GNU General Public License for more details.
|
|---|
| 15 | *
|
|---|
| 16 | * You should have received a copy of the GNU General Public License
|
|---|
| 17 | * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|---|
| 18 | */
|
|---|
| 19 |
|
|---|
| 20 | #include "includes.h"
|
|---|
| 21 | #include "librpc/gen_ndr/libnetapi.h"
|
|---|
| 22 | #include "lib/netapi/netapi.h"
|
|---|
| 23 | #include "lib/netapi/netapi_private.h"
|
|---|
| 24 | #include "lib/netapi/libnetapi.h"
|
|---|
| 25 | #include "librpc/gen_ndr/ndr_libnetapi.h"
|
|---|
| 26 |
|
|---|
| 27 | /****************************************************************
|
|---|
| 28 | NetJoinDomain
|
|---|
| 29 | ****************************************************************/
|
|---|
| 30 |
|
|---|
| 31 | NET_API_STATUS NetJoinDomain(const char * server /* [in] [unique] */,
|
|---|
| 32 | const char * domain /* [in] [ref] */,
|
|---|
| 33 | const char * account_ou /* [in] [unique] */,
|
|---|
| 34 | const char * account /* [in] [unique] */,
|
|---|
| 35 | const char * password /* [in] [unique] */,
|
|---|
| 36 | uint32_t join_flags /* [in] */)
|
|---|
| 37 | {
|
|---|
| 38 | struct NetJoinDomain r;
|
|---|
| 39 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 40 | NET_API_STATUS status;
|
|---|
| 41 | WERROR werr;
|
|---|
| 42 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 43 |
|
|---|
| 44 | status = libnetapi_getctx(&ctx);
|
|---|
| 45 | if (status != 0) {
|
|---|
| 46 | TALLOC_FREE(frame);
|
|---|
| 47 | return status;
|
|---|
| 48 | }
|
|---|
| 49 |
|
|---|
| 50 | /* In parameters */
|
|---|
| 51 | r.in.server = server;
|
|---|
| 52 | r.in.domain = domain;
|
|---|
| 53 | r.in.account_ou = account_ou;
|
|---|
| 54 | r.in.account = account;
|
|---|
| 55 | r.in.password = password;
|
|---|
| 56 | r.in.join_flags = join_flags;
|
|---|
| 57 |
|
|---|
| 58 | /* Out parameters */
|
|---|
| 59 |
|
|---|
| 60 | if (DEBUGLEVEL >= 10) {
|
|---|
| 61 | NDR_PRINT_IN_DEBUG(NetJoinDomain, &r);
|
|---|
| 62 | }
|
|---|
| 63 |
|
|---|
| 64 | if (LIBNETAPI_LOCAL_SERVER(server)) {
|
|---|
| 65 | werr = NetJoinDomain_l(ctx, &r);
|
|---|
| 66 | } else {
|
|---|
| 67 | werr = NetJoinDomain_r(ctx, &r);
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | r.out.result = W_ERROR_V(werr);
|
|---|
| 71 |
|
|---|
| 72 | if (DEBUGLEVEL >= 10) {
|
|---|
| 73 | NDR_PRINT_OUT_DEBUG(NetJoinDomain, &r);
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 | TALLOC_FREE(frame);
|
|---|
| 77 | return (NET_API_STATUS)r.out.result;
|
|---|
| 78 | }
|
|---|
| 79 |
|
|---|
| 80 | /****************************************************************
|
|---|
| 81 | NetUnjoinDomain
|
|---|
| 82 | ****************************************************************/
|
|---|
| 83 |
|
|---|
| 84 | NET_API_STATUS NetUnjoinDomain(const char * server_name /* [in] [unique] */,
|
|---|
| 85 | const char * account /* [in] [unique] */,
|
|---|
| 86 | const char * password /* [in] [unique] */,
|
|---|
| 87 | uint32_t unjoin_flags /* [in] */)
|
|---|
| 88 | {
|
|---|
| 89 | struct NetUnjoinDomain r;
|
|---|
| 90 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 91 | NET_API_STATUS status;
|
|---|
| 92 | WERROR werr;
|
|---|
| 93 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 94 |
|
|---|
| 95 | status = libnetapi_getctx(&ctx);
|
|---|
| 96 | if (status != 0) {
|
|---|
| 97 | TALLOC_FREE(frame);
|
|---|
| 98 | return status;
|
|---|
| 99 | }
|
|---|
| 100 |
|
|---|
| 101 | /* In parameters */
|
|---|
| 102 | r.in.server_name = server_name;
|
|---|
| 103 | r.in.account = account;
|
|---|
| 104 | r.in.password = password;
|
|---|
| 105 | r.in.unjoin_flags = unjoin_flags;
|
|---|
| 106 |
|
|---|
| 107 | /* Out parameters */
|
|---|
| 108 |
|
|---|
| 109 | if (DEBUGLEVEL >= 10) {
|
|---|
| 110 | NDR_PRINT_IN_DEBUG(NetUnjoinDomain, &r);
|
|---|
| 111 | }
|
|---|
| 112 |
|
|---|
| 113 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 114 | werr = NetUnjoinDomain_l(ctx, &r);
|
|---|
| 115 | } else {
|
|---|
| 116 | werr = NetUnjoinDomain_r(ctx, &r);
|
|---|
| 117 | }
|
|---|
| 118 |
|
|---|
| 119 | r.out.result = W_ERROR_V(werr);
|
|---|
| 120 |
|
|---|
| 121 | if (DEBUGLEVEL >= 10) {
|
|---|
| 122 | NDR_PRINT_OUT_DEBUG(NetUnjoinDomain, &r);
|
|---|
| 123 | }
|
|---|
| 124 |
|
|---|
| 125 | TALLOC_FREE(frame);
|
|---|
| 126 | return (NET_API_STATUS)r.out.result;
|
|---|
| 127 | }
|
|---|
| 128 |
|
|---|
| 129 | /****************************************************************
|
|---|
| 130 | NetGetJoinInformation
|
|---|
| 131 | ****************************************************************/
|
|---|
| 132 |
|
|---|
| 133 | NET_API_STATUS NetGetJoinInformation(const char * server_name /* [in] [unique] */,
|
|---|
| 134 | const char * *name_buffer /* [out] [ref] */,
|
|---|
| 135 | uint16_t *name_type /* [out] [ref] */)
|
|---|
| 136 | {
|
|---|
| 137 | struct NetGetJoinInformation r;
|
|---|
| 138 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 139 | NET_API_STATUS status;
|
|---|
| 140 | WERROR werr;
|
|---|
| 141 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 142 |
|
|---|
| 143 | status = libnetapi_getctx(&ctx);
|
|---|
| 144 | if (status != 0) {
|
|---|
| 145 | TALLOC_FREE(frame);
|
|---|
| 146 | return status;
|
|---|
| 147 | }
|
|---|
| 148 |
|
|---|
| 149 | /* In parameters */
|
|---|
| 150 | r.in.server_name = server_name;
|
|---|
| 151 |
|
|---|
| 152 | /* Out parameters */
|
|---|
| 153 | r.out.name_buffer = name_buffer;
|
|---|
| 154 | r.out.name_type = name_type;
|
|---|
| 155 |
|
|---|
| 156 | if (DEBUGLEVEL >= 10) {
|
|---|
| 157 | NDR_PRINT_IN_DEBUG(NetGetJoinInformation, &r);
|
|---|
| 158 | }
|
|---|
| 159 |
|
|---|
| 160 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 161 | werr = NetGetJoinInformation_l(ctx, &r);
|
|---|
| 162 | } else {
|
|---|
| 163 | werr = NetGetJoinInformation_r(ctx, &r);
|
|---|
| 164 | }
|
|---|
| 165 |
|
|---|
| 166 | r.out.result = W_ERROR_V(werr);
|
|---|
| 167 |
|
|---|
| 168 | if (DEBUGLEVEL >= 10) {
|
|---|
| 169 | NDR_PRINT_OUT_DEBUG(NetGetJoinInformation, &r);
|
|---|
| 170 | }
|
|---|
| 171 |
|
|---|
| 172 | TALLOC_FREE(frame);
|
|---|
| 173 | return (NET_API_STATUS)r.out.result;
|
|---|
| 174 | }
|
|---|
| 175 |
|
|---|
| 176 | /****************************************************************
|
|---|
| 177 | NetGetJoinableOUs
|
|---|
| 178 | ****************************************************************/
|
|---|
| 179 |
|
|---|
| 180 | NET_API_STATUS NetGetJoinableOUs(const char * server_name /* [in] [unique] */,
|
|---|
| 181 | const char * domain /* [in] [ref] */,
|
|---|
| 182 | const char * account /* [in] [unique] */,
|
|---|
| 183 | const char * password /* [in] [unique] */,
|
|---|
| 184 | uint32_t *ou_count /* [out] [ref] */,
|
|---|
| 185 | const char * **ous /* [out] [ref] */)
|
|---|
| 186 | {
|
|---|
| 187 | struct NetGetJoinableOUs r;
|
|---|
| 188 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 189 | NET_API_STATUS status;
|
|---|
| 190 | WERROR werr;
|
|---|
| 191 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 192 |
|
|---|
| 193 | status = libnetapi_getctx(&ctx);
|
|---|
| 194 | if (status != 0) {
|
|---|
| 195 | TALLOC_FREE(frame);
|
|---|
| 196 | return status;
|
|---|
| 197 | }
|
|---|
| 198 |
|
|---|
| 199 | /* In parameters */
|
|---|
| 200 | r.in.server_name = server_name;
|
|---|
| 201 | r.in.domain = domain;
|
|---|
| 202 | r.in.account = account;
|
|---|
| 203 | r.in.password = password;
|
|---|
| 204 |
|
|---|
| 205 | /* Out parameters */
|
|---|
| 206 | r.out.ou_count = ou_count;
|
|---|
| 207 | r.out.ous = ous;
|
|---|
| 208 |
|
|---|
| 209 | if (DEBUGLEVEL >= 10) {
|
|---|
| 210 | NDR_PRINT_IN_DEBUG(NetGetJoinableOUs, &r);
|
|---|
| 211 | }
|
|---|
| 212 |
|
|---|
| 213 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 214 | werr = NetGetJoinableOUs_l(ctx, &r);
|
|---|
| 215 | } else {
|
|---|
| 216 | werr = NetGetJoinableOUs_r(ctx, &r);
|
|---|
| 217 | }
|
|---|
| 218 |
|
|---|
| 219 | r.out.result = W_ERROR_V(werr);
|
|---|
| 220 |
|
|---|
| 221 | if (DEBUGLEVEL >= 10) {
|
|---|
| 222 | NDR_PRINT_OUT_DEBUG(NetGetJoinableOUs, &r);
|
|---|
| 223 | }
|
|---|
| 224 |
|
|---|
| 225 | TALLOC_FREE(frame);
|
|---|
| 226 | return (NET_API_STATUS)r.out.result;
|
|---|
| 227 | }
|
|---|
| 228 |
|
|---|
| 229 | /****************************************************************
|
|---|
| 230 | NetRenameMachineInDomain
|
|---|
| 231 | ****************************************************************/
|
|---|
| 232 |
|
|---|
| 233 | NET_API_STATUS NetRenameMachineInDomain(const char * server_name /* [in] */,
|
|---|
| 234 | const char * new_machine_name /* [in] */,
|
|---|
| 235 | const char * account /* [in] */,
|
|---|
| 236 | const char * password /* [in] */,
|
|---|
| 237 | uint32_t rename_options /* [in] */)
|
|---|
| 238 | {
|
|---|
| 239 | struct NetRenameMachineInDomain r;
|
|---|
| 240 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 241 | NET_API_STATUS status;
|
|---|
| 242 | WERROR werr;
|
|---|
| 243 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 244 |
|
|---|
| 245 | status = libnetapi_getctx(&ctx);
|
|---|
| 246 | if (status != 0) {
|
|---|
| 247 | TALLOC_FREE(frame);
|
|---|
| 248 | return status;
|
|---|
| 249 | }
|
|---|
| 250 |
|
|---|
| 251 | /* In parameters */
|
|---|
| 252 | r.in.server_name = server_name;
|
|---|
| 253 | r.in.new_machine_name = new_machine_name;
|
|---|
| 254 | r.in.account = account;
|
|---|
| 255 | r.in.password = password;
|
|---|
| 256 | r.in.rename_options = rename_options;
|
|---|
| 257 |
|
|---|
| 258 | /* Out parameters */
|
|---|
| 259 |
|
|---|
| 260 | if (DEBUGLEVEL >= 10) {
|
|---|
| 261 | NDR_PRINT_IN_DEBUG(NetRenameMachineInDomain, &r);
|
|---|
| 262 | }
|
|---|
| 263 |
|
|---|
| 264 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 265 | werr = NetRenameMachineInDomain_l(ctx, &r);
|
|---|
| 266 | } else {
|
|---|
| 267 | werr = NetRenameMachineInDomain_r(ctx, &r);
|
|---|
| 268 | }
|
|---|
| 269 |
|
|---|
| 270 | r.out.result = W_ERROR_V(werr);
|
|---|
| 271 |
|
|---|
| 272 | if (DEBUGLEVEL >= 10) {
|
|---|
| 273 | NDR_PRINT_OUT_DEBUG(NetRenameMachineInDomain, &r);
|
|---|
| 274 | }
|
|---|
| 275 |
|
|---|
| 276 | TALLOC_FREE(frame);
|
|---|
| 277 | return (NET_API_STATUS)r.out.result;
|
|---|
| 278 | }
|
|---|
| 279 |
|
|---|
| 280 | /****************************************************************
|
|---|
| 281 | NetServerGetInfo
|
|---|
| 282 | ****************************************************************/
|
|---|
| 283 |
|
|---|
| 284 | NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] [unique] */,
|
|---|
| 285 | uint32_t level /* [in] */,
|
|---|
| 286 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 287 | {
|
|---|
| 288 | struct NetServerGetInfo r;
|
|---|
| 289 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 290 | NET_API_STATUS status;
|
|---|
| 291 | WERROR werr;
|
|---|
| 292 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 293 |
|
|---|
| 294 | status = libnetapi_getctx(&ctx);
|
|---|
| 295 | if (status != 0) {
|
|---|
| 296 | TALLOC_FREE(frame);
|
|---|
| 297 | return status;
|
|---|
| 298 | }
|
|---|
| 299 |
|
|---|
| 300 | /* In parameters */
|
|---|
| 301 | r.in.server_name = server_name;
|
|---|
| 302 | r.in.level = level;
|
|---|
| 303 |
|
|---|
| 304 | /* Out parameters */
|
|---|
| 305 | r.out.buffer = buffer;
|
|---|
| 306 |
|
|---|
| 307 | if (DEBUGLEVEL >= 10) {
|
|---|
| 308 | NDR_PRINT_IN_DEBUG(NetServerGetInfo, &r);
|
|---|
| 309 | }
|
|---|
| 310 |
|
|---|
| 311 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 312 | werr = NetServerGetInfo_l(ctx, &r);
|
|---|
| 313 | } else {
|
|---|
| 314 | werr = NetServerGetInfo_r(ctx, &r);
|
|---|
| 315 | }
|
|---|
| 316 |
|
|---|
| 317 | r.out.result = W_ERROR_V(werr);
|
|---|
| 318 |
|
|---|
| 319 | if (DEBUGLEVEL >= 10) {
|
|---|
| 320 | NDR_PRINT_OUT_DEBUG(NetServerGetInfo, &r);
|
|---|
| 321 | }
|
|---|
| 322 |
|
|---|
| 323 | TALLOC_FREE(frame);
|
|---|
| 324 | return (NET_API_STATUS)r.out.result;
|
|---|
| 325 | }
|
|---|
| 326 |
|
|---|
| 327 | /****************************************************************
|
|---|
| 328 | NetServerSetInfo
|
|---|
| 329 | ****************************************************************/
|
|---|
| 330 |
|
|---|
| 331 | NET_API_STATUS NetServerSetInfo(const char * server_name /* [in] [unique] */,
|
|---|
| 332 | uint32_t level /* [in] */,
|
|---|
| 333 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 334 | uint32_t *parm_error /* [out] [ref] */)
|
|---|
| 335 | {
|
|---|
| 336 | struct NetServerSetInfo r;
|
|---|
| 337 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 338 | NET_API_STATUS status;
|
|---|
| 339 | WERROR werr;
|
|---|
| 340 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 341 |
|
|---|
| 342 | status = libnetapi_getctx(&ctx);
|
|---|
| 343 | if (status != 0) {
|
|---|
| 344 | TALLOC_FREE(frame);
|
|---|
| 345 | return status;
|
|---|
| 346 | }
|
|---|
| 347 |
|
|---|
| 348 | /* In parameters */
|
|---|
| 349 | r.in.server_name = server_name;
|
|---|
| 350 | r.in.level = level;
|
|---|
| 351 | r.in.buffer = buffer;
|
|---|
| 352 |
|
|---|
| 353 | /* Out parameters */
|
|---|
| 354 | r.out.parm_error = parm_error;
|
|---|
| 355 |
|
|---|
| 356 | if (DEBUGLEVEL >= 10) {
|
|---|
| 357 | NDR_PRINT_IN_DEBUG(NetServerSetInfo, &r);
|
|---|
| 358 | }
|
|---|
| 359 |
|
|---|
| 360 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 361 | werr = NetServerSetInfo_l(ctx, &r);
|
|---|
| 362 | } else {
|
|---|
| 363 | werr = NetServerSetInfo_r(ctx, &r);
|
|---|
| 364 | }
|
|---|
| 365 |
|
|---|
| 366 | r.out.result = W_ERROR_V(werr);
|
|---|
| 367 |
|
|---|
| 368 | if (DEBUGLEVEL >= 10) {
|
|---|
| 369 | NDR_PRINT_OUT_DEBUG(NetServerSetInfo, &r);
|
|---|
| 370 | }
|
|---|
| 371 |
|
|---|
| 372 | TALLOC_FREE(frame);
|
|---|
| 373 | return (NET_API_STATUS)r.out.result;
|
|---|
| 374 | }
|
|---|
| 375 |
|
|---|
| 376 | /****************************************************************
|
|---|
| 377 | NetGetDCName
|
|---|
| 378 | ****************************************************************/
|
|---|
| 379 |
|
|---|
| 380 | NET_API_STATUS NetGetDCName(const char * server_name /* [in] [unique] */,
|
|---|
| 381 | const char * domain_name /* [in] [unique] */,
|
|---|
| 382 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 383 | {
|
|---|
| 384 | struct NetGetDCName r;
|
|---|
| 385 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 386 | NET_API_STATUS status;
|
|---|
| 387 | WERROR werr;
|
|---|
| 388 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 389 |
|
|---|
| 390 | status = libnetapi_getctx(&ctx);
|
|---|
| 391 | if (status != 0) {
|
|---|
| 392 | TALLOC_FREE(frame);
|
|---|
| 393 | return status;
|
|---|
| 394 | }
|
|---|
| 395 |
|
|---|
| 396 | /* In parameters */
|
|---|
| 397 | r.in.server_name = server_name;
|
|---|
| 398 | r.in.domain_name = domain_name;
|
|---|
| 399 |
|
|---|
| 400 | /* Out parameters */
|
|---|
| 401 | r.out.buffer = buffer;
|
|---|
| 402 |
|
|---|
| 403 | if (DEBUGLEVEL >= 10) {
|
|---|
| 404 | NDR_PRINT_IN_DEBUG(NetGetDCName, &r);
|
|---|
| 405 | }
|
|---|
| 406 |
|
|---|
| 407 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 408 | werr = NetGetDCName_l(ctx, &r);
|
|---|
| 409 | } else {
|
|---|
| 410 | werr = NetGetDCName_r(ctx, &r);
|
|---|
| 411 | }
|
|---|
| 412 |
|
|---|
| 413 | r.out.result = W_ERROR_V(werr);
|
|---|
| 414 |
|
|---|
| 415 | if (DEBUGLEVEL >= 10) {
|
|---|
| 416 | NDR_PRINT_OUT_DEBUG(NetGetDCName, &r);
|
|---|
| 417 | }
|
|---|
| 418 |
|
|---|
| 419 | TALLOC_FREE(frame);
|
|---|
| 420 | return (NET_API_STATUS)r.out.result;
|
|---|
| 421 | }
|
|---|
| 422 |
|
|---|
| 423 | /****************************************************************
|
|---|
| 424 | NetGetAnyDCName
|
|---|
| 425 | ****************************************************************/
|
|---|
| 426 |
|
|---|
| 427 | NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] [unique] */,
|
|---|
| 428 | const char * domain_name /* [in] [unique] */,
|
|---|
| 429 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 430 | {
|
|---|
| 431 | struct NetGetAnyDCName r;
|
|---|
| 432 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 433 | NET_API_STATUS status;
|
|---|
| 434 | WERROR werr;
|
|---|
| 435 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 436 |
|
|---|
| 437 | status = libnetapi_getctx(&ctx);
|
|---|
| 438 | if (status != 0) {
|
|---|
| 439 | TALLOC_FREE(frame);
|
|---|
| 440 | return status;
|
|---|
| 441 | }
|
|---|
| 442 |
|
|---|
| 443 | /* In parameters */
|
|---|
| 444 | r.in.server_name = server_name;
|
|---|
| 445 | r.in.domain_name = domain_name;
|
|---|
| 446 |
|
|---|
| 447 | /* Out parameters */
|
|---|
| 448 | r.out.buffer = buffer;
|
|---|
| 449 |
|
|---|
| 450 | if (DEBUGLEVEL >= 10) {
|
|---|
| 451 | NDR_PRINT_IN_DEBUG(NetGetAnyDCName, &r);
|
|---|
| 452 | }
|
|---|
| 453 |
|
|---|
| 454 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 455 | werr = NetGetAnyDCName_l(ctx, &r);
|
|---|
| 456 | } else {
|
|---|
| 457 | werr = NetGetAnyDCName_r(ctx, &r);
|
|---|
| 458 | }
|
|---|
| 459 |
|
|---|
| 460 | r.out.result = W_ERROR_V(werr);
|
|---|
| 461 |
|
|---|
| 462 | if (DEBUGLEVEL >= 10) {
|
|---|
| 463 | NDR_PRINT_OUT_DEBUG(NetGetAnyDCName, &r);
|
|---|
| 464 | }
|
|---|
| 465 |
|
|---|
| 466 | TALLOC_FREE(frame);
|
|---|
| 467 | return (NET_API_STATUS)r.out.result;
|
|---|
| 468 | }
|
|---|
| 469 |
|
|---|
| 470 | /****************************************************************
|
|---|
| 471 | DsGetDcName
|
|---|
| 472 | ****************************************************************/
|
|---|
| 473 |
|
|---|
| 474 | NET_API_STATUS DsGetDcName(const char * server_name /* [in] [unique] */,
|
|---|
| 475 | const char * domain_name /* [in] [ref] */,
|
|---|
| 476 | struct GUID *domain_guid /* [in] [unique] */,
|
|---|
| 477 | const char * site_name /* [in] [unique] */,
|
|---|
| 478 | uint32_t flags /* [in] */,
|
|---|
| 479 | struct DOMAIN_CONTROLLER_INFO **dc_info /* [out] [ref] */)
|
|---|
| 480 | {
|
|---|
| 481 | struct DsGetDcName r;
|
|---|
| 482 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 483 | NET_API_STATUS status;
|
|---|
| 484 | WERROR werr;
|
|---|
| 485 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 486 |
|
|---|
| 487 | status = libnetapi_getctx(&ctx);
|
|---|
| 488 | if (status != 0) {
|
|---|
| 489 | TALLOC_FREE(frame);
|
|---|
| 490 | return status;
|
|---|
| 491 | }
|
|---|
| 492 |
|
|---|
| 493 | /* In parameters */
|
|---|
| 494 | r.in.server_name = server_name;
|
|---|
| 495 | r.in.domain_name = domain_name;
|
|---|
| 496 | r.in.domain_guid = domain_guid;
|
|---|
| 497 | r.in.site_name = site_name;
|
|---|
| 498 | r.in.flags = flags;
|
|---|
| 499 |
|
|---|
| 500 | /* Out parameters */
|
|---|
| 501 | r.out.dc_info = dc_info;
|
|---|
| 502 |
|
|---|
| 503 | if (DEBUGLEVEL >= 10) {
|
|---|
| 504 | NDR_PRINT_IN_DEBUG(DsGetDcName, &r);
|
|---|
| 505 | }
|
|---|
| 506 |
|
|---|
| 507 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 508 | werr = DsGetDcName_l(ctx, &r);
|
|---|
| 509 | } else {
|
|---|
| 510 | werr = DsGetDcName_r(ctx, &r);
|
|---|
| 511 | }
|
|---|
| 512 |
|
|---|
| 513 | r.out.result = W_ERROR_V(werr);
|
|---|
| 514 |
|
|---|
| 515 | if (DEBUGLEVEL >= 10) {
|
|---|
| 516 | NDR_PRINT_OUT_DEBUG(DsGetDcName, &r);
|
|---|
| 517 | }
|
|---|
| 518 |
|
|---|
| 519 | TALLOC_FREE(frame);
|
|---|
| 520 | return (NET_API_STATUS)r.out.result;
|
|---|
| 521 | }
|
|---|
| 522 |
|
|---|
| 523 | /****************************************************************
|
|---|
| 524 | NetUserAdd
|
|---|
| 525 | ****************************************************************/
|
|---|
| 526 |
|
|---|
| 527 | NET_API_STATUS NetUserAdd(const char * server_name /* [in] [unique] */,
|
|---|
| 528 | uint32_t level /* [in] */,
|
|---|
| 529 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 530 | uint32_t *parm_error /* [out] [ref] */)
|
|---|
| 531 | {
|
|---|
| 532 | struct NetUserAdd r;
|
|---|
| 533 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 534 | NET_API_STATUS status;
|
|---|
| 535 | WERROR werr;
|
|---|
| 536 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 537 |
|
|---|
| 538 | status = libnetapi_getctx(&ctx);
|
|---|
| 539 | if (status != 0) {
|
|---|
| 540 | TALLOC_FREE(frame);
|
|---|
| 541 | return status;
|
|---|
| 542 | }
|
|---|
| 543 |
|
|---|
| 544 | /* In parameters */
|
|---|
| 545 | r.in.server_name = server_name;
|
|---|
| 546 | r.in.level = level;
|
|---|
| 547 | r.in.buffer = buffer;
|
|---|
| 548 |
|
|---|
| 549 | /* Out parameters */
|
|---|
| 550 | r.out.parm_error = parm_error;
|
|---|
| 551 |
|
|---|
| 552 | if (DEBUGLEVEL >= 10) {
|
|---|
| 553 | NDR_PRINT_IN_DEBUG(NetUserAdd, &r);
|
|---|
| 554 | }
|
|---|
| 555 |
|
|---|
| 556 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 557 | werr = NetUserAdd_l(ctx, &r);
|
|---|
| 558 | } else {
|
|---|
| 559 | werr = NetUserAdd_r(ctx, &r);
|
|---|
| 560 | }
|
|---|
| 561 |
|
|---|
| 562 | r.out.result = W_ERROR_V(werr);
|
|---|
| 563 |
|
|---|
| 564 | if (DEBUGLEVEL >= 10) {
|
|---|
| 565 | NDR_PRINT_OUT_DEBUG(NetUserAdd, &r);
|
|---|
| 566 | }
|
|---|
| 567 |
|
|---|
| 568 | TALLOC_FREE(frame);
|
|---|
| 569 | return (NET_API_STATUS)r.out.result;
|
|---|
| 570 | }
|
|---|
| 571 |
|
|---|
| 572 | /****************************************************************
|
|---|
| 573 | NetUserDel
|
|---|
| 574 | ****************************************************************/
|
|---|
| 575 |
|
|---|
| 576 | NET_API_STATUS NetUserDel(const char * server_name /* [in] [unique] */,
|
|---|
| 577 | const char * user_name /* [in] [ref] */)
|
|---|
| 578 | {
|
|---|
| 579 | struct NetUserDel r;
|
|---|
| 580 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 581 | NET_API_STATUS status;
|
|---|
| 582 | WERROR werr;
|
|---|
| 583 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 584 |
|
|---|
| 585 | status = libnetapi_getctx(&ctx);
|
|---|
| 586 | if (status != 0) {
|
|---|
| 587 | TALLOC_FREE(frame);
|
|---|
| 588 | return status;
|
|---|
| 589 | }
|
|---|
| 590 |
|
|---|
| 591 | /* In parameters */
|
|---|
| 592 | r.in.server_name = server_name;
|
|---|
| 593 | r.in.user_name = user_name;
|
|---|
| 594 |
|
|---|
| 595 | /* Out parameters */
|
|---|
| 596 |
|
|---|
| 597 | if (DEBUGLEVEL >= 10) {
|
|---|
| 598 | NDR_PRINT_IN_DEBUG(NetUserDel, &r);
|
|---|
| 599 | }
|
|---|
| 600 |
|
|---|
| 601 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 602 | werr = NetUserDel_l(ctx, &r);
|
|---|
| 603 | } else {
|
|---|
| 604 | werr = NetUserDel_r(ctx, &r);
|
|---|
| 605 | }
|
|---|
| 606 |
|
|---|
| 607 | r.out.result = W_ERROR_V(werr);
|
|---|
| 608 |
|
|---|
| 609 | if (DEBUGLEVEL >= 10) {
|
|---|
| 610 | NDR_PRINT_OUT_DEBUG(NetUserDel, &r);
|
|---|
| 611 | }
|
|---|
| 612 |
|
|---|
| 613 | TALLOC_FREE(frame);
|
|---|
| 614 | return (NET_API_STATUS)r.out.result;
|
|---|
| 615 | }
|
|---|
| 616 |
|
|---|
| 617 | /****************************************************************
|
|---|
| 618 | NetUserEnum
|
|---|
| 619 | ****************************************************************/
|
|---|
| 620 |
|
|---|
| 621 | NET_API_STATUS NetUserEnum(const char * server_name /* [in] [unique] */,
|
|---|
| 622 | uint32_t level /* [in] */,
|
|---|
| 623 | uint32_t filter /* [in] */,
|
|---|
| 624 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 625 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 626 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 627 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 628 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 629 | {
|
|---|
| 630 | struct NetUserEnum r;
|
|---|
| 631 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 632 | NET_API_STATUS status;
|
|---|
| 633 | WERROR werr;
|
|---|
| 634 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 635 |
|
|---|
| 636 | status = libnetapi_getctx(&ctx);
|
|---|
| 637 | if (status != 0) {
|
|---|
| 638 | TALLOC_FREE(frame);
|
|---|
| 639 | return status;
|
|---|
| 640 | }
|
|---|
| 641 |
|
|---|
| 642 | /* In parameters */
|
|---|
| 643 | r.in.server_name = server_name;
|
|---|
| 644 | r.in.level = level;
|
|---|
| 645 | r.in.filter = filter;
|
|---|
| 646 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 647 | r.in.resume_handle = resume_handle;
|
|---|
| 648 |
|
|---|
| 649 | /* Out parameters */
|
|---|
| 650 | r.out.buffer = buffer;
|
|---|
| 651 | r.out.entries_read = entries_read;
|
|---|
| 652 | r.out.total_entries = total_entries;
|
|---|
| 653 | r.out.resume_handle = resume_handle;
|
|---|
| 654 |
|
|---|
| 655 | if (DEBUGLEVEL >= 10) {
|
|---|
| 656 | NDR_PRINT_IN_DEBUG(NetUserEnum, &r);
|
|---|
| 657 | }
|
|---|
| 658 |
|
|---|
| 659 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 660 | werr = NetUserEnum_l(ctx, &r);
|
|---|
| 661 | } else {
|
|---|
| 662 | werr = NetUserEnum_r(ctx, &r);
|
|---|
| 663 | }
|
|---|
| 664 |
|
|---|
| 665 | r.out.result = W_ERROR_V(werr);
|
|---|
| 666 |
|
|---|
| 667 | if (DEBUGLEVEL >= 10) {
|
|---|
| 668 | NDR_PRINT_OUT_DEBUG(NetUserEnum, &r);
|
|---|
| 669 | }
|
|---|
| 670 |
|
|---|
| 671 | TALLOC_FREE(frame);
|
|---|
| 672 | return (NET_API_STATUS)r.out.result;
|
|---|
| 673 | }
|
|---|
| 674 |
|
|---|
| 675 | /****************************************************************
|
|---|
| 676 | NetUserChangePassword
|
|---|
| 677 | ****************************************************************/
|
|---|
| 678 |
|
|---|
| 679 | NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
|
|---|
| 680 | const char * user_name /* [in] */,
|
|---|
| 681 | const char * old_password /* [in] */,
|
|---|
| 682 | const char * new_password /* [in] */)
|
|---|
| 683 | {
|
|---|
| 684 | struct NetUserChangePassword r;
|
|---|
| 685 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 686 | NET_API_STATUS status;
|
|---|
| 687 | WERROR werr;
|
|---|
| 688 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 689 |
|
|---|
| 690 | status = libnetapi_getctx(&ctx);
|
|---|
| 691 | if (status != 0) {
|
|---|
| 692 | TALLOC_FREE(frame);
|
|---|
| 693 | return status;
|
|---|
| 694 | }
|
|---|
| 695 |
|
|---|
| 696 | /* In parameters */
|
|---|
| 697 | r.in.domain_name = domain_name;
|
|---|
| 698 | r.in.user_name = user_name;
|
|---|
| 699 | r.in.old_password = old_password;
|
|---|
| 700 | r.in.new_password = new_password;
|
|---|
| 701 |
|
|---|
| 702 | /* Out parameters */
|
|---|
| 703 |
|
|---|
| 704 | if (DEBUGLEVEL >= 10) {
|
|---|
| 705 | NDR_PRINT_IN_DEBUG(NetUserChangePassword, &r);
|
|---|
| 706 | }
|
|---|
| 707 |
|
|---|
| 708 | if (LIBNETAPI_LOCAL_SERVER(domain_name)) {
|
|---|
| 709 | werr = NetUserChangePassword_l(ctx, &r);
|
|---|
| 710 | } else {
|
|---|
| 711 | werr = NetUserChangePassword_r(ctx, &r);
|
|---|
| 712 | }
|
|---|
| 713 |
|
|---|
| 714 | r.out.result = W_ERROR_V(werr);
|
|---|
| 715 |
|
|---|
| 716 | if (DEBUGLEVEL >= 10) {
|
|---|
| 717 | NDR_PRINT_OUT_DEBUG(NetUserChangePassword, &r);
|
|---|
| 718 | }
|
|---|
| 719 |
|
|---|
| 720 | TALLOC_FREE(frame);
|
|---|
| 721 | return (NET_API_STATUS)r.out.result;
|
|---|
| 722 | }
|
|---|
| 723 |
|
|---|
| 724 | /****************************************************************
|
|---|
| 725 | NetUserGetInfo
|
|---|
| 726 | ****************************************************************/
|
|---|
| 727 |
|
|---|
| 728 | NET_API_STATUS NetUserGetInfo(const char * server_name /* [in] */,
|
|---|
| 729 | const char * user_name /* [in] */,
|
|---|
| 730 | uint32_t level /* [in] */,
|
|---|
| 731 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 732 | {
|
|---|
| 733 | struct NetUserGetInfo r;
|
|---|
| 734 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 735 | NET_API_STATUS status;
|
|---|
| 736 | WERROR werr;
|
|---|
| 737 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 738 |
|
|---|
| 739 | status = libnetapi_getctx(&ctx);
|
|---|
| 740 | if (status != 0) {
|
|---|
| 741 | TALLOC_FREE(frame);
|
|---|
| 742 | return status;
|
|---|
| 743 | }
|
|---|
| 744 |
|
|---|
| 745 | /* In parameters */
|
|---|
| 746 | r.in.server_name = server_name;
|
|---|
| 747 | r.in.user_name = user_name;
|
|---|
| 748 | r.in.level = level;
|
|---|
| 749 |
|
|---|
| 750 | /* Out parameters */
|
|---|
| 751 | r.out.buffer = buffer;
|
|---|
| 752 |
|
|---|
| 753 | if (DEBUGLEVEL >= 10) {
|
|---|
| 754 | NDR_PRINT_IN_DEBUG(NetUserGetInfo, &r);
|
|---|
| 755 | }
|
|---|
| 756 |
|
|---|
| 757 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 758 | werr = NetUserGetInfo_l(ctx, &r);
|
|---|
| 759 | } else {
|
|---|
| 760 | werr = NetUserGetInfo_r(ctx, &r);
|
|---|
| 761 | }
|
|---|
| 762 |
|
|---|
| 763 | r.out.result = W_ERROR_V(werr);
|
|---|
| 764 |
|
|---|
| 765 | if (DEBUGLEVEL >= 10) {
|
|---|
| 766 | NDR_PRINT_OUT_DEBUG(NetUserGetInfo, &r);
|
|---|
| 767 | }
|
|---|
| 768 |
|
|---|
| 769 | TALLOC_FREE(frame);
|
|---|
| 770 | return (NET_API_STATUS)r.out.result;
|
|---|
| 771 | }
|
|---|
| 772 |
|
|---|
| 773 | /****************************************************************
|
|---|
| 774 | NetUserSetInfo
|
|---|
| 775 | ****************************************************************/
|
|---|
| 776 |
|
|---|
| 777 | NET_API_STATUS NetUserSetInfo(const char * server_name /* [in] */,
|
|---|
| 778 | const char * user_name /* [in] */,
|
|---|
| 779 | uint32_t level /* [in] */,
|
|---|
| 780 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 781 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 782 | {
|
|---|
| 783 | struct NetUserSetInfo r;
|
|---|
| 784 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 785 | NET_API_STATUS status;
|
|---|
| 786 | WERROR werr;
|
|---|
| 787 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 788 |
|
|---|
| 789 | status = libnetapi_getctx(&ctx);
|
|---|
| 790 | if (status != 0) {
|
|---|
| 791 | TALLOC_FREE(frame);
|
|---|
| 792 | return status;
|
|---|
| 793 | }
|
|---|
| 794 |
|
|---|
| 795 | /* In parameters */
|
|---|
| 796 | r.in.server_name = server_name;
|
|---|
| 797 | r.in.user_name = user_name;
|
|---|
| 798 | r.in.level = level;
|
|---|
| 799 | r.in.buffer = buffer;
|
|---|
| 800 |
|
|---|
| 801 | /* Out parameters */
|
|---|
| 802 | r.out.parm_err = parm_err;
|
|---|
| 803 |
|
|---|
| 804 | if (DEBUGLEVEL >= 10) {
|
|---|
| 805 | NDR_PRINT_IN_DEBUG(NetUserSetInfo, &r);
|
|---|
| 806 | }
|
|---|
| 807 |
|
|---|
| 808 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 809 | werr = NetUserSetInfo_l(ctx, &r);
|
|---|
| 810 | } else {
|
|---|
| 811 | werr = NetUserSetInfo_r(ctx, &r);
|
|---|
| 812 | }
|
|---|
| 813 |
|
|---|
| 814 | r.out.result = W_ERROR_V(werr);
|
|---|
| 815 |
|
|---|
| 816 | if (DEBUGLEVEL >= 10) {
|
|---|
| 817 | NDR_PRINT_OUT_DEBUG(NetUserSetInfo, &r);
|
|---|
| 818 | }
|
|---|
| 819 |
|
|---|
| 820 | TALLOC_FREE(frame);
|
|---|
| 821 | return (NET_API_STATUS)r.out.result;
|
|---|
| 822 | }
|
|---|
| 823 |
|
|---|
| 824 | /****************************************************************
|
|---|
| 825 | NetUserGetGroups
|
|---|
| 826 | ****************************************************************/
|
|---|
| 827 |
|
|---|
| 828 | NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
|
|---|
| 829 | const char * user_name /* [in] */,
|
|---|
| 830 | uint32_t level /* [in] */,
|
|---|
| 831 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 832 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 833 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 834 | uint32_t *total_entries /* [out] [ref] */)
|
|---|
| 835 | {
|
|---|
| 836 | struct NetUserGetGroups r;
|
|---|
| 837 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 838 | NET_API_STATUS status;
|
|---|
| 839 | WERROR werr;
|
|---|
| 840 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 841 |
|
|---|
| 842 | status = libnetapi_getctx(&ctx);
|
|---|
| 843 | if (status != 0) {
|
|---|
| 844 | TALLOC_FREE(frame);
|
|---|
| 845 | return status;
|
|---|
| 846 | }
|
|---|
| 847 |
|
|---|
| 848 | /* In parameters */
|
|---|
| 849 | r.in.server_name = server_name;
|
|---|
| 850 | r.in.user_name = user_name;
|
|---|
| 851 | r.in.level = level;
|
|---|
| 852 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 853 |
|
|---|
| 854 | /* Out parameters */
|
|---|
| 855 | r.out.buffer = buffer;
|
|---|
| 856 | r.out.entries_read = entries_read;
|
|---|
| 857 | r.out.total_entries = total_entries;
|
|---|
| 858 |
|
|---|
| 859 | if (DEBUGLEVEL >= 10) {
|
|---|
| 860 | NDR_PRINT_IN_DEBUG(NetUserGetGroups, &r);
|
|---|
| 861 | }
|
|---|
| 862 |
|
|---|
| 863 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 864 | werr = NetUserGetGroups_l(ctx, &r);
|
|---|
| 865 | } else {
|
|---|
| 866 | werr = NetUserGetGroups_r(ctx, &r);
|
|---|
| 867 | }
|
|---|
| 868 |
|
|---|
| 869 | r.out.result = W_ERROR_V(werr);
|
|---|
| 870 |
|
|---|
| 871 | if (DEBUGLEVEL >= 10) {
|
|---|
| 872 | NDR_PRINT_OUT_DEBUG(NetUserGetGroups, &r);
|
|---|
| 873 | }
|
|---|
| 874 |
|
|---|
| 875 | TALLOC_FREE(frame);
|
|---|
| 876 | return (NET_API_STATUS)r.out.result;
|
|---|
| 877 | }
|
|---|
| 878 |
|
|---|
| 879 | /****************************************************************
|
|---|
| 880 | NetUserSetGroups
|
|---|
| 881 | ****************************************************************/
|
|---|
| 882 |
|
|---|
| 883 | NET_API_STATUS NetUserSetGroups(const char * server_name /* [in] */,
|
|---|
| 884 | const char * user_name /* [in] */,
|
|---|
| 885 | uint32_t level /* [in] */,
|
|---|
| 886 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 887 | uint32_t num_entries /* [in] */)
|
|---|
| 888 | {
|
|---|
| 889 | struct NetUserSetGroups r;
|
|---|
| 890 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 891 | NET_API_STATUS status;
|
|---|
| 892 | WERROR werr;
|
|---|
| 893 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 894 |
|
|---|
| 895 | status = libnetapi_getctx(&ctx);
|
|---|
| 896 | if (status != 0) {
|
|---|
| 897 | TALLOC_FREE(frame);
|
|---|
| 898 | return status;
|
|---|
| 899 | }
|
|---|
| 900 |
|
|---|
| 901 | /* In parameters */
|
|---|
| 902 | r.in.server_name = server_name;
|
|---|
| 903 | r.in.user_name = user_name;
|
|---|
| 904 | r.in.level = level;
|
|---|
| 905 | r.in.buffer = buffer;
|
|---|
| 906 | r.in.num_entries = num_entries;
|
|---|
| 907 |
|
|---|
| 908 | /* Out parameters */
|
|---|
| 909 |
|
|---|
| 910 | if (DEBUGLEVEL >= 10) {
|
|---|
| 911 | NDR_PRINT_IN_DEBUG(NetUserSetGroups, &r);
|
|---|
| 912 | }
|
|---|
| 913 |
|
|---|
| 914 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 915 | werr = NetUserSetGroups_l(ctx, &r);
|
|---|
| 916 | } else {
|
|---|
| 917 | werr = NetUserSetGroups_r(ctx, &r);
|
|---|
| 918 | }
|
|---|
| 919 |
|
|---|
| 920 | r.out.result = W_ERROR_V(werr);
|
|---|
| 921 |
|
|---|
| 922 | if (DEBUGLEVEL >= 10) {
|
|---|
| 923 | NDR_PRINT_OUT_DEBUG(NetUserSetGroups, &r);
|
|---|
| 924 | }
|
|---|
| 925 |
|
|---|
| 926 | TALLOC_FREE(frame);
|
|---|
| 927 | return (NET_API_STATUS)r.out.result;
|
|---|
| 928 | }
|
|---|
| 929 |
|
|---|
| 930 | /****************************************************************
|
|---|
| 931 | NetUserGetLocalGroups
|
|---|
| 932 | ****************************************************************/
|
|---|
| 933 |
|
|---|
| 934 | NET_API_STATUS NetUserGetLocalGroups(const char * server_name /* [in] */,
|
|---|
| 935 | const char * user_name /* [in] */,
|
|---|
| 936 | uint32_t level /* [in] */,
|
|---|
| 937 | uint32_t flags /* [in] */,
|
|---|
| 938 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 939 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 940 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 941 | uint32_t *total_entries /* [out] [ref] */)
|
|---|
| 942 | {
|
|---|
| 943 | struct NetUserGetLocalGroups r;
|
|---|
| 944 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 945 | NET_API_STATUS status;
|
|---|
| 946 | WERROR werr;
|
|---|
| 947 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 948 |
|
|---|
| 949 | status = libnetapi_getctx(&ctx);
|
|---|
| 950 | if (status != 0) {
|
|---|
| 951 | TALLOC_FREE(frame);
|
|---|
| 952 | return status;
|
|---|
| 953 | }
|
|---|
| 954 |
|
|---|
| 955 | /* In parameters */
|
|---|
| 956 | r.in.server_name = server_name;
|
|---|
| 957 | r.in.user_name = user_name;
|
|---|
| 958 | r.in.level = level;
|
|---|
| 959 | r.in.flags = flags;
|
|---|
| 960 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 961 |
|
|---|
| 962 | /* Out parameters */
|
|---|
| 963 | r.out.buffer = buffer;
|
|---|
| 964 | r.out.entries_read = entries_read;
|
|---|
| 965 | r.out.total_entries = total_entries;
|
|---|
| 966 |
|
|---|
| 967 | if (DEBUGLEVEL >= 10) {
|
|---|
| 968 | NDR_PRINT_IN_DEBUG(NetUserGetLocalGroups, &r);
|
|---|
| 969 | }
|
|---|
| 970 |
|
|---|
| 971 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 972 | werr = NetUserGetLocalGroups_l(ctx, &r);
|
|---|
| 973 | } else {
|
|---|
| 974 | werr = NetUserGetLocalGroups_r(ctx, &r);
|
|---|
| 975 | }
|
|---|
| 976 |
|
|---|
| 977 | r.out.result = W_ERROR_V(werr);
|
|---|
| 978 |
|
|---|
| 979 | if (DEBUGLEVEL >= 10) {
|
|---|
| 980 | NDR_PRINT_OUT_DEBUG(NetUserGetLocalGroups, &r);
|
|---|
| 981 | }
|
|---|
| 982 |
|
|---|
| 983 | TALLOC_FREE(frame);
|
|---|
| 984 | return (NET_API_STATUS)r.out.result;
|
|---|
| 985 | }
|
|---|
| 986 |
|
|---|
| 987 | /****************************************************************
|
|---|
| 988 | NetUserModalsGet
|
|---|
| 989 | ****************************************************************/
|
|---|
| 990 |
|
|---|
| 991 | NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
|
|---|
| 992 | uint32_t level /* [in] */,
|
|---|
| 993 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 994 | {
|
|---|
| 995 | struct NetUserModalsGet r;
|
|---|
| 996 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 997 | NET_API_STATUS status;
|
|---|
| 998 | WERROR werr;
|
|---|
| 999 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1000 |
|
|---|
| 1001 | status = libnetapi_getctx(&ctx);
|
|---|
| 1002 | if (status != 0) {
|
|---|
| 1003 | TALLOC_FREE(frame);
|
|---|
| 1004 | return status;
|
|---|
| 1005 | }
|
|---|
| 1006 |
|
|---|
| 1007 | /* In parameters */
|
|---|
| 1008 | r.in.server_name = server_name;
|
|---|
| 1009 | r.in.level = level;
|
|---|
| 1010 |
|
|---|
| 1011 | /* Out parameters */
|
|---|
| 1012 | r.out.buffer = buffer;
|
|---|
| 1013 |
|
|---|
| 1014 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1015 | NDR_PRINT_IN_DEBUG(NetUserModalsGet, &r);
|
|---|
| 1016 | }
|
|---|
| 1017 |
|
|---|
| 1018 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1019 | werr = NetUserModalsGet_l(ctx, &r);
|
|---|
| 1020 | } else {
|
|---|
| 1021 | werr = NetUserModalsGet_r(ctx, &r);
|
|---|
| 1022 | }
|
|---|
| 1023 |
|
|---|
| 1024 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1025 |
|
|---|
| 1026 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1027 | NDR_PRINT_OUT_DEBUG(NetUserModalsGet, &r);
|
|---|
| 1028 | }
|
|---|
| 1029 |
|
|---|
| 1030 | TALLOC_FREE(frame);
|
|---|
| 1031 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1032 | }
|
|---|
| 1033 |
|
|---|
| 1034 | /****************************************************************
|
|---|
| 1035 | NetUserModalsSet
|
|---|
| 1036 | ****************************************************************/
|
|---|
| 1037 |
|
|---|
| 1038 | NET_API_STATUS NetUserModalsSet(const char * server_name /* [in] */,
|
|---|
| 1039 | uint32_t level /* [in] */,
|
|---|
| 1040 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1041 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1042 | {
|
|---|
| 1043 | struct NetUserModalsSet r;
|
|---|
| 1044 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1045 | NET_API_STATUS status;
|
|---|
| 1046 | WERROR werr;
|
|---|
| 1047 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1048 |
|
|---|
| 1049 | status = libnetapi_getctx(&ctx);
|
|---|
| 1050 | if (status != 0) {
|
|---|
| 1051 | TALLOC_FREE(frame);
|
|---|
| 1052 | return status;
|
|---|
| 1053 | }
|
|---|
| 1054 |
|
|---|
| 1055 | /* In parameters */
|
|---|
| 1056 | r.in.server_name = server_name;
|
|---|
| 1057 | r.in.level = level;
|
|---|
| 1058 | r.in.buffer = buffer;
|
|---|
| 1059 |
|
|---|
| 1060 | /* Out parameters */
|
|---|
| 1061 | r.out.parm_err = parm_err;
|
|---|
| 1062 |
|
|---|
| 1063 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1064 | NDR_PRINT_IN_DEBUG(NetUserModalsSet, &r);
|
|---|
| 1065 | }
|
|---|
| 1066 |
|
|---|
| 1067 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1068 | werr = NetUserModalsSet_l(ctx, &r);
|
|---|
| 1069 | } else {
|
|---|
| 1070 | werr = NetUserModalsSet_r(ctx, &r);
|
|---|
| 1071 | }
|
|---|
| 1072 |
|
|---|
| 1073 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1074 |
|
|---|
| 1075 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1076 | NDR_PRINT_OUT_DEBUG(NetUserModalsSet, &r);
|
|---|
| 1077 | }
|
|---|
| 1078 |
|
|---|
| 1079 | TALLOC_FREE(frame);
|
|---|
| 1080 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1081 | }
|
|---|
| 1082 |
|
|---|
| 1083 | /****************************************************************
|
|---|
| 1084 | NetQueryDisplayInformation
|
|---|
| 1085 | ****************************************************************/
|
|---|
| 1086 |
|
|---|
| 1087 | NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
|
|---|
| 1088 | uint32_t level /* [in] */,
|
|---|
| 1089 | uint32_t idx /* [in] */,
|
|---|
| 1090 | uint32_t entries_requested /* [in] */,
|
|---|
| 1091 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1092 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1093 | void **buffer /* [out] [noprint,ref] */)
|
|---|
| 1094 | {
|
|---|
| 1095 | struct NetQueryDisplayInformation r;
|
|---|
| 1096 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1097 | NET_API_STATUS status;
|
|---|
| 1098 | WERROR werr;
|
|---|
| 1099 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1100 |
|
|---|
| 1101 | status = libnetapi_getctx(&ctx);
|
|---|
| 1102 | if (status != 0) {
|
|---|
| 1103 | TALLOC_FREE(frame);
|
|---|
| 1104 | return status;
|
|---|
| 1105 | }
|
|---|
| 1106 |
|
|---|
| 1107 | /* In parameters */
|
|---|
| 1108 | r.in.server_name = server_name;
|
|---|
| 1109 | r.in.level = level;
|
|---|
| 1110 | r.in.idx = idx;
|
|---|
| 1111 | r.in.entries_requested = entries_requested;
|
|---|
| 1112 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1113 |
|
|---|
| 1114 | /* Out parameters */
|
|---|
| 1115 | r.out.entries_read = entries_read;
|
|---|
| 1116 | r.out.buffer = buffer;
|
|---|
| 1117 |
|
|---|
| 1118 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1119 | NDR_PRINT_IN_DEBUG(NetQueryDisplayInformation, &r);
|
|---|
| 1120 | }
|
|---|
| 1121 |
|
|---|
| 1122 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1123 | werr = NetQueryDisplayInformation_l(ctx, &r);
|
|---|
| 1124 | } else {
|
|---|
| 1125 | werr = NetQueryDisplayInformation_r(ctx, &r);
|
|---|
| 1126 | }
|
|---|
| 1127 |
|
|---|
| 1128 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1129 |
|
|---|
| 1130 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1131 | NDR_PRINT_OUT_DEBUG(NetQueryDisplayInformation, &r);
|
|---|
| 1132 | }
|
|---|
| 1133 |
|
|---|
| 1134 | TALLOC_FREE(frame);
|
|---|
| 1135 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1136 | }
|
|---|
| 1137 |
|
|---|
| 1138 | /****************************************************************
|
|---|
| 1139 | NetGroupAdd
|
|---|
| 1140 | ****************************************************************/
|
|---|
| 1141 |
|
|---|
| 1142 | NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
|
|---|
| 1143 | uint32_t level /* [in] */,
|
|---|
| 1144 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1145 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1146 | {
|
|---|
| 1147 | struct NetGroupAdd r;
|
|---|
| 1148 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1149 | NET_API_STATUS status;
|
|---|
| 1150 | WERROR werr;
|
|---|
| 1151 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1152 |
|
|---|
| 1153 | status = libnetapi_getctx(&ctx);
|
|---|
| 1154 | if (status != 0) {
|
|---|
| 1155 | TALLOC_FREE(frame);
|
|---|
| 1156 | return status;
|
|---|
| 1157 | }
|
|---|
| 1158 |
|
|---|
| 1159 | /* In parameters */
|
|---|
| 1160 | r.in.server_name = server_name;
|
|---|
| 1161 | r.in.level = level;
|
|---|
| 1162 | r.in.buffer = buffer;
|
|---|
| 1163 |
|
|---|
| 1164 | /* Out parameters */
|
|---|
| 1165 | r.out.parm_err = parm_err;
|
|---|
| 1166 |
|
|---|
| 1167 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1168 | NDR_PRINT_IN_DEBUG(NetGroupAdd, &r);
|
|---|
| 1169 | }
|
|---|
| 1170 |
|
|---|
| 1171 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1172 | werr = NetGroupAdd_l(ctx, &r);
|
|---|
| 1173 | } else {
|
|---|
| 1174 | werr = NetGroupAdd_r(ctx, &r);
|
|---|
| 1175 | }
|
|---|
| 1176 |
|
|---|
| 1177 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1178 |
|
|---|
| 1179 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1180 | NDR_PRINT_OUT_DEBUG(NetGroupAdd, &r);
|
|---|
| 1181 | }
|
|---|
| 1182 |
|
|---|
| 1183 | TALLOC_FREE(frame);
|
|---|
| 1184 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1185 | }
|
|---|
| 1186 |
|
|---|
| 1187 | /****************************************************************
|
|---|
| 1188 | NetGroupDel
|
|---|
| 1189 | ****************************************************************/
|
|---|
| 1190 |
|
|---|
| 1191 | NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
|
|---|
| 1192 | const char * group_name /* [in] */)
|
|---|
| 1193 | {
|
|---|
| 1194 | struct NetGroupDel r;
|
|---|
| 1195 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1196 | NET_API_STATUS status;
|
|---|
| 1197 | WERROR werr;
|
|---|
| 1198 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1199 |
|
|---|
| 1200 | status = libnetapi_getctx(&ctx);
|
|---|
| 1201 | if (status != 0) {
|
|---|
| 1202 | TALLOC_FREE(frame);
|
|---|
| 1203 | return status;
|
|---|
| 1204 | }
|
|---|
| 1205 |
|
|---|
| 1206 | /* In parameters */
|
|---|
| 1207 | r.in.server_name = server_name;
|
|---|
| 1208 | r.in.group_name = group_name;
|
|---|
| 1209 |
|
|---|
| 1210 | /* Out parameters */
|
|---|
| 1211 |
|
|---|
| 1212 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1213 | NDR_PRINT_IN_DEBUG(NetGroupDel, &r);
|
|---|
| 1214 | }
|
|---|
| 1215 |
|
|---|
| 1216 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1217 | werr = NetGroupDel_l(ctx, &r);
|
|---|
| 1218 | } else {
|
|---|
| 1219 | werr = NetGroupDel_r(ctx, &r);
|
|---|
| 1220 | }
|
|---|
| 1221 |
|
|---|
| 1222 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1223 |
|
|---|
| 1224 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1225 | NDR_PRINT_OUT_DEBUG(NetGroupDel, &r);
|
|---|
| 1226 | }
|
|---|
| 1227 |
|
|---|
| 1228 | TALLOC_FREE(frame);
|
|---|
| 1229 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1230 | }
|
|---|
| 1231 |
|
|---|
| 1232 | /****************************************************************
|
|---|
| 1233 | NetGroupEnum
|
|---|
| 1234 | ****************************************************************/
|
|---|
| 1235 |
|
|---|
| 1236 | NET_API_STATUS NetGroupEnum(const char * server_name /* [in] */,
|
|---|
| 1237 | uint32_t level /* [in] */,
|
|---|
| 1238 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 1239 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1240 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1241 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 1242 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 1243 | {
|
|---|
| 1244 | struct NetGroupEnum r;
|
|---|
| 1245 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1246 | NET_API_STATUS status;
|
|---|
| 1247 | WERROR werr;
|
|---|
| 1248 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1249 |
|
|---|
| 1250 | status = libnetapi_getctx(&ctx);
|
|---|
| 1251 | if (status != 0) {
|
|---|
| 1252 | TALLOC_FREE(frame);
|
|---|
| 1253 | return status;
|
|---|
| 1254 | }
|
|---|
| 1255 |
|
|---|
| 1256 | /* In parameters */
|
|---|
| 1257 | r.in.server_name = server_name;
|
|---|
| 1258 | r.in.level = level;
|
|---|
| 1259 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1260 | r.in.resume_handle = resume_handle;
|
|---|
| 1261 |
|
|---|
| 1262 | /* Out parameters */
|
|---|
| 1263 | r.out.buffer = buffer;
|
|---|
| 1264 | r.out.entries_read = entries_read;
|
|---|
| 1265 | r.out.total_entries = total_entries;
|
|---|
| 1266 | r.out.resume_handle = resume_handle;
|
|---|
| 1267 |
|
|---|
| 1268 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1269 | NDR_PRINT_IN_DEBUG(NetGroupEnum, &r);
|
|---|
| 1270 | }
|
|---|
| 1271 |
|
|---|
| 1272 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1273 | werr = NetGroupEnum_l(ctx, &r);
|
|---|
| 1274 | } else {
|
|---|
| 1275 | werr = NetGroupEnum_r(ctx, &r);
|
|---|
| 1276 | }
|
|---|
| 1277 |
|
|---|
| 1278 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1279 |
|
|---|
| 1280 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1281 | NDR_PRINT_OUT_DEBUG(NetGroupEnum, &r);
|
|---|
| 1282 | }
|
|---|
| 1283 |
|
|---|
| 1284 | TALLOC_FREE(frame);
|
|---|
| 1285 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1286 | }
|
|---|
| 1287 |
|
|---|
| 1288 | /****************************************************************
|
|---|
| 1289 | NetGroupSetInfo
|
|---|
| 1290 | ****************************************************************/
|
|---|
| 1291 |
|
|---|
| 1292 | NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
|
|---|
| 1293 | const char * group_name /* [in] */,
|
|---|
| 1294 | uint32_t level /* [in] */,
|
|---|
| 1295 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1296 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1297 | {
|
|---|
| 1298 | struct NetGroupSetInfo r;
|
|---|
| 1299 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1300 | NET_API_STATUS status;
|
|---|
| 1301 | WERROR werr;
|
|---|
| 1302 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1303 |
|
|---|
| 1304 | status = libnetapi_getctx(&ctx);
|
|---|
| 1305 | if (status != 0) {
|
|---|
| 1306 | TALLOC_FREE(frame);
|
|---|
| 1307 | return status;
|
|---|
| 1308 | }
|
|---|
| 1309 |
|
|---|
| 1310 | /* In parameters */
|
|---|
| 1311 | r.in.server_name = server_name;
|
|---|
| 1312 | r.in.group_name = group_name;
|
|---|
| 1313 | r.in.level = level;
|
|---|
| 1314 | r.in.buffer = buffer;
|
|---|
| 1315 |
|
|---|
| 1316 | /* Out parameters */
|
|---|
| 1317 | r.out.parm_err = parm_err;
|
|---|
| 1318 |
|
|---|
| 1319 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1320 | NDR_PRINT_IN_DEBUG(NetGroupSetInfo, &r);
|
|---|
| 1321 | }
|
|---|
| 1322 |
|
|---|
| 1323 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1324 | werr = NetGroupSetInfo_l(ctx, &r);
|
|---|
| 1325 | } else {
|
|---|
| 1326 | werr = NetGroupSetInfo_r(ctx, &r);
|
|---|
| 1327 | }
|
|---|
| 1328 |
|
|---|
| 1329 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1330 |
|
|---|
| 1331 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1332 | NDR_PRINT_OUT_DEBUG(NetGroupSetInfo, &r);
|
|---|
| 1333 | }
|
|---|
| 1334 |
|
|---|
| 1335 | TALLOC_FREE(frame);
|
|---|
| 1336 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1337 | }
|
|---|
| 1338 |
|
|---|
| 1339 | /****************************************************************
|
|---|
| 1340 | NetGroupGetInfo
|
|---|
| 1341 | ****************************************************************/
|
|---|
| 1342 |
|
|---|
| 1343 | NET_API_STATUS NetGroupGetInfo(const char * server_name /* [in] */,
|
|---|
| 1344 | const char * group_name /* [in] */,
|
|---|
| 1345 | uint32_t level /* [in] */,
|
|---|
| 1346 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 1347 | {
|
|---|
| 1348 | struct NetGroupGetInfo r;
|
|---|
| 1349 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1350 | NET_API_STATUS status;
|
|---|
| 1351 | WERROR werr;
|
|---|
| 1352 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1353 |
|
|---|
| 1354 | status = libnetapi_getctx(&ctx);
|
|---|
| 1355 | if (status != 0) {
|
|---|
| 1356 | TALLOC_FREE(frame);
|
|---|
| 1357 | return status;
|
|---|
| 1358 | }
|
|---|
| 1359 |
|
|---|
| 1360 | /* In parameters */
|
|---|
| 1361 | r.in.server_name = server_name;
|
|---|
| 1362 | r.in.group_name = group_name;
|
|---|
| 1363 | r.in.level = level;
|
|---|
| 1364 |
|
|---|
| 1365 | /* Out parameters */
|
|---|
| 1366 | r.out.buffer = buffer;
|
|---|
| 1367 |
|
|---|
| 1368 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1369 | NDR_PRINT_IN_DEBUG(NetGroupGetInfo, &r);
|
|---|
| 1370 | }
|
|---|
| 1371 |
|
|---|
| 1372 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1373 | werr = NetGroupGetInfo_l(ctx, &r);
|
|---|
| 1374 | } else {
|
|---|
| 1375 | werr = NetGroupGetInfo_r(ctx, &r);
|
|---|
| 1376 | }
|
|---|
| 1377 |
|
|---|
| 1378 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1379 |
|
|---|
| 1380 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1381 | NDR_PRINT_OUT_DEBUG(NetGroupGetInfo, &r);
|
|---|
| 1382 | }
|
|---|
| 1383 |
|
|---|
| 1384 | TALLOC_FREE(frame);
|
|---|
| 1385 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1386 | }
|
|---|
| 1387 |
|
|---|
| 1388 | /****************************************************************
|
|---|
| 1389 | NetGroupAddUser
|
|---|
| 1390 | ****************************************************************/
|
|---|
| 1391 |
|
|---|
| 1392 | NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
|
|---|
| 1393 | const char * group_name /* [in] */,
|
|---|
| 1394 | const char * user_name /* [in] */)
|
|---|
| 1395 | {
|
|---|
| 1396 | struct NetGroupAddUser r;
|
|---|
| 1397 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1398 | NET_API_STATUS status;
|
|---|
| 1399 | WERROR werr;
|
|---|
| 1400 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1401 |
|
|---|
| 1402 | status = libnetapi_getctx(&ctx);
|
|---|
| 1403 | if (status != 0) {
|
|---|
| 1404 | TALLOC_FREE(frame);
|
|---|
| 1405 | return status;
|
|---|
| 1406 | }
|
|---|
| 1407 |
|
|---|
| 1408 | /* In parameters */
|
|---|
| 1409 | r.in.server_name = server_name;
|
|---|
| 1410 | r.in.group_name = group_name;
|
|---|
| 1411 | r.in.user_name = user_name;
|
|---|
| 1412 |
|
|---|
| 1413 | /* Out parameters */
|
|---|
| 1414 |
|
|---|
| 1415 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1416 | NDR_PRINT_IN_DEBUG(NetGroupAddUser, &r);
|
|---|
| 1417 | }
|
|---|
| 1418 |
|
|---|
| 1419 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1420 | werr = NetGroupAddUser_l(ctx, &r);
|
|---|
| 1421 | } else {
|
|---|
| 1422 | werr = NetGroupAddUser_r(ctx, &r);
|
|---|
| 1423 | }
|
|---|
| 1424 |
|
|---|
| 1425 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1426 |
|
|---|
| 1427 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1428 | NDR_PRINT_OUT_DEBUG(NetGroupAddUser, &r);
|
|---|
| 1429 | }
|
|---|
| 1430 |
|
|---|
| 1431 | TALLOC_FREE(frame);
|
|---|
| 1432 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1433 | }
|
|---|
| 1434 |
|
|---|
| 1435 | /****************************************************************
|
|---|
| 1436 | NetGroupDelUser
|
|---|
| 1437 | ****************************************************************/
|
|---|
| 1438 |
|
|---|
| 1439 | NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
|
|---|
| 1440 | const char * group_name /* [in] */,
|
|---|
| 1441 | const char * user_name /* [in] */)
|
|---|
| 1442 | {
|
|---|
| 1443 | struct NetGroupDelUser r;
|
|---|
| 1444 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1445 | NET_API_STATUS status;
|
|---|
| 1446 | WERROR werr;
|
|---|
| 1447 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1448 |
|
|---|
| 1449 | status = libnetapi_getctx(&ctx);
|
|---|
| 1450 | if (status != 0) {
|
|---|
| 1451 | TALLOC_FREE(frame);
|
|---|
| 1452 | return status;
|
|---|
| 1453 | }
|
|---|
| 1454 |
|
|---|
| 1455 | /* In parameters */
|
|---|
| 1456 | r.in.server_name = server_name;
|
|---|
| 1457 | r.in.group_name = group_name;
|
|---|
| 1458 | r.in.user_name = user_name;
|
|---|
| 1459 |
|
|---|
| 1460 | /* Out parameters */
|
|---|
| 1461 |
|
|---|
| 1462 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1463 | NDR_PRINT_IN_DEBUG(NetGroupDelUser, &r);
|
|---|
| 1464 | }
|
|---|
| 1465 |
|
|---|
| 1466 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1467 | werr = NetGroupDelUser_l(ctx, &r);
|
|---|
| 1468 | } else {
|
|---|
| 1469 | werr = NetGroupDelUser_r(ctx, &r);
|
|---|
| 1470 | }
|
|---|
| 1471 |
|
|---|
| 1472 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1473 |
|
|---|
| 1474 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1475 | NDR_PRINT_OUT_DEBUG(NetGroupDelUser, &r);
|
|---|
| 1476 | }
|
|---|
| 1477 |
|
|---|
| 1478 | TALLOC_FREE(frame);
|
|---|
| 1479 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1480 | }
|
|---|
| 1481 |
|
|---|
| 1482 | /****************************************************************
|
|---|
| 1483 | NetGroupGetUsers
|
|---|
| 1484 | ****************************************************************/
|
|---|
| 1485 |
|
|---|
| 1486 | NET_API_STATUS NetGroupGetUsers(const char * server_name /* [in] */,
|
|---|
| 1487 | const char * group_name /* [in] */,
|
|---|
| 1488 | uint32_t level /* [in] */,
|
|---|
| 1489 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 1490 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1491 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1492 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 1493 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 1494 | {
|
|---|
| 1495 | struct NetGroupGetUsers r;
|
|---|
| 1496 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1497 | NET_API_STATUS status;
|
|---|
| 1498 | WERROR werr;
|
|---|
| 1499 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1500 |
|
|---|
| 1501 | status = libnetapi_getctx(&ctx);
|
|---|
| 1502 | if (status != 0) {
|
|---|
| 1503 | TALLOC_FREE(frame);
|
|---|
| 1504 | return status;
|
|---|
| 1505 | }
|
|---|
| 1506 |
|
|---|
| 1507 | /* In parameters */
|
|---|
| 1508 | r.in.server_name = server_name;
|
|---|
| 1509 | r.in.group_name = group_name;
|
|---|
| 1510 | r.in.level = level;
|
|---|
| 1511 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1512 | r.in.resume_handle = resume_handle;
|
|---|
| 1513 |
|
|---|
| 1514 | /* Out parameters */
|
|---|
| 1515 | r.out.buffer = buffer;
|
|---|
| 1516 | r.out.entries_read = entries_read;
|
|---|
| 1517 | r.out.total_entries = total_entries;
|
|---|
| 1518 | r.out.resume_handle = resume_handle;
|
|---|
| 1519 |
|
|---|
| 1520 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1521 | NDR_PRINT_IN_DEBUG(NetGroupGetUsers, &r);
|
|---|
| 1522 | }
|
|---|
| 1523 |
|
|---|
| 1524 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1525 | werr = NetGroupGetUsers_l(ctx, &r);
|
|---|
| 1526 | } else {
|
|---|
| 1527 | werr = NetGroupGetUsers_r(ctx, &r);
|
|---|
| 1528 | }
|
|---|
| 1529 |
|
|---|
| 1530 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1531 |
|
|---|
| 1532 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1533 | NDR_PRINT_OUT_DEBUG(NetGroupGetUsers, &r);
|
|---|
| 1534 | }
|
|---|
| 1535 |
|
|---|
| 1536 | TALLOC_FREE(frame);
|
|---|
| 1537 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1538 | }
|
|---|
| 1539 |
|
|---|
| 1540 | /****************************************************************
|
|---|
| 1541 | NetGroupSetUsers
|
|---|
| 1542 | ****************************************************************/
|
|---|
| 1543 |
|
|---|
| 1544 | NET_API_STATUS NetGroupSetUsers(const char * server_name /* [in] */,
|
|---|
| 1545 | const char * group_name /* [in] */,
|
|---|
| 1546 | uint32_t level /* [in] */,
|
|---|
| 1547 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1548 | uint32_t num_entries /* [in] */)
|
|---|
| 1549 | {
|
|---|
| 1550 | struct NetGroupSetUsers r;
|
|---|
| 1551 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1552 | NET_API_STATUS status;
|
|---|
| 1553 | WERROR werr;
|
|---|
| 1554 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1555 |
|
|---|
| 1556 | status = libnetapi_getctx(&ctx);
|
|---|
| 1557 | if (status != 0) {
|
|---|
| 1558 | TALLOC_FREE(frame);
|
|---|
| 1559 | return status;
|
|---|
| 1560 | }
|
|---|
| 1561 |
|
|---|
| 1562 | /* In parameters */
|
|---|
| 1563 | r.in.server_name = server_name;
|
|---|
| 1564 | r.in.group_name = group_name;
|
|---|
| 1565 | r.in.level = level;
|
|---|
| 1566 | r.in.buffer = buffer;
|
|---|
| 1567 | r.in.num_entries = num_entries;
|
|---|
| 1568 |
|
|---|
| 1569 | /* Out parameters */
|
|---|
| 1570 |
|
|---|
| 1571 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1572 | NDR_PRINT_IN_DEBUG(NetGroupSetUsers, &r);
|
|---|
| 1573 | }
|
|---|
| 1574 |
|
|---|
| 1575 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1576 | werr = NetGroupSetUsers_l(ctx, &r);
|
|---|
| 1577 | } else {
|
|---|
| 1578 | werr = NetGroupSetUsers_r(ctx, &r);
|
|---|
| 1579 | }
|
|---|
| 1580 |
|
|---|
| 1581 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1582 |
|
|---|
| 1583 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1584 | NDR_PRINT_OUT_DEBUG(NetGroupSetUsers, &r);
|
|---|
| 1585 | }
|
|---|
| 1586 |
|
|---|
| 1587 | TALLOC_FREE(frame);
|
|---|
| 1588 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1589 | }
|
|---|
| 1590 |
|
|---|
| 1591 | /****************************************************************
|
|---|
| 1592 | NetLocalGroupAdd
|
|---|
| 1593 | ****************************************************************/
|
|---|
| 1594 |
|
|---|
| 1595 | NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */,
|
|---|
| 1596 | uint32_t level /* [in] */,
|
|---|
| 1597 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1598 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1599 | {
|
|---|
| 1600 | struct NetLocalGroupAdd r;
|
|---|
| 1601 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1602 | NET_API_STATUS status;
|
|---|
| 1603 | WERROR werr;
|
|---|
| 1604 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1605 |
|
|---|
| 1606 | status = libnetapi_getctx(&ctx);
|
|---|
| 1607 | if (status != 0) {
|
|---|
| 1608 | TALLOC_FREE(frame);
|
|---|
| 1609 | return status;
|
|---|
| 1610 | }
|
|---|
| 1611 |
|
|---|
| 1612 | /* In parameters */
|
|---|
| 1613 | r.in.server_name = server_name;
|
|---|
| 1614 | r.in.level = level;
|
|---|
| 1615 | r.in.buffer = buffer;
|
|---|
| 1616 |
|
|---|
| 1617 | /* Out parameters */
|
|---|
| 1618 | r.out.parm_err = parm_err;
|
|---|
| 1619 |
|
|---|
| 1620 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1621 | NDR_PRINT_IN_DEBUG(NetLocalGroupAdd, &r);
|
|---|
| 1622 | }
|
|---|
| 1623 |
|
|---|
| 1624 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1625 | werr = NetLocalGroupAdd_l(ctx, &r);
|
|---|
| 1626 | } else {
|
|---|
| 1627 | werr = NetLocalGroupAdd_r(ctx, &r);
|
|---|
| 1628 | }
|
|---|
| 1629 |
|
|---|
| 1630 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1631 |
|
|---|
| 1632 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1633 | NDR_PRINT_OUT_DEBUG(NetLocalGroupAdd, &r);
|
|---|
| 1634 | }
|
|---|
| 1635 |
|
|---|
| 1636 | TALLOC_FREE(frame);
|
|---|
| 1637 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1638 | }
|
|---|
| 1639 |
|
|---|
| 1640 | /****************************************************************
|
|---|
| 1641 | NetLocalGroupDel
|
|---|
| 1642 | ****************************************************************/
|
|---|
| 1643 |
|
|---|
| 1644 | NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
|
|---|
| 1645 | const char * group_name /* [in] */)
|
|---|
| 1646 | {
|
|---|
| 1647 | struct NetLocalGroupDel r;
|
|---|
| 1648 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1649 | NET_API_STATUS status;
|
|---|
| 1650 | WERROR werr;
|
|---|
| 1651 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1652 |
|
|---|
| 1653 | status = libnetapi_getctx(&ctx);
|
|---|
| 1654 | if (status != 0) {
|
|---|
| 1655 | TALLOC_FREE(frame);
|
|---|
| 1656 | return status;
|
|---|
| 1657 | }
|
|---|
| 1658 |
|
|---|
| 1659 | /* In parameters */
|
|---|
| 1660 | r.in.server_name = server_name;
|
|---|
| 1661 | r.in.group_name = group_name;
|
|---|
| 1662 |
|
|---|
| 1663 | /* Out parameters */
|
|---|
| 1664 |
|
|---|
| 1665 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1666 | NDR_PRINT_IN_DEBUG(NetLocalGroupDel, &r);
|
|---|
| 1667 | }
|
|---|
| 1668 |
|
|---|
| 1669 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1670 | werr = NetLocalGroupDel_l(ctx, &r);
|
|---|
| 1671 | } else {
|
|---|
| 1672 | werr = NetLocalGroupDel_r(ctx, &r);
|
|---|
| 1673 | }
|
|---|
| 1674 |
|
|---|
| 1675 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1676 |
|
|---|
| 1677 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1678 | NDR_PRINT_OUT_DEBUG(NetLocalGroupDel, &r);
|
|---|
| 1679 | }
|
|---|
| 1680 |
|
|---|
| 1681 | TALLOC_FREE(frame);
|
|---|
| 1682 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1683 | }
|
|---|
| 1684 |
|
|---|
| 1685 | /****************************************************************
|
|---|
| 1686 | NetLocalGroupGetInfo
|
|---|
| 1687 | ****************************************************************/
|
|---|
| 1688 |
|
|---|
| 1689 | NET_API_STATUS NetLocalGroupGetInfo(const char * server_name /* [in] */,
|
|---|
| 1690 | const char * group_name /* [in] */,
|
|---|
| 1691 | uint32_t level /* [in] */,
|
|---|
| 1692 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 1693 | {
|
|---|
| 1694 | struct NetLocalGroupGetInfo r;
|
|---|
| 1695 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1696 | NET_API_STATUS status;
|
|---|
| 1697 | WERROR werr;
|
|---|
| 1698 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1699 |
|
|---|
| 1700 | status = libnetapi_getctx(&ctx);
|
|---|
| 1701 | if (status != 0) {
|
|---|
| 1702 | TALLOC_FREE(frame);
|
|---|
| 1703 | return status;
|
|---|
| 1704 | }
|
|---|
| 1705 |
|
|---|
| 1706 | /* In parameters */
|
|---|
| 1707 | r.in.server_name = server_name;
|
|---|
| 1708 | r.in.group_name = group_name;
|
|---|
| 1709 | r.in.level = level;
|
|---|
| 1710 |
|
|---|
| 1711 | /* Out parameters */
|
|---|
| 1712 | r.out.buffer = buffer;
|
|---|
| 1713 |
|
|---|
| 1714 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1715 | NDR_PRINT_IN_DEBUG(NetLocalGroupGetInfo, &r);
|
|---|
| 1716 | }
|
|---|
| 1717 |
|
|---|
| 1718 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1719 | werr = NetLocalGroupGetInfo_l(ctx, &r);
|
|---|
| 1720 | } else {
|
|---|
| 1721 | werr = NetLocalGroupGetInfo_r(ctx, &r);
|
|---|
| 1722 | }
|
|---|
| 1723 |
|
|---|
| 1724 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1725 |
|
|---|
| 1726 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1727 | NDR_PRINT_OUT_DEBUG(NetLocalGroupGetInfo, &r);
|
|---|
| 1728 | }
|
|---|
| 1729 |
|
|---|
| 1730 | TALLOC_FREE(frame);
|
|---|
| 1731 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1732 | }
|
|---|
| 1733 |
|
|---|
| 1734 | /****************************************************************
|
|---|
| 1735 | NetLocalGroupSetInfo
|
|---|
| 1736 | ****************************************************************/
|
|---|
| 1737 |
|
|---|
| 1738 | NET_API_STATUS NetLocalGroupSetInfo(const char * server_name /* [in] */,
|
|---|
| 1739 | const char * group_name /* [in] */,
|
|---|
| 1740 | uint32_t level /* [in] */,
|
|---|
| 1741 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1742 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1743 | {
|
|---|
| 1744 | struct NetLocalGroupSetInfo r;
|
|---|
| 1745 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1746 | NET_API_STATUS status;
|
|---|
| 1747 | WERROR werr;
|
|---|
| 1748 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1749 |
|
|---|
| 1750 | status = libnetapi_getctx(&ctx);
|
|---|
| 1751 | if (status != 0) {
|
|---|
| 1752 | TALLOC_FREE(frame);
|
|---|
| 1753 | return status;
|
|---|
| 1754 | }
|
|---|
| 1755 |
|
|---|
| 1756 | /* In parameters */
|
|---|
| 1757 | r.in.server_name = server_name;
|
|---|
| 1758 | r.in.group_name = group_name;
|
|---|
| 1759 | r.in.level = level;
|
|---|
| 1760 | r.in.buffer = buffer;
|
|---|
| 1761 |
|
|---|
| 1762 | /* Out parameters */
|
|---|
| 1763 | r.out.parm_err = parm_err;
|
|---|
| 1764 |
|
|---|
| 1765 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1766 | NDR_PRINT_IN_DEBUG(NetLocalGroupSetInfo, &r);
|
|---|
| 1767 | }
|
|---|
| 1768 |
|
|---|
| 1769 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1770 | werr = NetLocalGroupSetInfo_l(ctx, &r);
|
|---|
| 1771 | } else {
|
|---|
| 1772 | werr = NetLocalGroupSetInfo_r(ctx, &r);
|
|---|
| 1773 | }
|
|---|
| 1774 |
|
|---|
| 1775 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1776 |
|
|---|
| 1777 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1778 | NDR_PRINT_OUT_DEBUG(NetLocalGroupSetInfo, &r);
|
|---|
| 1779 | }
|
|---|
| 1780 |
|
|---|
| 1781 | TALLOC_FREE(frame);
|
|---|
| 1782 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1783 | }
|
|---|
| 1784 |
|
|---|
| 1785 | /****************************************************************
|
|---|
| 1786 | NetLocalGroupEnum
|
|---|
| 1787 | ****************************************************************/
|
|---|
| 1788 |
|
|---|
| 1789 | NET_API_STATUS NetLocalGroupEnum(const char * server_name /* [in] */,
|
|---|
| 1790 | uint32_t level /* [in] */,
|
|---|
| 1791 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 1792 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1793 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1794 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 1795 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 1796 | {
|
|---|
| 1797 | struct NetLocalGroupEnum r;
|
|---|
| 1798 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1799 | NET_API_STATUS status;
|
|---|
| 1800 | WERROR werr;
|
|---|
| 1801 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1802 |
|
|---|
| 1803 | status = libnetapi_getctx(&ctx);
|
|---|
| 1804 | if (status != 0) {
|
|---|
| 1805 | TALLOC_FREE(frame);
|
|---|
| 1806 | return status;
|
|---|
| 1807 | }
|
|---|
| 1808 |
|
|---|
| 1809 | /* In parameters */
|
|---|
| 1810 | r.in.server_name = server_name;
|
|---|
| 1811 | r.in.level = level;
|
|---|
| 1812 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1813 | r.in.resume_handle = resume_handle;
|
|---|
| 1814 |
|
|---|
| 1815 | /* Out parameters */
|
|---|
| 1816 | r.out.buffer = buffer;
|
|---|
| 1817 | r.out.entries_read = entries_read;
|
|---|
| 1818 | r.out.total_entries = total_entries;
|
|---|
| 1819 | r.out.resume_handle = resume_handle;
|
|---|
| 1820 |
|
|---|
| 1821 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1822 | NDR_PRINT_IN_DEBUG(NetLocalGroupEnum, &r);
|
|---|
| 1823 | }
|
|---|
| 1824 |
|
|---|
| 1825 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1826 | werr = NetLocalGroupEnum_l(ctx, &r);
|
|---|
| 1827 | } else {
|
|---|
| 1828 | werr = NetLocalGroupEnum_r(ctx, &r);
|
|---|
| 1829 | }
|
|---|
| 1830 |
|
|---|
| 1831 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1832 |
|
|---|
| 1833 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1834 | NDR_PRINT_OUT_DEBUG(NetLocalGroupEnum, &r);
|
|---|
| 1835 | }
|
|---|
| 1836 |
|
|---|
| 1837 | TALLOC_FREE(frame);
|
|---|
| 1838 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1839 | }
|
|---|
| 1840 |
|
|---|
| 1841 | /****************************************************************
|
|---|
| 1842 | NetLocalGroupAddMembers
|
|---|
| 1843 | ****************************************************************/
|
|---|
| 1844 |
|
|---|
| 1845 | NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
|
|---|
| 1846 | const char * group_name /* [in] */,
|
|---|
| 1847 | uint32_t level /* [in] */,
|
|---|
| 1848 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1849 | uint32_t total_entries /* [in] */)
|
|---|
| 1850 | {
|
|---|
| 1851 | struct NetLocalGroupAddMembers r;
|
|---|
| 1852 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1853 | NET_API_STATUS status;
|
|---|
| 1854 | WERROR werr;
|
|---|
| 1855 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1856 |
|
|---|
| 1857 | status = libnetapi_getctx(&ctx);
|
|---|
| 1858 | if (status != 0) {
|
|---|
| 1859 | TALLOC_FREE(frame);
|
|---|
| 1860 | return status;
|
|---|
| 1861 | }
|
|---|
| 1862 |
|
|---|
| 1863 | /* In parameters */
|
|---|
| 1864 | r.in.server_name = server_name;
|
|---|
| 1865 | r.in.group_name = group_name;
|
|---|
| 1866 | r.in.level = level;
|
|---|
| 1867 | r.in.buffer = buffer;
|
|---|
| 1868 | r.in.total_entries = total_entries;
|
|---|
| 1869 |
|
|---|
| 1870 | /* Out parameters */
|
|---|
| 1871 |
|
|---|
| 1872 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1873 | NDR_PRINT_IN_DEBUG(NetLocalGroupAddMembers, &r);
|
|---|
| 1874 | }
|
|---|
| 1875 |
|
|---|
| 1876 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1877 | werr = NetLocalGroupAddMembers_l(ctx, &r);
|
|---|
| 1878 | } else {
|
|---|
| 1879 | werr = NetLocalGroupAddMembers_r(ctx, &r);
|
|---|
| 1880 | }
|
|---|
| 1881 |
|
|---|
| 1882 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1883 |
|
|---|
| 1884 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1885 | NDR_PRINT_OUT_DEBUG(NetLocalGroupAddMembers, &r);
|
|---|
| 1886 | }
|
|---|
| 1887 |
|
|---|
| 1888 | TALLOC_FREE(frame);
|
|---|
| 1889 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1890 | }
|
|---|
| 1891 |
|
|---|
| 1892 | /****************************************************************
|
|---|
| 1893 | NetLocalGroupDelMembers
|
|---|
| 1894 | ****************************************************************/
|
|---|
| 1895 |
|
|---|
| 1896 | NET_API_STATUS NetLocalGroupDelMembers(const char * server_name /* [in] */,
|
|---|
| 1897 | const char * group_name /* [in] */,
|
|---|
| 1898 | uint32_t level /* [in] */,
|
|---|
| 1899 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1900 | uint32_t total_entries /* [in] */)
|
|---|
| 1901 | {
|
|---|
| 1902 | struct NetLocalGroupDelMembers r;
|
|---|
| 1903 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1904 | NET_API_STATUS status;
|
|---|
| 1905 | WERROR werr;
|
|---|
| 1906 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1907 |
|
|---|
| 1908 | status = libnetapi_getctx(&ctx);
|
|---|
| 1909 | if (status != 0) {
|
|---|
| 1910 | TALLOC_FREE(frame);
|
|---|
| 1911 | return status;
|
|---|
| 1912 | }
|
|---|
| 1913 |
|
|---|
| 1914 | /* In parameters */
|
|---|
| 1915 | r.in.server_name = server_name;
|
|---|
| 1916 | r.in.group_name = group_name;
|
|---|
| 1917 | r.in.level = level;
|
|---|
| 1918 | r.in.buffer = buffer;
|
|---|
| 1919 | r.in.total_entries = total_entries;
|
|---|
| 1920 |
|
|---|
| 1921 | /* Out parameters */
|
|---|
| 1922 |
|
|---|
| 1923 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1924 | NDR_PRINT_IN_DEBUG(NetLocalGroupDelMembers, &r);
|
|---|
| 1925 | }
|
|---|
| 1926 |
|
|---|
| 1927 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1928 | werr = NetLocalGroupDelMembers_l(ctx, &r);
|
|---|
| 1929 | } else {
|
|---|
| 1930 | werr = NetLocalGroupDelMembers_r(ctx, &r);
|
|---|
| 1931 | }
|
|---|
| 1932 |
|
|---|
| 1933 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1934 |
|
|---|
| 1935 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1936 | NDR_PRINT_OUT_DEBUG(NetLocalGroupDelMembers, &r);
|
|---|
| 1937 | }
|
|---|
| 1938 |
|
|---|
| 1939 | TALLOC_FREE(frame);
|
|---|
| 1940 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1941 | }
|
|---|
| 1942 |
|
|---|
| 1943 | /****************************************************************
|
|---|
| 1944 | NetLocalGroupGetMembers
|
|---|
| 1945 | ****************************************************************/
|
|---|
| 1946 |
|
|---|
| 1947 | NET_API_STATUS NetLocalGroupGetMembers(const char * server_name /* [in] */,
|
|---|
| 1948 | const char * local_group_name /* [in] */,
|
|---|
| 1949 | uint32_t level /* [in] */,
|
|---|
| 1950 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 1951 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1952 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1953 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 1954 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 1955 | {
|
|---|
| 1956 | struct NetLocalGroupGetMembers r;
|
|---|
| 1957 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1958 | NET_API_STATUS status;
|
|---|
| 1959 | WERROR werr;
|
|---|
| 1960 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1961 |
|
|---|
| 1962 | status = libnetapi_getctx(&ctx);
|
|---|
| 1963 | if (status != 0) {
|
|---|
| 1964 | TALLOC_FREE(frame);
|
|---|
| 1965 | return status;
|
|---|
| 1966 | }
|
|---|
| 1967 |
|
|---|
| 1968 | /* In parameters */
|
|---|
| 1969 | r.in.server_name = server_name;
|
|---|
| 1970 | r.in.local_group_name = local_group_name;
|
|---|
| 1971 | r.in.level = level;
|
|---|
| 1972 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1973 | r.in.resume_handle = resume_handle;
|
|---|
| 1974 |
|
|---|
| 1975 | /* Out parameters */
|
|---|
| 1976 | r.out.buffer = buffer;
|
|---|
| 1977 | r.out.entries_read = entries_read;
|
|---|
| 1978 | r.out.total_entries = total_entries;
|
|---|
| 1979 | r.out.resume_handle = resume_handle;
|
|---|
| 1980 |
|
|---|
| 1981 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1982 | NDR_PRINT_IN_DEBUG(NetLocalGroupGetMembers, &r);
|
|---|
| 1983 | }
|
|---|
| 1984 |
|
|---|
| 1985 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1986 | werr = NetLocalGroupGetMembers_l(ctx, &r);
|
|---|
| 1987 | } else {
|
|---|
| 1988 | werr = NetLocalGroupGetMembers_r(ctx, &r);
|
|---|
| 1989 | }
|
|---|
| 1990 |
|
|---|
| 1991 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1992 |
|
|---|
| 1993 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1994 | NDR_PRINT_OUT_DEBUG(NetLocalGroupGetMembers, &r);
|
|---|
| 1995 | }
|
|---|
| 1996 |
|
|---|
| 1997 | TALLOC_FREE(frame);
|
|---|
| 1998 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1999 | }
|
|---|
| 2000 |
|
|---|
| 2001 | /****************************************************************
|
|---|
| 2002 | NetLocalGroupSetMembers
|
|---|
| 2003 | ****************************************************************/
|
|---|
| 2004 |
|
|---|
| 2005 | NET_API_STATUS NetLocalGroupSetMembers(const char * server_name /* [in] */,
|
|---|
| 2006 | const char * group_name /* [in] */,
|
|---|
| 2007 | uint32_t level /* [in] */,
|
|---|
| 2008 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 2009 | uint32_t total_entries /* [in] */)
|
|---|
| 2010 | {
|
|---|
| 2011 | struct NetLocalGroupSetMembers r;
|
|---|
| 2012 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2013 | NET_API_STATUS status;
|
|---|
| 2014 | WERROR werr;
|
|---|
| 2015 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2016 |
|
|---|
| 2017 | status = libnetapi_getctx(&ctx);
|
|---|
| 2018 | if (status != 0) {
|
|---|
| 2019 | TALLOC_FREE(frame);
|
|---|
| 2020 | return status;
|
|---|
| 2021 | }
|
|---|
| 2022 |
|
|---|
| 2023 | /* In parameters */
|
|---|
| 2024 | r.in.server_name = server_name;
|
|---|
| 2025 | r.in.group_name = group_name;
|
|---|
| 2026 | r.in.level = level;
|
|---|
| 2027 | r.in.buffer = buffer;
|
|---|
| 2028 | r.in.total_entries = total_entries;
|
|---|
| 2029 |
|
|---|
| 2030 | /* Out parameters */
|
|---|
| 2031 |
|
|---|
| 2032 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2033 | NDR_PRINT_IN_DEBUG(NetLocalGroupSetMembers, &r);
|
|---|
| 2034 | }
|
|---|
| 2035 |
|
|---|
| 2036 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2037 | werr = NetLocalGroupSetMembers_l(ctx, &r);
|
|---|
| 2038 | } else {
|
|---|
| 2039 | werr = NetLocalGroupSetMembers_r(ctx, &r);
|
|---|
| 2040 | }
|
|---|
| 2041 |
|
|---|
| 2042 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2043 |
|
|---|
| 2044 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2045 | NDR_PRINT_OUT_DEBUG(NetLocalGroupSetMembers, &r);
|
|---|
| 2046 | }
|
|---|
| 2047 |
|
|---|
| 2048 | TALLOC_FREE(frame);
|
|---|
| 2049 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2050 | }
|
|---|
| 2051 |
|
|---|
| 2052 | /****************************************************************
|
|---|
| 2053 | NetRemoteTOD
|
|---|
| 2054 | ****************************************************************/
|
|---|
| 2055 |
|
|---|
| 2056 | NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
|
|---|
| 2057 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2058 | {
|
|---|
| 2059 | struct NetRemoteTOD r;
|
|---|
| 2060 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2061 | NET_API_STATUS status;
|
|---|
| 2062 | WERROR werr;
|
|---|
| 2063 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2064 |
|
|---|
| 2065 | status = libnetapi_getctx(&ctx);
|
|---|
| 2066 | if (status != 0) {
|
|---|
| 2067 | TALLOC_FREE(frame);
|
|---|
| 2068 | return status;
|
|---|
| 2069 | }
|
|---|
| 2070 |
|
|---|
| 2071 | /* In parameters */
|
|---|
| 2072 | r.in.server_name = server_name;
|
|---|
| 2073 |
|
|---|
| 2074 | /* Out parameters */
|
|---|
| 2075 | r.out.buffer = buffer;
|
|---|
| 2076 |
|
|---|
| 2077 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2078 | NDR_PRINT_IN_DEBUG(NetRemoteTOD, &r);
|
|---|
| 2079 | }
|
|---|
| 2080 |
|
|---|
| 2081 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2082 | werr = NetRemoteTOD_l(ctx, &r);
|
|---|
| 2083 | } else {
|
|---|
| 2084 | werr = NetRemoteTOD_r(ctx, &r);
|
|---|
| 2085 | }
|
|---|
| 2086 |
|
|---|
| 2087 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2088 |
|
|---|
| 2089 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2090 | NDR_PRINT_OUT_DEBUG(NetRemoteTOD, &r);
|
|---|
| 2091 | }
|
|---|
| 2092 |
|
|---|
| 2093 | TALLOC_FREE(frame);
|
|---|
| 2094 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2095 | }
|
|---|
| 2096 |
|
|---|
| 2097 | /****************************************************************
|
|---|
| 2098 | NetShareAdd
|
|---|
| 2099 | ****************************************************************/
|
|---|
| 2100 |
|
|---|
| 2101 | NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
|
|---|
| 2102 | uint32_t level /* [in] */,
|
|---|
| 2103 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 2104 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 2105 | {
|
|---|
| 2106 | struct NetShareAdd r;
|
|---|
| 2107 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2108 | NET_API_STATUS status;
|
|---|
| 2109 | WERROR werr;
|
|---|
| 2110 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2111 |
|
|---|
| 2112 | status = libnetapi_getctx(&ctx);
|
|---|
| 2113 | if (status != 0) {
|
|---|
| 2114 | TALLOC_FREE(frame);
|
|---|
| 2115 | return status;
|
|---|
| 2116 | }
|
|---|
| 2117 |
|
|---|
| 2118 | /* In parameters */
|
|---|
| 2119 | r.in.server_name = server_name;
|
|---|
| 2120 | r.in.level = level;
|
|---|
| 2121 | r.in.buffer = buffer;
|
|---|
| 2122 |
|
|---|
| 2123 | /* Out parameters */
|
|---|
| 2124 | r.out.parm_err = parm_err;
|
|---|
| 2125 |
|
|---|
| 2126 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2127 | NDR_PRINT_IN_DEBUG(NetShareAdd, &r);
|
|---|
| 2128 | }
|
|---|
| 2129 |
|
|---|
| 2130 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2131 | werr = NetShareAdd_l(ctx, &r);
|
|---|
| 2132 | } else {
|
|---|
| 2133 | werr = NetShareAdd_r(ctx, &r);
|
|---|
| 2134 | }
|
|---|
| 2135 |
|
|---|
| 2136 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2137 |
|
|---|
| 2138 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2139 | NDR_PRINT_OUT_DEBUG(NetShareAdd, &r);
|
|---|
| 2140 | }
|
|---|
| 2141 |
|
|---|
| 2142 | TALLOC_FREE(frame);
|
|---|
| 2143 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2144 | }
|
|---|
| 2145 |
|
|---|
| 2146 | /****************************************************************
|
|---|
| 2147 | NetShareDel
|
|---|
| 2148 | ****************************************************************/
|
|---|
| 2149 |
|
|---|
| 2150 | NET_API_STATUS NetShareDel(const char * server_name /* [in] */,
|
|---|
| 2151 | const char * net_name /* [in] */,
|
|---|
| 2152 | uint32_t reserved /* [in] */)
|
|---|
| 2153 | {
|
|---|
| 2154 | struct NetShareDel r;
|
|---|
| 2155 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2156 | NET_API_STATUS status;
|
|---|
| 2157 | WERROR werr;
|
|---|
| 2158 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2159 |
|
|---|
| 2160 | status = libnetapi_getctx(&ctx);
|
|---|
| 2161 | if (status != 0) {
|
|---|
| 2162 | TALLOC_FREE(frame);
|
|---|
| 2163 | return status;
|
|---|
| 2164 | }
|
|---|
| 2165 |
|
|---|
| 2166 | /* In parameters */
|
|---|
| 2167 | r.in.server_name = server_name;
|
|---|
| 2168 | r.in.net_name = net_name;
|
|---|
| 2169 | r.in.reserved = reserved;
|
|---|
| 2170 |
|
|---|
| 2171 | /* Out parameters */
|
|---|
| 2172 |
|
|---|
| 2173 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2174 | NDR_PRINT_IN_DEBUG(NetShareDel, &r);
|
|---|
| 2175 | }
|
|---|
| 2176 |
|
|---|
| 2177 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2178 | werr = NetShareDel_l(ctx, &r);
|
|---|
| 2179 | } else {
|
|---|
| 2180 | werr = NetShareDel_r(ctx, &r);
|
|---|
| 2181 | }
|
|---|
| 2182 |
|
|---|
| 2183 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2184 |
|
|---|
| 2185 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2186 | NDR_PRINT_OUT_DEBUG(NetShareDel, &r);
|
|---|
| 2187 | }
|
|---|
| 2188 |
|
|---|
| 2189 | TALLOC_FREE(frame);
|
|---|
| 2190 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2191 | }
|
|---|
| 2192 |
|
|---|
| 2193 | /****************************************************************
|
|---|
| 2194 | NetShareEnum
|
|---|
| 2195 | ****************************************************************/
|
|---|
| 2196 |
|
|---|
| 2197 | NET_API_STATUS NetShareEnum(const char * server_name /* [in] */,
|
|---|
| 2198 | uint32_t level /* [in] */,
|
|---|
| 2199 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 2200 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 2201 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 2202 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 2203 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 2204 | {
|
|---|
| 2205 | struct NetShareEnum r;
|
|---|
| 2206 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2207 | NET_API_STATUS status;
|
|---|
| 2208 | WERROR werr;
|
|---|
| 2209 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2210 |
|
|---|
| 2211 | status = libnetapi_getctx(&ctx);
|
|---|
| 2212 | if (status != 0) {
|
|---|
| 2213 | TALLOC_FREE(frame);
|
|---|
| 2214 | return status;
|
|---|
| 2215 | }
|
|---|
| 2216 |
|
|---|
| 2217 | /* In parameters */
|
|---|
| 2218 | r.in.server_name = server_name;
|
|---|
| 2219 | r.in.level = level;
|
|---|
| 2220 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 2221 | r.in.resume_handle = resume_handle;
|
|---|
| 2222 |
|
|---|
| 2223 | /* Out parameters */
|
|---|
| 2224 | r.out.buffer = buffer;
|
|---|
| 2225 | r.out.entries_read = entries_read;
|
|---|
| 2226 | r.out.total_entries = total_entries;
|
|---|
| 2227 | r.out.resume_handle = resume_handle;
|
|---|
| 2228 |
|
|---|
| 2229 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2230 | NDR_PRINT_IN_DEBUG(NetShareEnum, &r);
|
|---|
| 2231 | }
|
|---|
| 2232 |
|
|---|
| 2233 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2234 | werr = NetShareEnum_l(ctx, &r);
|
|---|
| 2235 | } else {
|
|---|
| 2236 | werr = NetShareEnum_r(ctx, &r);
|
|---|
| 2237 | }
|
|---|
| 2238 |
|
|---|
| 2239 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2240 |
|
|---|
| 2241 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2242 | NDR_PRINT_OUT_DEBUG(NetShareEnum, &r);
|
|---|
| 2243 | }
|
|---|
| 2244 |
|
|---|
| 2245 | TALLOC_FREE(frame);
|
|---|
| 2246 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2247 | }
|
|---|
| 2248 |
|
|---|
| 2249 | /****************************************************************
|
|---|
| 2250 | NetShareGetInfo
|
|---|
| 2251 | ****************************************************************/
|
|---|
| 2252 |
|
|---|
| 2253 | NET_API_STATUS NetShareGetInfo(const char * server_name /* [in] */,
|
|---|
| 2254 | const char * net_name /* [in] */,
|
|---|
| 2255 | uint32_t level /* [in] */,
|
|---|
| 2256 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2257 | {
|
|---|
| 2258 | struct NetShareGetInfo r;
|
|---|
| 2259 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2260 | NET_API_STATUS status;
|
|---|
| 2261 | WERROR werr;
|
|---|
| 2262 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2263 |
|
|---|
| 2264 | status = libnetapi_getctx(&ctx);
|
|---|
| 2265 | if (status != 0) {
|
|---|
| 2266 | TALLOC_FREE(frame);
|
|---|
| 2267 | return status;
|
|---|
| 2268 | }
|
|---|
| 2269 |
|
|---|
| 2270 | /* In parameters */
|
|---|
| 2271 | r.in.server_name = server_name;
|
|---|
| 2272 | r.in.net_name = net_name;
|
|---|
| 2273 | r.in.level = level;
|
|---|
| 2274 |
|
|---|
| 2275 | /* Out parameters */
|
|---|
| 2276 | r.out.buffer = buffer;
|
|---|
| 2277 |
|
|---|
| 2278 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2279 | NDR_PRINT_IN_DEBUG(NetShareGetInfo, &r);
|
|---|
| 2280 | }
|
|---|
| 2281 |
|
|---|
| 2282 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2283 | werr = NetShareGetInfo_l(ctx, &r);
|
|---|
| 2284 | } else {
|
|---|
| 2285 | werr = NetShareGetInfo_r(ctx, &r);
|
|---|
| 2286 | }
|
|---|
| 2287 |
|
|---|
| 2288 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2289 |
|
|---|
| 2290 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2291 | NDR_PRINT_OUT_DEBUG(NetShareGetInfo, &r);
|
|---|
| 2292 | }
|
|---|
| 2293 |
|
|---|
| 2294 | TALLOC_FREE(frame);
|
|---|
| 2295 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2296 | }
|
|---|
| 2297 |
|
|---|
| 2298 | /****************************************************************
|
|---|
| 2299 | NetShareSetInfo
|
|---|
| 2300 | ****************************************************************/
|
|---|
| 2301 |
|
|---|
| 2302 | NET_API_STATUS NetShareSetInfo(const char * server_name /* [in] */,
|
|---|
| 2303 | const char * net_name /* [in] */,
|
|---|
| 2304 | uint32_t level /* [in] */,
|
|---|
| 2305 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 2306 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 2307 | {
|
|---|
| 2308 | struct NetShareSetInfo r;
|
|---|
| 2309 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2310 | NET_API_STATUS status;
|
|---|
| 2311 | WERROR werr;
|
|---|
| 2312 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2313 |
|
|---|
| 2314 | status = libnetapi_getctx(&ctx);
|
|---|
| 2315 | if (status != 0) {
|
|---|
| 2316 | TALLOC_FREE(frame);
|
|---|
| 2317 | return status;
|
|---|
| 2318 | }
|
|---|
| 2319 |
|
|---|
| 2320 | /* In parameters */
|
|---|
| 2321 | r.in.server_name = server_name;
|
|---|
| 2322 | r.in.net_name = net_name;
|
|---|
| 2323 | r.in.level = level;
|
|---|
| 2324 | r.in.buffer = buffer;
|
|---|
| 2325 |
|
|---|
| 2326 | /* Out parameters */
|
|---|
| 2327 | r.out.parm_err = parm_err;
|
|---|
| 2328 |
|
|---|
| 2329 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2330 | NDR_PRINT_IN_DEBUG(NetShareSetInfo, &r);
|
|---|
| 2331 | }
|
|---|
| 2332 |
|
|---|
| 2333 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2334 | werr = NetShareSetInfo_l(ctx, &r);
|
|---|
| 2335 | } else {
|
|---|
| 2336 | werr = NetShareSetInfo_r(ctx, &r);
|
|---|
| 2337 | }
|
|---|
| 2338 |
|
|---|
| 2339 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2340 |
|
|---|
| 2341 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2342 | NDR_PRINT_OUT_DEBUG(NetShareSetInfo, &r);
|
|---|
| 2343 | }
|
|---|
| 2344 |
|
|---|
| 2345 | TALLOC_FREE(frame);
|
|---|
| 2346 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2347 | }
|
|---|
| 2348 |
|
|---|
| 2349 | /****************************************************************
|
|---|
| 2350 | NetFileClose
|
|---|
| 2351 | ****************************************************************/
|
|---|
| 2352 |
|
|---|
| 2353 | NET_API_STATUS NetFileClose(const char * server_name /* [in] */,
|
|---|
| 2354 | uint32_t fileid /* [in] */)
|
|---|
| 2355 | {
|
|---|
| 2356 | struct NetFileClose r;
|
|---|
| 2357 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2358 | NET_API_STATUS status;
|
|---|
| 2359 | WERROR werr;
|
|---|
| 2360 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2361 |
|
|---|
| 2362 | status = libnetapi_getctx(&ctx);
|
|---|
| 2363 | if (status != 0) {
|
|---|
| 2364 | TALLOC_FREE(frame);
|
|---|
| 2365 | return status;
|
|---|
| 2366 | }
|
|---|
| 2367 |
|
|---|
| 2368 | /* In parameters */
|
|---|
| 2369 | r.in.server_name = server_name;
|
|---|
| 2370 | r.in.fileid = fileid;
|
|---|
| 2371 |
|
|---|
| 2372 | /* Out parameters */
|
|---|
| 2373 |
|
|---|
| 2374 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2375 | NDR_PRINT_IN_DEBUG(NetFileClose, &r);
|
|---|
| 2376 | }
|
|---|
| 2377 |
|
|---|
| 2378 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2379 | werr = NetFileClose_l(ctx, &r);
|
|---|
| 2380 | } else {
|
|---|
| 2381 | werr = NetFileClose_r(ctx, &r);
|
|---|
| 2382 | }
|
|---|
| 2383 |
|
|---|
| 2384 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2385 |
|
|---|
| 2386 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2387 | NDR_PRINT_OUT_DEBUG(NetFileClose, &r);
|
|---|
| 2388 | }
|
|---|
| 2389 |
|
|---|
| 2390 | TALLOC_FREE(frame);
|
|---|
| 2391 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2392 | }
|
|---|
| 2393 |
|
|---|
| 2394 | /****************************************************************
|
|---|
| 2395 | NetFileGetInfo
|
|---|
| 2396 | ****************************************************************/
|
|---|
| 2397 |
|
|---|
| 2398 | NET_API_STATUS NetFileGetInfo(const char * server_name /* [in] */,
|
|---|
| 2399 | uint32_t fileid /* [in] */,
|
|---|
| 2400 | uint32_t level /* [in] */,
|
|---|
| 2401 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2402 | {
|
|---|
| 2403 | struct NetFileGetInfo r;
|
|---|
| 2404 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2405 | NET_API_STATUS status;
|
|---|
| 2406 | WERROR werr;
|
|---|
| 2407 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2408 |
|
|---|
| 2409 | status = libnetapi_getctx(&ctx);
|
|---|
| 2410 | if (status != 0) {
|
|---|
| 2411 | TALLOC_FREE(frame);
|
|---|
| 2412 | return status;
|
|---|
| 2413 | }
|
|---|
| 2414 |
|
|---|
| 2415 | /* In parameters */
|
|---|
| 2416 | r.in.server_name = server_name;
|
|---|
| 2417 | r.in.fileid = fileid;
|
|---|
| 2418 | r.in.level = level;
|
|---|
| 2419 |
|
|---|
| 2420 | /* Out parameters */
|
|---|
| 2421 | r.out.buffer = buffer;
|
|---|
| 2422 |
|
|---|
| 2423 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2424 | NDR_PRINT_IN_DEBUG(NetFileGetInfo, &r);
|
|---|
| 2425 | }
|
|---|
| 2426 |
|
|---|
| 2427 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2428 | werr = NetFileGetInfo_l(ctx, &r);
|
|---|
| 2429 | } else {
|
|---|
| 2430 | werr = NetFileGetInfo_r(ctx, &r);
|
|---|
| 2431 | }
|
|---|
| 2432 |
|
|---|
| 2433 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2434 |
|
|---|
| 2435 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2436 | NDR_PRINT_OUT_DEBUG(NetFileGetInfo, &r);
|
|---|
| 2437 | }
|
|---|
| 2438 |
|
|---|
| 2439 | TALLOC_FREE(frame);
|
|---|
| 2440 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2441 | }
|
|---|
| 2442 |
|
|---|
| 2443 | /****************************************************************
|
|---|
| 2444 | NetFileEnum
|
|---|
| 2445 | ****************************************************************/
|
|---|
| 2446 |
|
|---|
| 2447 | NET_API_STATUS NetFileEnum(const char * server_name /* [in] */,
|
|---|
| 2448 | const char * base_path /* [in] */,
|
|---|
| 2449 | const char * user_name /* [in] */,
|
|---|
| 2450 | uint32_t level /* [in] */,
|
|---|
| 2451 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 2452 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 2453 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 2454 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 2455 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 2456 | {
|
|---|
| 2457 | struct NetFileEnum r;
|
|---|
| 2458 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2459 | NET_API_STATUS status;
|
|---|
| 2460 | WERROR werr;
|
|---|
| 2461 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2462 |
|
|---|
| 2463 | status = libnetapi_getctx(&ctx);
|
|---|
| 2464 | if (status != 0) {
|
|---|
| 2465 | TALLOC_FREE(frame);
|
|---|
| 2466 | return status;
|
|---|
| 2467 | }
|
|---|
| 2468 |
|
|---|
| 2469 | /* In parameters */
|
|---|
| 2470 | r.in.server_name = server_name;
|
|---|
| 2471 | r.in.base_path = base_path;
|
|---|
| 2472 | r.in.user_name = user_name;
|
|---|
| 2473 | r.in.level = level;
|
|---|
| 2474 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 2475 | r.in.resume_handle = resume_handle;
|
|---|
| 2476 |
|
|---|
| 2477 | /* Out parameters */
|
|---|
| 2478 | r.out.buffer = buffer;
|
|---|
| 2479 | r.out.entries_read = entries_read;
|
|---|
| 2480 | r.out.total_entries = total_entries;
|
|---|
| 2481 | r.out.resume_handle = resume_handle;
|
|---|
| 2482 |
|
|---|
| 2483 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2484 | NDR_PRINT_IN_DEBUG(NetFileEnum, &r);
|
|---|
| 2485 | }
|
|---|
| 2486 |
|
|---|
| 2487 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2488 | werr = NetFileEnum_l(ctx, &r);
|
|---|
| 2489 | } else {
|
|---|
| 2490 | werr = NetFileEnum_r(ctx, &r);
|
|---|
| 2491 | }
|
|---|
| 2492 |
|
|---|
| 2493 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2494 |
|
|---|
| 2495 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2496 | NDR_PRINT_OUT_DEBUG(NetFileEnum, &r);
|
|---|
| 2497 | }
|
|---|
| 2498 |
|
|---|
| 2499 | TALLOC_FREE(frame);
|
|---|
| 2500 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2501 | }
|
|---|
| 2502 |
|
|---|
| 2503 | /****************************************************************
|
|---|
| 2504 | NetShutdownInit
|
|---|
| 2505 | ****************************************************************/
|
|---|
| 2506 |
|
|---|
| 2507 | NET_API_STATUS NetShutdownInit(const char * server_name /* [in] */,
|
|---|
| 2508 | const char * message /* [in] */,
|
|---|
| 2509 | uint32_t timeout /* [in] */,
|
|---|
| 2510 | uint8_t force_apps /* [in] */,
|
|---|
| 2511 | uint8_t do_reboot /* [in] */)
|
|---|
| 2512 | {
|
|---|
| 2513 | struct NetShutdownInit r;
|
|---|
| 2514 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2515 | NET_API_STATUS status;
|
|---|
| 2516 | WERROR werr;
|
|---|
| 2517 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2518 |
|
|---|
| 2519 | status = libnetapi_getctx(&ctx);
|
|---|
| 2520 | if (status != 0) {
|
|---|
| 2521 | TALLOC_FREE(frame);
|
|---|
| 2522 | return status;
|
|---|
| 2523 | }
|
|---|
| 2524 |
|
|---|
| 2525 | /* In parameters */
|
|---|
| 2526 | r.in.server_name = server_name;
|
|---|
| 2527 | r.in.message = message;
|
|---|
| 2528 | r.in.timeout = timeout;
|
|---|
| 2529 | r.in.force_apps = force_apps;
|
|---|
| 2530 | r.in.do_reboot = do_reboot;
|
|---|
| 2531 |
|
|---|
| 2532 | /* Out parameters */
|
|---|
| 2533 |
|
|---|
| 2534 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2535 | NDR_PRINT_IN_DEBUG(NetShutdownInit, &r);
|
|---|
| 2536 | }
|
|---|
| 2537 |
|
|---|
| 2538 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2539 | werr = NetShutdownInit_l(ctx, &r);
|
|---|
| 2540 | } else {
|
|---|
| 2541 | werr = NetShutdownInit_r(ctx, &r);
|
|---|
| 2542 | }
|
|---|
| 2543 |
|
|---|
| 2544 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2545 |
|
|---|
| 2546 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2547 | NDR_PRINT_OUT_DEBUG(NetShutdownInit, &r);
|
|---|
| 2548 | }
|
|---|
| 2549 |
|
|---|
| 2550 | TALLOC_FREE(frame);
|
|---|
| 2551 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2552 | }
|
|---|
| 2553 |
|
|---|
| 2554 | /****************************************************************
|
|---|
| 2555 | NetShutdownAbort
|
|---|
| 2556 | ****************************************************************/
|
|---|
| 2557 |
|
|---|
| 2558 | NET_API_STATUS NetShutdownAbort(const char * server_name /* [in] */)
|
|---|
| 2559 | {
|
|---|
| 2560 | struct NetShutdownAbort r;
|
|---|
| 2561 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2562 | NET_API_STATUS status;
|
|---|
| 2563 | WERROR werr;
|
|---|
| 2564 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2565 |
|
|---|
| 2566 | status = libnetapi_getctx(&ctx);
|
|---|
| 2567 | if (status != 0) {
|
|---|
| 2568 | TALLOC_FREE(frame);
|
|---|
| 2569 | return status;
|
|---|
| 2570 | }
|
|---|
| 2571 |
|
|---|
| 2572 | /* In parameters */
|
|---|
| 2573 | r.in.server_name = server_name;
|
|---|
| 2574 |
|
|---|
| 2575 | /* Out parameters */
|
|---|
| 2576 |
|
|---|
| 2577 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2578 | NDR_PRINT_IN_DEBUG(NetShutdownAbort, &r);
|
|---|
| 2579 | }
|
|---|
| 2580 |
|
|---|
| 2581 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2582 | werr = NetShutdownAbort_l(ctx, &r);
|
|---|
| 2583 | } else {
|
|---|
| 2584 | werr = NetShutdownAbort_r(ctx, &r);
|
|---|
| 2585 | }
|
|---|
| 2586 |
|
|---|
| 2587 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2588 |
|
|---|
| 2589 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2590 | NDR_PRINT_OUT_DEBUG(NetShutdownAbort, &r);
|
|---|
| 2591 | }
|
|---|
| 2592 |
|
|---|
| 2593 | TALLOC_FREE(frame);
|
|---|
| 2594 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2595 | }
|
|---|
| 2596 |
|
|---|
| 2597 | /****************************************************************
|
|---|
| 2598 | I_NetLogonControl
|
|---|
| 2599 | ****************************************************************/
|
|---|
| 2600 |
|
|---|
| 2601 | NET_API_STATUS I_NetLogonControl(const char * server_name /* [in] */,
|
|---|
| 2602 | uint32_t function_code /* [in] */,
|
|---|
| 2603 | uint32_t query_level /* [in] */,
|
|---|
| 2604 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2605 | {
|
|---|
| 2606 | struct I_NetLogonControl r;
|
|---|
| 2607 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2608 | NET_API_STATUS status;
|
|---|
| 2609 | WERROR werr;
|
|---|
| 2610 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2611 |
|
|---|
| 2612 | status = libnetapi_getctx(&ctx);
|
|---|
| 2613 | if (status != 0) {
|
|---|
| 2614 | TALLOC_FREE(frame);
|
|---|
| 2615 | return status;
|
|---|
| 2616 | }
|
|---|
| 2617 |
|
|---|
| 2618 | /* In parameters */
|
|---|
| 2619 | r.in.server_name = server_name;
|
|---|
| 2620 | r.in.function_code = function_code;
|
|---|
| 2621 | r.in.query_level = query_level;
|
|---|
| 2622 |
|
|---|
| 2623 | /* Out parameters */
|
|---|
| 2624 | r.out.buffer = buffer;
|
|---|
| 2625 |
|
|---|
| 2626 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2627 | NDR_PRINT_IN_DEBUG(I_NetLogonControl, &r);
|
|---|
| 2628 | }
|
|---|
| 2629 |
|
|---|
| 2630 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2631 | werr = I_NetLogonControl_l(ctx, &r);
|
|---|
| 2632 | } else {
|
|---|
| 2633 | werr = I_NetLogonControl_r(ctx, &r);
|
|---|
| 2634 | }
|
|---|
| 2635 |
|
|---|
| 2636 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2637 |
|
|---|
| 2638 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2639 | NDR_PRINT_OUT_DEBUG(I_NetLogonControl, &r);
|
|---|
| 2640 | }
|
|---|
| 2641 |
|
|---|
| 2642 | TALLOC_FREE(frame);
|
|---|
| 2643 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2644 | }
|
|---|
| 2645 |
|
|---|
| 2646 | /****************************************************************
|
|---|
| 2647 | I_NetLogonControl2
|
|---|
| 2648 | ****************************************************************/
|
|---|
| 2649 |
|
|---|
| 2650 | NET_API_STATUS I_NetLogonControl2(const char * server_name /* [in] */,
|
|---|
| 2651 | uint32_t function_code /* [in] */,
|
|---|
| 2652 | uint32_t query_level /* [in] */,
|
|---|
| 2653 | uint8_t *data /* [in] [ref] */,
|
|---|
| 2654 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2655 | {
|
|---|
| 2656 | struct I_NetLogonControl2 r;
|
|---|
| 2657 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2658 | NET_API_STATUS status;
|
|---|
| 2659 | WERROR werr;
|
|---|
| 2660 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2661 |
|
|---|
| 2662 | status = libnetapi_getctx(&ctx);
|
|---|
| 2663 | if (status != 0) {
|
|---|
| 2664 | TALLOC_FREE(frame);
|
|---|
| 2665 | return status;
|
|---|
| 2666 | }
|
|---|
| 2667 |
|
|---|
| 2668 | /* In parameters */
|
|---|
| 2669 | r.in.server_name = server_name;
|
|---|
| 2670 | r.in.function_code = function_code;
|
|---|
| 2671 | r.in.query_level = query_level;
|
|---|
| 2672 | r.in.data = data;
|
|---|
| 2673 |
|
|---|
| 2674 | /* Out parameters */
|
|---|
| 2675 | r.out.buffer = buffer;
|
|---|
| 2676 |
|
|---|
| 2677 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2678 | NDR_PRINT_IN_DEBUG(I_NetLogonControl2, &r);
|
|---|
| 2679 | }
|
|---|
| 2680 |
|
|---|
| 2681 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2682 | werr = I_NetLogonControl2_l(ctx, &r);
|
|---|
| 2683 | } else {
|
|---|
| 2684 | werr = I_NetLogonControl2_r(ctx, &r);
|
|---|
| 2685 | }
|
|---|
| 2686 |
|
|---|
| 2687 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2688 |
|
|---|
| 2689 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2690 | NDR_PRINT_OUT_DEBUG(I_NetLogonControl2, &r);
|
|---|
| 2691 | }
|
|---|
| 2692 |
|
|---|
| 2693 | TALLOC_FREE(frame);
|
|---|
| 2694 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2695 | }
|
|---|
| 2696 |
|
|---|