From 09c953e4200cf4983106b626b448651b94433e59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Mon, 1 Sep 2008 18:54:53 +0200 Subject: [PATCH] netapi: add support for local query of level 101 in NetServerGetInfo. Guenther (cherry picked from commit b7a2f27c1cae9abed2f821177fca425012222632) (cherry picked from commit a2b1809dfbe790dabd0812d4c0464e9b83ff431d) --- source/lib/netapi/serverinfo.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/lib/netapi/serverinfo.c b/source/lib/netapi/serverinfo.c index 12a08086582..b2a134b0afc 100644 --- a/source/lib/netapi/serverinfo.c +++ b/source/lib/netapi/serverinfo.c @@ -28,6 +28,29 @@ /**************************************************************** ****************************************************************/ +static WERROR NetServerGetInfo_l_101(struct libnetapi_ctx *ctx, + uint8_t **buffer) +{ + struct SERVER_INFO_101 i; + + i.sv101_platform_id = PLATFORM_ID_NT; + i.sv101_name = global_myname(); + i.sv101_version_major = lp_major_announce_version(); + i.sv101_version_minor = lp_minor_announce_version(); + i.sv101_type = lp_default_server_announce(); + i.sv101_comment = lp_serverstring(); + + *buffer = (uint8_t *)talloc_memdup(ctx, &i, sizeof(i)); + if (!*buffer) { + return WERR_NOMEM; + } + + return WERR_OK; +} + +/**************************************************************** +****************************************************************/ + static WERROR NetServerGetInfo_l_1005(struct libnetapi_ctx *ctx, uint8_t **buffer) { @@ -49,6 +72,8 @@ WERROR NetServerGetInfo_l(struct libnetapi_ctx *ctx, struct NetServerGetInfo *r) { switch (r->in.level) { + case 101: + return NetServerGetInfo_l_101(ctx, r->out.buffer); case 1005: return NetServerGetInfo_l_1005(ctx, r->out.buffer); default: -- 2.11.4.GIT