netapi: add skeleton for NetUserSetGroups.
authorGünther Deschner <gd@samba.org>
Fri, 5 Sep 2008 14:51:55 +0000 (16:51 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 11 Sep 2008 12:28:46 +0000 (14:28 +0200)
Guenther
(This used to be commit 165be948fab1c64526421b44b08de700849bba25)

source3/lib/netapi/libnetapi.c
source3/lib/netapi/libnetapi.h
source3/lib/netapi/user.c

index 1f3f2d9bdbe031d4004b82b1caeda694d6d007d6..e8c69ae837f914343e11389677847fc3cb18da76 100644 (file)
@@ -825,6 +825,54 @@ NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
        return r.out.result;
 }
 
+/****************************************************************
+ NetUserSetGroups
+****************************************************************/
+
+NET_API_STATUS NetUserSetGroups(const char * server_name /* [in] */,
+                               const char * user_name /* [in] */,
+                               uint32_t level /* [in] */,
+                               uint8_t *buffer /* [in] [ref] */,
+                               uint32_t num_entries /* [in] */)
+{
+       struct NetUserSetGroups 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.user_name = user_name;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.num_entries = num_entries;
+
+       /* Out parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(NetUserSetGroups, &r);
+       }
+
+       if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+               werr = NetUserSetGroups_l(ctx, &r);
+       } else {
+               werr = NetUserSetGroups_r(ctx, &r);
+       }
+
+       r.out.result = W_ERROR_V(werr);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(NetUserSetGroups, &r);
+       }
+
+       return r.out.result;
+}
+
 /****************************************************************
  NetUserModalsGet
 ****************************************************************/
index 00ad4de47986e5a08b68e5ce1357b336a63c7a58..eecbf8e4d5d6d19d02fe2df35fb802c69c3401d2 100644 (file)
@@ -145,6 +145,15 @@ WERROR NetUserGetGroups_r(struct libnetapi_ctx *ctx,
                          struct NetUserGetGroups *r);
 WERROR NetUserGetGroups_l(struct libnetapi_ctx *ctx,
                          struct NetUserGetGroups *r);
+NET_API_STATUS NetUserSetGroups(const char * server_name /* [in] */,
+                               const char * user_name /* [in] */,
+                               uint32_t level /* [in] */,
+                               uint8_t *buffer /* [in] [ref] */,
+                               uint32_t num_entries /* [in] */);
+WERROR NetUserSetGroups_r(struct libnetapi_ctx *ctx,
+                         struct NetUserSetGroups *r);
+WERROR NetUserSetGroups_l(struct libnetapi_ctx *ctx,
+                         struct NetUserSetGroups *r);
 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
                                uint32_t level /* [in] */,
                                uint8_t **buffer /* [out] [ref] */);
index 4fe0aa04ab19cdf1be11c865a6cee3c8ca8f03b0..bf3397b4eb2b8723522a08f83a9625a7ac258d23 100644 (file)
@@ -2923,3 +2923,22 @@ WERROR NetUserGetGroups_l(struct libnetapi_ctx *ctx,
 {
        LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetUserGetGroups);
 }
+
+/****************************************************************
+****************************************************************/
+
+
+WERROR NetUserSetGroups_r(struct libnetapi_ctx *ctx,
+                         struct NetUserSetGroups *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetUserSetGroups_l(struct libnetapi_ctx *ctx,
+                         struct NetUserSetGroups *r)
+{
+       LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetUserSetGroups);
+}