xfs
[Top] [All Lists]

Re: [PATCH] nfsd: revoking of suid/sgid bits after chown() in a consiste

To: linux-nfs@xxxxxxxxxxxxxxx
Subject: Re: [PATCH] nfsd: revoking of suid/sgid bits after chown() in a consistent way
From: Stanislav Kholmanskikh <stanislav.kholmanskikh@xxxxxxxxxx>
Date: Wed, 11 Dec 2013 15:00:22 +0400
Cc: vasily.isaenko@xxxxxxxxxx, hch@xxxxxxxxxxxxx, xfs@xxxxxxxxxxx, sprabhu@xxxxxxxxxx, bfields@xxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1386756996-28083-1-git-send-email-stanislav.kholmanskikh@xxxxxxxxxx>
References: <20131206204747.GB12613@xxxxxxxxxxxx> <1386756996-28083-1-git-send-email-stanislav.kholmanskikh@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131030 Thunderbird/17.0.10


On 12/11/2013 02:16 PM, Stanislav Kholmanskikh wrote:
[cut off]

This patch makes NFS to behave like local file systems.

[cut off]

This patch allows to run generic/193 without any issues with NFSv3.

With NFSv4 generic/193 fails (but with the other issues, which existed even before the patch).

generic/193 expects that suid/sgid bits are cleared after the file truncation:

touch file
chown fsgqa:fsgqa file
chmod u+s file
echo 'xyz' > file
ls -l file
su fsgqa -c 'echo > file'
ls -l file

With ext4 (for example), we have expectable results:
-rwSr--r-- 1 fsgqa fsgqa 4 Dec 11 05:21 file
-rw-r--r-- 1 fsgqa fsgqa 1 Dec 11 05:22 file

With NFSv3 as well:
-rwSr--r-- 1 fsgqa fsgqa 4 Dec 11 05:24 file
-rw-r--r-- 1 fsgqa fsgqa 1 Dec 11 05:25 file

But with NFSv4 the bits are not cleared:
-rwSr--r-- 1 fsgqa fsgqa 1 Dec 11 05:19 file
-rwSr--r-- 1 fsgqa fsgqa 1 Dec 11 05:21 file

'echo > file' issues:

open("file", O_WRONLY|O_CREAT|O_TRUNC, 0666)

Can it be because of design differences between NFSv3 and NFSv4?

Thank you.

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