netapi: add NetUserGetLocalGroups skeleton.
authorGünther Deschner <gd@samba.org>
Tue, 9 Sep 2008 11:42:27 +0000 (13:42 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 11 Sep 2008 12:30:42 +0000 (14:30 +0200)
Guenther
(This used to be commit b31209e4495de31140c57338a891569b3436d91e)

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

index 4f3a5bdcb08a02f7246e2c61ef1ea1211311cdca..639cbf9e65a1b1a412a289175e037afd70db85d4 100644 (file)
@@ -873,6 +873,60 @@ NET_API_STATUS NetUserSetGroups(const char * server_name /* [in] */,
        return r.out.result;
 }
 
+/****************************************************************
+ NetUserGetLocalGroups
+****************************************************************/
+
+NET_API_STATUS NetUserGetLocalGroups(const char * server_name /* [in] */,
+                                    const char * user_name /* [in] */,
+                                    uint32_t level /* [in] */,
+                                    uint32_t flags /* [in] */,
+                                    uint8_t **buffer /* [out] [ref] */,
+                                    uint32_t prefmaxlen /* [in] */,
+                                    uint32_t *entries_read /* [out] [ref] */,
+                                    uint32_t *total_entries /* [out] [ref] */)
+{
+       struct NetUserGetLocalGroups 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.flags = flags;
+       r.in.prefmaxlen = prefmaxlen;
+
+       /* Out parameters */
+       r.out.buffer = buffer;
+       r.out.entries_read = entries_read;
+       r.out.total_entries = total_entries;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(NetUserGetLocalGroups, &r);
+       }
+
+       if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+               werr = NetUserGetLocalGroups_l(ctx, &r);
+       } else {
+               werr = NetUserGetLocalGroups_r(ctx, &r);
+       }
+
+       r.out.result = W_ERROR_V(werr);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(NetUserGetLocalGroups, &r);
+       }
+
+       return r.out.result;
+}
+
 /****************************************************************
  NetUserModalsGet
 ****************************************************************/
index c622116a93d49ad14c6ad242a35f1151a49ac6cb..766d6fb705b5222fa157c9a34ccbfae50bb0345c 100644 (file)
@@ -154,6 +154,18 @@ WERROR NetUserSetGroups_r(struct libnetapi_ctx *ctx,
                          struct NetUserSetGroups *r);
 WERROR NetUserSetGroups_l(struct libnetapi_ctx *ctx,
                          struct NetUserSetGroups *r);
+NET_API_STATUS NetUserGetLocalGroups(const char * server_name /* [in] */,
+                                    const char * user_name /* [in] */,
+                                    uint32_t level /* [in] */,
+                                    uint32_t flags /* [in] */,
+                                    uint8_t **buffer /* [out] [ref] */,
+                                    uint32_t prefmaxlen /* [in] */,
+                                    uint32_t *entries_read /* [out] [ref] */,
+                                    uint32_t *total_entries /* [out] [ref] */);
+WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx,
+                              struct NetUserGetLocalGroups *r);
+WERROR NetUserGetLocalGroups_l(struct libnetapi_ctx *ctx,
+                              struct NetUserGetLocalGroups *r);
 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
                                uint32_t level /* [in] */,
                                uint8_t **buffer /* [out] [ref] */);
index 4fbc27f364354a9dae16819bbe4120d643f5ba39..80c7c53b37fb2d3aa626208951d0a6c451453bb9 100644 (file)
@@ -3182,3 +3182,21 @@ WERROR NetUserSetGroups_l(struct libnetapi_ctx *ctx,
 {
        LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetUserSetGroups);
 }
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx,
+                              struct NetUserGetLocalGroups *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetUserGetLocalGroups_l(struct libnetapi_ctx *ctx,
+                              struct NetUserGetLocalGroups *r)
+{
+       LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetUserGetLocalGroups);
+}