summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Haines <richard_c_haines@btinternet.com>2015-11-22 14:55:26 +0000
committerRichard Haines <richard_c_haines@btinternet.com>2015-11-22 15:01:55 +0000
commitbe5f860effa9aff2afb397703f64de7acf92ad6d (patch)
treeaaf6b0a60b6670d7bb53df89d11e251dc3d9da3f
parent02df2e30820051a4b592071946521d5c9f7eb74b (diff)
downloadlibselinux-be5f860effa9aff2afb397703f64de7acf92ad6d.tar.gz
Correct line count for property and service contexts filesbrillo-m8-releasebrillo-m8-dev
When a line number is displayed for context errors they are x2 the correct value, so reset line count for each pass. Change-Id: I03cc6320b22d52ce989dafe4c8ecd854540d1367 Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
-rw-r--r--src/label_android_property.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/label_android_property.c b/src/label_android_property.c
index af06c4a..d7ab4ba 100644
--- a/src/label_android_property.c
+++ b/src/label_android_property.c
@@ -132,7 +132,7 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
const char *path = NULL;
FILE *fp;
char line_buf[BUFSIZ];
- unsigned int lineno = 0, maxnspec, pass;
+ unsigned int lineno, maxnspec, pass;
int status = -1;
struct stat sb;
@@ -166,6 +166,7 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
maxnspec = UINT_MAX / sizeof(spec_t);
for (pass = 0; pass < 2; pass++) {
data->nspec = 0;
+ lineno = 0;
while (fgets(line_buf, sizeof(line_buf) - 1, fp)
&& data->nspec < maxnspec) {