diff options
-rw-r--r-- | eval.c | 22 | ||||
-rw-r--r-- | parse.c | 2 |
2 files changed, 22 insertions, 2 deletions
@@ -369,7 +369,16 @@ bool eval_nogroup(const struct expr *expr, struct eval_state *state) { return false; } - return getgrgid(statbuf->gid) == NULL; + errno = 0; + if (getgrgid(statbuf->gid) == NULL) { + if (errno == 0) { + return true; + } else { + eval_report_error(state); + } + } + + return false; } /** @@ -381,7 +390,16 @@ bool eval_nouser(const struct expr *expr, struct eval_state *state) { return false; } - return getpwuid(statbuf->uid) == NULL; + errno = 0; + if (getpwuid(statbuf->uid) == NULL) { + if (errno == 0) { + return true; + } else { + eval_report_error(state); + } + } + + return false; } /** @@ -1658,6 +1658,7 @@ static struct expr *parse_nogroup(struct parser_state *state, int arg1, int arg2 struct expr *expr = parse_nullary_test(state, eval_nogroup); if (expr) { expr->cost = 9000.0; + expr->ephemeral_fds = 1; } return expr; } @@ -1688,6 +1689,7 @@ static struct expr *parse_nouser(struct parser_state *state, int arg1, int arg2) struct expr *expr = parse_nullary_test(state, eval_nouser); if (expr) { expr->cost = 9000.0; + expr->ephemeral_fds = 1; } return expr; } |