Commit cb92504c authored by Stephen Smalley's avatar Stephen Smalley
Browse files

Fix logging of sepolicy pathname on policy load.


I9d83122e276a25d2e7c928b724344d5f3420af73 eliminated a temporary path
variable but ended up using the wrong index in the sepolicy_file[] array,
thereby indexing off the end of the array or logging the
wrong path.

Change-Id: If1b61c938bdcf53aef000d45e9415ded68a96585
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
parent 8792a5ce
......@@ -847,14 +847,14 @@ int selinux_android_reload_policy(void)
}
if (fstat(fd, &sb) < 0) {
selinux_log(SELINUX_ERROR, "SELinux: Could not stat %s: %s\n",
sepolicy_file[i], strerror(errno));
sepolicy_file[i-1], strerror(errno));
close(fd);
return -1;
}
map = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (map == MAP_FAILED) {
selinux_log(SELINUX_ERROR, "SELinux: Could not map %s: %s\n",
sepolicy_file[i], strerror(errno));
sepolicy_file[i-1], strerror(errno));
close(fd);
return -1;
}
......@@ -870,7 +870,7 @@ int selinux_android_reload_policy(void)
munmap(map, sb.st_size);
close(fd);
selinux_log(SELINUX_INFO, "SELinux: Loaded policy from %s\n", sepolicy_file[i]);
selinux_log(SELINUX_INFO, "SELinux: Loaded policy from %s\n", sepolicy_file[i-1]);
return 0;
}
......
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