------------------------------------------------------------ revno: 13050 revision-id: squid3@treenet.co.nz-20131206121819-462aw0u9mddfygac parent: squid3@treenet.co.nz-20131206121622-dpuipsixoqgr5h2s author: Alex Rousskov committer: Amos Jeffries branch nick: 3.4 timestamp: Fri 2013-12-06 05:18:19 -0700 message: Destroy ACLs in the reverse order of creation to avoid destruction segfaults during reconfiguration. Group ACLs created later may use other ACLs created earlier. A group ACL must be deleted first so that its AclDeleter can safely access registration status (and avoid double deletion) of the ACLs it uses. Since ACLs are remembered (in Config.aclList) using a singly-linked list, it is difficult to change their deletion order. Instead, we change their listing order from FIFO to LIFO. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20131206121819-462aw0u9mddfygac # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # testament_sha1: 3fddbde0719b617a619a92da8f713d00d7c9b031 # timestamp: 2013-12-06 12:23:15 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # base_revision_id: squid3@treenet.co.nz-20131206121622-\ # dpuipsixoqgr5h2s # # Begin patch === modified file 'src/acl/Acl.cc' --- src/acl/Acl.cc 2013-09-28 15:38:33 +0000 +++ src/acl/Acl.cc 2013-12-06 12:18:19 +0000 @@ -298,13 +298,11 @@ A->cfgline); } - /* append */ + // prepend so that ACLs declared later (and possibly using earlier ACLs) + // are destroyed earlier (before the ACLs they use are destroyed) assert(head && *head == Config.aclList); A->registered = true; - - while (*head) - head = &(*head)->next; - + A->next = *head; *head = A; }