patch for user rename with tdbsam

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Oct 10 20:11:14 GMT 2005

On Mon, Oct 10, 2005 at 01:18:28PM -0600, Jim McDonough wrote:
> Can y'all take a look at this patch?  It adds support for user renames 
> from usrmgr.exe, for tdbsam only.  ldapsam and ldapsam_trusted will 
> require two additional patches.

+	if (!oldname->methods){
+		pdb_selected = context->pdb_methods;
+		/* There's no passdb backend specified for this account.
+		 * Try to delete it in every passdb available 
+		 * Needed to delete accounts in smbpasswd that are not
+		 * in /etc/passwd.
+		 */

Is that really necessary? I'd say screw those situations.

+ Renames a SAM_ACCOUNT
+ - check for the posix user/rename user script
+ - Add and lock the new user record
+ - rename the posix user
+ - rewrite the rid->username record
+ - delete the old user
+ - unlock the new user record

In particular with tdbsam, this *cries* for tridge's new tdb transaction
code. I'd say this is a real reason to import it.

Start a transaction, do all the tdb stuff, try the posix script, and roll back
if that fails.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the samba-technical mailing list