summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_tdb2.c
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2008-01-16 16:50:46 +0300
committerAlexander Bokovoy <ab@samba.org>2008-01-16 16:50:46 +0300
commit024741500abd30ac74adfdfa88694026792ba284 (patch)
treeb9752cd9a677258cee7b4da9c09556f7f371fbd5 /source3/winbindd/idmap_tdb2.c
parentb3f3eb1bc551b8bc9698257cf1b3abc7442dd41b (diff)
downloadsamba-024741500abd30ac74adfdfa88694026792ba284.tar.gz
samba-024741500abd30ac74adfdfa88694026792ba284.tar.bz2
samba-024741500abd30ac74adfdfa88694026792ba284.zip
Convert old sid-string handling in idmap_tdb2 to a new one
(This used to be commit ee851730cef1eb506b47faf57e25789ad3c6aafa)
Diffstat (limited to 'source3/winbindd/idmap_tdb2.c')
-rw-r--r--source3/winbindd/idmap_tdb2.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c
index fa106aa134..ab89e615f7 100644
--- a/source3/winbindd/idmap_tdb2.c
+++ b/source3/winbindd/idmap_tdb2.c
@@ -610,7 +610,7 @@ static NTSTATUS idmap_tdb2_id_to_sid(struct idmap_tdb2_context *ctx, struct id_m
goto done;
}
- if (sid_to_string(sidstr, map->sid)) {
+ if (sid_to_fstring(sidstr, map->sid)) {
/* both forward and reverse mappings */
tdb2_store_bystring(keystr,
string_term_tdb_data(sidstr),
@@ -648,7 +648,7 @@ static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_tdb2_context *ctx, struct id_m
char *keystr;
unsigned long rec_id = 0;
- if ((keystr = talloc_asprintf(ctx, "%s", sid_string_static(map->sid))) == NULL) {
+ if ((keystr = sid_string_talloc(ctx, map->sid)) == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
@@ -859,7 +859,7 @@ static NTSTATUS idmap_tdb2_set_mapping(struct idmap_domain *dom, const struct id
goto done;
}
- if (!(ksidstr = talloc_strdup(ctx, sid_string_static(map->sid)))) {
+ if (!(ksidstr = sid_string_talloc(ctx, map->sid))) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
@@ -1008,7 +1008,10 @@ NTSTATUS idmap_tdb2_init(void)
/* register both backends */
ret = smb_register_idmap_alloc(SMB_IDMAP_INTERFACE_VERSION, "tdb2", &db_alloc_methods);
- NT_STATUS_NOT_OK_RETURN(ret);
+ if (! NT_STATUS_IS_OK(ret)) {
+ DEBUG(0, ("Unable to register idmap alloc tdb2 module: %s\n", get_friendly_nt_error_msg(ret)));
+ return ret;
+ }
return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "tdb2", &db_methods);
}