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

From: Bernhard Voelker <[email-masked]>
Date: Mon, 13 Jan 2014 16:27:40 +0100

On 01/13/2014 03:57 PM, Pádraig Brady wrote:
> On 01/13/2014 02:50 PM, Pádraig Brady wrote:
>> +# Then compile/link it:
>> +$CC -shared -fPIC -O2 k.c -o k.so \
>> +  || framework_failure_ 'failed to build SELinux shared library'
> 
> I'll change that to a || skip_ ...
> so that we avoid issues with no (stub) <selinux/selinux.h> being available.

LD_PRELOADed tests are sometimes a bit tricky, so doing
double checks is a good idea: I'd add a
  fclose(fopen("x"));
inside the dummies, and check if that file has really been
created. Otherwise, you can't be sure if replacing the functions
really worked.

Furthermore, when I added a LD_PRELOADed test a while ago,
I think Paul suggested to add -ldl for some non-GNU/Linux
platforms. I'd also specify 'gcc' hardcoded ... probably
with -Wall.

+1 otherwise.

Thanks & have a nice day,
Berny