Bug 185090 - "install" command terribly slow when no -P option used (selinux related bug)
"install" command terribly slow when no -P option used (selinux related bug)
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
4
All Linux
medium Severity low
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-10 10:43 EST by Tomasz Ostrowski
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-27 13:18:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomasz Ostrowski 2006-03-10 10:43:49 EST
Description of problem:
install command is terribly slow when no -P option is used.

Version-Release number of selected component (if applicable):
coreutils-5.2.1-48.1

How reproducible:
Always.

Steps to Reproduce:
1. touch /tmp/example1
2. time install /tmp/example1 /tmp/example2
  
Actual results:
real    0m0.672s
user    0m0.452s
sys     0m0.220s

Expected results:
real    0m0.010s
user    0m0.004s
sys     0m0.004s

Additional info:
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.
Comment 1 Tim Waugh 2006-03-27 13:18:27 EST
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.

Note You need to log in before you can comment on or make changes to this bug.