summaryrefslogtreecommitdiffstats
path: root/src/squark-filter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/squark-filter.c')
-rw-r--r--src/squark-filter.c13
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",