]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netapi: add skeleton for NetUserGetGroups.
authorGünther Deschner <gd@samba.org>
Wed, 27 Aug 2008 09:49:55 +0000 (11:49 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 11:57:58 +0000 (13:57 +0200)
Guenther

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

index 5fe48077a89d26a8c9061507b9911c99f6f88b9e..4b87bbcdf484ef47d28bb1f2a9270d2519449709 100644 (file)
@@ -725,6 +725,58 @@ NET_API_STATUS NetUserSetInfo(const char * server_name /* [in] */,
        return r.out.result;
 }
 
+/****************************************************************
+ NetUserGetGroups
+****************************************************************/
+
+NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
+                               const char * user_name /* [in] */,
+                               uint32_t level /* [in] */,
+                               uint8_t **buffer /* [out] [ref] */,
+                               uint32_t prefmaxlen /* [in] */,
+                               uint32_t *entries_read /* [out] [ref] */,
+                               uint32_t *total_entries /* [out] [ref] */)
+{
+       struct NetUserGetGroups 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.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(NetUserGetGroups, &r);
+       }
+
+       if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+               werr = NetUserGetGroups_l(ctx, &r);
+       } else {
+               werr = NetUserGetGroups_r(ctx, &r);
+       }
+
+       r.out.result = W_ERROR_V(werr);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(NetUserGetGroups, &r);
+       }
+
+       return r.out.result;
+}
+
 /****************************************************************
  NetUserModalsGet
 ****************************************************************/
index b0ff8e5baff20e180716b1a78950c129dbb77b00..189083cc1fb6820a5bd66456546478e88e56d9b2 100644 (file)
@@ -125,6 +125,17 @@ WERROR NetUserSetInfo_r(struct libnetapi_ctx *ctx,
                        struct NetUserSetInfo *r);
 WERROR NetUserSetInfo_l(struct libnetapi_ctx *ctx,
                        struct NetUserSetInfo *r);
+NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
+                               const char * user_name /* [in] */,
+                               uint32_t level /* [in] */,
+                               uint8_t **buffer /* [out] [ref] */,
+                               uint32_t prefmaxlen /* [in] */,
+                               uint32_t *entries_read /* [out] [ref] */,
+                               uint32_t *total_entries /* [out] [ref] */);
+WERROR NetUserGetGroups_r(struct libnetapi_ctx *ctx,
+                         struct NetUserGetGroups *r);
+WERROR NetUserGetGroups_l(struct libnetapi_ctx *ctx,
+                         struct NetUserGetGroups *r);
 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
                                uint32_t level /* [in] */,
                                uint8_t **buffer /* [out] [ref] */);
index dba7542235e6dd7881e616351f8d32740711fb15..78a95fd10bf37b37178138721432670f3a728f9b 100644 (file)
@@ -2354,3 +2354,21 @@ WERROR NetUserModalsSet_l(struct libnetapi_ctx *ctx,
 {
        LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetUserModalsSet);
 }
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetUserGetGroups_r(struct libnetapi_ctx *ctx,
+                         struct NetUserGetGroups *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetUserGetGroups_l(struct libnetapi_ctx *ctx,
+                         struct NetUserGetGroups *r)
+{
+       LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetUserGetGroups);
+}