Red Hat Bugzilla – Bug 185090
"install" command terribly slow when no -P option used (selinux related bug)
Last modified: 2007-11-30 17:11:26 EST
Description of problem:
install command is terribly slow when no -P option is used.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. touch /tmp/example1
2. time install /tmp/example1 /tmp/example2
This delay is caused by over 1300 cycles of opening, writing and closing of
"/selinux/context", seen by strace:
open("/selinux/context", O_RDWR|O_LARGEFILE) = 5
write(5, "system_u:object_r:default_t\0", 28) = 28
close(5) = 0
Why does "install" do this is beyond my understanding.
When SELinux is enabled, the two choices are:
1. set the context to be the default based on the target location
2. preserve the original file context
Option 1 is the default; -P switches to option 2.
If neither of these is performed, the resulting file context may well be incorrect.