Fix bug #6628 - "smbpassdb -a" using rid algorithm with tdbsam passdb
authorSimo Sorce <idra@samba.org>
Sun, 13 Jul 2008 02:44:15 +0000 (22:44 -0400)
committerKarolin Seeger <kseeger@samba.org>
Wed, 12 Aug 2009 11:59:17 +0000 (13:59 +0200)
samu_set_unix() does not use the rid allocator, but forces to use the
algoritmic allocator unconditionally, this is wrong and inconsistent.
Use samu_alloc_rid_unix() instead.
(If we create a new user we should do it in a way consistent with all
other commands like pdbedit -a and net rpc user add.)
(cherry picked from commit e1d4db8f55b25c7e9c408cb334fb89ccfd4c6565)

Signed-off-by: Michael Adam <obnox@samba.org>
This fixes bug #6628.
(cherry picked from commit 0a1b125ae4260de3cee6a92b19e3977d922a8c11)

source/passdb/passdb.c

index e3a3d3ca9e54c9ff89db8d02d3e4d391b57b4836..125689caad3c69677faae7844a9e462be5048781 100644 (file)
@@ -675,7 +675,7 @@ NTSTATUS local_password_change(const char *user_name,
                                return NT_STATUS_NO_MEMORY;
                        }
 
-                       result = samu_set_unix( sam_pass, pwd );
+                       result = samu_alloc_rid_unix( sam_pass, pwd );
 
                        DEBUGLEVEL = tmp_debug;