SEGV in acl_validate_spn_value: dnsHostName NULL
authorArvid Requate <requate@univention.de>
Fri, 2 Mar 2012 12:59:30 +0000 (13:59 +0100)
committerNadezhda Ivanova <nivanova@samba.org>
Fri, 2 Mar 2012 20:26:40 +0000 (21:26 +0100)
This patch addresses a segfault in acl_validate_spn_value which occurs
when the "dnsHostName" attribute is missing. This seems to be the case
in domains migrated with samba3upgrade. Looks similar to MS KB 817543.

Signed-off-by: Nadezhda Ivanova <nivanova@drizzit.(none)>
Autobuild-User: Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date: Fri Mar  2 21:26:40 CET 2012 on sn-devel-104

source4/dsdb/samdb/ldb_modules/acl.c

index abde85f..6aed682 100644 (file)
@@ -516,7 +516,7 @@ static int acl_validate_spn_value(TALLOC_CTX *mem_ctx,
        if (strlen(instanceName) == (strlen(samAccountName) - 1)
            && strncasecmp(instanceName, samAccountName, strlen(samAccountName) - 1) == 0) {
                goto success;
-       } else if (strcasecmp(instanceName, dnsHostName) == 0) {
+       } else if (dnsHostName != NULL && strcasecmp(instanceName, dnsHostName) == 0) {
                goto success;
        } else if (is_dc) {
                const char *guid_str;