diff options
author | Timo Teräs <timo.teras@iki.fi> | 2011-09-01 15:13:24 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2011-09-01 15:14:27 +0300 |
commit | eafaf02a07ea8436d195805bba57a25dc6b9e26b (patch) | |
tree | df3acec78429955708c6c4495eaeeddf6a999520 /src/squark-filter.c | |
parent | 604378a88fc348718b01e5ce8a3a77cf976a7065 (diff) | |
download | squark-eafaf02a07ea8436d195805bba57a25dc6b9e26b.tar.bz2 squark-eafaf02a07ea8436d195805bba57a25dc6b9e26b.tar.xz |
filter: option to allow automatic anonymous login
so no captive portal, snmp or squid authentication is required.
fixes #737.
Diffstat (limited to 'src/squark-filter.c')
-rw-r--r-- | src/squark-filter.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/squark-filter.c b/src/squark-filter.c index ac99a67..a5d4013 100644 --- a/src/squark-filter.c +++ b/src/squark-filter.c @@ -405,7 +405,8 @@ static void read_input(struct sqdb *db) if (authdb_check_login(token, &entry, username, now, &adbc)) { auth_ok = 1; username = BLOB_STRLEN(entry.p.login_name); - } else if (!blob_is_null(username) && blob_cmp(username, dash) != 0) { + } else if ((!adbc.require_auth) || + (!blob_is_null(username) && blob_cmp(username, dash) != 0)) { auth_ok = 1; authdb_clear_entry(&entry); memcpy(entry.p.login_name, username.ptr, username.len); @@ -436,7 +437,15 @@ static void read_input(struct sqdb *db) int main(int argc, char **argv) { - int rc = 1; + int rc = 1, opt; + + while ((opt = getopt(argc, argv, "V")) != -1) { + switch (opt) { + case 'V': + fprintf(stderr, "squark-filter %s\n", squark_version); + return 0; + } + } if (sqdb_open(&db, squark_dbname) < 0) { fprintf(stderr, "%s: failed to open squarkdb\n", |