summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_tdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb/pdb_tdb.c')
-rw-r--r--source3/passdb/pdb_tdb.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index 3a1702a4e0..7e2f4b832f 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -585,10 +585,8 @@ static NTSTATUS tdbsam_getsampwnam (struct pdb_methods *my_methods, SAM_ACCOUNT
return nt_status;
}
-
/* Data is stored in all lower-case */
- fstrcpy(name, sname);
- strlower(name);
+ unix_strlower(sname, -1, name, sizeof(name));
/* set search key */
slprintf(keystr, sizeof(keystr)-1, "%s%s", USERPREFIX, name);
@@ -694,8 +692,7 @@ static NTSTATUS tdbsam_delete_sam_account(struct pdb_methods *my_methods, SAM_AC
uint32 rid;
fstring name;
- fstrcpy(name, pdb_get_username(sam_pass));
- strlower(name);
+ unix_strlower(pdb_get_username(sam_pass), -1, name, sizeof(name));
/* open the TDB */
if (!(pwd_tdb = tdb_open_log(tdb_state->tdbsam_location, 0, TDB_DEFAULT, O_RDWR, 0600))) {
@@ -829,8 +826,7 @@ static BOOL tdb_update_sam(struct pdb_methods *my_methods, SAM_ACCOUNT* newpwd,
}
data.dptr = buf;
- fstrcpy(name, pdb_get_username(newpwd));
- strlower(name);
+ unix_strlower(pdb_get_username(newpwd), -1, name, sizeof(name));
DEBUG(5, ("Storing %saccount %s with RID %d\n", flag == TDB_INSERT ? "(new) " : "", name, user_rid));