Fix policy validation bug (parse_policy() should return success when the policy name is OK!)
This commit is contained in:
@@ -166,6 +166,7 @@ parse_policy (const char *resp, char **policy, int *mask, int bit)
|
|||||||
}
|
}
|
||||||
if (mask)
|
if (mask)
|
||||||
*mask |= bit;
|
*mask |= bit;
|
||||||
|
return 0;
|
||||||
} else if(*resp == '?') {
|
} else if(*resp == '?') {
|
||||||
print_flags_table (kdb_attrs, stderr);
|
print_flags_table (kdb_attrs, stderr);
|
||||||
} else {
|
} else {
|
||||||
@@ -197,6 +198,8 @@ edit_policy (const char *prompt, char **policy, int *mask, int bit)
|
|||||||
if (parse_policy (resp, policy, mask, bit) == 0)
|
if (parse_policy (resp, policy, mask, bit) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (*policy)
|
||||||
|
strlcpy(buf, *policy, sizeof (buf));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user