Proposing SELinux support in strace

Renaud Métrich rmetrich at redhat.com
Wed Mar 24 14:52:21 UTC 2021


Hi Dmitry,

Sorry for the delay, I was busy this week.

I pushed the new code with updated test suite.

Still I have an issue regarding 1 test: test_personality_64

I don't understand what is supposed to be checked here, the strace runs 
on "getcwd" but fails because now some tests (including "execveat") use 
getcwd() internally.

Renaud.

On 3/16/21 2:30 AM, Dmitry V. Levin wrote:
> On Mon, Mar 15, 2021 at 06:09:34PM +0100, Renaud Métrich wrote:
> [...]
>> diff --git a/tests/linkat--secontext.c b/tests/linkat--secontext.c
>> index f2fd003d7..4818d676b 100644
>> --- a/tests/linkat--secontext.c
>> +++ b/tests/linkat--secontext.c
>> @@ -20,6 +20,7 @@
>>   # include <fcntl.h>
>>   # include <stdio.h>
>>   # include <unistd.h>
>> +# include <xmalloc.h>
>>   
>>   /* for getcwd()/opendir() */
>>   # include <limits.h>
>> @@ -97,9 +98,7 @@ main(void)
>>   		perror_msg_and_fail("dirfd");
>>   
>>   	static const char sample_2_dir[] = "new";
>> -	char *new_sample_2 = malloc(strlen(sample_2_dir) + 1 + strlen(sample_2) + 1);
>> -	if (new_sample_2 == NULL)
>> -		perror_msg_and_fail("malloc");
>> +	char *new_sample_2 = xmalloc(strlen(sample_2_dir) + 1 + strlen(sample_2) + 1);
>>   	sprintf(new_sample_2, "%s/%s", sample_2_dir, sample_2);
> I've added xasprintf to xmalloc, now you can write this as simple as
>
> 	char *new_sample_2 = xasprintf("%s/%s", sample_2_dir, sample_2);
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20210324/f81e5676/attachment.bin>


More information about the Strace-devel mailing list