seem that someone changed the semanthic of unix_strlower without fixing all
authorSimo Sorce <idra@samba.org>
Thu, 17 Apr 2003 14:25:52 +0000 (14:25 +0000)
committerSimo Sorce <idra@samba.org>
Thu, 17 Apr 2003 14:25:52 +0000 (14:25 +0000)
places where it was used, this caused me segfaults in the last week :(

add more debugging in idmap to chase down a problem

source/passdb/pdb_tdb.c
source/sam/gumm_tdb.c
source/sam/idmap_tdb.c

index 7e2f4b832f4a6765b31ca2f332530c6786c7b4e9..3a1702a4e07bbc49ddb24a97c3fbdf3e932f02f0 100644 (file)
@@ -585,8 +585,10 @@ static NTSTATUS tdbsam_getsampwnam (struct pdb_methods *my_methods, SAM_ACCOUNT
                return nt_status;
        }
 
+       
        /* Data is stored in all lower-case */
-       unix_strlower(sname, -1, name, sizeof(name));
+       fstrcpy(name, sname);
+       strlower(name);
 
        /* set search key */
        slprintf(keystr, sizeof(keystr)-1, "%s%s", USERPREFIX, name);
@@ -692,7 +694,8 @@ static NTSTATUS tdbsam_delete_sam_account(struct pdb_methods *my_methods, SAM_AC
        uint32          rid;
        fstring         name;
        
-       unix_strlower(pdb_get_username(sam_pass), -1, name, sizeof(name));
+       fstrcpy(name, pdb_get_username(sam_pass));
+       strlower(name);
        
        /* open the TDB */
        if (!(pwd_tdb = tdb_open_log(tdb_state->tdbsam_location, 0, TDB_DEFAULT, O_RDWR, 0600))) {
@@ -826,7 +829,8 @@ static BOOL tdb_update_sam(struct pdb_methods *my_methods, SAM_ACCOUNT* newpwd,
        }
        data.dptr = buf;
 
-       unix_strlower(pdb_get_username(newpwd), -1, name, sizeof(name));
+       fstrcpy(name, pdb_get_username(newpwd));
+       strlower(name);
        
        DEBUG(5, ("Storing %saccount %s with RID %d\n", flag == TDB_INSERT ? "(new) " : "", name, user_rid));
 
index 5e390490cf07fc9034926c42b76b139f127af9f5..5da2407faac4253b7b69ecef7f13bf82fb467a0b 100644 (file)
@@ -264,7 +264,8 @@ static NTSTATUS get_object_by_name(TALLOC_CTX *mem_ctx, struct tdbsam2_object *o
                return ret;
        }
 
-       unix_strlower(name, -1, objname, sizeof(objname));
+       fstrcpy(objname, name);
+       strlower(objname);
 
        slprintf(keystr, sizeof(keystr)-1, "%s%s", NAMEPREFIX, objname);
        key.dptr = keystr;
@@ -603,7 +604,8 @@ static NTSTATUS tdbsam2_get_domain_sid(DOM_SID *sid, const char* name)
                goto done;
        }
 
-       unix_strlower(name, -1, domname, sizeof(domname));
+       fstrcpy(domname, name);
+       strlower(domname);
 
        ret = get_object_by_name(mem_ctx, &obj, domname);
 
@@ -650,7 +652,8 @@ static NTSTATUS tdbsam2_set_domain_sid (const DOM_SID *sid, const char *name)
                }
        }
 
-       unix_strlower(name, -1, domname, sizeof(domname));
+       fstrcpy(domname, name);
+       strlower(domname);
 
 /* TODO: we need to lock this entry until updated! */
 
index 7080ac56e6cb9004acdd01cf35ffc64dbbe1c750..c494cf595faafef10d1b122875ad397b29302d5d 100644 (file)
@@ -236,11 +236,11 @@ static NTSTATUS db_set_mapping(DOM_SID *sid, unid_t id, int id_type)
        kid.dsize = strlen(kidstr) + 1;
 
        if (tdb_store(idmap_tdb, ksid, kid, TDB_INSERT) == -1) {
-               DEBUG(0, ("idb_set_mapping: tdb_store 1 error: %s", tdb_errorstr(idmap_tdb)));
+               DEBUG(0, ("idb_set_mapping: tdb_store 1 error: %s\n", tdb_errorstr(idmap_tdb)));
                return NT_STATUS_UNSUCCESSFUL;
        }
        if (tdb_store(idmap_tdb, kid, ksid, TDB_INSERT) == -1) {
-               DEBUG(0, ("idb_set_mapping: tdb_store 2 error: %s", tdb_errorstr(idmap_tdb)));
+               DEBUG(0, ("idb_set_mapping: tdb_store 2 error: %s\n", tdb_errorstr(idmap_tdb)));
                return NT_STATUS_UNSUCCESSFUL;
        }
        return NT_STATUS_OK;