[PATCH v2 1/5] fs: rework getname_kernel to handle up to PATH_MAX sized filenames

Guenter Roeck linux at roeck-us.net
Thu Jan 22 16:56:50 UTC 2015


On 01/22/2015 07:53 AM, Richard Guy Briggs wrote:
> On 15/01/21, Paul Moore wrote:
>> In preparation for expanded use in the kernel, make getname_kernel()
>> more useful by allowing it to handle any legal filename length.
>>
>> Thanks to Guenter Roeck for his suggestion to substitute memcpy() for
>> strlcpy().
>>
>> CC: linux at roeck-us.net
>> CC: viro at zeniv.linux.org.uk
>> CC: linux-fsdevel at vger.kernel.org
>> Signed-off-by: Paul Moore <pmoore at redhat.com>
>
> Noted memcpy() difference (I assume to avoid races).
>

It is more efficient to use memcpy if the string length is known.

Guenter




More information about the Linux-audit mailing list