summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_tdb.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-15 22:00:39 +0100
committerVolker Lendecke <vl@samba.org>2007-12-15 22:09:37 +0100
commit14ef4cdec1ab6be55c97d0f32780cbddbcdde218 (patch)
treee7cb94297496f758a7935aaec62c7dd772e96f3a /source3/winbindd/idmap_tdb.c
parentd899b8c56ad6556baf2d2374704cc8cd1b15d5ad (diff)
downloadsamba-14ef4cdec1ab6be55c97d0f32780cbddbcdde218.tar.gz
samba-14ef4cdec1ab6be55c97d0f32780cbddbcdde218.tar.bz2
samba-14ef4cdec1ab6be55c97d0f32780cbddbcdde218.zip
Replace sid_string_static with sid_to_string
This adds 28 fstrings on the stack, but I think an fstring on the stack is still far better than a static one. (This used to be commit c7c885078be8fd3024c186044ac28275d7609679)
Diffstat (limited to 'source3/winbindd/idmap_tdb.c')
-rw-r--r--source3/winbindd/idmap_tdb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index 1ec7085a3b..d693c357f7 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -712,8 +712,10 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_tdb_context *ctx, struct id_map
TDB_DATA data;
char *keystr;
unsigned long rec_id = 0;
+ fstring tmp;
- if ((keystr = talloc_asprintf(ctx, "%s", sid_string_static(map->sid))) == NULL) {
+ if ((keystr = talloc_asprintf(ctx, "%s",
+ sid_to_string(tmp, map->sid))) == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
@@ -864,6 +866,7 @@ static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom, const struct id_
NTSTATUS ret;
TDB_DATA ksid, kid, data;
char *ksidstr, *kidstr;
+ fstring tmp;
/* make sure we initialized */
if ( ! dom->initialized) {
@@ -905,7 +908,8 @@ static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom, const struct id_
goto done;
}
- if ((ksidstr = talloc_asprintf(ctx, "%s", sid_string_static(map->sid))) == NULL) {
+ if ((ksidstr = talloc_asprintf(
+ ctx, "%s", sid_to_string(tmp, map->sid))) == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
@@ -977,6 +981,7 @@ static NTSTATUS idmap_tdb_remove_mapping(struct idmap_domain *dom, const struct
NTSTATUS ret;
TDB_DATA ksid, kid, data;
char *ksidstr, *kidstr;
+ fstring tmp;
/* make sure we initialized */
if ( ! dom->initialized) {
@@ -1018,7 +1023,8 @@ static NTSTATUS idmap_tdb_remove_mapping(struct idmap_domain *dom, const struct
goto done;
}
- if ((ksidstr = talloc_asprintf(ctx, "%s", sid_string_static(map->sid))) == NULL) {
+ if ((ksidstr = talloc_asprintf(
+ ctx, "%s", sid_to_string(tmp, map->sid))) == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;