From e59d5624d92809cb776854561a1aae373acc3512 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 9 Sep 2013 16:41:27 -0600 Subject: [PATCH] Make "this" and "next" qualifiers work a bit better. There is still room for improvement as "this week" will use the current time instead of the beginning of the week. That's a separate issue though. --- NEWS | 6 ++++++ plugins/sudoers/getdate.c | 4 ++-- plugins/sudoers/getdate.y | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 9c62f8352..4325360e0 100644 --- a/NEWS +++ b/NEWS @@ -66,6 +66,12 @@ What's new in Sudo 1.8.8? to the I/O log timing file are two greater than they should be. Sudoreplay now contains a work-around to parse those files. + * In sudoreplay's list mode, the "this" and "next" qualifiers in + "fromdate" or "todate" expressions now behave more sensibly. + Previously, they would often match a date that was "one more" + than expected. For example "this week" now matches the current + week and not the following week. + What's new in Sudo 1.8.7? * The non-Unix group plugin is now supported when sudoers data diff --git a/plugins/sudoers/getdate.c b/plugins/sudoers/getdate.c index 16abf3a96..daa1f708e 100644 --- a/plugins/sudoers/getdate.c +++ b/plugins/sudoers/getdate.c @@ -443,8 +443,8 @@ static TABLE const OtherTable[] = { { "today", tMINUTE_UNIT, 0 }, { "now", tMINUTE_UNIT, 0 }, { "last", tUNUMBER, -1 }, - { "this", tMINUTE_UNIT, 0 }, - { "next", tUNUMBER, 2 }, + { "this", tUNUMBER, 0 }, + { "next", tUNUMBER, 1 }, { "first", tUNUMBER, 1 }, /* { "second", tUNUMBER, 2 }, */ { "third", tUNUMBER, 3 }, diff --git a/plugins/sudoers/getdate.y b/plugins/sudoers/getdate.y index bd411a0ad..2639c971c 100644 --- a/plugins/sudoers/getdate.y +++ b/plugins/sudoers/getdate.y @@ -375,8 +375,8 @@ static TABLE const OtherTable[] = { { "today", tMINUTE_UNIT, 0 }, { "now", tMINUTE_UNIT, 0 }, { "last", tUNUMBER, -1 }, - { "this", tMINUTE_UNIT, 0 }, - { "next", tUNUMBER, 2 }, + { "this", tUNUMBER, 0 }, + { "next", tUNUMBER, 1 }, { "first", tUNUMBER, 1 }, /* { "second", tUNUMBER, 2 }, */ { "third", tUNUMBER, 3 }, -- 2.40.0