Only call dups check within selabel/matchpathcon if you are validating the

context
This seems to speed the loading of labels by 4 times.
This commit is contained in:
Dan Walsh 2011-06-13 11:29:06 -04:00
parent 2c3aaeae1e
commit 076f35f59b
2 changed files with 19 additions and 1 deletions

View File

@ -361,6 +361,19 @@ index a948920..dd03559 100644
out:
free(buf);
diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
index 937e509..112af1f 100644
--- a/libselinux/src/label_file.c
+++ b/libselinux/src/label_file.c
@@ -473,7 +473,7 @@ static int init(struct selabel_handle *rec, struct selinux_opt *opts,
pass, ++lineno) != 0)
goto finish;
}
- if (pass == 1) {
+ if (pass == 1 && rec->validating) {
status = nodups_specs(data, path);
if (status)
goto finish;
diff --git a/libselinux/src/load_policy.c b/libselinux/src/load_policy.c
index 83d2143..0961912 100644
--- a/libselinux/src/load_policy.c

View File

@ -7,7 +7,7 @@
Summary: SELinux library and simple utilities
Name: libselinux
Version: 2.0.102
Release: 5%{?dist}
Release: 6%{?dist}
License: Public Domain
Group: System Environment/Libraries
Source: http://www.nsa.gov/research/selinux/%{name}-%{version}.tgz
@ -237,6 +237,11 @@ exit 0
%{ruby_sitearch}/selinux.so
%changelog
* Mon Jun 13 2011 Dan Walsh <dwalsh@redhat.com> - 2.0.102-6
- Only call dups check within selabel/matchpathcon if you are validating the
context
- This seems to speed the loading of labels by 4 times.
* Fri Apr 29 2011 Dan Walsh <dwalsh@redhat.com> - 2.0.102-5
- Move /selinux to /sys/fs/selinux
- Add selinuxexeccon