From a675b09e8d45b9298df8f8c82bbaa7b91a793eb5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Sep 2004 05:42:02 +0000 Subject: r2709: finally solved the talloc reference problem. The problem was that the simple "uint_t ref_count;" in a talloc chunk did not give enough information. It told us that a pointer was referenced more than once, but it didn't say who it was referenced by. This means that when the pointer was freed we had no sane way to clean up the reference. I have now replaced ref_count with a "refs" list, which means that references point to the pointer, and the pointer has a linked list of references. So now we can cleanup from either direction without losing track of anything. I've also added a LOCAL-TALLOC smbtorture test that tests talloc behaviour for some common uses. (This used to be commit 911a8d590cb184bcb892810729955c2c4cf02550) --- source4/torture/torture.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source4/torture/torture.c') diff --git a/source4/torture/torture.c b/source4/torture/torture.c index 5db861124b..c6af807357 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -94,10 +94,10 @@ BOOL torture_open_connection_share(struct smbcli_state **c, flags |= SMBCLI_FULL_CONNECTION_USE_KERBEROS; status = smbcli_full_connection(c, lp_netbios_name(), - hostname, NULL, - sharename, "?????", - username, username[0]?userdomain:"", - password, flags, &retry); + hostname, NULL, + sharename, "?????", + username, username[0]?userdomain:"", + password, flags, &retry); if (!NT_STATUS_IS_OK(status)) { printf("Failed to open connection - %s\n", nt_errstr(status)); return False; @@ -858,10 +858,10 @@ static BOOL run_tcon_devtype_test(int dummy) const char *password = lp_parm_string(-1, "torture", "password"); status = smbcli_full_connection(&cli1, lp_netbios_name(), - host, NULL, - share, "?????", - username, userdomain, - password, flags, &retry); + host, NULL, + share, "?????", + username, userdomain, + password, flags, &retry); if (!NT_STATUS_IS_OK(status)) { printf("could not open connection\n"); @@ -4247,6 +4247,7 @@ static struct { /* local (no server) testers */ {"LOCAL-NTLMSSP", torture_ntlmssp_self_check, 0}, {"LOCAL-ICONV", torture_local_iconv, 0}, + {"LOCAL-TALLOC", torture_local_talloc, 0}, /* ldap testers */ {"LDAP-BASIC", torture_ldap_basic, 0}, -- cgit