Fix policy validation bug (parse_policy() should return success when the policy name is OK!)

This commit is contained in:
Nicolas Williams
2011-07-18 22:51:33 -05:00
parent a35ea4955a
commit fad463bbd9

View File

@@ -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;
} }