Subject: bug#16335: Segmentation fault when using cp -a with SELinux and fakeroot

From: Bernhard Voelker <[email-masked]>
Date: Tue, 14 Jan 2014 11:54:24 +0100

On 01/13/2014 09:09 PM, Pádraig Brady wrote:
> Pushing the attached 2 patches in a while.

Hi Padraig,

thanks, the refactoring into gcc_shared_ is a good idea.

But I missed this one:
when selinux is not supported, the new no-ctx.sh test is skipped
with the wrong and misleading "LD_PRELOAD interception failed" diagnostic:

+ gcc -std=gnu99 -Wall -shared --std=gnu99 -fPIC -ldl -O2 k.c -o k.so
+ touch file_src
+ LD_PRELOAD=./k.so
+ cp -a file_src file_dst
+ LD_PRELOAD=./k.so
+ cp -a file_src file_dst
+ LD_PRELOAD=./k.so
+ cp --preserve=context file_src file_dst
cp: cannot preserve security context without an SELinux-enabled kernel
+ test -e preloaded
+ skip_ 'LD_PRELOAD interception failed'
+ warn_ 'no-ctx.sh: skipped test: LD_PRELOAD interception failed'
+ case $IFS in
+ printf '%s\n' 'no-ctx.sh: skipped test: LD_PRELOAD interception failed'
no-ctx.sh: skipped test: LD_PRELOAD interception failed
+ test 9 = 2
+ printf '%s\n' 'no-ctx.sh: skipped test: LD_PRELOAD interception failed'
+ sed 1q
+ Exit 77

I've no time now to analyze further, unfortunately.

Have a nice day,
Berny