summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index de57b9f..e05aff1 100644
--- a/eval.c
+++ b/eval.c
@@ -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;
}
/**