diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-12-17 22:05:49 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-12-17 22:05:49 -0500 |
commit | c52635fce35aa7d2e4414a44bac9fe06dfb56885 (patch) | |
tree | cb84f43d5e888ce429f30f6df5d45d8357af9bdf /parse.c | |
parent | fb7a61add741b28ae6c91787373bdb544b2e751b (diff) | |
download | bfs-c52635fce35aa7d2e4414a44bac9fe06dfb56885.tar.xz |
Implement -acl test
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -923,6 +923,22 @@ static struct expr *parse_access(struct parser_state *state, int flag, int arg2) } /** + * Parse -acl. + */ +static struct expr *parse_acl(struct parser_state *state, int flag, int arg2) { +#if BFS_HAS_SYS_ACL + struct expr *expr = parse_nullary_test(state, eval_acl); + if (expr) { + expr->cost = 2*STAT_COST; + } + return expr; +#else + cfprintf(state->cmdline->cerr, "%{er}error: %s is missing platform support.%{rs}\n", state->argv[0]); + return NULL; +#endif +} + +/** * Parse -[aBcm]?newer. */ static struct expr *parse_newer(struct parser_state *state, int field, int arg2) { @@ -2438,6 +2454,8 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) { cfprintf(cout, " %{cyn}-f%{rs} %{mag}PATH%{rs}\n"); cfprintf(cout, " Treat %{mag}PATH%{rs} as a path to search (useful if begins with a dash)\n\n"); + cfprintf(cout, " %{blu}-acl%{rs}\n"); + cfprintf(cout, " Find files with non-trivial Access Control Lists\n"); cfprintf(cout, " %{blu}-Bmin%{rs} %{bld}[-+]N%{rs}\n"); cfprintf(cout, " %{blu}-Btime%{rs} %{bld}[-+]N%{rs}\n"); cfprintf(cout, " Find files Birthed %{bld}N%{rs} minutes/days ago\n"); @@ -2538,6 +2556,7 @@ static const struct table_entry parse_table[] = { {"-L", false, parse_follow, BFTW_LOGICAL | BFTW_DETECT_CYCLES, false}, {"-X", false, parse_xargs_safe}, {"-a"}, + {"-acl", false, parse_acl}, {"-amin", false, parse_time, BFS_STAT_ATIME, MINUTES}, {"-and"}, {"-anewer", false, parse_newer, BFS_STAT_ATIME}, |