summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-02-01 17:46:06 -0500
committerTavian Barnes <tavianator@tavianator.com>2016-02-02 10:43:41 -0500
commit70fadadf1fc7e1bd09c3d0f451614a678277409c (patch)
tree92ffc1ae7b3ce13a93b6a85330b0615c52484786 /eval.c
parentb997ddf3df6535765f7eab0683eae4703933a703 (diff)
downloadbfs-70fadadf1fc7e1bd09c3d0f451614a678277409c.tar.xz
Add -gid and -uid support.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 243546e..b042339 100644
--- a/eval.c
+++ b/eval.c
@@ -179,6 +179,30 @@ bool eval_mtime(const expression *expr, eval_state *state) {
}
/**
+ * -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.
*/
bool eval_delete(const expression *expr, eval_state *state) {