summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-10-13 15:47:56 +0200
committerGünther Deschner <gd@samba.org>2009-10-16 10:50:28 +0200
commite8e1d609411c37b5839e5b50b95f07691370c247 (patch)
treecbcac4560ea2f1c1951d0779c97140a9e87e4479 /source3
parent8bd4378ff8ddc81710575a21ca7713195a105b52 (diff)
downloadsamba-e8e1d609411c37b5839e5b50b95f07691370c247.tar.gz
samba-e8e1d609411c37b5839e5b50b95f07691370c247.tar.bz2
samba-e8e1d609411c37b5839e5b50b95f07691370c247.zip
s3-libnetapi: add I_NetLogonControl{2} skeleton.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in3
-rw-r--r--source3/lib/netapi/libnetapi.c94
-rw-r--r--source3/lib/netapi/libnetapi.h17
-rw-r--r--source3/lib/netapi/netlogon.c61
4 files changed, 174 insertions, 1 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index d12c9911c3..4dbc8cd84e 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -2156,7 +2156,8 @@ LIBNETAPI_OBJ0 = lib/netapi/netapi.o \
lib/netapi/sid.o \
lib/netapi/share.o \
lib/netapi/file.o \
- lib/netapi/shutdown.o
+ lib/netapi/shutdown.o \
+ lib/netapi/netlogon.o
LIBNETAPI_OBJ = $(LIBNETAPI_OBJ0) $(LIBNET_OBJ) \
$(LIBSMBCONF_OBJ) \
diff --git a/source3/lib/netapi/libnetapi.c b/source3/lib/netapi/libnetapi.c
index 6e366673f1..336ab26854 100644
--- a/source3/lib/netapi/libnetapi.c
+++ b/source3/lib/netapi/libnetapi.c
@@ -2441,3 +2441,97 @@ NET_API_STATUS NetShutdownAbort(const char * server_name /* [in] */)
return r.out.result;
}
+/****************************************************************
+ I_NetLogonControl
+****************************************************************/
+
+NET_API_STATUS I_NetLogonControl(const char * server_name /* [in] */,
+ uint32_t function_code /* [in] */,
+ uint32_t query_level /* [in] */,
+ uint8_t **buffer /* [out] [ref] */)
+{
+ struct I_NetLogonControl 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.function_code = function_code;
+ r.in.query_level = query_level;
+
+ /* Out parameters */
+ r.out.buffer = buffer;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(I_NetLogonControl, &r);
+ }
+
+ if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+ werr = I_NetLogonControl_l(ctx, &r);
+ } else {
+ werr = I_NetLogonControl_r(ctx, &r);
+ }
+
+ r.out.result = W_ERROR_V(werr);
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(I_NetLogonControl, &r);
+ }
+
+ return r.out.result;
+}
+
+/****************************************************************
+ I_NetLogonControl2
+****************************************************************/
+
+NET_API_STATUS I_NetLogonControl2(const char * server_name /* [in] */,
+ uint32_t function_code /* [in] */,
+ uint32_t query_level /* [in] */,
+ uint8_t *data /* [in] [ref] */,
+ uint8_t **buffer /* [out] [ref] */)
+{
+ struct I_NetLogonControl2 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.function_code = function_code;
+ r.in.query_level = query_level;
+ r.in.data = data;
+
+ /* Out parameters */
+ r.out.buffer = buffer;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(I_NetLogonControl2, &r);
+ }
+
+ if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+ werr = I_NetLogonControl2_l(ctx, &r);
+ } else {
+ werr = I_NetLogonControl2_r(ctx, &r);
+ }
+
+ r.out.result = W_ERROR_V(werr);
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(I_NetLogonControl2, &r);
+ }
+
+ return r.out.result;
+}
+
diff --git a/source3/lib/netapi/libnetapi.h b/source3/lib/netapi/libnetapi.h
index 3eab6e61ab..2711558dbc 100644
--- a/source3/lib/netapi/libnetapi.h
+++ b/source3/lib/netapi/libnetapi.h
@@ -440,4 +440,21 @@ WERROR NetShutdownAbort_r(struct libnetapi_ctx *ctx,
struct NetShutdownAbort *r);
WERROR NetShutdownAbort_l(struct libnetapi_ctx *ctx,
struct NetShutdownAbort *r);
+NET_API_STATUS I_NetLogonControl(const char * server_name /* [in] */,
+ uint32_t function_code /* [in] */,
+ uint32_t query_level /* [in] */,
+ uint8_t **buffer /* [out] [ref] */);
+WERROR I_NetLogonControl_r(struct libnetapi_ctx *ctx,
+ struct I_NetLogonControl *r);
+WERROR I_NetLogonControl_l(struct libnetapi_ctx *ctx,
+ struct I_NetLogonControl *r);
+NET_API_STATUS I_NetLogonControl2(const char * server_name /* [in] */,
+ uint32_t function_code /* [in] */,
+ uint32_t query_level /* [in] */,
+ uint8_t *data /* [in] [ref] */,
+ uint8_t **buffer /* [out] [ref] */);
+WERROR I_NetLogonControl2_r(struct libnetapi_ctx *ctx,
+ struct I_NetLogonControl2 *r);
+WERROR I_NetLogonControl2_l(struct libnetapi_ctx *ctx,
+ struct I_NetLogonControl2 *r);
#endif /* __LIBNETAPI_LIBNETAPI__ */
diff --git a/source3/lib/netapi/netlogon.c b/source3/lib/netapi/netlogon.c
new file mode 100644
index 0000000000..eb18a1edf6
--- /dev/null
+++ b/source3/lib/netapi/netlogon.c
@@ -0,0 +1,61 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * NetApi LogonControl Support
+ * Copyright (C) Guenther Deschner 2009
+ *
+ * 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 I_NetLogonControl_r(struct libnetapi_ctx *ctx,
+ struct I_NetLogonControl *r)
+{
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR I_NetLogonControl_l(struct libnetapi_ctx *ctx,
+ struct I_NetLogonControl *r)
+{
+ LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, I_NetLogonControl);
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR I_NetLogonControl2_r(struct libnetapi_ctx *ctx,
+ struct I_NetLogonControl2 *r)
+{
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR I_NetLogonControl2_l(struct libnetapi_ctx *ctx,
+ struct I_NetLogonControl2 *r)
+{
+ LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, I_NetLogonControl2);
+}