Red Hat Bugzilla – Bug 556350
build tests depend on optional component
Last modified: 2010-02-05 11:34:05 EST
Description of problem:
If one builds coreutils configure without "--enable-selinux" then the resultant ls utility does not contain the "--scontext" command-line option. However, the test suite library (test-lib.sh) contains a function require_selinux_ which uses "ls --scontext" to attempt to determine whether selinux is enabled. Unfortunately the said function does not account for the possibility that ls doesn't support that option ... it only acts on the ls output (either ? or unlabeled).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. build coreutils without configure option of '--enable-selinux'
1. Various tests fail because the require_selinux_ function fails in an unexpected manner
The require_selinux_ function should also invoke skip_test_ if ls exits with non-zero status.
selinux is unwanted, unnecessary, and pollutes the system by creating an overly complex and unmanageable mess.
It is in fact the fault of a patch: coreutils-6.10-configuration.patch
This patch replaces the 'ls -Z' in the test-lib.sh with 'ls --scontext' for some undocumented reason.
This is wrong because --scontext might not be compiled into ls. Chicken and egg. You cannot use the output from a missing feature to test if a feature is missing!
The spec file groups the patch in "Our patches" so I figure that RedHat has introduced this bug.
Thanks for report. You are right, it's caused by Red Hat patch and it has to be fixed.
That replacement is because previous coreutils Fedora/Red Hat maintainer added SELinux patch from NSA before it was accepted by upstream. Now it sometimes slightly differs from upstream and I have to keep those things as they might be in use in some Fedora/RHEL-4/5 scripts.
Moved that test-lib.sh modification into selinux patch directly and built as coreutils-8.4-4.fc13 - closing RAWHIDE.