| 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 | NetWkstaGetInfo
|
|---|
| 378 | ****************************************************************/
|
|---|
| 379 |
|
|---|
| 380 | NET_API_STATUS NetWkstaGetInfo(const char * wksta_name /* [in] [unique] */,
|
|---|
| 381 | uint32_t level /* [in] */,
|
|---|
| 382 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 383 | {
|
|---|
| 384 | struct NetWkstaGetInfo 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 = wksta_name;
|
|---|
| 398 | r.in.level = level;
|
|---|
| 399 |
|
|---|
| 400 | /* Out parameters */
|
|---|
| 401 | r.out.buffer = buffer;
|
|---|
| 402 |
|
|---|
| 403 | if (DEBUGLEVEL >= 10) {
|
|---|
| 404 | NDR_PRINT_IN_DEBUG(NetWkstaGetInfo, &r);
|
|---|
| 405 | }
|
|---|
| 406 |
|
|---|
| 407 | if (LIBNETAPI_LOCAL_SERVER(wksta_name)) {
|
|---|
| 408 | werr = NetWkstaGetInfo_l(ctx, &r);
|
|---|
| 409 | } else {
|
|---|
| 410 | werr = NetWkstaGetInfo_r(ctx, &r);
|
|---|
| 411 | }
|
|---|
| 412 |
|
|---|
| 413 | r.out.result = W_ERROR_V(werr);
|
|---|
| 414 |
|
|---|
| 415 | if (DEBUGLEVEL >= 10) {
|
|---|
| 416 | NDR_PRINT_OUT_DEBUG(NetWkstaGetInfo, &r);
|
|---|
| 417 | }
|
|---|
| 418 |
|
|---|
| 419 | TALLOC_FREE(frame);
|
|---|
| 420 | return (NET_API_STATUS)r.out.result;
|
|---|
| 421 | }
|
|---|
| 422 |
|
|---|
| 423 | /****************************************************************
|
|---|
| 424 | NetGetDCName
|
|---|
| 425 | ****************************************************************/
|
|---|
| 426 |
|
|---|
| 427 | NET_API_STATUS NetGetDCName(const char * server_name /* [in] [unique] */,
|
|---|
| 428 | const char * domain_name /* [in] [unique] */,
|
|---|
| 429 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 430 | {
|
|---|
| 431 | struct NetGetDCName 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(NetGetDCName, &r);
|
|---|
| 452 | }
|
|---|
| 453 |
|
|---|
| 454 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 455 | werr = NetGetDCName_l(ctx, &r);
|
|---|
| 456 | } else {
|
|---|
| 457 | werr = NetGetDCName_r(ctx, &r);
|
|---|
| 458 | }
|
|---|
| 459 |
|
|---|
| 460 | r.out.result = W_ERROR_V(werr);
|
|---|
| 461 |
|
|---|
| 462 | if (DEBUGLEVEL >= 10) {
|
|---|
| 463 | NDR_PRINT_OUT_DEBUG(NetGetDCName, &r);
|
|---|
| 464 | }
|
|---|
| 465 |
|
|---|
| 466 | TALLOC_FREE(frame);
|
|---|
| 467 | return (NET_API_STATUS)r.out.result;
|
|---|
| 468 | }
|
|---|
| 469 |
|
|---|
| 470 | /****************************************************************
|
|---|
| 471 | NetGetAnyDCName
|
|---|
| 472 | ****************************************************************/
|
|---|
| 473 |
|
|---|
| 474 | NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] [unique] */,
|
|---|
| 475 | const char * domain_name /* [in] [unique] */,
|
|---|
| 476 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 477 | {
|
|---|
| 478 | struct NetGetAnyDCName r;
|
|---|
| 479 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 480 | NET_API_STATUS status;
|
|---|
| 481 | WERROR werr;
|
|---|
| 482 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 483 |
|
|---|
| 484 | status = libnetapi_getctx(&ctx);
|
|---|
| 485 | if (status != 0) {
|
|---|
| 486 | TALLOC_FREE(frame);
|
|---|
| 487 | return status;
|
|---|
| 488 | }
|
|---|
| 489 |
|
|---|
| 490 | /* In parameters */
|
|---|
| 491 | r.in.server_name = server_name;
|
|---|
| 492 | r.in.domain_name = domain_name;
|
|---|
| 493 |
|
|---|
| 494 | /* Out parameters */
|
|---|
| 495 | r.out.buffer = buffer;
|
|---|
| 496 |
|
|---|
| 497 | if (DEBUGLEVEL >= 10) {
|
|---|
| 498 | NDR_PRINT_IN_DEBUG(NetGetAnyDCName, &r);
|
|---|
| 499 | }
|
|---|
| 500 |
|
|---|
| 501 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 502 | werr = NetGetAnyDCName_l(ctx, &r);
|
|---|
| 503 | } else {
|
|---|
| 504 | werr = NetGetAnyDCName_r(ctx, &r);
|
|---|
| 505 | }
|
|---|
| 506 |
|
|---|
| 507 | r.out.result = W_ERROR_V(werr);
|
|---|
| 508 |
|
|---|
| 509 | if (DEBUGLEVEL >= 10) {
|
|---|
| 510 | NDR_PRINT_OUT_DEBUG(NetGetAnyDCName, &r);
|
|---|
| 511 | }
|
|---|
| 512 |
|
|---|
| 513 | TALLOC_FREE(frame);
|
|---|
| 514 | return (NET_API_STATUS)r.out.result;
|
|---|
| 515 | }
|
|---|
| 516 |
|
|---|
| 517 | /****************************************************************
|
|---|
| 518 | DsGetDcName
|
|---|
| 519 | ****************************************************************/
|
|---|
| 520 |
|
|---|
| 521 | NET_API_STATUS DsGetDcName(const char * server_name /* [in] [unique] */,
|
|---|
| 522 | const char * domain_name /* [in] [ref] */,
|
|---|
| 523 | struct GUID *domain_guid /* [in] [unique] */,
|
|---|
| 524 | const char * site_name /* [in] [unique] */,
|
|---|
| 525 | uint32_t flags /* [in] */,
|
|---|
| 526 | struct DOMAIN_CONTROLLER_INFO **dc_info /* [out] [ref] */)
|
|---|
| 527 | {
|
|---|
| 528 | struct DsGetDcName r;
|
|---|
| 529 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 530 | NET_API_STATUS status;
|
|---|
| 531 | WERROR werr;
|
|---|
| 532 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 533 |
|
|---|
| 534 | status = libnetapi_getctx(&ctx);
|
|---|
| 535 | if (status != 0) {
|
|---|
| 536 | TALLOC_FREE(frame);
|
|---|
| 537 | return status;
|
|---|
| 538 | }
|
|---|
| 539 |
|
|---|
| 540 | /* In parameters */
|
|---|
| 541 | r.in.server_name = server_name;
|
|---|
| 542 | r.in.domain_name = domain_name;
|
|---|
| 543 | r.in.domain_guid = domain_guid;
|
|---|
| 544 | r.in.site_name = site_name;
|
|---|
| 545 | r.in.flags = flags;
|
|---|
| 546 |
|
|---|
| 547 | /* Out parameters */
|
|---|
| 548 | r.out.dc_info = dc_info;
|
|---|
| 549 |
|
|---|
| 550 | if (DEBUGLEVEL >= 10) {
|
|---|
| 551 | NDR_PRINT_IN_DEBUG(DsGetDcName, &r);
|
|---|
| 552 | }
|
|---|
| 553 |
|
|---|
| 554 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 555 | werr = DsGetDcName_l(ctx, &r);
|
|---|
| 556 | } else {
|
|---|
| 557 | werr = DsGetDcName_r(ctx, &r);
|
|---|
| 558 | }
|
|---|
| 559 |
|
|---|
| 560 | r.out.result = W_ERROR_V(werr);
|
|---|
| 561 |
|
|---|
| 562 | if (DEBUGLEVEL >= 10) {
|
|---|
| 563 | NDR_PRINT_OUT_DEBUG(DsGetDcName, &r);
|
|---|
| 564 | }
|
|---|
| 565 |
|
|---|
| 566 | TALLOC_FREE(frame);
|
|---|
| 567 | return (NET_API_STATUS)r.out.result;
|
|---|
| 568 | }
|
|---|
| 569 |
|
|---|
| 570 | /****************************************************************
|
|---|
| 571 | NetUserAdd
|
|---|
| 572 | ****************************************************************/
|
|---|
| 573 |
|
|---|
| 574 | NET_API_STATUS NetUserAdd(const char * server_name /* [in] [unique] */,
|
|---|
| 575 | uint32_t level /* [in] */,
|
|---|
| 576 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 577 | uint32_t *parm_error /* [out] [ref] */)
|
|---|
| 578 | {
|
|---|
| 579 | struct NetUserAdd 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.level = level;
|
|---|
| 594 | r.in.buffer = buffer;
|
|---|
| 595 |
|
|---|
| 596 | /* Out parameters */
|
|---|
| 597 | r.out.parm_error = parm_error;
|
|---|
| 598 |
|
|---|
| 599 | if (DEBUGLEVEL >= 10) {
|
|---|
| 600 | NDR_PRINT_IN_DEBUG(NetUserAdd, &r);
|
|---|
| 601 | }
|
|---|
| 602 |
|
|---|
| 603 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 604 | werr = NetUserAdd_l(ctx, &r);
|
|---|
| 605 | } else {
|
|---|
| 606 | werr = NetUserAdd_r(ctx, &r);
|
|---|
| 607 | }
|
|---|
| 608 |
|
|---|
| 609 | r.out.result = W_ERROR_V(werr);
|
|---|
| 610 |
|
|---|
| 611 | if (DEBUGLEVEL >= 10) {
|
|---|
| 612 | NDR_PRINT_OUT_DEBUG(NetUserAdd, &r);
|
|---|
| 613 | }
|
|---|
| 614 |
|
|---|
| 615 | TALLOC_FREE(frame);
|
|---|
| 616 | return (NET_API_STATUS)r.out.result;
|
|---|
| 617 | }
|
|---|
| 618 |
|
|---|
| 619 | /****************************************************************
|
|---|
| 620 | NetUserDel
|
|---|
| 621 | ****************************************************************/
|
|---|
| 622 |
|
|---|
| 623 | NET_API_STATUS NetUserDel(const char * server_name /* [in] [unique] */,
|
|---|
| 624 | const char * user_name /* [in] [ref] */)
|
|---|
| 625 | {
|
|---|
| 626 | struct NetUserDel r;
|
|---|
| 627 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 628 | NET_API_STATUS status;
|
|---|
| 629 | WERROR werr;
|
|---|
| 630 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 631 |
|
|---|
| 632 | status = libnetapi_getctx(&ctx);
|
|---|
| 633 | if (status != 0) {
|
|---|
| 634 | TALLOC_FREE(frame);
|
|---|
| 635 | return status;
|
|---|
| 636 | }
|
|---|
| 637 |
|
|---|
| 638 | /* In parameters */
|
|---|
| 639 | r.in.server_name = server_name;
|
|---|
| 640 | r.in.user_name = user_name;
|
|---|
| 641 |
|
|---|
| 642 | /* Out parameters */
|
|---|
| 643 |
|
|---|
| 644 | if (DEBUGLEVEL >= 10) {
|
|---|
| 645 | NDR_PRINT_IN_DEBUG(NetUserDel, &r);
|
|---|
| 646 | }
|
|---|
| 647 |
|
|---|
| 648 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 649 | werr = NetUserDel_l(ctx, &r);
|
|---|
| 650 | } else {
|
|---|
| 651 | werr = NetUserDel_r(ctx, &r);
|
|---|
| 652 | }
|
|---|
| 653 |
|
|---|
| 654 | r.out.result = W_ERROR_V(werr);
|
|---|
| 655 |
|
|---|
| 656 | if (DEBUGLEVEL >= 10) {
|
|---|
| 657 | NDR_PRINT_OUT_DEBUG(NetUserDel, &r);
|
|---|
| 658 | }
|
|---|
| 659 |
|
|---|
| 660 | TALLOC_FREE(frame);
|
|---|
| 661 | return (NET_API_STATUS)r.out.result;
|
|---|
| 662 | }
|
|---|
| 663 |
|
|---|
| 664 | /****************************************************************
|
|---|
| 665 | NetUserEnum
|
|---|
| 666 | ****************************************************************/
|
|---|
| 667 |
|
|---|
| 668 | NET_API_STATUS NetUserEnum(const char * server_name /* [in] [unique] */,
|
|---|
| 669 | uint32_t level /* [in] */,
|
|---|
| 670 | uint32_t filter /* [in] */,
|
|---|
| 671 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 672 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 673 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 674 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 675 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 676 | {
|
|---|
| 677 | struct NetUserEnum r;
|
|---|
| 678 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 679 | NET_API_STATUS status;
|
|---|
| 680 | WERROR werr;
|
|---|
| 681 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 682 |
|
|---|
| 683 | status = libnetapi_getctx(&ctx);
|
|---|
| 684 | if (status != 0) {
|
|---|
| 685 | TALLOC_FREE(frame);
|
|---|
| 686 | return status;
|
|---|
| 687 | }
|
|---|
| 688 |
|
|---|
| 689 | /* In parameters */
|
|---|
| 690 | r.in.server_name = server_name;
|
|---|
| 691 | r.in.level = level;
|
|---|
| 692 | r.in.filter = filter;
|
|---|
| 693 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 694 | r.in.resume_handle = resume_handle;
|
|---|
| 695 |
|
|---|
| 696 | /* Out parameters */
|
|---|
| 697 | r.out.buffer = buffer;
|
|---|
| 698 | r.out.entries_read = entries_read;
|
|---|
| 699 | r.out.total_entries = total_entries;
|
|---|
| 700 | r.out.resume_handle = resume_handle;
|
|---|
| 701 |
|
|---|
| 702 | if (DEBUGLEVEL >= 10) {
|
|---|
| 703 | NDR_PRINT_IN_DEBUG(NetUserEnum, &r);
|
|---|
| 704 | }
|
|---|
| 705 |
|
|---|
| 706 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 707 | werr = NetUserEnum_l(ctx, &r);
|
|---|
| 708 | } else {
|
|---|
| 709 | werr = NetUserEnum_r(ctx, &r);
|
|---|
| 710 | }
|
|---|
| 711 |
|
|---|
| 712 | r.out.result = W_ERROR_V(werr);
|
|---|
| 713 |
|
|---|
| 714 | if (DEBUGLEVEL >= 10) {
|
|---|
| 715 | NDR_PRINT_OUT_DEBUG(NetUserEnum, &r);
|
|---|
| 716 | }
|
|---|
| 717 |
|
|---|
| 718 | TALLOC_FREE(frame);
|
|---|
| 719 | return (NET_API_STATUS)r.out.result;
|
|---|
| 720 | }
|
|---|
| 721 |
|
|---|
| 722 | /****************************************************************
|
|---|
| 723 | NetUserChangePassword
|
|---|
| 724 | ****************************************************************/
|
|---|
| 725 |
|
|---|
| 726 | NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
|
|---|
| 727 | const char * user_name /* [in] */,
|
|---|
| 728 | const char * old_password /* [in] */,
|
|---|
| 729 | const char * new_password /* [in] */)
|
|---|
| 730 | {
|
|---|
| 731 | struct NetUserChangePassword r;
|
|---|
| 732 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 733 | NET_API_STATUS status;
|
|---|
| 734 | WERROR werr;
|
|---|
| 735 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 736 |
|
|---|
| 737 | status = libnetapi_getctx(&ctx);
|
|---|
| 738 | if (status != 0) {
|
|---|
| 739 | TALLOC_FREE(frame);
|
|---|
| 740 | return status;
|
|---|
| 741 | }
|
|---|
| 742 |
|
|---|
| 743 | /* In parameters */
|
|---|
| 744 | r.in.domain_name = domain_name;
|
|---|
| 745 | r.in.user_name = user_name;
|
|---|
| 746 | r.in.old_password = old_password;
|
|---|
| 747 | r.in.new_password = new_password;
|
|---|
| 748 |
|
|---|
| 749 | /* Out parameters */
|
|---|
| 750 |
|
|---|
| 751 | if (DEBUGLEVEL >= 10) {
|
|---|
| 752 | NDR_PRINT_IN_DEBUG(NetUserChangePassword, &r);
|
|---|
| 753 | }
|
|---|
| 754 |
|
|---|
| 755 | if (LIBNETAPI_LOCAL_SERVER(domain_name)) {
|
|---|
| 756 | werr = NetUserChangePassword_l(ctx, &r);
|
|---|
| 757 | } else {
|
|---|
| 758 | werr = NetUserChangePassword_r(ctx, &r);
|
|---|
| 759 | }
|
|---|
| 760 |
|
|---|
| 761 | r.out.result = W_ERROR_V(werr);
|
|---|
| 762 |
|
|---|
| 763 | if (DEBUGLEVEL >= 10) {
|
|---|
| 764 | NDR_PRINT_OUT_DEBUG(NetUserChangePassword, &r);
|
|---|
| 765 | }
|
|---|
| 766 |
|
|---|
| 767 | TALLOC_FREE(frame);
|
|---|
| 768 | return (NET_API_STATUS)r.out.result;
|
|---|
| 769 | }
|
|---|
| 770 |
|
|---|
| 771 | /****************************************************************
|
|---|
| 772 | NetUserGetInfo
|
|---|
| 773 | ****************************************************************/
|
|---|
| 774 |
|
|---|
| 775 | NET_API_STATUS NetUserGetInfo(const char * server_name /* [in] */,
|
|---|
| 776 | const char * user_name /* [in] */,
|
|---|
| 777 | uint32_t level /* [in] */,
|
|---|
| 778 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 779 | {
|
|---|
| 780 | struct NetUserGetInfo r;
|
|---|
| 781 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 782 | NET_API_STATUS status;
|
|---|
| 783 | WERROR werr;
|
|---|
| 784 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 785 |
|
|---|
| 786 | status = libnetapi_getctx(&ctx);
|
|---|
| 787 | if (status != 0) {
|
|---|
| 788 | TALLOC_FREE(frame);
|
|---|
| 789 | return status;
|
|---|
| 790 | }
|
|---|
| 791 |
|
|---|
| 792 | /* In parameters */
|
|---|
| 793 | r.in.server_name = server_name;
|
|---|
| 794 | r.in.user_name = user_name;
|
|---|
| 795 | r.in.level = level;
|
|---|
| 796 |
|
|---|
| 797 | /* Out parameters */
|
|---|
| 798 | r.out.buffer = buffer;
|
|---|
| 799 |
|
|---|
| 800 | if (DEBUGLEVEL >= 10) {
|
|---|
| 801 | NDR_PRINT_IN_DEBUG(NetUserGetInfo, &r);
|
|---|
| 802 | }
|
|---|
| 803 |
|
|---|
| 804 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 805 | werr = NetUserGetInfo_l(ctx, &r);
|
|---|
| 806 | } else {
|
|---|
| 807 | werr = NetUserGetInfo_r(ctx, &r);
|
|---|
| 808 | }
|
|---|
| 809 |
|
|---|
| 810 | r.out.result = W_ERROR_V(werr);
|
|---|
| 811 |
|
|---|
| 812 | if (DEBUGLEVEL >= 10) {
|
|---|
| 813 | NDR_PRINT_OUT_DEBUG(NetUserGetInfo, &r);
|
|---|
| 814 | }
|
|---|
| 815 |
|
|---|
| 816 | TALLOC_FREE(frame);
|
|---|
| 817 | return (NET_API_STATUS)r.out.result;
|
|---|
| 818 | }
|
|---|
| 819 |
|
|---|
| 820 | /****************************************************************
|
|---|
| 821 | NetUserSetInfo
|
|---|
| 822 | ****************************************************************/
|
|---|
| 823 |
|
|---|
| 824 | NET_API_STATUS NetUserSetInfo(const char * server_name /* [in] */,
|
|---|
| 825 | const char * user_name /* [in] */,
|
|---|
| 826 | uint32_t level /* [in] */,
|
|---|
| 827 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 828 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 829 | {
|
|---|
| 830 | struct NetUserSetInfo r;
|
|---|
| 831 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 832 | NET_API_STATUS status;
|
|---|
| 833 | WERROR werr;
|
|---|
| 834 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 835 |
|
|---|
| 836 | status = libnetapi_getctx(&ctx);
|
|---|
| 837 | if (status != 0) {
|
|---|
| 838 | TALLOC_FREE(frame);
|
|---|
| 839 | return status;
|
|---|
| 840 | }
|
|---|
| 841 |
|
|---|
| 842 | /* In parameters */
|
|---|
| 843 | r.in.server_name = server_name;
|
|---|
| 844 | r.in.user_name = user_name;
|
|---|
| 845 | r.in.level = level;
|
|---|
| 846 | r.in.buffer = buffer;
|
|---|
| 847 |
|
|---|
| 848 | /* Out parameters */
|
|---|
| 849 | r.out.parm_err = parm_err;
|
|---|
| 850 |
|
|---|
| 851 | if (DEBUGLEVEL >= 10) {
|
|---|
| 852 | NDR_PRINT_IN_DEBUG(NetUserSetInfo, &r);
|
|---|
| 853 | }
|
|---|
| 854 |
|
|---|
| 855 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 856 | werr = NetUserSetInfo_l(ctx, &r);
|
|---|
| 857 | } else {
|
|---|
| 858 | werr = NetUserSetInfo_r(ctx, &r);
|
|---|
| 859 | }
|
|---|
| 860 |
|
|---|
| 861 | r.out.result = W_ERROR_V(werr);
|
|---|
| 862 |
|
|---|
| 863 | if (DEBUGLEVEL >= 10) {
|
|---|
| 864 | NDR_PRINT_OUT_DEBUG(NetUserSetInfo, &r);
|
|---|
| 865 | }
|
|---|
| 866 |
|
|---|
| 867 | TALLOC_FREE(frame);
|
|---|
| 868 | return (NET_API_STATUS)r.out.result;
|
|---|
| 869 | }
|
|---|
| 870 |
|
|---|
| 871 | /****************************************************************
|
|---|
| 872 | NetUserGetGroups
|
|---|
| 873 | ****************************************************************/
|
|---|
| 874 |
|
|---|
| 875 | NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
|
|---|
| 876 | const char * user_name /* [in] */,
|
|---|
| 877 | uint32_t level /* [in] */,
|
|---|
| 878 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 879 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 880 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 881 | uint32_t *total_entries /* [out] [ref] */)
|
|---|
| 882 | {
|
|---|
| 883 | struct NetUserGetGroups r;
|
|---|
| 884 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 885 | NET_API_STATUS status;
|
|---|
| 886 | WERROR werr;
|
|---|
| 887 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 888 |
|
|---|
| 889 | status = libnetapi_getctx(&ctx);
|
|---|
| 890 | if (status != 0) {
|
|---|
| 891 | TALLOC_FREE(frame);
|
|---|
| 892 | return status;
|
|---|
| 893 | }
|
|---|
| 894 |
|
|---|
| 895 | /* In parameters */
|
|---|
| 896 | r.in.server_name = server_name;
|
|---|
| 897 | r.in.user_name = user_name;
|
|---|
| 898 | r.in.level = level;
|
|---|
| 899 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 900 |
|
|---|
| 901 | /* Out parameters */
|
|---|
| 902 | r.out.buffer = buffer;
|
|---|
| 903 | r.out.entries_read = entries_read;
|
|---|
| 904 | r.out.total_entries = total_entries;
|
|---|
| 905 |
|
|---|
| 906 | if (DEBUGLEVEL >= 10) {
|
|---|
| 907 | NDR_PRINT_IN_DEBUG(NetUserGetGroups, &r);
|
|---|
| 908 | }
|
|---|
| 909 |
|
|---|
| 910 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 911 | werr = NetUserGetGroups_l(ctx, &r);
|
|---|
| 912 | } else {
|
|---|
| 913 | werr = NetUserGetGroups_r(ctx, &r);
|
|---|
| 914 | }
|
|---|
| 915 |
|
|---|
| 916 | r.out.result = W_ERROR_V(werr);
|
|---|
| 917 |
|
|---|
| 918 | if (DEBUGLEVEL >= 10) {
|
|---|
| 919 | NDR_PRINT_OUT_DEBUG(NetUserGetGroups, &r);
|
|---|
| 920 | }
|
|---|
| 921 |
|
|---|
| 922 | TALLOC_FREE(frame);
|
|---|
| 923 | return (NET_API_STATUS)r.out.result;
|
|---|
| 924 | }
|
|---|
| 925 |
|
|---|
| 926 | /****************************************************************
|
|---|
| 927 | NetUserSetGroups
|
|---|
| 928 | ****************************************************************/
|
|---|
| 929 |
|
|---|
| 930 | NET_API_STATUS NetUserSetGroups(const char * server_name /* [in] */,
|
|---|
| 931 | const char * user_name /* [in] */,
|
|---|
| 932 | uint32_t level /* [in] */,
|
|---|
| 933 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 934 | uint32_t num_entries /* [in] */)
|
|---|
| 935 | {
|
|---|
| 936 | struct NetUserSetGroups r;
|
|---|
| 937 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 938 | NET_API_STATUS status;
|
|---|
| 939 | WERROR werr;
|
|---|
| 940 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 941 |
|
|---|
| 942 | status = libnetapi_getctx(&ctx);
|
|---|
| 943 | if (status != 0) {
|
|---|
| 944 | TALLOC_FREE(frame);
|
|---|
| 945 | return status;
|
|---|
| 946 | }
|
|---|
| 947 |
|
|---|
| 948 | /* In parameters */
|
|---|
| 949 | r.in.server_name = server_name;
|
|---|
| 950 | r.in.user_name = user_name;
|
|---|
| 951 | r.in.level = level;
|
|---|
| 952 | r.in.buffer = buffer;
|
|---|
| 953 | r.in.num_entries = num_entries;
|
|---|
| 954 |
|
|---|
| 955 | /* Out parameters */
|
|---|
| 956 |
|
|---|
| 957 | if (DEBUGLEVEL >= 10) {
|
|---|
| 958 | NDR_PRINT_IN_DEBUG(NetUserSetGroups, &r);
|
|---|
| 959 | }
|
|---|
| 960 |
|
|---|
| 961 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 962 | werr = NetUserSetGroups_l(ctx, &r);
|
|---|
| 963 | } else {
|
|---|
| 964 | werr = NetUserSetGroups_r(ctx, &r);
|
|---|
| 965 | }
|
|---|
| 966 |
|
|---|
| 967 | r.out.result = W_ERROR_V(werr);
|
|---|
| 968 |
|
|---|
| 969 | if (DEBUGLEVEL >= 10) {
|
|---|
| 970 | NDR_PRINT_OUT_DEBUG(NetUserSetGroups, &r);
|
|---|
| 971 | }
|
|---|
| 972 |
|
|---|
| 973 | TALLOC_FREE(frame);
|
|---|
| 974 | return (NET_API_STATUS)r.out.result;
|
|---|
| 975 | }
|
|---|
| 976 |
|
|---|
| 977 | /****************************************************************
|
|---|
| 978 | NetUserGetLocalGroups
|
|---|
| 979 | ****************************************************************/
|
|---|
| 980 |
|
|---|
| 981 | NET_API_STATUS NetUserGetLocalGroups(const char * server_name /* [in] */,
|
|---|
| 982 | const char * user_name /* [in] */,
|
|---|
| 983 | uint32_t level /* [in] */,
|
|---|
| 984 | uint32_t flags /* [in] */,
|
|---|
| 985 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 986 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 987 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 988 | uint32_t *total_entries /* [out] [ref] */)
|
|---|
| 989 | {
|
|---|
| 990 | struct NetUserGetLocalGroups r;
|
|---|
| 991 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 992 | NET_API_STATUS status;
|
|---|
| 993 | WERROR werr;
|
|---|
| 994 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 995 |
|
|---|
| 996 | status = libnetapi_getctx(&ctx);
|
|---|
| 997 | if (status != 0) {
|
|---|
| 998 | TALLOC_FREE(frame);
|
|---|
| 999 | return status;
|
|---|
| 1000 | }
|
|---|
| 1001 |
|
|---|
| 1002 | /* In parameters */
|
|---|
| 1003 | r.in.server_name = server_name;
|
|---|
| 1004 | r.in.user_name = user_name;
|
|---|
| 1005 | r.in.level = level;
|
|---|
| 1006 | r.in.flags = flags;
|
|---|
| 1007 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1008 |
|
|---|
| 1009 | /* Out parameters */
|
|---|
| 1010 | r.out.buffer = buffer;
|
|---|
| 1011 | r.out.entries_read = entries_read;
|
|---|
| 1012 | r.out.total_entries = total_entries;
|
|---|
| 1013 |
|
|---|
| 1014 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1015 | NDR_PRINT_IN_DEBUG(NetUserGetLocalGroups, &r);
|
|---|
| 1016 | }
|
|---|
| 1017 |
|
|---|
| 1018 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1019 | werr = NetUserGetLocalGroups_l(ctx, &r);
|
|---|
| 1020 | } else {
|
|---|
| 1021 | werr = NetUserGetLocalGroups_r(ctx, &r);
|
|---|
| 1022 | }
|
|---|
| 1023 |
|
|---|
| 1024 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1025 |
|
|---|
| 1026 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1027 | NDR_PRINT_OUT_DEBUG(NetUserGetLocalGroups, &r);
|
|---|
| 1028 | }
|
|---|
| 1029 |
|
|---|
| 1030 | TALLOC_FREE(frame);
|
|---|
| 1031 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1032 | }
|
|---|
| 1033 |
|
|---|
| 1034 | /****************************************************************
|
|---|
| 1035 | NetUserModalsGet
|
|---|
| 1036 | ****************************************************************/
|
|---|
| 1037 |
|
|---|
| 1038 | NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
|
|---|
| 1039 | uint32_t level /* [in] */,
|
|---|
| 1040 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 1041 | {
|
|---|
| 1042 | struct NetUserModalsGet r;
|
|---|
| 1043 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1044 | NET_API_STATUS status;
|
|---|
| 1045 | WERROR werr;
|
|---|
| 1046 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1047 |
|
|---|
| 1048 | status = libnetapi_getctx(&ctx);
|
|---|
| 1049 | if (status != 0) {
|
|---|
| 1050 | TALLOC_FREE(frame);
|
|---|
| 1051 | return status;
|
|---|
| 1052 | }
|
|---|
| 1053 |
|
|---|
| 1054 | /* In parameters */
|
|---|
| 1055 | r.in.server_name = server_name;
|
|---|
| 1056 | r.in.level = level;
|
|---|
| 1057 |
|
|---|
| 1058 | /* Out parameters */
|
|---|
| 1059 | r.out.buffer = buffer;
|
|---|
| 1060 |
|
|---|
| 1061 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1062 | NDR_PRINT_IN_DEBUG(NetUserModalsGet, &r);
|
|---|
| 1063 | }
|
|---|
| 1064 |
|
|---|
| 1065 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1066 | werr = NetUserModalsGet_l(ctx, &r);
|
|---|
| 1067 | } else {
|
|---|
| 1068 | werr = NetUserModalsGet_r(ctx, &r);
|
|---|
| 1069 | }
|
|---|
| 1070 |
|
|---|
| 1071 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1072 |
|
|---|
| 1073 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1074 | NDR_PRINT_OUT_DEBUG(NetUserModalsGet, &r);
|
|---|
| 1075 | }
|
|---|
| 1076 |
|
|---|
| 1077 | TALLOC_FREE(frame);
|
|---|
| 1078 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1079 | }
|
|---|
| 1080 |
|
|---|
| 1081 | /****************************************************************
|
|---|
| 1082 | NetUserModalsSet
|
|---|
| 1083 | ****************************************************************/
|
|---|
| 1084 |
|
|---|
| 1085 | NET_API_STATUS NetUserModalsSet(const char * server_name /* [in] */,
|
|---|
| 1086 | uint32_t level /* [in] */,
|
|---|
| 1087 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1088 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1089 | {
|
|---|
| 1090 | struct NetUserModalsSet r;
|
|---|
| 1091 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1092 | NET_API_STATUS status;
|
|---|
| 1093 | WERROR werr;
|
|---|
| 1094 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1095 |
|
|---|
| 1096 | status = libnetapi_getctx(&ctx);
|
|---|
| 1097 | if (status != 0) {
|
|---|
| 1098 | TALLOC_FREE(frame);
|
|---|
| 1099 | return status;
|
|---|
| 1100 | }
|
|---|
| 1101 |
|
|---|
| 1102 | /* In parameters */
|
|---|
| 1103 | r.in.server_name = server_name;
|
|---|
| 1104 | r.in.level = level;
|
|---|
| 1105 | r.in.buffer = buffer;
|
|---|
| 1106 |
|
|---|
| 1107 | /* Out parameters */
|
|---|
| 1108 | r.out.parm_err = parm_err;
|
|---|
| 1109 |
|
|---|
| 1110 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1111 | NDR_PRINT_IN_DEBUG(NetUserModalsSet, &r);
|
|---|
| 1112 | }
|
|---|
| 1113 |
|
|---|
| 1114 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1115 | werr = NetUserModalsSet_l(ctx, &r);
|
|---|
| 1116 | } else {
|
|---|
| 1117 | werr = NetUserModalsSet_r(ctx, &r);
|
|---|
| 1118 | }
|
|---|
| 1119 |
|
|---|
| 1120 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1121 |
|
|---|
| 1122 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1123 | NDR_PRINT_OUT_DEBUG(NetUserModalsSet, &r);
|
|---|
| 1124 | }
|
|---|
| 1125 |
|
|---|
| 1126 | TALLOC_FREE(frame);
|
|---|
| 1127 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1128 | }
|
|---|
| 1129 |
|
|---|
| 1130 | /****************************************************************
|
|---|
| 1131 | NetQueryDisplayInformation
|
|---|
| 1132 | ****************************************************************/
|
|---|
| 1133 |
|
|---|
| 1134 | NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
|
|---|
| 1135 | uint32_t level /* [in] */,
|
|---|
| 1136 | uint32_t idx /* [in] */,
|
|---|
| 1137 | uint32_t entries_requested /* [in] */,
|
|---|
| 1138 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1139 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1140 | void **buffer /* [out] [noprint,ref] */)
|
|---|
| 1141 | {
|
|---|
| 1142 | struct NetQueryDisplayInformation r;
|
|---|
| 1143 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1144 | NET_API_STATUS status;
|
|---|
| 1145 | WERROR werr;
|
|---|
| 1146 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1147 |
|
|---|
| 1148 | status = libnetapi_getctx(&ctx);
|
|---|
| 1149 | if (status != 0) {
|
|---|
| 1150 | TALLOC_FREE(frame);
|
|---|
| 1151 | return status;
|
|---|
| 1152 | }
|
|---|
| 1153 |
|
|---|
| 1154 | /* In parameters */
|
|---|
| 1155 | r.in.server_name = server_name;
|
|---|
| 1156 | r.in.level = level;
|
|---|
| 1157 | r.in.idx = idx;
|
|---|
| 1158 | r.in.entries_requested = entries_requested;
|
|---|
| 1159 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1160 |
|
|---|
| 1161 | /* Out parameters */
|
|---|
| 1162 | r.out.entries_read = entries_read;
|
|---|
| 1163 | r.out.buffer = buffer;
|
|---|
| 1164 |
|
|---|
| 1165 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1166 | NDR_PRINT_IN_DEBUG(NetQueryDisplayInformation, &r);
|
|---|
| 1167 | }
|
|---|
| 1168 |
|
|---|
| 1169 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1170 | werr = NetQueryDisplayInformation_l(ctx, &r);
|
|---|
| 1171 | } else {
|
|---|
| 1172 | werr = NetQueryDisplayInformation_r(ctx, &r);
|
|---|
| 1173 | }
|
|---|
| 1174 |
|
|---|
| 1175 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1176 |
|
|---|
| 1177 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1178 | NDR_PRINT_OUT_DEBUG(NetQueryDisplayInformation, &r);
|
|---|
| 1179 | }
|
|---|
| 1180 |
|
|---|
| 1181 | TALLOC_FREE(frame);
|
|---|
| 1182 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1183 | }
|
|---|
| 1184 |
|
|---|
| 1185 | /****************************************************************
|
|---|
| 1186 | NetGroupAdd
|
|---|
| 1187 | ****************************************************************/
|
|---|
| 1188 |
|
|---|
| 1189 | NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
|
|---|
| 1190 | uint32_t level /* [in] */,
|
|---|
| 1191 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1192 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1193 | {
|
|---|
| 1194 | struct NetGroupAdd 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.level = level;
|
|---|
| 1209 | r.in.buffer = buffer;
|
|---|
| 1210 |
|
|---|
| 1211 | /* Out parameters */
|
|---|
| 1212 | r.out.parm_err = parm_err;
|
|---|
| 1213 |
|
|---|
| 1214 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1215 | NDR_PRINT_IN_DEBUG(NetGroupAdd, &r);
|
|---|
| 1216 | }
|
|---|
| 1217 |
|
|---|
| 1218 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1219 | werr = NetGroupAdd_l(ctx, &r);
|
|---|
| 1220 | } else {
|
|---|
| 1221 | werr = NetGroupAdd_r(ctx, &r);
|
|---|
| 1222 | }
|
|---|
| 1223 |
|
|---|
| 1224 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1225 |
|
|---|
| 1226 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1227 | NDR_PRINT_OUT_DEBUG(NetGroupAdd, &r);
|
|---|
| 1228 | }
|
|---|
| 1229 |
|
|---|
| 1230 | TALLOC_FREE(frame);
|
|---|
| 1231 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1232 | }
|
|---|
| 1233 |
|
|---|
| 1234 | /****************************************************************
|
|---|
| 1235 | NetGroupDel
|
|---|
| 1236 | ****************************************************************/
|
|---|
| 1237 |
|
|---|
| 1238 | NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
|
|---|
| 1239 | const char * group_name /* [in] */)
|
|---|
| 1240 | {
|
|---|
| 1241 | struct NetGroupDel r;
|
|---|
| 1242 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1243 | NET_API_STATUS status;
|
|---|
| 1244 | WERROR werr;
|
|---|
| 1245 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1246 |
|
|---|
| 1247 | status = libnetapi_getctx(&ctx);
|
|---|
| 1248 | if (status != 0) {
|
|---|
| 1249 | TALLOC_FREE(frame);
|
|---|
| 1250 | return status;
|
|---|
| 1251 | }
|
|---|
| 1252 |
|
|---|
| 1253 | /* In parameters */
|
|---|
| 1254 | r.in.server_name = server_name;
|
|---|
| 1255 | r.in.group_name = group_name;
|
|---|
| 1256 |
|
|---|
| 1257 | /* Out parameters */
|
|---|
| 1258 |
|
|---|
| 1259 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1260 | NDR_PRINT_IN_DEBUG(NetGroupDel, &r);
|
|---|
| 1261 | }
|
|---|
| 1262 |
|
|---|
| 1263 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1264 | werr = NetGroupDel_l(ctx, &r);
|
|---|
| 1265 | } else {
|
|---|
| 1266 | werr = NetGroupDel_r(ctx, &r);
|
|---|
| 1267 | }
|
|---|
| 1268 |
|
|---|
| 1269 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1270 |
|
|---|
| 1271 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1272 | NDR_PRINT_OUT_DEBUG(NetGroupDel, &r);
|
|---|
| 1273 | }
|
|---|
| 1274 |
|
|---|
| 1275 | TALLOC_FREE(frame);
|
|---|
| 1276 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1277 | }
|
|---|
| 1278 |
|
|---|
| 1279 | /****************************************************************
|
|---|
| 1280 | NetGroupEnum
|
|---|
| 1281 | ****************************************************************/
|
|---|
| 1282 |
|
|---|
| 1283 | NET_API_STATUS NetGroupEnum(const char * server_name /* [in] */,
|
|---|
| 1284 | uint32_t level /* [in] */,
|
|---|
| 1285 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 1286 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1287 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1288 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 1289 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 1290 | {
|
|---|
| 1291 | struct NetGroupEnum r;
|
|---|
| 1292 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1293 | NET_API_STATUS status;
|
|---|
| 1294 | WERROR werr;
|
|---|
| 1295 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1296 |
|
|---|
| 1297 | status = libnetapi_getctx(&ctx);
|
|---|
| 1298 | if (status != 0) {
|
|---|
| 1299 | TALLOC_FREE(frame);
|
|---|
| 1300 | return status;
|
|---|
| 1301 | }
|
|---|
| 1302 |
|
|---|
| 1303 | /* In parameters */
|
|---|
| 1304 | r.in.server_name = server_name;
|
|---|
| 1305 | r.in.level = level;
|
|---|
| 1306 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1307 | r.in.resume_handle = resume_handle;
|
|---|
| 1308 |
|
|---|
| 1309 | /* Out parameters */
|
|---|
| 1310 | r.out.buffer = buffer;
|
|---|
| 1311 | r.out.entries_read = entries_read;
|
|---|
| 1312 | r.out.total_entries = total_entries;
|
|---|
| 1313 | r.out.resume_handle = resume_handle;
|
|---|
| 1314 |
|
|---|
| 1315 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1316 | NDR_PRINT_IN_DEBUG(NetGroupEnum, &r);
|
|---|
| 1317 | }
|
|---|
| 1318 |
|
|---|
| 1319 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1320 | werr = NetGroupEnum_l(ctx, &r);
|
|---|
| 1321 | } else {
|
|---|
| 1322 | werr = NetGroupEnum_r(ctx, &r);
|
|---|
| 1323 | }
|
|---|
| 1324 |
|
|---|
| 1325 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1326 |
|
|---|
| 1327 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1328 | NDR_PRINT_OUT_DEBUG(NetGroupEnum, &r);
|
|---|
| 1329 | }
|
|---|
| 1330 |
|
|---|
| 1331 | TALLOC_FREE(frame);
|
|---|
| 1332 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1333 | }
|
|---|
| 1334 |
|
|---|
| 1335 | /****************************************************************
|
|---|
| 1336 | NetGroupSetInfo
|
|---|
| 1337 | ****************************************************************/
|
|---|
| 1338 |
|
|---|
| 1339 | NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
|
|---|
| 1340 | const char * group_name /* [in] */,
|
|---|
| 1341 | uint32_t level /* [in] */,
|
|---|
| 1342 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1343 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1344 | {
|
|---|
| 1345 | struct NetGroupSetInfo r;
|
|---|
| 1346 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1347 | NET_API_STATUS status;
|
|---|
| 1348 | WERROR werr;
|
|---|
| 1349 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1350 |
|
|---|
| 1351 | status = libnetapi_getctx(&ctx);
|
|---|
| 1352 | if (status != 0) {
|
|---|
| 1353 | TALLOC_FREE(frame);
|
|---|
| 1354 | return status;
|
|---|
| 1355 | }
|
|---|
| 1356 |
|
|---|
| 1357 | /* In parameters */
|
|---|
| 1358 | r.in.server_name = server_name;
|
|---|
| 1359 | r.in.group_name = group_name;
|
|---|
| 1360 | r.in.level = level;
|
|---|
| 1361 | r.in.buffer = buffer;
|
|---|
| 1362 |
|
|---|
| 1363 | /* Out parameters */
|
|---|
| 1364 | r.out.parm_err = parm_err;
|
|---|
| 1365 |
|
|---|
| 1366 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1367 | NDR_PRINT_IN_DEBUG(NetGroupSetInfo, &r);
|
|---|
| 1368 | }
|
|---|
| 1369 |
|
|---|
| 1370 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1371 | werr = NetGroupSetInfo_l(ctx, &r);
|
|---|
| 1372 | } else {
|
|---|
| 1373 | werr = NetGroupSetInfo_r(ctx, &r);
|
|---|
| 1374 | }
|
|---|
| 1375 |
|
|---|
| 1376 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1377 |
|
|---|
| 1378 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1379 | NDR_PRINT_OUT_DEBUG(NetGroupSetInfo, &r);
|
|---|
| 1380 | }
|
|---|
| 1381 |
|
|---|
| 1382 | TALLOC_FREE(frame);
|
|---|
| 1383 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1384 | }
|
|---|
| 1385 |
|
|---|
| 1386 | /****************************************************************
|
|---|
| 1387 | NetGroupGetInfo
|
|---|
| 1388 | ****************************************************************/
|
|---|
| 1389 |
|
|---|
| 1390 | NET_API_STATUS NetGroupGetInfo(const char * server_name /* [in] */,
|
|---|
| 1391 | const char * group_name /* [in] */,
|
|---|
| 1392 | uint32_t level /* [in] */,
|
|---|
| 1393 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 1394 | {
|
|---|
| 1395 | struct NetGroupGetInfo r;
|
|---|
| 1396 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1397 | NET_API_STATUS status;
|
|---|
| 1398 | WERROR werr;
|
|---|
| 1399 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1400 |
|
|---|
| 1401 | status = libnetapi_getctx(&ctx);
|
|---|
| 1402 | if (status != 0) {
|
|---|
| 1403 | TALLOC_FREE(frame);
|
|---|
| 1404 | return status;
|
|---|
| 1405 | }
|
|---|
| 1406 |
|
|---|
| 1407 | /* In parameters */
|
|---|
| 1408 | r.in.server_name = server_name;
|
|---|
| 1409 | r.in.group_name = group_name;
|
|---|
| 1410 | r.in.level = level;
|
|---|
| 1411 |
|
|---|
| 1412 | /* Out parameters */
|
|---|
| 1413 | r.out.buffer = buffer;
|
|---|
| 1414 |
|
|---|
| 1415 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1416 | NDR_PRINT_IN_DEBUG(NetGroupGetInfo, &r);
|
|---|
| 1417 | }
|
|---|
| 1418 |
|
|---|
| 1419 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1420 | werr = NetGroupGetInfo_l(ctx, &r);
|
|---|
| 1421 | } else {
|
|---|
| 1422 | werr = NetGroupGetInfo_r(ctx, &r);
|
|---|
| 1423 | }
|
|---|
| 1424 |
|
|---|
| 1425 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1426 |
|
|---|
| 1427 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1428 | NDR_PRINT_OUT_DEBUG(NetGroupGetInfo, &r);
|
|---|
| 1429 | }
|
|---|
| 1430 |
|
|---|
| 1431 | TALLOC_FREE(frame);
|
|---|
| 1432 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1433 | }
|
|---|
| 1434 |
|
|---|
| 1435 | /****************************************************************
|
|---|
| 1436 | NetGroupAddUser
|
|---|
| 1437 | ****************************************************************/
|
|---|
| 1438 |
|
|---|
| 1439 | NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
|
|---|
| 1440 | const char * group_name /* [in] */,
|
|---|
| 1441 | const char * user_name /* [in] */)
|
|---|
| 1442 | {
|
|---|
| 1443 | struct NetGroupAddUser 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(NetGroupAddUser, &r);
|
|---|
| 1464 | }
|
|---|
| 1465 |
|
|---|
| 1466 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1467 | werr = NetGroupAddUser_l(ctx, &r);
|
|---|
| 1468 | } else {
|
|---|
| 1469 | werr = NetGroupAddUser_r(ctx, &r);
|
|---|
| 1470 | }
|
|---|
| 1471 |
|
|---|
| 1472 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1473 |
|
|---|
| 1474 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1475 | NDR_PRINT_OUT_DEBUG(NetGroupAddUser, &r);
|
|---|
| 1476 | }
|
|---|
| 1477 |
|
|---|
| 1478 | TALLOC_FREE(frame);
|
|---|
| 1479 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1480 | }
|
|---|
| 1481 |
|
|---|
| 1482 | /****************************************************************
|
|---|
| 1483 | NetGroupDelUser
|
|---|
| 1484 | ****************************************************************/
|
|---|
| 1485 |
|
|---|
| 1486 | NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
|
|---|
| 1487 | const char * group_name /* [in] */,
|
|---|
| 1488 | const char * user_name /* [in] */)
|
|---|
| 1489 | {
|
|---|
| 1490 | struct NetGroupDelUser r;
|
|---|
| 1491 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1492 | NET_API_STATUS status;
|
|---|
| 1493 | WERROR werr;
|
|---|
| 1494 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1495 |
|
|---|
| 1496 | status = libnetapi_getctx(&ctx);
|
|---|
| 1497 | if (status != 0) {
|
|---|
| 1498 | TALLOC_FREE(frame);
|
|---|
| 1499 | return status;
|
|---|
| 1500 | }
|
|---|
| 1501 |
|
|---|
| 1502 | /* In parameters */
|
|---|
| 1503 | r.in.server_name = server_name;
|
|---|
| 1504 | r.in.group_name = group_name;
|
|---|
| 1505 | r.in.user_name = user_name;
|
|---|
| 1506 |
|
|---|
| 1507 | /* Out parameters */
|
|---|
| 1508 |
|
|---|
| 1509 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1510 | NDR_PRINT_IN_DEBUG(NetGroupDelUser, &r);
|
|---|
| 1511 | }
|
|---|
| 1512 |
|
|---|
| 1513 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1514 | werr = NetGroupDelUser_l(ctx, &r);
|
|---|
| 1515 | } else {
|
|---|
| 1516 | werr = NetGroupDelUser_r(ctx, &r);
|
|---|
| 1517 | }
|
|---|
| 1518 |
|
|---|
| 1519 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1520 |
|
|---|
| 1521 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1522 | NDR_PRINT_OUT_DEBUG(NetGroupDelUser, &r);
|
|---|
| 1523 | }
|
|---|
| 1524 |
|
|---|
| 1525 | TALLOC_FREE(frame);
|
|---|
| 1526 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1527 | }
|
|---|
| 1528 |
|
|---|
| 1529 | /****************************************************************
|
|---|
| 1530 | NetGroupGetUsers
|
|---|
| 1531 | ****************************************************************/
|
|---|
| 1532 |
|
|---|
| 1533 | NET_API_STATUS NetGroupGetUsers(const char * server_name /* [in] */,
|
|---|
| 1534 | const char * group_name /* [in] */,
|
|---|
| 1535 | uint32_t level /* [in] */,
|
|---|
| 1536 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 1537 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1538 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1539 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 1540 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 1541 | {
|
|---|
| 1542 | struct NetGroupGetUsers r;
|
|---|
| 1543 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1544 | NET_API_STATUS status;
|
|---|
| 1545 | WERROR werr;
|
|---|
| 1546 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1547 |
|
|---|
| 1548 | status = libnetapi_getctx(&ctx);
|
|---|
| 1549 | if (status != 0) {
|
|---|
| 1550 | TALLOC_FREE(frame);
|
|---|
| 1551 | return status;
|
|---|
| 1552 | }
|
|---|
| 1553 |
|
|---|
| 1554 | /* In parameters */
|
|---|
| 1555 | r.in.server_name = server_name;
|
|---|
| 1556 | r.in.group_name = group_name;
|
|---|
| 1557 | r.in.level = level;
|
|---|
| 1558 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1559 | r.in.resume_handle = resume_handle;
|
|---|
| 1560 |
|
|---|
| 1561 | /* Out parameters */
|
|---|
| 1562 | r.out.buffer = buffer;
|
|---|
| 1563 | r.out.entries_read = entries_read;
|
|---|
| 1564 | r.out.total_entries = total_entries;
|
|---|
| 1565 | r.out.resume_handle = resume_handle;
|
|---|
| 1566 |
|
|---|
| 1567 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1568 | NDR_PRINT_IN_DEBUG(NetGroupGetUsers, &r);
|
|---|
| 1569 | }
|
|---|
| 1570 |
|
|---|
| 1571 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1572 | werr = NetGroupGetUsers_l(ctx, &r);
|
|---|
| 1573 | } else {
|
|---|
| 1574 | werr = NetGroupGetUsers_r(ctx, &r);
|
|---|
| 1575 | }
|
|---|
| 1576 |
|
|---|
| 1577 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1578 |
|
|---|
| 1579 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1580 | NDR_PRINT_OUT_DEBUG(NetGroupGetUsers, &r);
|
|---|
| 1581 | }
|
|---|
| 1582 |
|
|---|
| 1583 | TALLOC_FREE(frame);
|
|---|
| 1584 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1585 | }
|
|---|
| 1586 |
|
|---|
| 1587 | /****************************************************************
|
|---|
| 1588 | NetGroupSetUsers
|
|---|
| 1589 | ****************************************************************/
|
|---|
| 1590 |
|
|---|
| 1591 | NET_API_STATUS NetGroupSetUsers(const char * server_name /* [in] */,
|
|---|
| 1592 | const char * group_name /* [in] */,
|
|---|
| 1593 | uint32_t level /* [in] */,
|
|---|
| 1594 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1595 | uint32_t num_entries /* [in] */)
|
|---|
| 1596 | {
|
|---|
| 1597 | struct NetGroupSetUsers r;
|
|---|
| 1598 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1599 | NET_API_STATUS status;
|
|---|
| 1600 | WERROR werr;
|
|---|
| 1601 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1602 |
|
|---|
| 1603 | status = libnetapi_getctx(&ctx);
|
|---|
| 1604 | if (status != 0) {
|
|---|
| 1605 | TALLOC_FREE(frame);
|
|---|
| 1606 | return status;
|
|---|
| 1607 | }
|
|---|
| 1608 |
|
|---|
| 1609 | /* In parameters */
|
|---|
| 1610 | r.in.server_name = server_name;
|
|---|
| 1611 | r.in.group_name = group_name;
|
|---|
| 1612 | r.in.level = level;
|
|---|
| 1613 | r.in.buffer = buffer;
|
|---|
| 1614 | r.in.num_entries = num_entries;
|
|---|
| 1615 |
|
|---|
| 1616 | /* Out parameters */
|
|---|
| 1617 |
|
|---|
| 1618 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1619 | NDR_PRINT_IN_DEBUG(NetGroupSetUsers, &r);
|
|---|
| 1620 | }
|
|---|
| 1621 |
|
|---|
| 1622 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1623 | werr = NetGroupSetUsers_l(ctx, &r);
|
|---|
| 1624 | } else {
|
|---|
| 1625 | werr = NetGroupSetUsers_r(ctx, &r);
|
|---|
| 1626 | }
|
|---|
| 1627 |
|
|---|
| 1628 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1629 |
|
|---|
| 1630 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1631 | NDR_PRINT_OUT_DEBUG(NetGroupSetUsers, &r);
|
|---|
| 1632 | }
|
|---|
| 1633 |
|
|---|
| 1634 | TALLOC_FREE(frame);
|
|---|
| 1635 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1636 | }
|
|---|
| 1637 |
|
|---|
| 1638 | /****************************************************************
|
|---|
| 1639 | NetLocalGroupAdd
|
|---|
| 1640 | ****************************************************************/
|
|---|
| 1641 |
|
|---|
| 1642 | NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */,
|
|---|
| 1643 | uint32_t level /* [in] */,
|
|---|
| 1644 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1645 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1646 | {
|
|---|
| 1647 | struct NetLocalGroupAdd 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.level = level;
|
|---|
| 1662 | r.in.buffer = buffer;
|
|---|
| 1663 |
|
|---|
| 1664 | /* Out parameters */
|
|---|
| 1665 | r.out.parm_err = parm_err;
|
|---|
| 1666 |
|
|---|
| 1667 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1668 | NDR_PRINT_IN_DEBUG(NetLocalGroupAdd, &r);
|
|---|
| 1669 | }
|
|---|
| 1670 |
|
|---|
| 1671 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1672 | werr = NetLocalGroupAdd_l(ctx, &r);
|
|---|
| 1673 | } else {
|
|---|
| 1674 | werr = NetLocalGroupAdd_r(ctx, &r);
|
|---|
| 1675 | }
|
|---|
| 1676 |
|
|---|
| 1677 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1678 |
|
|---|
| 1679 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1680 | NDR_PRINT_OUT_DEBUG(NetLocalGroupAdd, &r);
|
|---|
| 1681 | }
|
|---|
| 1682 |
|
|---|
| 1683 | TALLOC_FREE(frame);
|
|---|
| 1684 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1685 | }
|
|---|
| 1686 |
|
|---|
| 1687 | /****************************************************************
|
|---|
| 1688 | NetLocalGroupDel
|
|---|
| 1689 | ****************************************************************/
|
|---|
| 1690 |
|
|---|
| 1691 | NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
|
|---|
| 1692 | const char * group_name /* [in] */)
|
|---|
| 1693 | {
|
|---|
| 1694 | struct NetLocalGroupDel 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 |
|
|---|
| 1710 | /* Out parameters */
|
|---|
| 1711 |
|
|---|
| 1712 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1713 | NDR_PRINT_IN_DEBUG(NetLocalGroupDel, &r);
|
|---|
| 1714 | }
|
|---|
| 1715 |
|
|---|
| 1716 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1717 | werr = NetLocalGroupDel_l(ctx, &r);
|
|---|
| 1718 | } else {
|
|---|
| 1719 | werr = NetLocalGroupDel_r(ctx, &r);
|
|---|
| 1720 | }
|
|---|
| 1721 |
|
|---|
| 1722 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1723 |
|
|---|
| 1724 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1725 | NDR_PRINT_OUT_DEBUG(NetLocalGroupDel, &r);
|
|---|
| 1726 | }
|
|---|
| 1727 |
|
|---|
| 1728 | TALLOC_FREE(frame);
|
|---|
| 1729 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1730 | }
|
|---|
| 1731 |
|
|---|
| 1732 | /****************************************************************
|
|---|
| 1733 | NetLocalGroupGetInfo
|
|---|
| 1734 | ****************************************************************/
|
|---|
| 1735 |
|
|---|
| 1736 | NET_API_STATUS NetLocalGroupGetInfo(const char * server_name /* [in] */,
|
|---|
| 1737 | const char * group_name /* [in] */,
|
|---|
| 1738 | uint32_t level /* [in] */,
|
|---|
| 1739 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 1740 | {
|
|---|
| 1741 | struct NetLocalGroupGetInfo r;
|
|---|
| 1742 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1743 | NET_API_STATUS status;
|
|---|
| 1744 | WERROR werr;
|
|---|
| 1745 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1746 |
|
|---|
| 1747 | status = libnetapi_getctx(&ctx);
|
|---|
| 1748 | if (status != 0) {
|
|---|
| 1749 | TALLOC_FREE(frame);
|
|---|
| 1750 | return status;
|
|---|
| 1751 | }
|
|---|
| 1752 |
|
|---|
| 1753 | /* In parameters */
|
|---|
| 1754 | r.in.server_name = server_name;
|
|---|
| 1755 | r.in.group_name = group_name;
|
|---|
| 1756 | r.in.level = level;
|
|---|
| 1757 |
|
|---|
| 1758 | /* Out parameters */
|
|---|
| 1759 | r.out.buffer = buffer;
|
|---|
| 1760 |
|
|---|
| 1761 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1762 | NDR_PRINT_IN_DEBUG(NetLocalGroupGetInfo, &r);
|
|---|
| 1763 | }
|
|---|
| 1764 |
|
|---|
| 1765 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1766 | werr = NetLocalGroupGetInfo_l(ctx, &r);
|
|---|
| 1767 | } else {
|
|---|
| 1768 | werr = NetLocalGroupGetInfo_r(ctx, &r);
|
|---|
| 1769 | }
|
|---|
| 1770 |
|
|---|
| 1771 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1772 |
|
|---|
| 1773 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1774 | NDR_PRINT_OUT_DEBUG(NetLocalGroupGetInfo, &r);
|
|---|
| 1775 | }
|
|---|
| 1776 |
|
|---|
| 1777 | TALLOC_FREE(frame);
|
|---|
| 1778 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1779 | }
|
|---|
| 1780 |
|
|---|
| 1781 | /****************************************************************
|
|---|
| 1782 | NetLocalGroupSetInfo
|
|---|
| 1783 | ****************************************************************/
|
|---|
| 1784 |
|
|---|
| 1785 | NET_API_STATUS NetLocalGroupSetInfo(const char * server_name /* [in] */,
|
|---|
| 1786 | const char * group_name /* [in] */,
|
|---|
| 1787 | uint32_t level /* [in] */,
|
|---|
| 1788 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1789 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 1790 | {
|
|---|
| 1791 | struct NetLocalGroupSetInfo r;
|
|---|
| 1792 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1793 | NET_API_STATUS status;
|
|---|
| 1794 | WERROR werr;
|
|---|
| 1795 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1796 |
|
|---|
| 1797 | status = libnetapi_getctx(&ctx);
|
|---|
| 1798 | if (status != 0) {
|
|---|
| 1799 | TALLOC_FREE(frame);
|
|---|
| 1800 | return status;
|
|---|
| 1801 | }
|
|---|
| 1802 |
|
|---|
| 1803 | /* In parameters */
|
|---|
| 1804 | r.in.server_name = server_name;
|
|---|
| 1805 | r.in.group_name = group_name;
|
|---|
| 1806 | r.in.level = level;
|
|---|
| 1807 | r.in.buffer = buffer;
|
|---|
| 1808 |
|
|---|
| 1809 | /* Out parameters */
|
|---|
| 1810 | r.out.parm_err = parm_err;
|
|---|
| 1811 |
|
|---|
| 1812 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1813 | NDR_PRINT_IN_DEBUG(NetLocalGroupSetInfo, &r);
|
|---|
| 1814 | }
|
|---|
| 1815 |
|
|---|
| 1816 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1817 | werr = NetLocalGroupSetInfo_l(ctx, &r);
|
|---|
| 1818 | } else {
|
|---|
| 1819 | werr = NetLocalGroupSetInfo_r(ctx, &r);
|
|---|
| 1820 | }
|
|---|
| 1821 |
|
|---|
| 1822 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1823 |
|
|---|
| 1824 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1825 | NDR_PRINT_OUT_DEBUG(NetLocalGroupSetInfo, &r);
|
|---|
| 1826 | }
|
|---|
| 1827 |
|
|---|
| 1828 | TALLOC_FREE(frame);
|
|---|
| 1829 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1830 | }
|
|---|
| 1831 |
|
|---|
| 1832 | /****************************************************************
|
|---|
| 1833 | NetLocalGroupEnum
|
|---|
| 1834 | ****************************************************************/
|
|---|
| 1835 |
|
|---|
| 1836 | NET_API_STATUS NetLocalGroupEnum(const char * server_name /* [in] */,
|
|---|
| 1837 | uint32_t level /* [in] */,
|
|---|
| 1838 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 1839 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1840 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 1841 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 1842 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 1843 | {
|
|---|
| 1844 | struct NetLocalGroupEnum r;
|
|---|
| 1845 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1846 | NET_API_STATUS status;
|
|---|
| 1847 | WERROR werr;
|
|---|
| 1848 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1849 |
|
|---|
| 1850 | status = libnetapi_getctx(&ctx);
|
|---|
| 1851 | if (status != 0) {
|
|---|
| 1852 | TALLOC_FREE(frame);
|
|---|
| 1853 | return status;
|
|---|
| 1854 | }
|
|---|
| 1855 |
|
|---|
| 1856 | /* In parameters */
|
|---|
| 1857 | r.in.server_name = server_name;
|
|---|
| 1858 | r.in.level = level;
|
|---|
| 1859 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 1860 | r.in.resume_handle = resume_handle;
|
|---|
| 1861 |
|
|---|
| 1862 | /* Out parameters */
|
|---|
| 1863 | r.out.buffer = buffer;
|
|---|
| 1864 | r.out.entries_read = entries_read;
|
|---|
| 1865 | r.out.total_entries = total_entries;
|
|---|
| 1866 | r.out.resume_handle = resume_handle;
|
|---|
| 1867 |
|
|---|
| 1868 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1869 | NDR_PRINT_IN_DEBUG(NetLocalGroupEnum, &r);
|
|---|
| 1870 | }
|
|---|
| 1871 |
|
|---|
| 1872 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1873 | werr = NetLocalGroupEnum_l(ctx, &r);
|
|---|
| 1874 | } else {
|
|---|
| 1875 | werr = NetLocalGroupEnum_r(ctx, &r);
|
|---|
| 1876 | }
|
|---|
| 1877 |
|
|---|
| 1878 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1879 |
|
|---|
| 1880 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1881 | NDR_PRINT_OUT_DEBUG(NetLocalGroupEnum, &r);
|
|---|
| 1882 | }
|
|---|
| 1883 |
|
|---|
| 1884 | TALLOC_FREE(frame);
|
|---|
| 1885 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1886 | }
|
|---|
| 1887 |
|
|---|
| 1888 | /****************************************************************
|
|---|
| 1889 | NetLocalGroupAddMembers
|
|---|
| 1890 | ****************************************************************/
|
|---|
| 1891 |
|
|---|
| 1892 | NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
|
|---|
| 1893 | const char * group_name /* [in] */,
|
|---|
| 1894 | uint32_t level /* [in] */,
|
|---|
| 1895 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1896 | uint32_t total_entries /* [in] */)
|
|---|
| 1897 | {
|
|---|
| 1898 | struct NetLocalGroupAddMembers r;
|
|---|
| 1899 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1900 | NET_API_STATUS status;
|
|---|
| 1901 | WERROR werr;
|
|---|
| 1902 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1903 |
|
|---|
| 1904 | status = libnetapi_getctx(&ctx);
|
|---|
| 1905 | if (status != 0) {
|
|---|
| 1906 | TALLOC_FREE(frame);
|
|---|
| 1907 | return status;
|
|---|
| 1908 | }
|
|---|
| 1909 |
|
|---|
| 1910 | /* In parameters */
|
|---|
| 1911 | r.in.server_name = server_name;
|
|---|
| 1912 | r.in.group_name = group_name;
|
|---|
| 1913 | r.in.level = level;
|
|---|
| 1914 | r.in.buffer = buffer;
|
|---|
| 1915 | r.in.total_entries = total_entries;
|
|---|
| 1916 |
|
|---|
| 1917 | /* Out parameters */
|
|---|
| 1918 |
|
|---|
| 1919 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1920 | NDR_PRINT_IN_DEBUG(NetLocalGroupAddMembers, &r);
|
|---|
| 1921 | }
|
|---|
| 1922 |
|
|---|
| 1923 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1924 | werr = NetLocalGroupAddMembers_l(ctx, &r);
|
|---|
| 1925 | } else {
|
|---|
| 1926 | werr = NetLocalGroupAddMembers_r(ctx, &r);
|
|---|
| 1927 | }
|
|---|
| 1928 |
|
|---|
| 1929 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1930 |
|
|---|
| 1931 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1932 | NDR_PRINT_OUT_DEBUG(NetLocalGroupAddMembers, &r);
|
|---|
| 1933 | }
|
|---|
| 1934 |
|
|---|
| 1935 | TALLOC_FREE(frame);
|
|---|
| 1936 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1937 | }
|
|---|
| 1938 |
|
|---|
| 1939 | /****************************************************************
|
|---|
| 1940 | NetLocalGroupDelMembers
|
|---|
| 1941 | ****************************************************************/
|
|---|
| 1942 |
|
|---|
| 1943 | NET_API_STATUS NetLocalGroupDelMembers(const char * server_name /* [in] */,
|
|---|
| 1944 | const char * group_name /* [in] */,
|
|---|
| 1945 | uint32_t level /* [in] */,
|
|---|
| 1946 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 1947 | uint32_t total_entries /* [in] */)
|
|---|
| 1948 | {
|
|---|
| 1949 | struct NetLocalGroupDelMembers r;
|
|---|
| 1950 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 1951 | NET_API_STATUS status;
|
|---|
| 1952 | WERROR werr;
|
|---|
| 1953 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 1954 |
|
|---|
| 1955 | status = libnetapi_getctx(&ctx);
|
|---|
| 1956 | if (status != 0) {
|
|---|
| 1957 | TALLOC_FREE(frame);
|
|---|
| 1958 | return status;
|
|---|
| 1959 | }
|
|---|
| 1960 |
|
|---|
| 1961 | /* In parameters */
|
|---|
| 1962 | r.in.server_name = server_name;
|
|---|
| 1963 | r.in.group_name = group_name;
|
|---|
| 1964 | r.in.level = level;
|
|---|
| 1965 | r.in.buffer = buffer;
|
|---|
| 1966 | r.in.total_entries = total_entries;
|
|---|
| 1967 |
|
|---|
| 1968 | /* Out parameters */
|
|---|
| 1969 |
|
|---|
| 1970 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1971 | NDR_PRINT_IN_DEBUG(NetLocalGroupDelMembers, &r);
|
|---|
| 1972 | }
|
|---|
| 1973 |
|
|---|
| 1974 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 1975 | werr = NetLocalGroupDelMembers_l(ctx, &r);
|
|---|
| 1976 | } else {
|
|---|
| 1977 | werr = NetLocalGroupDelMembers_r(ctx, &r);
|
|---|
| 1978 | }
|
|---|
| 1979 |
|
|---|
| 1980 | r.out.result = W_ERROR_V(werr);
|
|---|
| 1981 |
|
|---|
| 1982 | if (DEBUGLEVEL >= 10) {
|
|---|
| 1983 | NDR_PRINT_OUT_DEBUG(NetLocalGroupDelMembers, &r);
|
|---|
| 1984 | }
|
|---|
| 1985 |
|
|---|
| 1986 | TALLOC_FREE(frame);
|
|---|
| 1987 | return (NET_API_STATUS)r.out.result;
|
|---|
| 1988 | }
|
|---|
| 1989 |
|
|---|
| 1990 | /****************************************************************
|
|---|
| 1991 | NetLocalGroupGetMembers
|
|---|
| 1992 | ****************************************************************/
|
|---|
| 1993 |
|
|---|
| 1994 | NET_API_STATUS NetLocalGroupGetMembers(const char * server_name /* [in] */,
|
|---|
| 1995 | const char * local_group_name /* [in] */,
|
|---|
| 1996 | uint32_t level /* [in] */,
|
|---|
| 1997 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 1998 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 1999 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 2000 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 2001 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 2002 | {
|
|---|
| 2003 | struct NetLocalGroupGetMembers r;
|
|---|
| 2004 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2005 | NET_API_STATUS status;
|
|---|
| 2006 | WERROR werr;
|
|---|
| 2007 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2008 |
|
|---|
| 2009 | status = libnetapi_getctx(&ctx);
|
|---|
| 2010 | if (status != 0) {
|
|---|
| 2011 | TALLOC_FREE(frame);
|
|---|
| 2012 | return status;
|
|---|
| 2013 | }
|
|---|
| 2014 |
|
|---|
| 2015 | /* In parameters */
|
|---|
| 2016 | r.in.server_name = server_name;
|
|---|
| 2017 | r.in.local_group_name = local_group_name;
|
|---|
| 2018 | r.in.level = level;
|
|---|
| 2019 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 2020 | r.in.resume_handle = resume_handle;
|
|---|
| 2021 |
|
|---|
| 2022 | /* Out parameters */
|
|---|
| 2023 | r.out.buffer = buffer;
|
|---|
| 2024 | r.out.entries_read = entries_read;
|
|---|
| 2025 | r.out.total_entries = total_entries;
|
|---|
| 2026 | r.out.resume_handle = resume_handle;
|
|---|
| 2027 |
|
|---|
| 2028 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2029 | NDR_PRINT_IN_DEBUG(NetLocalGroupGetMembers, &r);
|
|---|
| 2030 | }
|
|---|
| 2031 |
|
|---|
| 2032 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2033 | werr = NetLocalGroupGetMembers_l(ctx, &r);
|
|---|
| 2034 | } else {
|
|---|
| 2035 | werr = NetLocalGroupGetMembers_r(ctx, &r);
|
|---|
| 2036 | }
|
|---|
| 2037 |
|
|---|
| 2038 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2039 |
|
|---|
| 2040 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2041 | NDR_PRINT_OUT_DEBUG(NetLocalGroupGetMembers, &r);
|
|---|
| 2042 | }
|
|---|
| 2043 |
|
|---|
| 2044 | TALLOC_FREE(frame);
|
|---|
| 2045 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2046 | }
|
|---|
| 2047 |
|
|---|
| 2048 | /****************************************************************
|
|---|
| 2049 | NetLocalGroupSetMembers
|
|---|
| 2050 | ****************************************************************/
|
|---|
| 2051 |
|
|---|
| 2052 | NET_API_STATUS NetLocalGroupSetMembers(const char * server_name /* [in] */,
|
|---|
| 2053 | const char * group_name /* [in] */,
|
|---|
| 2054 | uint32_t level /* [in] */,
|
|---|
| 2055 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 2056 | uint32_t total_entries /* [in] */)
|
|---|
| 2057 | {
|
|---|
| 2058 | struct NetLocalGroupSetMembers r;
|
|---|
| 2059 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2060 | NET_API_STATUS status;
|
|---|
| 2061 | WERROR werr;
|
|---|
| 2062 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2063 |
|
|---|
| 2064 | status = libnetapi_getctx(&ctx);
|
|---|
| 2065 | if (status != 0) {
|
|---|
| 2066 | TALLOC_FREE(frame);
|
|---|
| 2067 | return status;
|
|---|
| 2068 | }
|
|---|
| 2069 |
|
|---|
| 2070 | /* In parameters */
|
|---|
| 2071 | r.in.server_name = server_name;
|
|---|
| 2072 | r.in.group_name = group_name;
|
|---|
| 2073 | r.in.level = level;
|
|---|
| 2074 | r.in.buffer = buffer;
|
|---|
| 2075 | r.in.total_entries = total_entries;
|
|---|
| 2076 |
|
|---|
| 2077 | /* Out parameters */
|
|---|
| 2078 |
|
|---|
| 2079 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2080 | NDR_PRINT_IN_DEBUG(NetLocalGroupSetMembers, &r);
|
|---|
| 2081 | }
|
|---|
| 2082 |
|
|---|
| 2083 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2084 | werr = NetLocalGroupSetMembers_l(ctx, &r);
|
|---|
| 2085 | } else {
|
|---|
| 2086 | werr = NetLocalGroupSetMembers_r(ctx, &r);
|
|---|
| 2087 | }
|
|---|
| 2088 |
|
|---|
| 2089 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2090 |
|
|---|
| 2091 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2092 | NDR_PRINT_OUT_DEBUG(NetLocalGroupSetMembers, &r);
|
|---|
| 2093 | }
|
|---|
| 2094 |
|
|---|
| 2095 | TALLOC_FREE(frame);
|
|---|
| 2096 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2097 | }
|
|---|
| 2098 |
|
|---|
| 2099 | /****************************************************************
|
|---|
| 2100 | NetRemoteTOD
|
|---|
| 2101 | ****************************************************************/
|
|---|
| 2102 |
|
|---|
| 2103 | NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
|
|---|
| 2104 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2105 | {
|
|---|
| 2106 | struct NetRemoteTOD 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 |
|
|---|
| 2121 | /* Out parameters */
|
|---|
| 2122 | r.out.buffer = buffer;
|
|---|
| 2123 |
|
|---|
| 2124 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2125 | NDR_PRINT_IN_DEBUG(NetRemoteTOD, &r);
|
|---|
| 2126 | }
|
|---|
| 2127 |
|
|---|
| 2128 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2129 | werr = NetRemoteTOD_l(ctx, &r);
|
|---|
| 2130 | } else {
|
|---|
| 2131 | werr = NetRemoteTOD_r(ctx, &r);
|
|---|
| 2132 | }
|
|---|
| 2133 |
|
|---|
| 2134 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2135 |
|
|---|
| 2136 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2137 | NDR_PRINT_OUT_DEBUG(NetRemoteTOD, &r);
|
|---|
| 2138 | }
|
|---|
| 2139 |
|
|---|
| 2140 | TALLOC_FREE(frame);
|
|---|
| 2141 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2142 | }
|
|---|
| 2143 |
|
|---|
| 2144 | /****************************************************************
|
|---|
| 2145 | NetShareAdd
|
|---|
| 2146 | ****************************************************************/
|
|---|
| 2147 |
|
|---|
| 2148 | NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
|
|---|
| 2149 | uint32_t level /* [in] */,
|
|---|
| 2150 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 2151 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 2152 | {
|
|---|
| 2153 | struct NetShareAdd r;
|
|---|
| 2154 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2155 | NET_API_STATUS status;
|
|---|
| 2156 | WERROR werr;
|
|---|
| 2157 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2158 |
|
|---|
| 2159 | status = libnetapi_getctx(&ctx);
|
|---|
| 2160 | if (status != 0) {
|
|---|
| 2161 | TALLOC_FREE(frame);
|
|---|
| 2162 | return status;
|
|---|
| 2163 | }
|
|---|
| 2164 |
|
|---|
| 2165 | /* In parameters */
|
|---|
| 2166 | r.in.server_name = server_name;
|
|---|
| 2167 | r.in.level = level;
|
|---|
| 2168 | r.in.buffer = buffer;
|
|---|
| 2169 |
|
|---|
| 2170 | /* Out parameters */
|
|---|
| 2171 | r.out.parm_err = parm_err;
|
|---|
| 2172 |
|
|---|
| 2173 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2174 | NDR_PRINT_IN_DEBUG(NetShareAdd, &r);
|
|---|
| 2175 | }
|
|---|
| 2176 |
|
|---|
| 2177 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2178 | werr = NetShareAdd_l(ctx, &r);
|
|---|
| 2179 | } else {
|
|---|
| 2180 | werr = NetShareAdd_r(ctx, &r);
|
|---|
| 2181 | }
|
|---|
| 2182 |
|
|---|
| 2183 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2184 |
|
|---|
| 2185 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2186 | NDR_PRINT_OUT_DEBUG(NetShareAdd, &r);
|
|---|
| 2187 | }
|
|---|
| 2188 |
|
|---|
| 2189 | TALLOC_FREE(frame);
|
|---|
| 2190 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2191 | }
|
|---|
| 2192 |
|
|---|
| 2193 | /****************************************************************
|
|---|
| 2194 | NetShareDel
|
|---|
| 2195 | ****************************************************************/
|
|---|
| 2196 |
|
|---|
| 2197 | NET_API_STATUS NetShareDel(const char * server_name /* [in] */,
|
|---|
| 2198 | const char * net_name /* [in] */,
|
|---|
| 2199 | uint32_t reserved /* [in] */)
|
|---|
| 2200 | {
|
|---|
| 2201 | struct NetShareDel r;
|
|---|
| 2202 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2203 | NET_API_STATUS status;
|
|---|
| 2204 | WERROR werr;
|
|---|
| 2205 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2206 |
|
|---|
| 2207 | status = libnetapi_getctx(&ctx);
|
|---|
| 2208 | if (status != 0) {
|
|---|
| 2209 | TALLOC_FREE(frame);
|
|---|
| 2210 | return status;
|
|---|
| 2211 | }
|
|---|
| 2212 |
|
|---|
| 2213 | /* In parameters */
|
|---|
| 2214 | r.in.server_name = server_name;
|
|---|
| 2215 | r.in.net_name = net_name;
|
|---|
| 2216 | r.in.reserved = reserved;
|
|---|
| 2217 |
|
|---|
| 2218 | /* Out parameters */
|
|---|
| 2219 |
|
|---|
| 2220 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2221 | NDR_PRINT_IN_DEBUG(NetShareDel, &r);
|
|---|
| 2222 | }
|
|---|
| 2223 |
|
|---|
| 2224 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2225 | werr = NetShareDel_l(ctx, &r);
|
|---|
| 2226 | } else {
|
|---|
| 2227 | werr = NetShareDel_r(ctx, &r);
|
|---|
| 2228 | }
|
|---|
| 2229 |
|
|---|
| 2230 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2231 |
|
|---|
| 2232 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2233 | NDR_PRINT_OUT_DEBUG(NetShareDel, &r);
|
|---|
| 2234 | }
|
|---|
| 2235 |
|
|---|
| 2236 | TALLOC_FREE(frame);
|
|---|
| 2237 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2238 | }
|
|---|
| 2239 |
|
|---|
| 2240 | /****************************************************************
|
|---|
| 2241 | NetShareEnum
|
|---|
| 2242 | ****************************************************************/
|
|---|
| 2243 |
|
|---|
| 2244 | NET_API_STATUS NetShareEnum(const char * server_name /* [in] */,
|
|---|
| 2245 | uint32_t level /* [in] */,
|
|---|
| 2246 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 2247 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 2248 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 2249 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 2250 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 2251 | {
|
|---|
| 2252 | struct NetShareEnum r;
|
|---|
| 2253 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2254 | NET_API_STATUS status;
|
|---|
| 2255 | WERROR werr;
|
|---|
| 2256 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2257 |
|
|---|
| 2258 | status = libnetapi_getctx(&ctx);
|
|---|
| 2259 | if (status != 0) {
|
|---|
| 2260 | TALLOC_FREE(frame);
|
|---|
| 2261 | return status;
|
|---|
| 2262 | }
|
|---|
| 2263 |
|
|---|
| 2264 | /* In parameters */
|
|---|
| 2265 | r.in.server_name = server_name;
|
|---|
| 2266 | r.in.level = level;
|
|---|
| 2267 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 2268 | r.in.resume_handle = resume_handle;
|
|---|
| 2269 |
|
|---|
| 2270 | /* Out parameters */
|
|---|
| 2271 | r.out.buffer = buffer;
|
|---|
| 2272 | r.out.entries_read = entries_read;
|
|---|
| 2273 | r.out.total_entries = total_entries;
|
|---|
| 2274 | r.out.resume_handle = resume_handle;
|
|---|
| 2275 |
|
|---|
| 2276 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2277 | NDR_PRINT_IN_DEBUG(NetShareEnum, &r);
|
|---|
| 2278 | }
|
|---|
| 2279 |
|
|---|
| 2280 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2281 | werr = NetShareEnum_l(ctx, &r);
|
|---|
| 2282 | } else {
|
|---|
| 2283 | werr = NetShareEnum_r(ctx, &r);
|
|---|
| 2284 | }
|
|---|
| 2285 |
|
|---|
| 2286 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2287 |
|
|---|
| 2288 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2289 | NDR_PRINT_OUT_DEBUG(NetShareEnum, &r);
|
|---|
| 2290 | }
|
|---|
| 2291 |
|
|---|
| 2292 | TALLOC_FREE(frame);
|
|---|
| 2293 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2294 | }
|
|---|
| 2295 |
|
|---|
| 2296 | /****************************************************************
|
|---|
| 2297 | NetShareGetInfo
|
|---|
| 2298 | ****************************************************************/
|
|---|
| 2299 |
|
|---|
| 2300 | NET_API_STATUS NetShareGetInfo(const char * server_name /* [in] */,
|
|---|
| 2301 | const char * net_name /* [in] */,
|
|---|
| 2302 | uint32_t level /* [in] */,
|
|---|
| 2303 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2304 | {
|
|---|
| 2305 | struct NetShareGetInfo r;
|
|---|
| 2306 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2307 | NET_API_STATUS status;
|
|---|
| 2308 | WERROR werr;
|
|---|
| 2309 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2310 |
|
|---|
| 2311 | status = libnetapi_getctx(&ctx);
|
|---|
| 2312 | if (status != 0) {
|
|---|
| 2313 | TALLOC_FREE(frame);
|
|---|
| 2314 | return status;
|
|---|
| 2315 | }
|
|---|
| 2316 |
|
|---|
| 2317 | /* In parameters */
|
|---|
| 2318 | r.in.server_name = server_name;
|
|---|
| 2319 | r.in.net_name = net_name;
|
|---|
| 2320 | r.in.level = level;
|
|---|
| 2321 |
|
|---|
| 2322 | /* Out parameters */
|
|---|
| 2323 | r.out.buffer = buffer;
|
|---|
| 2324 |
|
|---|
| 2325 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2326 | NDR_PRINT_IN_DEBUG(NetShareGetInfo, &r);
|
|---|
| 2327 | }
|
|---|
| 2328 |
|
|---|
| 2329 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2330 | werr = NetShareGetInfo_l(ctx, &r);
|
|---|
| 2331 | } else {
|
|---|
| 2332 | werr = NetShareGetInfo_r(ctx, &r);
|
|---|
| 2333 | }
|
|---|
| 2334 |
|
|---|
| 2335 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2336 |
|
|---|
| 2337 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2338 | NDR_PRINT_OUT_DEBUG(NetShareGetInfo, &r);
|
|---|
| 2339 | }
|
|---|
| 2340 |
|
|---|
| 2341 | TALLOC_FREE(frame);
|
|---|
| 2342 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2343 | }
|
|---|
| 2344 |
|
|---|
| 2345 | /****************************************************************
|
|---|
| 2346 | NetShareSetInfo
|
|---|
| 2347 | ****************************************************************/
|
|---|
| 2348 |
|
|---|
| 2349 | NET_API_STATUS NetShareSetInfo(const char * server_name /* [in] */,
|
|---|
| 2350 | const char * net_name /* [in] */,
|
|---|
| 2351 | uint32_t level /* [in] */,
|
|---|
| 2352 | uint8_t *buffer /* [in] [ref] */,
|
|---|
| 2353 | uint32_t *parm_err /* [out] [ref] */)
|
|---|
| 2354 | {
|
|---|
| 2355 | struct NetShareSetInfo r;
|
|---|
| 2356 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2357 | NET_API_STATUS status;
|
|---|
| 2358 | WERROR werr;
|
|---|
| 2359 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2360 |
|
|---|
| 2361 | status = libnetapi_getctx(&ctx);
|
|---|
| 2362 | if (status != 0) {
|
|---|
| 2363 | TALLOC_FREE(frame);
|
|---|
| 2364 | return status;
|
|---|
| 2365 | }
|
|---|
| 2366 |
|
|---|
| 2367 | /* In parameters */
|
|---|
| 2368 | r.in.server_name = server_name;
|
|---|
| 2369 | r.in.net_name = net_name;
|
|---|
| 2370 | r.in.level = level;
|
|---|
| 2371 | r.in.buffer = buffer;
|
|---|
| 2372 |
|
|---|
| 2373 | /* Out parameters */
|
|---|
| 2374 | r.out.parm_err = parm_err;
|
|---|
| 2375 |
|
|---|
| 2376 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2377 | NDR_PRINT_IN_DEBUG(NetShareSetInfo, &r);
|
|---|
| 2378 | }
|
|---|
| 2379 |
|
|---|
| 2380 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2381 | werr = NetShareSetInfo_l(ctx, &r);
|
|---|
| 2382 | } else {
|
|---|
| 2383 | werr = NetShareSetInfo_r(ctx, &r);
|
|---|
| 2384 | }
|
|---|
| 2385 |
|
|---|
| 2386 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2387 |
|
|---|
| 2388 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2389 | NDR_PRINT_OUT_DEBUG(NetShareSetInfo, &r);
|
|---|
| 2390 | }
|
|---|
| 2391 |
|
|---|
| 2392 | TALLOC_FREE(frame);
|
|---|
| 2393 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2394 | }
|
|---|
| 2395 |
|
|---|
| 2396 | /****************************************************************
|
|---|
| 2397 | NetFileClose
|
|---|
| 2398 | ****************************************************************/
|
|---|
| 2399 |
|
|---|
| 2400 | NET_API_STATUS NetFileClose(const char * server_name /* [in] */,
|
|---|
| 2401 | uint32_t fileid /* [in] */)
|
|---|
| 2402 | {
|
|---|
| 2403 | struct NetFileClose 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 |
|
|---|
| 2419 | /* Out parameters */
|
|---|
| 2420 |
|
|---|
| 2421 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2422 | NDR_PRINT_IN_DEBUG(NetFileClose, &r);
|
|---|
| 2423 | }
|
|---|
| 2424 |
|
|---|
| 2425 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2426 | werr = NetFileClose_l(ctx, &r);
|
|---|
| 2427 | } else {
|
|---|
| 2428 | werr = NetFileClose_r(ctx, &r);
|
|---|
| 2429 | }
|
|---|
| 2430 |
|
|---|
| 2431 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2432 |
|
|---|
| 2433 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2434 | NDR_PRINT_OUT_DEBUG(NetFileClose, &r);
|
|---|
| 2435 | }
|
|---|
| 2436 |
|
|---|
| 2437 | TALLOC_FREE(frame);
|
|---|
| 2438 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2439 | }
|
|---|
| 2440 |
|
|---|
| 2441 | /****************************************************************
|
|---|
| 2442 | NetFileGetInfo
|
|---|
| 2443 | ****************************************************************/
|
|---|
| 2444 |
|
|---|
| 2445 | NET_API_STATUS NetFileGetInfo(const char * server_name /* [in] */,
|
|---|
| 2446 | uint32_t fileid /* [in] */,
|
|---|
| 2447 | uint32_t level /* [in] */,
|
|---|
| 2448 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2449 | {
|
|---|
| 2450 | struct NetFileGetInfo r;
|
|---|
| 2451 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2452 | NET_API_STATUS status;
|
|---|
| 2453 | WERROR werr;
|
|---|
| 2454 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2455 |
|
|---|
| 2456 | status = libnetapi_getctx(&ctx);
|
|---|
| 2457 | if (status != 0) {
|
|---|
| 2458 | TALLOC_FREE(frame);
|
|---|
| 2459 | return status;
|
|---|
| 2460 | }
|
|---|
| 2461 |
|
|---|
| 2462 | /* In parameters */
|
|---|
| 2463 | r.in.server_name = server_name;
|
|---|
| 2464 | r.in.fileid = fileid;
|
|---|
| 2465 | r.in.level = level;
|
|---|
| 2466 |
|
|---|
| 2467 | /* Out parameters */
|
|---|
| 2468 | r.out.buffer = buffer;
|
|---|
| 2469 |
|
|---|
| 2470 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2471 | NDR_PRINT_IN_DEBUG(NetFileGetInfo, &r);
|
|---|
| 2472 | }
|
|---|
| 2473 |
|
|---|
| 2474 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2475 | werr = NetFileGetInfo_l(ctx, &r);
|
|---|
| 2476 | } else {
|
|---|
| 2477 | werr = NetFileGetInfo_r(ctx, &r);
|
|---|
| 2478 | }
|
|---|
| 2479 |
|
|---|
| 2480 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2481 |
|
|---|
| 2482 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2483 | NDR_PRINT_OUT_DEBUG(NetFileGetInfo, &r);
|
|---|
| 2484 | }
|
|---|
| 2485 |
|
|---|
| 2486 | TALLOC_FREE(frame);
|
|---|
| 2487 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2488 | }
|
|---|
| 2489 |
|
|---|
| 2490 | /****************************************************************
|
|---|
| 2491 | NetFileEnum
|
|---|
| 2492 | ****************************************************************/
|
|---|
| 2493 |
|
|---|
| 2494 | NET_API_STATUS NetFileEnum(const char * server_name /* [in] */,
|
|---|
| 2495 | const char * base_path /* [in] */,
|
|---|
| 2496 | const char * user_name /* [in] */,
|
|---|
| 2497 | uint32_t level /* [in] */,
|
|---|
| 2498 | uint8_t **buffer /* [out] [ref] */,
|
|---|
| 2499 | uint32_t prefmaxlen /* [in] */,
|
|---|
| 2500 | uint32_t *entries_read /* [out] [ref] */,
|
|---|
| 2501 | uint32_t *total_entries /* [out] [ref] */,
|
|---|
| 2502 | uint32_t *resume_handle /* [in,out] [ref] */)
|
|---|
| 2503 | {
|
|---|
| 2504 | struct NetFileEnum r;
|
|---|
| 2505 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2506 | NET_API_STATUS status;
|
|---|
| 2507 | WERROR werr;
|
|---|
| 2508 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2509 |
|
|---|
| 2510 | status = libnetapi_getctx(&ctx);
|
|---|
| 2511 | if (status != 0) {
|
|---|
| 2512 | TALLOC_FREE(frame);
|
|---|
| 2513 | return status;
|
|---|
| 2514 | }
|
|---|
| 2515 |
|
|---|
| 2516 | /* In parameters */
|
|---|
| 2517 | r.in.server_name = server_name;
|
|---|
| 2518 | r.in.base_path = base_path;
|
|---|
| 2519 | r.in.user_name = user_name;
|
|---|
| 2520 | r.in.level = level;
|
|---|
| 2521 | r.in.prefmaxlen = prefmaxlen;
|
|---|
| 2522 | r.in.resume_handle = resume_handle;
|
|---|
| 2523 |
|
|---|
| 2524 | /* Out parameters */
|
|---|
| 2525 | r.out.buffer = buffer;
|
|---|
| 2526 | r.out.entries_read = entries_read;
|
|---|
| 2527 | r.out.total_entries = total_entries;
|
|---|
| 2528 | r.out.resume_handle = resume_handle;
|
|---|
| 2529 |
|
|---|
| 2530 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2531 | NDR_PRINT_IN_DEBUG(NetFileEnum, &r);
|
|---|
| 2532 | }
|
|---|
| 2533 |
|
|---|
| 2534 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2535 | werr = NetFileEnum_l(ctx, &r);
|
|---|
| 2536 | } else {
|
|---|
| 2537 | werr = NetFileEnum_r(ctx, &r);
|
|---|
| 2538 | }
|
|---|
| 2539 |
|
|---|
| 2540 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2541 |
|
|---|
| 2542 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2543 | NDR_PRINT_OUT_DEBUG(NetFileEnum, &r);
|
|---|
| 2544 | }
|
|---|
| 2545 |
|
|---|
| 2546 | TALLOC_FREE(frame);
|
|---|
| 2547 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2548 | }
|
|---|
| 2549 |
|
|---|
| 2550 | /****************************************************************
|
|---|
| 2551 | NetShutdownInit
|
|---|
| 2552 | ****************************************************************/
|
|---|
| 2553 |
|
|---|
| 2554 | NET_API_STATUS NetShutdownInit(const char * server_name /* [in] */,
|
|---|
| 2555 | const char * message /* [in] */,
|
|---|
| 2556 | uint32_t timeout /* [in] */,
|
|---|
| 2557 | uint8_t force_apps /* [in] */,
|
|---|
| 2558 | uint8_t do_reboot /* [in] */)
|
|---|
| 2559 | {
|
|---|
| 2560 | struct NetShutdownInit 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 | r.in.message = message;
|
|---|
| 2575 | r.in.timeout = timeout;
|
|---|
| 2576 | r.in.force_apps = force_apps;
|
|---|
| 2577 | r.in.do_reboot = do_reboot;
|
|---|
| 2578 |
|
|---|
| 2579 | /* Out parameters */
|
|---|
| 2580 |
|
|---|
| 2581 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2582 | NDR_PRINT_IN_DEBUG(NetShutdownInit, &r);
|
|---|
| 2583 | }
|
|---|
| 2584 |
|
|---|
| 2585 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2586 | werr = NetShutdownInit_l(ctx, &r);
|
|---|
| 2587 | } else {
|
|---|
| 2588 | werr = NetShutdownInit_r(ctx, &r);
|
|---|
| 2589 | }
|
|---|
| 2590 |
|
|---|
| 2591 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2592 |
|
|---|
| 2593 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2594 | NDR_PRINT_OUT_DEBUG(NetShutdownInit, &r);
|
|---|
| 2595 | }
|
|---|
| 2596 |
|
|---|
| 2597 | TALLOC_FREE(frame);
|
|---|
| 2598 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2599 | }
|
|---|
| 2600 |
|
|---|
| 2601 | /****************************************************************
|
|---|
| 2602 | NetShutdownAbort
|
|---|
| 2603 | ****************************************************************/
|
|---|
| 2604 |
|
|---|
| 2605 | NET_API_STATUS NetShutdownAbort(const char * server_name /* [in] */)
|
|---|
| 2606 | {
|
|---|
| 2607 | struct NetShutdownAbort r;
|
|---|
| 2608 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2609 | NET_API_STATUS status;
|
|---|
| 2610 | WERROR werr;
|
|---|
| 2611 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2612 |
|
|---|
| 2613 | status = libnetapi_getctx(&ctx);
|
|---|
| 2614 | if (status != 0) {
|
|---|
| 2615 | TALLOC_FREE(frame);
|
|---|
| 2616 | return status;
|
|---|
| 2617 | }
|
|---|
| 2618 |
|
|---|
| 2619 | /* In parameters */
|
|---|
| 2620 | r.in.server_name = server_name;
|
|---|
| 2621 |
|
|---|
| 2622 | /* Out parameters */
|
|---|
| 2623 |
|
|---|
| 2624 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2625 | NDR_PRINT_IN_DEBUG(NetShutdownAbort, &r);
|
|---|
| 2626 | }
|
|---|
| 2627 |
|
|---|
| 2628 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2629 | werr = NetShutdownAbort_l(ctx, &r);
|
|---|
| 2630 | } else {
|
|---|
| 2631 | werr = NetShutdownAbort_r(ctx, &r);
|
|---|
| 2632 | }
|
|---|
| 2633 |
|
|---|
| 2634 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2635 |
|
|---|
| 2636 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2637 | NDR_PRINT_OUT_DEBUG(NetShutdownAbort, &r);
|
|---|
| 2638 | }
|
|---|
| 2639 |
|
|---|
| 2640 | TALLOC_FREE(frame);
|
|---|
| 2641 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2642 | }
|
|---|
| 2643 |
|
|---|
| 2644 | /****************************************************************
|
|---|
| 2645 | I_NetLogonControl
|
|---|
| 2646 | ****************************************************************/
|
|---|
| 2647 |
|
|---|
| 2648 | NET_API_STATUS I_NetLogonControl(const char * server_name /* [in] */,
|
|---|
| 2649 | uint32_t function_code /* [in] */,
|
|---|
| 2650 | uint32_t query_level /* [in] */,
|
|---|
| 2651 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2652 | {
|
|---|
| 2653 | struct I_NetLogonControl r;
|
|---|
| 2654 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2655 | NET_API_STATUS status;
|
|---|
| 2656 | WERROR werr;
|
|---|
| 2657 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2658 |
|
|---|
| 2659 | status = libnetapi_getctx(&ctx);
|
|---|
| 2660 | if (status != 0) {
|
|---|
| 2661 | TALLOC_FREE(frame);
|
|---|
| 2662 | return status;
|
|---|
| 2663 | }
|
|---|
| 2664 |
|
|---|
| 2665 | /* In parameters */
|
|---|
| 2666 | r.in.server_name = server_name;
|
|---|
| 2667 | r.in.function_code = function_code;
|
|---|
| 2668 | r.in.query_level = query_level;
|
|---|
| 2669 |
|
|---|
| 2670 | /* Out parameters */
|
|---|
| 2671 | r.out.buffer = buffer;
|
|---|
| 2672 |
|
|---|
| 2673 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2674 | NDR_PRINT_IN_DEBUG(I_NetLogonControl, &r);
|
|---|
| 2675 | }
|
|---|
| 2676 |
|
|---|
| 2677 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2678 | werr = I_NetLogonControl_l(ctx, &r);
|
|---|
| 2679 | } else {
|
|---|
| 2680 | werr = I_NetLogonControl_r(ctx, &r);
|
|---|
| 2681 | }
|
|---|
| 2682 |
|
|---|
| 2683 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2684 |
|
|---|
| 2685 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2686 | NDR_PRINT_OUT_DEBUG(I_NetLogonControl, &r);
|
|---|
| 2687 | }
|
|---|
| 2688 |
|
|---|
| 2689 | TALLOC_FREE(frame);
|
|---|
| 2690 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2691 | }
|
|---|
| 2692 |
|
|---|
| 2693 | /****************************************************************
|
|---|
| 2694 | I_NetLogonControl2
|
|---|
| 2695 | ****************************************************************/
|
|---|
| 2696 |
|
|---|
| 2697 | NET_API_STATUS I_NetLogonControl2(const char * server_name /* [in] */,
|
|---|
| 2698 | uint32_t function_code /* [in] */,
|
|---|
| 2699 | uint32_t query_level /* [in] */,
|
|---|
| 2700 | uint8_t *data /* [in] [ref] */,
|
|---|
| 2701 | uint8_t **buffer /* [out] [ref] */)
|
|---|
| 2702 | {
|
|---|
| 2703 | struct I_NetLogonControl2 r;
|
|---|
| 2704 | struct libnetapi_ctx *ctx = NULL;
|
|---|
| 2705 | NET_API_STATUS status;
|
|---|
| 2706 | WERROR werr;
|
|---|
| 2707 | TALLOC_CTX *frame = talloc_stackframe();
|
|---|
| 2708 |
|
|---|
| 2709 | status = libnetapi_getctx(&ctx);
|
|---|
| 2710 | if (status != 0) {
|
|---|
| 2711 | TALLOC_FREE(frame);
|
|---|
| 2712 | return status;
|
|---|
| 2713 | }
|
|---|
| 2714 |
|
|---|
| 2715 | /* In parameters */
|
|---|
| 2716 | r.in.server_name = server_name;
|
|---|
| 2717 | r.in.function_code = function_code;
|
|---|
| 2718 | r.in.query_level = query_level;
|
|---|
| 2719 | r.in.data = data;
|
|---|
| 2720 |
|
|---|
| 2721 | /* Out parameters */
|
|---|
| 2722 | r.out.buffer = buffer;
|
|---|
| 2723 |
|
|---|
| 2724 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2725 | NDR_PRINT_IN_DEBUG(I_NetLogonControl2, &r);
|
|---|
| 2726 | }
|
|---|
| 2727 |
|
|---|
| 2728 | if (LIBNETAPI_LOCAL_SERVER(server_name)) {
|
|---|
| 2729 | werr = I_NetLogonControl2_l(ctx, &r);
|
|---|
| 2730 | } else {
|
|---|
| 2731 | werr = I_NetLogonControl2_r(ctx, &r);
|
|---|
| 2732 | }
|
|---|
| 2733 |
|
|---|
| 2734 | r.out.result = W_ERROR_V(werr);
|
|---|
| 2735 |
|
|---|
| 2736 | if (DEBUGLEVEL >= 10) {
|
|---|
| 2737 | NDR_PRINT_OUT_DEBUG(I_NetLogonControl2, &r);
|
|---|
| 2738 | }
|
|---|
| 2739 |
|
|---|
| 2740 | TALLOC_FREE(frame);
|
|---|
| 2741 | return (NET_API_STATUS)r.out.result;
|
|---|
| 2742 | }
|
|---|
| 2743 |
|
|---|