Commit be5f860e authored by Richard Haines's avatar Richard Haines
Browse files

Correct line count for property and service contexts files


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: default avatarRichard Haines <richard_c_haines@btinternet.com>
parent 02df2e30
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment