[1987] in Moira Commits

home help back first fref pref prev next nref lref last post

/svn/moira r4126 - trunk/moira/incremental/ldap

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Mon Jul 29 08:40:59 2013

Date: Mon, 29 Jul 2013 08:40:52 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201307291240.r6TCeqfu015591@drugstore.mit.edu>
To: moira-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2013-07-29 08:40:52 -0400 (Mon, 29 Jul 2013)
New Revision: 4126

Modified:
   trunk/moira/incremental/ldap/winad.c
Log:
Fix mailbox creation issue.

Modified: trunk/moira/incremental/ldap/winad.c
===================================================================
--- trunk/moira/incremental/ldap/winad.c	2013-07-23 15:29:57 UTC (rev 4125)
+++ trunk/moira/incremental/ldap/winad.c	2013-07-29 12:40:52 UTC (rev 4126)
@@ -2464,8 +2464,8 @@
 	  
 	  if (group_count)
 	    {
-	      com_err(whoami, 0, "Object already exists with name %s",
-		      after_group_name);
+	      com_err(whoami, 0, "Object %s already exists with name %s",
+		      group_base->dn, after_group_name);
 	      MailDisabled++;
 	    }
 	
@@ -2793,8 +2793,8 @@
 	      
 	      if (group_count)
 		{
-		  com_err(whoami, 0, "Object already exists with name %s",
-			  av[L_NAME]);
+		  com_err(whoami, 0, "Object %s already exists with name %s",
+			  group_base->dn, av[L_NAME]);
 		  MailDisabled++;
 		}
 	
@@ -2932,11 +2932,11 @@
 			  av[L_NAME], ldap_err2string(rc));
 		  return(rc);
 		}
-	      
+	    
 	      if (group_count)
 		{
-		  com_err(whoami, 0, "Object already exists with name %s",
-			  av[L_NAME]);
+		  com_err(whoami, 0, "Object %s already exists with name %s",
+			  group_base->dn, av[L_NAME]);
 		  MailDisabled++;
 		}
 	      
@@ -3927,8 +3927,8 @@
       
 	  if (group_count) 
 	    {
-	      com_err(whoami, 0, "Object already exists with name %s",
-		      user);
+	      com_err(whoami, 0, "Object %s already exists with name %s",
+		      group_base->dn, user);
 	      return(1);
 	    }
 
@@ -3951,8 +3951,8 @@
 	  
 	  if (group_count) 
 	    {
-	      com_err(whoami, 0, "Object already exists with name %s",
-		      user);
+	      com_err(whoami, 0, "Object %s already exists with name %s",
+		      group_base->dn, user);
 	      return(1);
 	    }
   
@@ -3975,8 +3975,8 @@
 	  
 	  if (group_count) 
 	    {
-	      com_err(whoami, 0, "Object already exists with name %s",
-		      user);
+	      com_err(whoami, 0, "Object %s already exists with name %s",
+		      group_base->dn, user);
 	      return(1);
 	    }
 	
@@ -3999,8 +3999,8 @@
       
 	  if (group_count) 
 	    {
-	      com_err(whoami, 0, "Object already exists with name %s",
-		      user);
+	      com_err(whoami, 0, "Object %s already exists with name %s",
+		      group_base->dn, user);
 	      return(1);
 	    }
 	  
@@ -4025,8 +4025,8 @@
       
 	  if (group_count) 
 	    {
-	      com_err(whoami, 0, "Object already exists with name %s",
-		      user);
+	      com_err(whoami, 0, "Object %s already exists with name %s",
+		      group_base->dn, user);
 	      return(1);
 	    }
 
@@ -4050,8 +4050,8 @@
       
 	  if (group_count) 
 	    {
-	      com_err(whoami, 0, "Object already exists with name %s",
-		      user);
+	      com_err(whoami, 0, "Object %s already exists with name %s",
+		      group_base->dn, user);
 	      return(1);
 	    }
 
