1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

netapi: add NetShareAdd skeleton.

Guenther
(This used to be commit 6e22bcc1f5cba9bc37ecf193bbc7e031b69134f5)
This commit is contained in:
Günther Deschner 2008-08-28 01:01:11 +02:00
parent 0f1025a1bc
commit 0b484e684a
4 changed files with 99 additions and 1 deletions

View File

@ -1835,7 +1835,8 @@ LIBNETAPI_OBJ0 = lib/netapi/netapi.o \
lib/netapi/group.o \
lib/netapi/localgroup.o \
lib/netapi/samr.o \
lib/netapi/sid.o
lib/netapi/sid.o \
lib/netapi/share.o
LIBNETAPI_OBJ = $(LIBNETAPI_OBJ0) $(LIBNET_OBJ) \
$(LIBSMBCONF_OBJ) \

View File

@ -1773,3 +1773,49 @@ NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
return r.out.result;
}
/****************************************************************
NetShareAdd
****************************************************************/
NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
uint32_t level /* [in] */,
uint8_t *buffer /* [in] [ref] */,
uint32_t *parm_err /* [out] [ref] */)
{
struct NetShareAdd 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.buffer = buffer;
/* Out parameters */
r.out.parm_err = parm_err;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(NetShareAdd, &r);
}
if (LIBNETAPI_LOCAL_SERVER(server_name)) {
werr = NetShareAdd_l(ctx, &r);
} else {
werr = NetShareAdd_r(ctx, &r);
}
r.out.result = W_ERROR_V(werr);
if (DEBUGLEVEL >= 10) {
NDR_PRINT_OUT_DEBUG(NetShareAdd, &r);
}
return r.out.result;
}

View File

@ -317,4 +317,12 @@ WERROR NetRemoteTOD_r(struct libnetapi_ctx *ctx,
struct NetRemoteTOD *r);
WERROR NetRemoteTOD_l(struct libnetapi_ctx *ctx,
struct NetRemoteTOD *r);
NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
uint32_t level /* [in] */,
uint8_t *buffer /* [in] [ref] */,
uint32_t *parm_err /* [out] [ref] */);
WERROR NetShareAdd_r(struct libnetapi_ctx *ctx,
struct NetShareAdd *r);
WERROR NetShareAdd_l(struct libnetapi_ctx *ctx,
struct NetShareAdd *r);
#endif /* __LIBNETAPI_LIBNETAPI__ */

View File

@ -0,0 +1,43 @@
/*
* Unix SMB/CIFS implementation.
* NetApi Share 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 NetShareAdd_r(struct libnetapi_ctx *ctx,
struct NetShareAdd *r)
{
return WERR_NOT_SUPPORTED;
}
/****************************************************************
****************************************************************/
WERROR NetShareAdd_l(struct libnetapi_ctx *ctx,
struct NetShareAdd *r)
{
LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetShareAdd);
}