From f7d6bb3f71953655b497692c1e7583baf1aa558c Mon Sep 17 00:00:00 2001
From: William Roberts <william.c.roberts@intel.com>
Date: Mon, 8 Aug 2016 10:31:54 -0700
Subject: [PATCH] check_seapp: correct output on invalid policy file

If in invalid policy file is loaded check_seapp outputs:

Error: Could not lod policy file to db: Success!

The "Success" value is from errno, which is not manipulated
by libsepol. Also, load should have an a in it!

Hardcode the error message to:

Error: Could not load policy file to db: invalid input file!

Test: That when providing an invalid sepolicy binary, that the output
message is correct.
Change-Id: Iaf1f85eeb217d484997ee1367d91d461c1195bf4
Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
 tools/check_seapp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/check_seapp.c b/tools/check_seapp.c
index 927d4fd93..d8fa63647 100644
--- a/tools/check_seapp.c
+++ b/tools/check_seapp.c
@@ -897,8 +897,7 @@ static void init() {
 		}
 
 		if (sepol_policydb_read(pol.db, pol.pf) < 0) {
-			log_error("Could not lod policy file to db: %s!\n",
-					strerror(errno));
+			log_error("Could not load policy file to db: invalid input file!\n");
 			exit(EXIT_FAILURE);
 		}
 	}
-- 
GitLab