@@ -4324,8 +4324,8 @@
       group_base = NULL;
       
       sprintf(filter_exp, 
-	      "(|(mail=%s)(proxyaddresses=smtp:%s)(mailnickname=%s))", mail,
-	      mail, user_name);
+	      "(&(|(mail=%s)(proxyaddresses=smtp:%s)(mailnickname=%s))"
+	      "(!(samaccountname=%s)))", mail, mail, user_name, user_name);
       attr_array[0] = "cn";
       attr_array[1] = NULL;
       
@@ -4337,11 +4337,11 @@
 		  user_name, ldap_err2string(rc));
 	  return(1);
 	}
-      
+    
       if (group_count) 
 	{
-	  com_err(whoami, 0, "Object already exists with mail %s",
-		  mail);
+	  com_err(whoami, 0, "Object %s already exists with mail %s",
+		  group_base->dn, mail);
 	  MailDisabled++;
 	}
       
@@ -4350,8 +4350,9 @@
       group_base = NULL;
       
       sprintf(filter_exp, 
-	      "(|(mail=%s@mit.edu)(proxyaddresses=smtp:%s@mit.edu)"
-	      "(mailnickname=%s))", user_name, user_name, user_name);
+	      "(&(|(mail=%s@mit.edu)(proxyaddresses=smtp:%s@mit.edu)"
+	      "(mailnickname=%s))(!(samaccountname=%s)))", user_name, 
+	      user_name, user_name, user_name);
       attr_array[0] = "cn";
       attr_array[1] = NULL;
       
@@ -4366,8 +4367,8 @@
       
       if (group_count) 
 	{
-	  com_err(whoami, 0, "Object already exists with mail %s@mit.edu",
-		  user_name);
+	  com_err(whoami, 0, "Object %s already exists with mail %s@mit.edu",
+		  group_base->dn, user_name);
 	  MailDisabled++;
 	}
       
@@ -6843,9 +6844,8 @@
       group_base = NULL;
       
       sprintf(filter_exp, 
-	      "(|(mail=%s)(proxyaddresses=smtp%s)(mailnickname=%s))", mail,
-	      mail, user_name);
-  
+	      "(&(|(mail=%s)(proxyaddresses=smtp:%s)(mailnickname=%s))"
+	      "(!(samaccountname=%s)))", mail, mail, user_name, user_name);
       attr_array[0] = "cn";
       attr_array[1] = NULL;
       
@@ -6861,8 +6861,8 @@
       
       if (group_count) 
 	{
-	  com_err(whoami, 0, "Object already exists with mail %s",
-		  mail);
+	  com_err(whoami, 0, "Object %s already exists with mail %s",
+		  group_base->dn, mail);
 	  MailDisabled++;
 	}
       
@@ -6871,8 +6871,9 @@
       group_base = NULL;
       
       sprintf(filter_exp, 
-	      "(|(mail=%s@mit.edu)(proxyaddresses=smtp:%s@mit.edu)"
-	      "(mailnickname=%s))", user_name, user_name, user_name);
+	      "(&(|(mail=%s@mit.edu)(proxyaddresses=smtp:%s@mit.edu)"
+	      "(mailnickname=%s))(!(samaccountname=%s)))", user_name,
+	      user_name, user_name, user_name);
       attr_array[0] = "cn";
       attr_array[1] = NULL;
       
@@ -6884,11 +6885,11 @@
 		  user_name, ldap_err2string(rc));
 	  return(1);
 	}
-      
+
       if (group_count) 
 	{
-	  com_err(whoami, 0, "Object already exists with mail %s@mit.edu",
-		  user_name);
+	  com_err(whoami, 0, "Object %s already exists with mail %s@mit.edu",
+		  group_base->dn, user_name);
 	  MailDisabled++;
 	}
       


home help back first fref pref prev next nref lref last post