Pull selinux updates from Paul Moore: "Beyond the usual smattering of bug fixes, we've got three small improvements worth highlighting: - improved SELinux policy symbol table performance due to a reworking of the insert and search functions - allow reading of SELinux labels before the policy is loaded, allowing for some more "exotic" initramfs approaches - improved checking an error reporting about process class/permissions during SELinux policy load" * tag 'selinux-pr-20200803' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: complete the inlining of hashtab functions selinux: prepare for inlining of hashtab functions selinux: specialize symtab insert and search functions selinux: Fix spelling mistakes in the comments selinux: fixed a checkpatch warning with the sizeof macro selinux: log error messages on required process class / permissions scripts/selinux/mdp: fix initial SID handling selinux: allow reading labels before policy is loaded
Showing the changes to scripts (1 of 15 files). Show all
Unified · Split
| @@ -67,8 +67,14 @@ int main(int argc, char *argv[]) · 66 unmodified lines | ||
| 67 | 67 | |
| 68 | 68 | initial_sid_to_string_len = sizeof(initial_sid_to_string) / sizeof (char *); |
| 69 | 69 | /* print out the sids */ |
| 70 | − for (i = 1; i < initial_sid_to_string_len; i++) | |
| 71 | − fprintf(fout, "sid %s\n", initial_sid_to_string[i]); | |
| 70 | + for (i = 1; i < initial_sid_to_string_len; i++) { | |
| 71 | + const char *name = initial_sid_to_string[i]; | |
| 72 | + | |
| 73 | + if (name) | |
| 74 | + fprintf(fout, "sid %s\n", name); | |
| 75 | + else | |
| 76 | + fprintf(fout, "sid unused%d\n", i); | |
| 77 | + } | |
| 72 | 78 | fprintf(fout, "\n"); |
| 73 | 79 | |
| 74 | 80 | /* print out the class permissions */ |
| @@ -126,9 +132,16 @@ int main(int argc, char *argv[]) · 51 unmodified lines | ||
| 126 | 132 | #define OBJUSERROLETYPE "user_u:object_r:base_t" |
| 127 | 133 | |
| 128 | 134 | /* default sids */ |
| 129 | − for (i = 1; i < initial_sid_to_string_len; i++) | |
| 130 | − fprintf(fout, "sid %s " SUBJUSERROLETYPE "%s\n", | |
| 131 | − initial_sid_to_string[i], mls ? ":" SYSTEMLOW : ""); | |
| 135 | + for (i = 1; i < initial_sid_to_string_len; i++) { | |
| 136 | + const char *name = initial_sid_to_string[i]; | |
| 137 | + | |
| 138 | + if (name) | |
| 139 | + fprintf(fout, "sid %s ", name); | |
| 140 | + else | |
| 141 | + fprintf(fout, "sid unused%d\n", i); | |
| 142 | + fprintf(fout, SUBJUSERROLETYPE "%s\n", | |
| 143 | + mls ? ":" SYSTEMLOW : ""); | |
| 144 | + } | |
| 132 | 145 | fprintf(fout, "\n"); |
| 133 | 146 | |
| 134 | 147 | #define FS_USE(behavior, fstype) \ |