Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libselinux: Do not clobber errno of the world
libselinux clobbers errno of all consumers (systemd, sshd you name it) because its constructors do not properly save and restore errno. The following program demonstrates it. int main(void) { assert(errno == 0); /* Just a test, it doesn't matter already clobbered */ if(is_selinux_enabled() < 0) { perror("not enabled"); return 1; } } if any function sets errno, it is not switched back to the original value and standards DO NOT require errno to the set to zero before entering main
- Loading branch information