]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client/mds: have write codepath clear the setuid/setgid bits if they're set
authorJeff Layton <jlayton@redhat.com>
Thu, 8 Dec 2016 19:24:04 +0000 (14:24 -0500)
committerJeff Layton <jlayton@redhat.com>
Thu, 8 Dec 2016 19:24:04 +0000 (14:24 -0500)
commit2d1c91f490331492cd9195bc63ca49eae545bbbf
tree227101041af83234e45b32df5b5e52f9a098dee8
parent8338b9445761e71a4fb7c5b5d1ebda0a933c3ba1
client/mds: have write codepath clear the setuid/setgid bits if they're set

Declare a new CEPH_SETATTR_KILL_SGUID flag. When that bit is set in
the mask, then that tells the server to clear out the S_ISUID and
S_ISGID bits. Doing that is less racy and problematic than trying
to do a read/modify/write cycle on the mode. Note that this flag is
ignored if the mode is being set in the same setattr call (uncommon,
but possible from something like ganesha or samba).

Then, change the client library write code to get As caps when issuing a
write, so we can check whether the mode has the setuid/setgid bits set.
If it does, then call __setattrx to clear them using
CEPH_SETATTR_KILL_SGUID.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/client/Client.cc
src/include/ceph_fs.h
src/mds/Server.cc