mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-05 04:59:42 +00:00
libselinux: 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. Signed-off-by: Richard Haines <richard_c_haines@btinternet.com> Acked-by: Jeff Vander Stoep <jeffv@google.com>
This commit is contained in:
parent
6c925600fa
commit
46320aefc2
@ -132,7 +132,7 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
|
|||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char line_buf[BUFSIZ];
|
char line_buf[BUFSIZ];
|
||||||
unsigned int lineno = 0, maxnspec, pass;
|
unsigned int lineno, maxnspec, pass;
|
||||||
int status = -1;
|
int status = -1;
|
||||||
struct stat sb;
|
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);
|
maxnspec = UINT_MAX / sizeof(spec_t);
|
||||||
for (pass = 0; pass < 2; pass++) {
|
for (pass = 0; pass < 2; pass++) {
|
||||||
data->nspec = 0;
|
data->nspec = 0;
|
||||||
|
lineno = 0;
|
||||||
|
|
||||||
while (fgets(line_buf, sizeof(line_buf) - 1, fp)
|
while (fgets(line_buf, sizeof(line_buf) - 1, fp)
|
||||||
&& data->nspec < maxnspec) {
|
&& data->nspec < maxnspec) {
|
||||||
|
Loading…
Reference in New Issue
Block a user