mirror of
https://github.com/samba-team/samba.git
synced 2025-07-30 19:42:05 +03:00
libnetapi: add dummy implementation for NetGroupAdd() and NetGroupDel().
Guenther
(This used to be commit d690f9e9f8
)
This commit is contained in:
@ -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) \
|
||||
|
54
source3/lib/netapi/group.c
Normal file
54
source3/lib/netapi/group.c
Normal file
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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__ */
|
||||
|
Reference in New Issue
Block a user