Re: Problem with SGID and new inode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 22 Nov 2012, Giorgos Kappes wrote:
> ??,
> 
> I was looking at the source code of the ceph MDS and in particular at
> the function
> CInode* Server::prepare_new_inode(...) in the mds/Server.cc file which
> creates a new inode.
> At lines 1739-1747 the code checks if the parent directory has the
> set-group-ID bit set. If
> this bit is set and the new inode refers to a directory then the new
> inode should also have
> the set-group-ID bit set. However, as I understand, at line 1744 the
> set-group-ID bit is set
> at the local variable [mode |= S_ISGID] and not on the inode.
> Shouldn't this line be
> [in->inode.mode |= S_ISGID;]?
> 
> To illustrate the above problem I tried to create a new directory
> inside a directory that has
> the set-group-ID bit set:
> 
> root@client-admin:/mnt/admin# mkdir mydir
> root@client-admin:/mnt/admin# chmod +s mydir
> root@client-admin:/mnt/admin# ls -l
> total 1
> drwsr-sr-x 1 root root  0 Nov 22  2012 mydir
> -rw-r--r-- 1 root root 13 Oct 19 08:05 myfile.txt
> root@client-admin:/mnt/admin# cd mydir
> root@client-admin:/mnt/admin/mydir# mkdir newdir
> root@client-admin:/mnt/admin/mydir# ls -l
> total 1
> drwxr-xr-x 1 root root 0 Nov 22  2012 newdir
> 
> Finally, I would like to note that I am using Ceph 0.48.2 but the
> above problem also seems
> to exist in the v0.54 development release.

Thanks, this is indeed a bug.  I pushed a fix to the next branch, commit 
1c715a11f70788d987c16aa67ce2b6f32c04a673.

Thanks!
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux