| To: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] xfstests: fix up fs_perms test used by 126 |
| From: | Eric Sandeen <sandeen@xxxxxxxxxxx> |
| Date: | Mon, 08 Feb 2010 13:47:16 -0600 |
| Cc: | xfs-oss <xfs@xxxxxxxxxxx>, Theodore Tso <tytso@xxxxxxx> |
| In-reply-to: | <20100208194058.GC9527@xxxxxxxxxxxxx> |
| References: | <4B6C4E81.6060201@xxxxxxxxxxx> <20100208194058.GC9527@xxxxxxxxxxxxx> |
| User-agent: | Thunderbird 2.0.0.23 (Macintosh/20090812) |
Christoph Hellwig wrote:
> 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?
eh that's probably better, I guess I was just thinking copy
based on how it was before. (which copied the char, right, it
didn't assign a pointer, unless I'm short on coffee today...)
OTOH fopen only takes 2 chars anyway. But probably no reason to
truncate what was given, just fail if it's something that's wrong...
-Eric
> 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> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH] Inode reclaim fixes (was Re: 2.6.31 xfs_fs_destroy_inode: cannot reclaim), Christoph Hellwig |
|---|---|
| Next by Date: | [XFS updates] XFS development tree branch, master, updated. v2.6.33-rc4-46-g388f1f0, xfs |
| Previous by Thread: | Re: [PATCH] xfstests: fix up fs_perms test used by 126, Christoph Hellwig |
| Next by Thread: | [PATCH V2] xfstests: fix up fs_perms test used by 126, Eric Sandeen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |