svn commit: samba r12561 - in trunk/source/passdb: .

vlendec at samba.org vlendec at samba.org
Thu Dec 29 11:05:44 GMT 2005


Author: vlendec
Date: 2005-12-29 11:05:42 +0000 (Thu, 29 Dec 2005)
New Revision: 12561

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

Log:
If 'algorithmic rid base' is set and we have tdbsam or ldapsam, refuse to
allocate a new RID. The way to handle this is to explicitly map all groups and
issue a 'net maxrid' to find out the maximum used RID. This will be extended
to actually set the next rid attribute in LDAP and tdbsam.

With an algorithmic rid base explicitly set there is just no way to sanely
find a reasonable RID space to allocate from.

BTW, in the current 3_0 code tdbsam doesn't care whereas ldapsam does. So this
is sort of broken anyway.

Volker

Modified:
   trunk/source/passdb/pdb_interface.c


Changeset:
Modified: trunk/source/passdb/pdb_interface.c
===================================================================
--- trunk/source/passdb/pdb_interface.c	2005-12-29 11:02:33 UTC (rev 12560)
+++ trunk/source/passdb/pdb_interface.c	2005-12-29 11:05:42 UTC (rev 12561)
@@ -1603,6 +1603,21 @@
 		return False;
 	}
 
+	if (pdb_rid_algorithm()) {
+		DEBUG(0, ("Trying to allocate a RID when algorithmic RIDs "
+			  "are active\n"));
+		return False;
+	}
+
+	if (algorithmic_rid_base() != BASE_RID) {
+		DEBUG(0, ("'algorithmic rid base' is set but a passdb backend "
+			  "without algorithmic RIDs is chosen.\n"));
+		DEBUGADD(0, ("Please map all used groups using 'net groupmap "
+			     "add', set the maximum used RID using\n"));
+		DEBUGADD(0, ("'net setmaxrid' and remove the parameter\n"));
+		return False;
+	}
+
 	return pdb_context->pdb_new_rid(pdb_context, rid);
 }
 



More information about the samba-cvs mailing list