libnetapi: add dummy implementation for NetGroupAdd() and NetGroupDel().
authorGünther Deschner <gd@samba.org>
Tue, 27 May 2008 10:11:28 +0000 (12:11 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 2 Jun 2008 23:27:40 +0000 (01:27 +0200)
Guenther

source/Makefile.in
source/lib/netapi/group.c [new file with mode: 0644]
source/lib/netapi/libnetapi.c
source/lib/netapi/libnetapi.h

index 91710dab6c2b3748b5307f25b31915a8b077bbfd..435d9900b4b456bf9b25192ae6536a4bbfd27976 100644 (file)
@@ -864,7 +864,8 @@ LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
                 lib/netapi/joindomain.o \
                 lib/netapi/serverinfo.o \
                 lib/netapi/getdc.o \
-                lib/netapi/user.o
+                lib/netapi/user.o \
+                lib/netapi/group.o
 
 LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
                 $(LIBSMBCONF_OBJ) \
diff --git a/source/lib/netapi/group.c b/source/lib/netapi/group.c
new file mode 100644 (file)
index 0000000..3515d28
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  NetApi Group 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 <http://www.gnu.org/licenses/>.
+ */
+
+#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 NetGroupAdd_r(struct libnetapi_ctx *ctx,
+                    struct NetGroupAdd *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+WERROR NetGroupAdd_l(struct libnetapi_ctx *ctx,
+                    struct NetGroupAdd *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+WERROR NetGroupDel_r(struct libnetapi_ctx *ctx,
+                    struct NetGroupDel *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+WERROR NetGroupDel_l(struct libnetapi_ctx *ctx,
+                    struct NetGroupDel *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
index e71adc6893bca89afed99d02e1c9091b47be9de2..75087e8b294974224e24d7608e291ad82c4583ff 100644 (file)
@@ -21,7 +21,7 @@
 #include "librpc/gen_ndr/libnetapi.h"
 #include "lib/netapi/netapi.h"
 #include "lib/netapi/netapi_private.h"
-#include "libnetapi.h"
+#include "lib/netapi/libnetapi.h"
 #include "librpc/gen_ndr/ndr_libnetapi.h"
 
 /****************************************************************
@@ -637,3 +637,91 @@ NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [uniq
        return r.out.result;
 }
 
+/****************************************************************
+ NetGroupAdd
+****************************************************************/
+
+NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
+                          uint32_t level /* [in] */,
+                          uint8_t *buf /* [in] [ref] */,
+                          uint32_t *parm_err /* [out] [ref] */)
+{
+       struct NetGroupAdd 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(NetGroupAdd, &r);
+       }
+
+       if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+               werr = NetGroupAdd_l(ctx, &r);
+       } else {
+               werr = NetGroupAdd_r(ctx, &r);
+       }
+
+       r.out.result = W_ERROR_V(werr);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(NetGroupAdd, &r);
+       }
+
+       return r.out.result;
+}
+
+/****************************************************************
+ NetGroupDel
+****************************************************************/
+
+NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
+                          const char * group_name /* [in] */)
+{
+       struct NetGroupDel 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.group_name = group_name;
+
+       /* Out parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(NetGroupDel, &r);
+       }
+
+       if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+               werr = NetGroupDel_l(ctx, &r);
+       } else {
+               werr = NetGroupDel_r(ctx, &r);
+       }
+
+       r.out.result = W_ERROR_V(werr);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(NetGroupDel, &r);
+       }
+
+       return r.out.result;
+}
+
index 7aff3556529872e2d0a5c992cf6a48f3df806cf4..93029ab4f32f6d8c8d0316b8db87df49049460ae 100644 (file)
@@ -111,4 +111,18 @@ WERROR NetQueryDisplayInformation_r(struct libnetapi_ctx *ctx,
                                    struct NetQueryDisplayInformation *r);
 WERROR NetQueryDisplayInformation_l(struct libnetapi_ctx *ctx,
                                    struct NetQueryDisplayInformation *r);
+NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
+                          uint32_t level /* [in] */,
+                          uint8_t *buf /* [in] [ref] */,
+                          uint32_t *parm_err /* [out] [ref] */);
+WERROR NetGroupAdd_r(struct libnetapi_ctx *ctx,
+                    struct NetGroupAdd *r);
+WERROR NetGroupAdd_l(struct libnetapi_ctx *ctx,
+                    struct NetGroupAdd *r);
+NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
+                          const char * group_name /* [in] */);
+WERROR NetGroupDel_r(struct libnetapi_ctx *ctx,
+                    struct NetGroupDel *r);
+WERROR NetGroupDel_l(struct libnetapi_ctx *ctx,
+                    struct NetGroupDel *r);
 #endif /* __LIBNETAPI_LIBNETAPI__ */