diff options
author | Günther Deschner <gd@samba.org> | 2008-09-09 13:42:27 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-09-15 13:00:36 +0200 |
commit | 2feaf2bcc2059824d8fbf8cdd51fe5c4e7170df5 (patch) | |
tree | 9f6efaebf43065b75c84cbd05591a9f3ae710c7f /source | |
parent | ef1311d19402f611c9bded937f4b9f83562d4b3a (diff) | |
download | samba-2feaf2bcc2059824d8fbf8cdd51fe5c4e7170df5.tar.gz samba-2feaf2bcc2059824d8fbf8cdd51fe5c4e7170df5.tar.xz samba-2feaf2bcc2059824d8fbf8cdd51fe5c4e7170df5.zip |
netapi: add NetUserGetLocalGroups skeleton.
Guenther
(cherry picked from commit b31209e4495de31140c57338a891569b3436d91e)
(cherry picked from commit df24fef7e919fb44ed01bf2a48b413a0e4b880ca)
Diffstat (limited to 'source')
-rw-r--r-- | source/lib/netapi/libnetapi.c | 54 | ||||
-rw-r--r-- | source/lib/netapi/libnetapi.h | 12 | ||||
-rw-r--r-- | source/lib/netapi/user.c | 18 |
3 files changed, 84 insertions, 0 deletions
diff --git a/source/lib/netapi/libnetapi.c b/source/lib/netapi/libnetapi.c index 4f3a5bdcb08..639cbf9e65a 100644 --- a/source/lib/netapi/libnetapi.c +++ b/source/lib/netapi/libnetapi.c @@ -874,6 +874,60 @@ NET_API_STATUS NetUserSetGroups(const char * server_name /* [in] */, } /**************************************************************** + 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 ****************************************************************/ diff --git a/source/lib/netapi/libnetapi.h b/source/lib/netapi/libnetapi.h index c622116a93d..766d6fb705b 100644 --- a/source/lib/netapi/libnetapi.h +++ b/source/lib/netapi/libnetapi.h @@ -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] */); diff --git a/source/lib/netapi/user.c b/source/lib/netapi/user.c index 4fbc27f3643..80c7c53b37f 100644 --- a/source/lib/netapi/user.c +++ b/source/lib/netapi/user.c @@ -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); +} |