From 528544d4ce8fa27940a2f5e3c989cf37ef888f94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Mon, 2 Jun 2008 17:34:53 +0200 Subject: [PATCH] netapi: add NetLocalGroupAdd() skeleton. Guenther --- source/Makefile.in | 1 + source/lib/netapi/libnetapi.c | 46 ++++++++++++++++++++++++++++++++++ source/lib/netapi/libnetapi.h | 8 ++++++ source/lib/netapi/localgroup.c | 43 +++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 source/lib/netapi/localgroup.c diff --git a/source/Makefile.in b/source/Makefile.in index c289b01467..9f05165dfa 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -866,6 +866,7 @@ LIBNETAPI_OBJ1 = lib/netapi/netapi.o \ lib/netapi/getdc.o \ lib/netapi/user.o \ lib/netapi/group.o \ + lib/netapi/localgroup.o \ lib/netapi/samr.o LIBNETAPI_OBJ = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \ diff --git a/source/lib/netapi/libnetapi.c b/source/lib/netapi/libnetapi.c index 3bbb1686ab..6537329fe0 100644 --- a/source/lib/netapi/libnetapi.c +++ b/source/lib/netapi/libnetapi.c @@ -907,3 +907,49 @@ NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */, return r.out.result; } +/**************************************************************** + NetLocalGroupAdd +****************************************************************/ + +NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */, + uint32_t level /* [in] */, + uint8_t *buf /* [in] [ref] */, + uint32_t *parm_err /* [out] [ref] */) +{ + struct NetLocalGroupAdd r; + struct libnetapi_ctx *ctx = NULL; + NET_API_STATUS status; + WERROR werr; + + status = libnetapi_getctx(&ctx); + if (status != 0) { + return status; + } + + /* In parameters */ + r.in.server_name = server_name; + r.in.level = level; + r.in.buf = buf; + + /* Out parameters */ + r.out.parm_err = parm_err; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(NetLocalGroupAdd, &r); + } + + if (LIBNETAPI_LOCAL_SERVER(server_name)) { + werr = NetLocalGroupAdd_l(ctx, &r); + } else { + werr = NetLocalGroupAdd_r(ctx, &r); + } + + r.out.result = W_ERROR_V(werr); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(NetLocalGroupAdd, &r); + } + + return r.out.result; +} + diff --git a/source/lib/netapi/libnetapi.h b/source/lib/netapi/libnetapi.h index 4faca46b22..38826996fa 100644 --- a/source/lib/netapi/libnetapi.h +++ b/source/lib/netapi/libnetapi.h @@ -156,4 +156,12 @@ WERROR NetGroupDelUser_r(struct libnetapi_ctx *ctx, struct NetGroupDelUser *r); WERROR NetGroupDelUser_l(struct libnetapi_ctx *ctx, struct NetGroupDelUser *r); +NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */, + uint32_t level /* [in] */, + uint8_t *buf /* [in] [ref] */, + uint32_t *parm_err /* [out] [ref] */); +WERROR NetLocalGroupAdd_r(struct libnetapi_ctx *ctx, + struct NetLocalGroupAdd *r); +WERROR NetLocalGroupAdd_l(struct libnetapi_ctx *ctx, + struct NetLocalGroupAdd *r); #endif /* __LIBNETAPI_LIBNETAPI__ */ diff --git a/source/lib/netapi/localgroup.c b/source/lib/netapi/localgroup.c new file mode 100644 index 0000000000..4a1b76003c --- /dev/null +++ b/source/lib/netapi/localgroup.c @@ -0,0 +1,43 @@ +/* + * Unix SMB/CIFS implementation. + * NetApi LocalGroup Support + * Copyright (C) Guenther Deschner 2008 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include "includes.h" + +#include "librpc/gen_ndr/libnetapi.h" +#include "lib/netapi/netapi.h" +#include "lib/netapi/netapi_private.h" +#include "lib/netapi/libnetapi.h" + +/**************************************************************** +****************************************************************/ + +WERROR NetLocalGroupAdd_r(struct libnetapi_ctx *ctx, + struct NetLocalGroupAdd *r) +{ + return WERR_NOT_SUPPORTED; +} + +/**************************************************************** +****************************************************************/ + +WERROR NetLocalGroupAdd_l(struct libnetapi_ctx *ctx, + struct NetLocalGroupAdd *r) +{ + return WERR_NOT_SUPPORTED; +} -- 2.34.1