diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-09-07 15:21:25 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2010-09-07 15:21:25 +0300 |
commit | df7ffbb0628ec129af4f11353d7a51afd1f4052c (patch) | |
tree | eb48bf00f6286090e0f5dbf2afc6d48372879d60 | |
parent | b9290a29fae3b229372fc444a8d3f4631b62a57d (diff) | |
download | squark-df7ffbb0628ec129af4f11353d7a51afd1f4052c.tar.bz2 squark-df7ffbb0628ec129af4f11353d7a51afd1f4052c.tar.xz |
filter: do not do auto-login, fix url parsing without hostname
do not have filter process to do auto login. this is required since
squid might have stale login info in cache, and we should not honor it.
need to fix auth-snmp to record logins in authdb too (should do that
anyway to store the additional snmp information in authdb).
-rw-r--r-- | squark-filter.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/squark-filter.c b/squark-filter.c index 78728de..ce2d183 100644 --- a/squark-filter.c +++ b/squark-filter.c @@ -138,6 +138,8 @@ static int url_parse(blob_t uri, struct url_info *nfo) nfo->num_dots = cur.num_dots; nfo->is_ipv4 = cur.numeric && cur.num_dots == 3; } + if (blob_is_null(nfo->host)) + nfo->host = BLOB_STR("localhost"); break; } } while (blob_is_null(nfo->host) && !blob_is_null(uri)); @@ -407,13 +409,6 @@ static void read_input(struct sqdb *db) if (authdb_check_login(token, &entry, username, now)) { auth_ok = 1; username = BLOB_STRLEN(entry.p.login_name); - } else if (blob_cmp(username, dash) != 0 || - blob_is_null(redirect_login_page)) { - auth_ok = 1; - authdb_clear_entry(&entry); - entry.p.block_categories = banned_categories; - memcpy(entry.p.login_name, username.ptr, username.len); - authdb_commit_login(token, &entry, now); } else { auth_ok = 0; } |