summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-02-22 09:44:19 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2016-03-12 21:19:06 +0100
commit047c62c251b33f4758c9944748f92d4511158a7e (patch)
treee26826f0c284e5adaca218a62a6fd88a19c9e159
parent6748a4c9d75db997c724c1dcea541e0047742f52 (diff)
downloadsssd-047c62c251b33f4758c9944748f92d4511158a7e.tar.gz
sssd-047c62c251b33f4758c9944748f92d4511158a7e.tar.xz
sssd-047c62c251b33f4758c9944748f92d4511158a7e.zip
libipa_hbac: Do not use C99
libipa_hbac can be used by external consumers like pam_hbac who run on old platforms that do not support C99. Refrain from using C99 features in that codebase. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
-rw-r--r--src/providers/ipa/hbac_evaluator.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/providers/ipa/hbac_evaluator.c b/src/providers/ipa/hbac_evaluator.c
index f4b76d8e6..36376abb4 100644
--- a/src/providers/ipa/hbac_evaluator.c
+++ b/src/providers/ipa/hbac_evaluator.c
@@ -146,6 +146,8 @@ enum hbac_eval_result hbac_evaluate(struct hbac_rule **rules,
struct hbac_eval_req *hbac_req,
struct hbac_info **info)
{
+ uint32_t i;
+
enum hbac_error_code ret;
enum hbac_eval_result result = HBAC_EVAL_DENY;
enum hbac_eval_result_int intermediate_result;
@@ -163,7 +165,7 @@ enum hbac_eval_result hbac_evaluate(struct hbac_rule **rules,
(*info)->rule_name = NULL;
}
- for (uint32_t i = 0; rules[i]; i++) {
+ for (i = 0; rules[i]; i++) {
hbac_rule_debug_print(rules[i]);
intermediate_result = hbac_evaluate_rule(rules[i], hbac_req, &ret);
if (intermediate_result == HBAC_EVAL_UNMATCHED) {
@@ -381,6 +383,8 @@ const char *hbac_error_string(enum hbac_error_code code)
static void hbac_request_element_debug_print(struct hbac_request_element *el,
const char *label)
{
+ int i;
+
if (el) {
if (el->name) {
HBAC_DEBUG(HBAC_DBG_TRACE, "\t\t%s [%s]\n", label, el->name);
@@ -389,7 +393,7 @@ static void hbac_request_element_debug_print(struct hbac_request_element *el,
if (el->groups) {
if (el->groups[0]) {
HBAC_DEBUG(HBAC_DBG_TRACE, "\t\t%s_group:\n", label);
- for (int i = 0; el->groups[i]; i++) {
+ for (i = 0; el->groups[i]; i++) {
HBAC_DEBUG(HBAC_DBG_TRACE, "\t\t\t[%s]\n", el->groups[i]);
}
} else {
@@ -434,6 +438,8 @@ static void hbac_req_debug_print(struct hbac_eval_req *req)
static void hbac_rule_element_debug_print(struct hbac_rule_element *el,
const char *label)
{
+ int i;
+
if (el) {
HBAC_DEBUG(HBAC_DBG_TRACE, "\t\tcategory [%#x] [%s]\n", el->category,
(el->category == HBAC_CATEGORY_ALL) ? "ALL" : "NONE");
@@ -441,7 +447,7 @@ static void hbac_rule_element_debug_print(struct hbac_rule_element *el,
if (el->names) {
if (el->names[0]) {
HBAC_DEBUG(HBAC_DBG_TRACE, "\t\t%s_names:\n", label);
- for (int i = 0; el->names[i]; i++) {
+ for (i = 0; el->names[i]; i++) {
HBAC_DEBUG(HBAC_DBG_TRACE, "\t\t\t[%s]\n", el->names[i]);
}
} else {
@@ -452,7 +458,7 @@ static void hbac_rule_element_debug_print(struct hbac_rule_element *el,
if (el->groups) {
if (el->groups[0]) {
HBAC_DEBUG(HBAC_DBG_TRACE, "\t\t%s_groups:\n", label);
- for (int i = 0; el->groups[i]; i++) {
+ for (i = 0; el->groups[i]; i++) {
HBAC_DEBUG(HBAC_DBG_TRACE, "\t\t\t[%s]\n", el->groups[i]);
}
} else {