xfs
[Top] [All Lists]

Re: [PATCH] xfstests: fix up fs_perms test used by 126

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] xfstests: fix up fs_perms test used by 126
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 8 Feb 2010 14:40:58 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>, Theodore Tso <tytso@xxxxxxx>
In-reply-to: <4B6C4E81.6060201@xxxxxxxxxxx>
References: <4B6C4E81.6060201@xxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Fri, Feb 05, 2010 at 10:59:45AM -0600, Eric Sandeen wrote:
> @@ -53,7 +53,8 @@ int main( int argc, char *argv[]) {
>                cgroupId = atoi(argv[3]);
>                userId = atoi(argv[4]);
>                groupId = atoi(argv[5]);
> -              fperm[0] = *argv[6];
> +              strncpy(fperm, argv[6], 3);
> +              fperm[2] = '\0';

This still looks rather weird to me.  What's the reason for copying
the string into a fixed length buffer?  Why not leave fperm as a pointer
to the original argument?

The rest of the patch looks fine, but a clean up pass on the whole
file wouldn't hurt either, it's a grotty mess..

<Prev in Thread] Current Thread [Next in Thread>