View | Details | Raw Unified | Return to bug 34326 | Differences between
and this patch

Collapse All | Expand All

(-)a/samba-4.1.0/dfs_server/dfs_server_ad.c.orig (+19 lines)
 Lines 38-43    Link Here 
38
	uint32_t count;
38
	uint32_t count;
39
};
39
};
40
40
41
static void shuffle_dc_set(struct dc_set *list)
42
{
43
	uint32_t i;
44
45
	srandom(time(NULL));
46
47
	for (i = list->count; i > 1; i--) {
48
		uint32_t r;
49
		const char *tmp;
50
51
		r = random() % i;
52
53
		tmp = list->names[i - 1];
54
		list->names[i - 1] = list->names[r];
55
		list->names[r] = tmp;
56
	}
57
}
58
41
/*
59
/*
42
  fill a referral type structure
60
  fill a referral type structure
43
 */
61
 */
 Lines 252-257    Link Here 
252
		list->count++;
270
		list->count++;
253
		talloc_free(r2);
271
		talloc_free(r2);
254
	}
272
	}
273
	shuffle_dc_set(list);
255
274
256
	talloc_free(r);
275
	talloc_free(r);
257
	return NT_STATUS_OK;
276
	return NT_STATUS_OK;

Return to bug 34326