summaryrefslogtreecommitdiff
path: root/source3/nsswitch/wbinfo.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-01-04 11:59:11 +0000
committerVolker Lendecke <vlendec@samba.org>2004-01-04 11:59:11 +0000
commit612a97f84535c2d2b397f7a1b3941f7f6f602b27 (patch)
treee8158166910bd9be81912eb18bdd1f9821b59c88 /source3/nsswitch/wbinfo.c
parent60639680195015739909ea7a2be032bdbab4f76c (diff)
downloadsamba-612a97f84535c2d2b397f7a1b3941f7f6f602b27.tar.gz
samba-612a97f84535c2d2b397f7a1b3941f7f6f602b27.tar.bz2
samba-612a97f84535c2d2b397f7a1b3941f7f6f602b27.zip
Commit the translation of the realm to the netbios domain name in the kerberos
session setup. After talking to jht and abartlet I made this unconditional, no additional parameter. Jerry: This is a change in behaviour, but I think it is necessary. Volker (This used to be commit d32f47fedcff3fdf46f42926d1cd84433e7ab487)
Diffstat (limited to 'source3/nsswitch/wbinfo.c')
-rw-r--r--source3/nsswitch/wbinfo.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index 04233bb85c..bca1813167 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -247,6 +247,42 @@ static BOOL wbinfo_show_sequence(const char *domain)
return True;
}
+/* Show domain info */
+
+static BOOL wbinfo_domain_info(const char *domain_name)
+{
+ struct winbindd_request request;
+ struct winbindd_response response;
+
+ ZERO_STRUCT(request);
+ ZERO_STRUCT(response);
+
+ fstrcpy(request.domain_name, domain_name);
+
+ /* Send request */
+
+ if (winbindd_request(WINBINDD_DOMAIN_INFO, &request, &response) !=
+ NSS_STATUS_SUCCESS)
+ return False;
+
+ /* Display response */
+
+ d_printf("Name : %s\n", response.data.domain_info.name);
+ d_printf("Alt_Name: %s\n", response.data.domain_info.alt_name);
+
+ d_printf("SID : %s\n", response.data.domain_info.sid);
+
+ d_printf("Native : %s\n",
+ response.data.domain_info.native_mode ? "Yes" : "No");
+
+ d_printf("Primary : %s\n",
+ response.data.domain_info.primary ? "Yes" : "No");
+
+ d_printf("Sequence: %d\n", response.data.domain_info.sequence_number);
+
+ return True;
+}
+
/* Check trust account password */
static BOOL wbinfo_check_secret(void)
@@ -922,6 +958,8 @@ int main(int argc, char **argv)
{ "check-secret", 't', POPT_ARG_NONE, 0, 't', "Check shared secret" },
{ "trusted-domains", 'm', POPT_ARG_NONE, 0, 'm', "List trusted domains" },
{ "sequence", 0, POPT_ARG_NONE, 0, OPT_SEQUENCE, "Show sequence numbers of all domains" },
+ { "domain-info", 'D', POPT_ARG_STRING, &string_arg, 'D',
+ "Show all most info we have about the domain" },
{ "user-groups", 'r', POPT_ARG_STRING, &string_arg, 'r', "Get user groups", "USER" },
{ "authenticate", 'a', POPT_ARG_STRING, &string_arg, 'a', "authenticate user", "user%password" },
{ "set-auth-user", 0, POPT_ARG_STRING, &string_arg, OPT_SET_AUTH_USER, "Store user and password used by winbindd (root only)", "user%password" },
@@ -1048,6 +1086,12 @@ int main(int argc, char **argv)
goto done;
}
break;
+ case 'D':
+ if (!wbinfo_domain_info(string_arg)) {
+ d_printf("Could not get domain info\n");
+ goto done;
+ }
+ break;
case 'r':
if (!wbinfo_get_usergroups(string_arg)) {
d_printf("Could not get groups for user %s\n",