diff options
author | Jim McDonough <jmcd@samba.org> | 2005-10-20 20:40:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:08 -0500 |
commit | 1113cad9c0c81e9ecec3a0f4317c950943cfc62a (patch) | |
tree | fdafa600529a6bcc43cf283007630d8cd51b1151 /source3/passdb/pdb_tdb.c | |
parent | 6fc9098dcc1a1ef232b96f5d4c562bf340db8988 (diff) | |
download | samba-1113cad9c0c81e9ecec3a0f4317c950943cfc62a.tar.gz samba-1113cad9c0c81e9ecec3a0f4317c950943cfc62a.tar.bz2 samba-1113cad9c0c81e9ecec3a0f4317c950943cfc62a.zip |
r11236: Implement user rename for smbpasswd and ldap backends. Some cleanup on
tdb as well to make naming consistent.
(This used to be commit ee91eb9a39cc5e3edd9e97eb040e7557930e4e62)
Diffstat (limited to 'source3/passdb/pdb_tdb.c')
-rw-r--r-- | source3/passdb/pdb_tdb.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index f04c82a5b1..8bf9b1b282 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -775,7 +775,8 @@ static NTSTATUS tdbsam_add_sam_account (struct pdb_methods *my_methods, SAM_ACCO - unlock the new user record ***************************************************************************/ static NTSTATUS tdbsam_rename_sam_account(struct pdb_methods *my_methods, - SAM_ACCOUNT *oldname, const char *newname) + SAM_ACCOUNT *old_acct, + const char *newname) { struct tdbsam_privates *tdb_state = (struct tdbsam_privates *)my_methods->private_data; @@ -788,7 +789,7 @@ static NTSTATUS tdbsam_rename_sam_account(struct pdb_methods *my_methods, if (!*(lp_renameuser_script())) goto done; - if (!pdb_copy_sam_account(oldname, &new_acct) || + if (!pdb_copy_sam_account(old_acct, &new_acct) || !pdb_set_username(new_acct, newname, PDB_CHANGED)) goto done; @@ -826,7 +827,8 @@ static NTSTATUS tdbsam_rename_sam_account(struct pdb_methods *my_methods, int rename_ret; pstring_sub(rename_script, "%unew", newname); - pstring_sub(rename_script, "%uold", pdb_get_username(oldname)); + pstring_sub(rename_script, "%uold", + pdb_get_username(old_acct)); rename_ret = smbrun(rename_script, NULL); DEBUG(rename_ret ? 0 : 3,("Running the command `%s' gave %d\n", rename_script, rename_ret)); @@ -843,7 +845,7 @@ static NTSTATUS tdbsam_rename_sam_account(struct pdb_methods *my_methods, interim_account = False; tdb_unlock_bystring(pwd_tdb, newname); - tdb_delete_samacct_only(pwd_tdb, my_methods, oldname); + tdb_delete_samacct_only(pwd_tdb, my_methods, old_acct); ret = NT_STATUS_OK; |