svn commit: samba r15985 - branches/SAMBA_3_0/source/nsswitch trunk/source/nsswitch

gd at samba.org gd at samba.org
Wed May 31 17:15:34 GMT 2006


Author: gd
Date: 2006-05-31 17:15:33 +0000 (Wed, 31 May 2006)
New Revision: 15985

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15985

Log:
Adding "own-domain" switch to wbinfo which is handy from time to time.

Guenther

Modified:
   branches/SAMBA_3_0/source/nsswitch/wbinfo.c
   trunk/source/nsswitch/wbinfo.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/wbinfo.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/wbinfo.c	2006-05-31 15:45:19 UTC (rev 15984)
+++ branches/SAMBA_3_0/source/nsswitch/wbinfo.c	2006-05-31 17:15:33 UTC (rev 15985)
@@ -332,7 +332,15 @@
 	return True;
 }
 
+/* List own domain */
 
+static BOOL wbinfo_list_own_domain(void)
+{
+	d_printf("%s\n", get_winbind_domain());
+
+	return True;
+}
+
 /* show sequence numbers */
 static BOOL wbinfo_show_sequence(const char *domain)
 {
@@ -1080,7 +1088,8 @@
 	OPT_ALLOCATE_UID,
 	OPT_ALLOCATE_GID,
 	OPT_SEPARATOR,
-	OPT_LIST_ALL_DOMAINS
+	OPT_LIST_ALL_DOMAINS,
+	OPT_LIST_OWN_DOMAIN
 };
 
 int main(int argc, char **argv)
@@ -1116,6 +1125,7 @@
 		{ "check-secret", 't', POPT_ARG_NONE, 0, 't', "Check shared secret" },
 		{ "trusted-domains", 'm', POPT_ARG_NONE, 0, 'm', "List trusted domains" },
 		{ "all-domains", 0, POPT_ARG_NONE, 0, OPT_LIST_ALL_DOMAINS, "List all domains (trusted and own domain)" },
+		{ "own-domain", 0, POPT_ARG_NONE, 0, OPT_LIST_OWN_DOMAIN, "List own domain" },
 		{ "sequence", 0, POPT_ARG_NONE, 0, OPT_SEQUENCE, "Show sequence numbers of all domains" },
 		{ "domain-info", 'D', POPT_ARG_STRING, &string_arg, 'D', "Show most of the info we have about the domain" },
 		{ "user-info", 'i', POPT_ARG_STRING, &string_arg, 'i', "Get user info", "USER" },
@@ -1396,6 +1406,12 @@
 			if (!wbinfo_list_domains(True)) {
 				goto done;
 			}
+			break;
+		case OPT_LIST_OWN_DOMAIN:
+			if (!wbinfo_list_own_domain()) {
+				goto done;
+			}
+			break;
 		/* generic configuration options */
 		case OPT_DOMAIN_NAME:
 			break;

Modified: trunk/source/nsswitch/wbinfo.c
===================================================================
--- trunk/source/nsswitch/wbinfo.c	2006-05-31 15:45:19 UTC (rev 15984)
+++ trunk/source/nsswitch/wbinfo.c	2006-05-31 17:15:33 UTC (rev 15985)
@@ -332,7 +332,15 @@
 	return True;
 }
 
+/* List own domain */
 
+static BOOL wbinfo_list_own_domain(void)
+{
+	d_printf("%s\n", get_winbind_domain());
+
+	return True;
+}
+
 /* show sequence numbers */
 static BOOL wbinfo_show_sequence(const char *domain)
 {
@@ -1138,7 +1146,8 @@
 	OPT_ALLOCATE_UID,
 	OPT_ALLOCATE_GID,
 	OPT_SEPARATOR,
-	OPT_LIST_ALL_DOMAINS
+	OPT_LIST_ALL_DOMAINS,
+	OPT_LIST_OWN_DOMAIN
 };
 
 int main(int argc, char **argv)
@@ -1175,6 +1184,7 @@
 		{ "check-secret", 't', POPT_ARG_NONE, 0, 't', "Check shared secret" },
 		{ "trusted-domains", 'm', POPT_ARG_NONE, 0, 'm', "List trusted domains" },
 		{ "all-domains", 0, POPT_ARG_NONE, 0, OPT_LIST_ALL_DOMAINS, "List all domains (trusted and own domain)" },
+		{ "own-domain", 0, POPT_ARG_NONE, 0, OPT_LIST_OWN_DOMAIN, "List own domain" },
 		{ "sequence", 0, POPT_ARG_NONE, 0, OPT_SEQUENCE, "Show sequence numbers of all domains" },
 		{ "domain-info", 'D', POPT_ARG_STRING, &string_arg, 'D', "Show most of the info we have about the domain" },
 		{ "user-info", 'i', POPT_ARG_STRING, &string_arg, 'i', "Get user info", "USER" },
@@ -1461,6 +1471,12 @@
 			if (!wbinfo_list_domains(True)) {
 				goto done;
 			}
+			break;
+		case OPT_LIST_OWN_DOMAIN:
+			if (!wbinfo_list_own_domain()) {
+				goto done;
+			}
+			break;
 		/* generic configuration options */
 		case OPT_DOMAIN_NAME:
 			break;



More information about the samba-cvs mailing list