libselinux: getsebool: support boolean name substitution
Use selinux_boolean_sub to translate the boolean name handed in by the user. Report back the correct name of the boolean. Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
88c3524153
commit
bac96c8c70
|
@ -87,14 +87,22 @@ int main(int argc, char **argv)
|
|||
rc = -1;
|
||||
goto out;
|
||||
}
|
||||
char *alt_name = selinux_boolean_sub(names[i]);
|
||||
if (! alt_name) {
|
||||
perror("Out of memory\n");
|
||||
rc = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (pending != active) {
|
||||
printf("%s --> %s pending: %s\n", names[i],
|
||||
printf("%s --> %s pending: %s\n", alt_name,
|
||||
(active ? "on" : "off"),
|
||||
(pending ? "on" : "off"));
|
||||
} else {
|
||||
printf("%s --> %s\n", names[i],
|
||||
printf("%s --> %s\n", alt_name,
|
||||
(active ? "on" : "off"));
|
||||
}
|
||||
free(alt_name);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
Loading…
Reference in New Issue