diff mbox

[2/2] sestatus: show checkreqprot status

Message ID CAJ2a_DeiDjzz=CK_MuWB+zSvw7SGOiu_U9N-_LXYvBj3hQtdrw@mail.gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Christian Göttsche April 12, 2017, 1:42 p.m. UTC
Show the current active checkreqprot state in sestatus

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 policycoreutils/sestatus/sestatus.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox

Patch

diff --git a/policycoreutils/sestatus/sestatus.c
b/policycoreutils/sestatus/sestatus.c
index 2111b15d..f9ed5b66 100644
--- a/policycoreutils/sestatus/sestatus.c
+++ b/policycoreutils/sestatus/sestatus.c
@@ -330,6 +330,20 @@  int main(int argc, char **argv)
  break;
  }

+ printf_tab("Policy checkreqprot status:");
+ rc = security_checkreqprot();
+ switch (rc) {
+ case 0:
+ printf("kernel\n");
+ break;
+ case 1:
+ printf("application\n");
+ break;
+ default:
+ printf("error (%s)\n", strerror(errno));
+ break;
+ }
+
  rc = security_policyvers();
  printf_tab("Max kernel policy version:");
  if (rc < 0)