From 70fadadf1fc7e1bd09c3d0f451614a678277409c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 1 Feb 2016 17:46:06 -0500 Subject: Add -gid and -uid support. --- eval.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 243546e..b042339 100644 --- a/eval.c +++ b/eval.c @@ -178,6 +178,30 @@ bool eval_mtime(const expression *expr, eval_state *state) { return do_cmp(expr, to_days(diff)); } +/** + * -gid test. + */ +bool eval_gid(const expression *expr, eval_state *state) { + const struct stat *statbuf = fill_statbuf(state); + if (!statbuf) { + return false; + } + + return do_cmp(expr, statbuf->st_gid); +} + +/** + * -uid test. + */ +bool eval_uid(const expression *expr, eval_state *state) { + const struct stat *statbuf = fill_statbuf(state); + if (!statbuf) { + return false; + } + + return do_cmp(expr, statbuf->st_uid); +} + /** * -delete action. */ -- cgit v1.2.3