svn commit: samba r24807 - in branches: SAMBA_3_2/source/nsswitch SAMBA_3_2_0/source/nsswitch

gd at samba.org gd at samba.org
Thu Aug 30 16:24:54 GMT 2007


Author: gd
Date: 2007-08-30 16:24:51 +0000 (Thu, 30 Aug 2007)
New Revision: 24807

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

Log:
Add WINBINDD_LOCATOR_KDC_ADDRESS env which will be used for the case when the
locator gets called from within winbindd.

Guenther

Modified:
   branches/SAMBA_3_2/source/nsswitch/winbindd_nss.h
   branches/SAMBA_3_2/source/nsswitch/winbindd_util.c
   branches/SAMBA_3_2_0/source/nsswitch/winbindd_nss.h
   branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c


Changeset:
Modified: branches/SAMBA_3_2/source/nsswitch/winbindd_nss.h
===================================================================
--- branches/SAMBA_3_2/source/nsswitch/winbindd_nss.h	2007-08-30 16:02:22 UTC (rev 24806)
+++ branches/SAMBA_3_2/source/nsswitch/winbindd_nss.h	2007-08-30 16:24:51 UTC (rev 24807)
@@ -39,6 +39,7 @@
 #define WINBINDD_PRIV_SOCKET_SUBDIR "winbindd_privileged" /* name of subdirectory of lp_lockdir() to hold the 'privileged' pipe */
 #define WINBINDD_DOMAIN_ENV  "WINBINDD_DOMAIN" /* Environment variables */
 #define WINBINDD_DONT_ENV    "_NO_WINBINDD"
+#define WINBINDD_LOCATOR_KDC_ADDRESS "WINBINDD_LOCATOR_KDC_ADDRESS"
 
 /* Update this when you change the interface.  */
 

Modified: branches/SAMBA_3_2/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_2/source/nsswitch/winbindd_util.c	2007-08-30 16:02:22 UTC (rev 24806)
+++ branches/SAMBA_3_2/source/nsswitch/winbindd_util.c	2007-08-30 16:24:51 UTC (rev 24807)
@@ -1365,3 +1365,36 @@
 
 	return False;
 }
+
+/*********************************************************************
+ ********************************************************************/
+
+void winbindd_set_locator_kdc_env(const struct winbindd_domain *domain)
+{
+	char *var = NULL;
+	const char *kdc = NULL;
+
+	if (!domain) {
+		return;
+	}
+
+	kdc = inet_ntoa(domain->dcaddr.sin_addr);
+	if (!kdc) {
+		kdc = domain->dcname;
+	}
+
+	if (!kdc || !*kdc) {
+		return;
+	}
+
+	if (asprintf(&var, "%s_%s", WINBINDD_LOCATOR_KDC_ADDRESS,
+		     strupper_static(domain->alt_name)) == -1) {
+		return;
+	}
+
+	DEBUG(10,("winbindd_set_locator_kdc_env: setting var: %s to: %s\n",
+		var, kdc));
+
+	setenv(var, kdc, 1);
+	free(var);
+}

Modified: branches/SAMBA_3_2_0/source/nsswitch/winbindd_nss.h
===================================================================
--- branches/SAMBA_3_2_0/source/nsswitch/winbindd_nss.h	2007-08-30 16:02:22 UTC (rev 24806)
+++ branches/SAMBA_3_2_0/source/nsswitch/winbindd_nss.h	2007-08-30 16:24:51 UTC (rev 24807)
@@ -32,6 +32,7 @@
 #define WINBINDD_PRIV_SOCKET_SUBDIR "winbindd_privileged" /* name of subdirectory of lp_lockdir() to hold the 'privileged' pipe */
 #define WINBINDD_DOMAIN_ENV  "WINBINDD_DOMAIN" /* Environment variables */
 #define WINBINDD_DONT_ENV    "_NO_WINBINDD"
+#define WINBINDD_LOCATOR_KDC_ADDRESS "WINBINDD_LOCATOR_KDC_ADDRESS"
 
 /* Update this when you change the interface.  */
 

Modified: branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c	2007-08-30 16:02:22 UTC (rev 24806)
+++ branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c	2007-08-30 16:24:51 UTC (rev 24807)
@@ -1413,3 +1413,36 @@
 
 	return False;
 }
+
+/*********************************************************************
+ ********************************************************************/
+
+void winbindd_set_locator_kdc_env(const struct winbindd_domain *domain)
+{
+	char *var = NULL;
+	const char *kdc = NULL;
+
+	if (!domain) {
+		return;
+	}
+
+	kdc = inet_ntoa(domain->dcaddr.sin_addr);
+	if (!kdc) {
+		kdc = domain->dcname;
+	}
+
+	if (!kdc || !*kdc) {
+		return;
+	}
+
+	if (asprintf(&var, "%s_%s", WINBINDD_LOCATOR_KDC_ADDRESS,
+		     strupper_static(domain->alt_name)) == -1) {
+		return;
+	}
+
+	DEBUG(10,("winbindd_set_locator_kdc_env: setting var: %s to: %s\n",
+		var, kdc));
+
+	setenv(var, kdc, 1);
+	free(var);
+}



More information about the samba-cvs mailing list