lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <53d7f348-98a6-00d3-5a7d-4d78a1e0d6c9@fb.com>
Date:   Thu, 29 Nov 2018 23:26:38 +0000
From:   Yonghong Song <yhs@...com>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>
CC:     Alexei Starovoitov <ast@...com>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Kernel Team <Kernel-team@...com>
Subject: Re: [PATCH bpf-next] tools/bpf: make libbpf _GNU_SOURCE friendly



On 11/29/18 1:00 PM, Jakub Kicinski wrote:
> On Thu, 29 Nov 2018 12:38:03 -0800, Yonghong Song wrote:
>> diff --git a/tools/lib/bpf/libbpf_errno.c b/tools/lib/bpf/libbpf_errno.c
>> index d83b17f8435c..286e497c50ec 100644
>> --- a/tools/lib/bpf/libbpf_errno.c
>> +++ b/tools/lib/bpf/libbpf_errno.c
>> @@ -40,9 +40,19 @@ int libbpf_strerror(int err, char *buf, size_t size)
>>   	err = err > 0 ? err : -err;
>>   
>>   	if (err < __LIBBPF_ERRNO__START) {
>> +#ifdef _GNU_SOURCE
>> +		const char *ret_buf;
>> +#endif
>>   		int ret;
>>   
>> +#ifdef _GNU_SOURCE
>> +		ret_buf = strerror_r(err, buf, size);
>> +		if (ret_buf != buf)
>> +			snprintf(buf, size, "%s", ret_buf);
>> +		ret = 0;
>> +#else
>>   		ret = strerror_r(err, buf, size);
>> +#endif
>>   		buf[size - 1] = '\0';
>>   		return ret;
>>   	}
> 
> That is kinda strange, the whole point for this file was to have
> non-GNU strerror_r, would doing #undef _GNU_SOURCE at the top not work?

Thanks for suggestion as I did not the history of this file.
Yes, #undef _GNU_SOURCE works. Will send a revision shortly.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