Re: [PATCH 32/32] selftests/namespaces: add file handle selftests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 10, 2025 at 02:46:21PM -0700, Bart Van Assche wrote:
> On 9/10/25 7:37 AM, Christian Brauner wrote:
> > +	snprintf(ns_path, sizeof(ns_path), "/proc/self/ns/net");
> > +	ns_fd = open(ns_path, O_RDONLY);
> 
> Here and also in TEST(nsfs_uts_handle), ns_path is not modified. Does
> this mean that "/proc/self/ns/net" can be stored in a static const char
> array and also that the snprintf() call can be left out? In case I would
> have missed the reason why the path is copied, how about using
> asprintf() or strdup() instead of snprintf()?

Yep, that can just be a static string. Thanks.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux