From: "J. Bruce Fields" <bfields@fieldses.org>
To: Andrey Borzenkov <arvidjaar@gmail.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: Effective process GID is ignored when client creates file on NFS
Date: Wed, 7 Nov 2012 14:13:36 -0500 [thread overview]
Message-ID: <20121107191336.GE7421@fieldses.org> (raw)
In-Reply-To: <CAA91j0VBWhT58iyNDTMXVnMU8skJTEwHyezD_HyhmaqW5+pt3w@mail.gmail.com>
On Mon, Oct 29, 2012 at 06:09:29PM +0400, Andrey Borzenkov wrote:
> I have met application that is badly broken when installed on NFS. The
> reason is - it expects files to belong to specific group. It switches
> to this group on startup (explicit setgid) and creates files. But
> files come out as belonging to GID 0.
>
> I finally reduced it to this trivial script:
>
> === cut here ===
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <unistd.h>
>
> main()
> {
> int fd;
>
> setgid(107);
> fd = open("bar", O_CREAT, 0666);
> close(fd);
> }
> === cut here ===
>
> On local storage file comes with GID 107; on NFS file comes with GID 0.
>
> Linux is SLES10 SP3 with relatively old kernel: 2.6.16.60-0.89.1-smp,
> server(s) are NetApp with different Data ONTAP versions (7.x and 8.1.1
> as the last).
>
> Client passes correct credentials (UID:0, GID:107), but does not
Those are the credentials in the rpc header on the CREATE call?
> explicitly request file ownership in CREATE call (uid set_it - 0, gid
> set_it - 0).
The client shouldn't have to set the owner or group itself.
So this is server behavior.
Have you checked that the directory you're creating in doesn't have the
sgid bit? Or perhaps there's some other server configuration that
causes this.
--b.
>
> I am not sure whether this is a bug and if yes, on which side. I
> appreciate any hint. Thank you!
>
> -andrey
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-11-07 19:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-29 14:09 Effective process GID is ignored when client creates file on NFS Andrey Borzenkov
2012-11-07 19:13 ` J. Bruce Fields [this message]
2012-11-07 19:28 ` Andrey Borzenkov
2012-11-07 20:35 ` Myklebust, Trond
2012-11-08 3:12 ` Andrey Borzenkov
2012-11-08 6:43 ` Andrey Borzenkov
2012-11-08 12:19 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121107191336.GE7421@fieldses.org \
--to=bfields@fieldses.org \
--cc=arvidjaar@gmail.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.