1 Index: squid/src/external_acl.c
2 diff -c squid/src/external_acl.c:1.1.2.23 squid/src/external_acl.c:1.1.2.25
3 *** squid/src/external_acl.c:1.1.2.23 Sat May 10 16:17:44 2003
4 --- squid/src/external_acl.c Sat May 17 12:35:25 2003
7 aclMatchExternal(void *data, aclCheck_t * ch)
10 ! external_acl_entry *entry;
11 external_acl_data *acl = data;
13 debug(82, 9) ("aclMatchExternal: acl=\"%s\"\n", acl->def->name);
14 ! entry = ch->extacl_entry;
16 ! if (cbdataValid(entry) && entry->def == acl->def &&
17 ! strcmp(entry->hash.key, key) == 0) {
18 ! /* Ours, use it.. */
20 ! /* Not valid, or not ours.. get rid of it */
21 cbdataUnlock(ch->extacl_entry);
22 ch->extacl_entry = NULL;
27 - if (acl->def->require_auth) {
29 - /* Make sure the user is authenticated */
30 - if ((ti = aclAuthenticated(ch)) != 1) {
31 - debug(82, 2) ("aclMatchExternal: %s user not authenticated (%d)\n", acl->def->name, ti);
35 - key = makeExternalAclKey(ch, acl);
36 entry = hash_lookup(acl->def->cache, key);
37 if (entry && external_acl_entry_expired(acl->def, entry)) {
38 /* Expired entry, ignore */
39 debug(82, 2) ("external_acl_cache_lookup: '%s' = expired\n", key);
42 - ch->auth_user_request = NULL;
44 if (!entry || entry->result == -1) {
45 debug(82, 2) ("aclMatchExternal: %s(\"%s\") = lookup needed\n", acl->def->name, key);
47 aclMatchExternal(void *data, aclCheck_t * ch)
50 ! external_acl_entry *entry = NULL;
51 external_acl_data *acl = data;
53 debug(82, 9) ("aclMatchExternal: acl=\"%s\"\n", acl->def->name);
54 ! if (ch->extacl_entry) {
55 ! entry = ch->extacl_entry;
56 ! if (!cbdataValid(entry))
58 ! cbdataUnlock(ch->extacl_entry);
59 ! ch->extacl_entry = NULL;
61 ! if (acl->def->require_auth) {
63 ! /* Make sure the user is authenticated */
64 ! if ((ti = aclAuthenticated(ch)) != 1) {
65 ! debug(82, 2) ("aclMatchExternal: %s user not authenticated (%d)\n", acl->def->name, ti);
69 ! key = makeExternalAclKey(ch, acl);
70 ! ch->auth_user_request = NULL;
72 ! if (entry->def != acl->def || strcmp(entry->hash.key, key) != 0) {
73 ! /* Not ours.. get rid of it */
74 cbdataUnlock(ch->extacl_entry);
75 ch->extacl_entry = NULL;
80 entry = hash_lookup(acl->def->cache, key);
81 if (entry && external_acl_entry_expired(acl->def, entry)) {
82 /* Expired entry, ignore */
83 debug(82, 2) ("external_acl_cache_lookup: '%s' = expired\n", key);
87 if (!entry || entry->result == -1) {
88 debug(82, 2) ("aclMatchExternal: %s(\"%s\") = lookup needed\n", acl->def->name, key);