summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_tdb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2003-05-01 16:02:55 +0000
committerSimo Sorce <idra@samba.org>2003-05-01 16:02:55 +0000
commite492cdb4e4deb9bba714272caed8772b8b25e4be (patch)
tree587cf288d532193477a78af4265f5d75dbb67054 /source3/passdb/pdb_tdb.c
parent741f18d439fd31920913a0c7d6e3357f245b283b (diff)
downloadsamba-e492cdb4e4deb9bba714272caed8772b8b25e4be.tar.gz
samba-e492cdb4e4deb9bba714272caed8772b8b25e4be.tar.bz2
samba-e492cdb4e4deb9bba714272caed8772b8b25e4be.zip
fix wrong debug messages in idmap_util.c
correctly handle allocated rids in tdbsam (This used to be commit 7ae6162e1dd668897628c4f7edff508616644d21)
Diffstat (limited to 'source3/passdb/pdb_tdb.c')
-rw-r--r--source3/passdb/pdb_tdb.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index 3ed5d2d4d6..74437cba6f 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -640,7 +640,7 @@ static NTSTATUS tdbsam_getsampwrid (struct pdb_methods *my_methods, SAM_ACCOUNT
return nt_status;
}
- fstrcpy (name, data.dptr);
+ fstrcpy(name, data.dptr);
SAFE_FREE(data.dptr);
tdb_close (pwd_tdb);
@@ -771,6 +771,11 @@ static BOOL tdb_update_sam(struct pdb_methods *my_methods, SAM_ACCOUNT* newpwd,
ret = False;
goto done;
}
+ if (!pdb_set_user_sid_from_rid(newpwd, user_rid, PDB_CHANGED)) {
+ DEBUG(0, ("tdbsam: not able to set new allocated user RID into sam account!\n"));
+ ret = False;
+ goto done;
+ }
} else {
DEBUG (0,("tdb_update_sam: Failing to store a SAM_ACCOUNT for [%s] without a RID\n",pdb_get_username(newpwd)));
ret = False;
@@ -794,7 +799,7 @@ static BOOL tdb_update_sam(struct pdb_methods *my_methods, SAM_ACCOUNT* newpwd,
/* setup the USER index key */
slprintf(keystr, sizeof(keystr)-1, "%s%s", USERPREFIX, name);
key.dptr = keystr;
- key.dsize = strlen (keystr) + 1;
+ key.dsize = strlen(keystr) + 1;
/* add the account */
if (tdb_store(pwd_tdb, key, data, flag) != TDB_SUCCESS) {
@@ -806,7 +811,7 @@ static BOOL tdb_update_sam(struct pdb_methods *my_methods, SAM_ACCOUNT* newpwd,
}
/* setup RID data */
- data.dsize = sizeof(fstring);
+ data.dsize = strlen(name) + 1;
data.dptr = name;
/* setup the RID index key */