From: Joseph Sutton Date: Tue, 23 May 2023 21:48:19 +0000 (+1200) Subject: net_ads: Handle new NBT_SERVER_* flags X-Git-Tag: talloc-2.4.1~535 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e14b5974c67ee39d7033c6aa7cbf71c6dc46d7ec;p=thirdparty%2Fsamba.git net_ads: Handle new NBT_SERVER_* flags Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index d1b2a25ca92..9a3ee73567e 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -232,6 +232,36 @@ static int net_ads_cldap_netlogon_json goto failure; } + ret = json_add_bool(&flagsobj, "Runs on Windows 2012R2 or later", + reply->server_type & NBT_SERVER_DS_9); + if (ret != 0) { + goto failure; + } + + ret = json_add_bool(&flagsobj, "Runs on Windows 2016 or later", + reply->server_type & NBT_SERVER_DS_10); + if (ret != 0) { + goto failure; + } + + ret = json_add_bool(&flagsobj, "Has a DNS name", + reply->server_type & NBT_SERVER_HAS_DNS_NAME); + if (ret != 0) { + goto failure; + } + + ret = json_add_bool(&flagsobj, "Is a default NC", + reply->server_type & NBT_SERVER_IS_DEFAULT_NC); + if (ret != 0) { + goto failure; + } + + ret = json_add_bool(&flagsobj, "Is the forest root", + reply->server_type & NBT_SERVER_FOREST_ROOT); + if (ret != 0) { + goto failure; + } + ret = json_add_string(&jsobj, "Forest", reply->forest); if (ret != 0) { goto failure; @@ -372,7 +402,12 @@ static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads) "\tIs NT6 DC that has some secrets: %s\n" "\tIs NT6 DC that has all secrets: %s\n" "\tRuns Active Directory Web Services: %s\n" - "\tRuns on Windows 2012 or later: %s\n"), + "\tRuns on Windows 2012 or later: %s\n" + "\tRuns on Windows 2012R2 or later: %s\n" + "\tRuns on Windows 2016 or later: %s\n" + "\tHas a DNS name: %s\n" + "\tIs a default NC: %s\n" + "\tIs the forest root: %s\n"), (reply.server_type & NBT_SERVER_PDC) ? _("yes") : _("no"), (reply.server_type & NBT_SERVER_GC) ? _("yes") : _("no"), (reply.server_type & NBT_SERVER_LDAP) ? _("yes") : _("no"), @@ -386,7 +421,12 @@ static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads) (reply.server_type & NBT_SERVER_SELECT_SECRET_DOMAIN_6) ? _("yes") : _("no"), (reply.server_type & NBT_SERVER_FULL_SECRET_DOMAIN_6) ? _("yes") : _("no"), (reply.server_type & NBT_SERVER_ADS_WEB_SERVICE) ? _("yes") : _("no"), - (reply.server_type & NBT_SERVER_DS_8) ? _("yes") : _("no")); + (reply.server_type & NBT_SERVER_DS_8) ? _("yes") : _("no"), + (reply.server_type & NBT_SERVER_DS_9) ? _("yes") : _("no"), + (reply.server_type & NBT_SERVER_DS_10) ? _("yes") : _("no"), + (reply.server_type & NBT_SERVER_HAS_DNS_NAME) ? _("yes") : _("no"), + (reply.server_type & NBT_SERVER_IS_DEFAULT_NC) ? _("yes") : _("no"), + (reply.server_type & NBT_SERVER_FOREST_ROOT) ? _("yes") : _("no")); printf(_("Forest: %s\n"), reply.forest);