MINOR: acl/pattern: use types different from int to clarify who does what.
We now have the following enums and all related functions return them and
consume them :
enum pat_match_res {
PAT_NOMATCH = 0, /* sample didn't match any pattern */
PAT_MATCH = 3, /* sample matched at least one pattern */
};
enum acl_test_res {
ACL_TEST_FAIL = 0, /* test failed */
ACL_TEST_MISS = 1, /* test may pass with more info */
ACL_TEST_PASS = 3, /* test passed */
};
enum acl_cond_pol {
ACL_COND_NONE, /* no polarity set yet */
ACL_COND_IF, /* positive condition (after 'if') */
ACL_COND_UNLESS, /* negative condition (after 'unless') */
};
It's just in order to avoid doubts when reading some code.
diff --git a/include/proto/auth.h b/include/proto/auth.h
index ddaf9c1..711b2f8 100644
--- a/include/proto/auth.h
+++ b/include/proto/auth.h
@@ -21,7 +21,7 @@
struct userlist *auth_find_userlist(char *name);
unsigned int auth_resolve_groups(struct userlist *l, char *groups);
void userlist_free(struct userlist *ul);
-int pat_match_auth(struct sample *smp, struct pattern *pattern);
+enum pat_match_res pat_match_auth(struct sample *smp, struct pattern *pattern);
int check_user(struct userlist *ul, unsigned int group_mask, const char *user, const char *pass);
#endif /* _PROTO_AUTH_H */