netapi: add support for local query of level 101 in NetServerGetInfo.
authorGünther Deschner <gd@samba.org>
Mon, 1 Sep 2008 16:54:53 +0000 (18:54 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 5 Sep 2008 11:03:36 +0000 (13:03 +0200)
Guenther
(This used to be commit b7a2f27c1cae9abed2f821177fca425012222632)

source3/lib/netapi/serverinfo.c

index 12a08086582f753352dfd39cf14c3caec3b8df01..b2a134b0afc4e47a5c1ca096ac7217eaa240ea32 100644 (file)
 /****************************************************************
 ****************************************************************/
 
+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: