s3:idmap_ldap: remove special handling of alloc secret (not used any more).
authorMichael Adam <obnox@samba.org>
Tue, 7 Dec 2010 23:32:53 +0000 (00:32 +0100)
committerMichael Adam <obnox@samba.org>
Sun, 2 Jan 2011 11:51:54 +0000 (12:51 +0100)
source3/winbindd/idmap_ldap.c

index 91c8f1e6be20fe165850f953b341d9fd56f74d0a..aea5d6acf5efb2acd4475d6bebd0c205b1169065 100644 (file)
 
 #include "smbldap.h"
 
-static char *idmap_fetch_secret(const char *backend, bool alloc,
+static char *idmap_fetch_secret(const char *backend,
                                const char *domain, const char *identity)
 {
        char *tmp, *ret;
        int r;
 
-       if (alloc) {
-               r = asprintf(&tmp, "IDMAP_ALLOC_%s", backend);
-       } else {
-               r = asprintf(&tmp, "IDMAP_%s_%s", backend, domain);
-       }
+       r = asprintf(&tmp, "IDMAP_%s_%s", backend, domain);
 
        if (r < 0)
                return NULL;
@@ -102,12 +98,13 @@ static NTSTATUS get_credentials( TALLOC_CTX *mem_ctx,
 
        if ( tmp ) {
                if (!dom) {
-                       /* only the alloc backend can pass in a NULL dom */
-                       secret = idmap_fetch_secret("ldap", True,
-                                                   NULL, tmp);
+                       DEBUG(0, ("get_credentials: Invalid domain 'NULL' "
+                                 "encountered for user DN %s\n",
+                                 tmp));
+                       ret = NT_STATUS_UNSUCCESSFUL;
+                       goto done;
                } else {
-                       secret = idmap_fetch_secret("ldap", False,
-                                                   dom->name, tmp);
+                       secret = idmap_fetch_secret("ldap", dom->name, tmp);
                }
 
                if (!secret) {