summaryrefslogtreecommitdiff
path: root/source3/nsswitch/idmap.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-02-06 17:29:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:46 -0500
commite7d2f462297087d785e6b16d018540f3a7110d24 (patch)
tree767b5084d86c16bba783c68029355e8832992a1d /source3/nsswitch/idmap.c
parent6ab97dc69dab505699ef44d43a19fa7835e28751 (diff)
downloadsamba-e7d2f462297087d785e6b16d018540f3a7110d24.tar.gz
samba-e7d2f462297087d785e6b16d018540f3a7110d24.tar.bz2
samba-e7d2f462297087d785e6b16d018540f3a7110d24.zip
r21182: * Refactor the code to obtain the LDAP connection credentials
from both idmap_ldap_{alloc,db}_init() * Fix the backwards compat support in idmap_ldap.c * Fix a spelling error in the idmap_fetch_secret() function name (This used to be commit 615a10435618abb89852910a0d36c1d9ff35647f)
Diffstat (limited to 'source3/nsswitch/idmap.c')
-rw-r--r--source3/nsswitch/idmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/nsswitch/idmap.c b/source3/nsswitch/idmap.c
index 4652980807..6de2187e5f 100644
--- a/source3/nsswitch/idmap.c
+++ b/source3/nsswitch/idmap.c
@@ -1283,8 +1283,8 @@ void idmap_dump_maps(char *logfile)
fclose(dump);
}
-const char *idmap_fecth_secret(const char *backend, bool alloc,
- const char *domain, const char *identity)
+char *idmap_fetch_secret(const char *backend, bool alloc,
+ const char *domain, const char *identity)
{
char *tmp, *ret;
int r;
@@ -1295,11 +1295,13 @@ const char *idmap_fecth_secret(const char *backend, bool alloc,
r = asprintf(&tmp, "IDMAP_%s_%s", backend, domain);
}
- if (r < 0) return NULL;
+ if (r < 0)
+ return NULL;
strupper_m(tmp); /* make sure the key is case insensitive */
ret = secrets_fetch_generic(tmp, identity);
- free(tmp);
+ SAFE_FREE( tmp );
+
return ret;
}