s4:kdc Fix netbios name retrieval
authorSimo Sorce <idra@samba.org>
Sun, 31 Jan 2010 17:53:50 +0000 (12:53 -0500)
committerSimo Sorce <idra@samba.org>
Sun, 31 Jan 2010 18:25:17 +0000 (13:25 -0500)
The code was looping but always checking only the first address.

source4/kdc/wdc-samba4.c

index a58d0c2d661eb187dfbfd8281cd1551771b58c97..6be0de718e0a6aff60183fc5aa8b8a851e6e2d81 100644 (file)
@@ -131,8 +131,8 @@ static krb5_error_code samba_wdc_check_client_access(void *priv,
 
        if (addresses) {
                for (i=0; i < addresses->len; i++) {
 
        if (addresses) {
                for (i=0; i < addresses->len; i++) {
-                       if (addresses->val->addr_type == KRB5_ADDRESS_NETBIOS) {
-                               workstation = talloc_strndup(tmp_ctx, addresses->val->address.data, MIN(addresses->val->address.length, 15));
+                       if (addresses->val[i].addr_type == KRB5_ADDRESS_NETBIOS) {
+                               workstation = talloc_strndup(tmp_ctx, addresses->val[i].address.data, MIN(addresses->val[i].address.length, 15));
                                if (workstation) {
                                        break;
                                }
                                if (workstation) {
                                        break;
                                }